added chip select and added falling/rising edge