![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
FINAL PROJECT isn't it
Fork of ELEC351 by
Diff: SPI.cpp
- Revision:
- 56:bc5345bc6650
- Parent:
- 53:71f59e195f06
- Child:
- 57:aba1296e51b1
--- a/SPI.cpp Thu May 24 13:31:20 2018 +0000 +++ b/SPI.cpp Mon Jul 16 10:51:47 2018 +0000 @@ -1,7 +1,7 @@ #include "SPI.hpp" //File for SPI communication - +int SPI_RX_DATA = 0; void SPI_INIT() { @@ -35,4 +35,18 @@ //printf("WHOAMI register = 0x%X\n", whoami); // Deselect the device //cs = 1; +} + + +void SPI_INTERFACE_SERIAL() +{ + //pc.printf("SPI Test \n"); + Thread::wait(1000); + cs= 0; + SPI_RX_DATA = spi.write(0xF0); + wait_us(3); + cs= 1; + colour_data = SPI_RX_DATA; + if(Log_Value == 1){pc.printf("Received data = %d\n", SPI_RX_DATA);} + Thread::wait(1000); } \ No newline at end of file