- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sir/Madam,
unsigned char ReadWriteSPI(unsigned char Data)
{
SPDR=Data;
while(!(SPSR & 0x80));
return SPDR;
}
It first writes the data that is to be send to the SPI Data Register (one byte). Then it waits until sending and receiving the data is done. Finally it returns the data that has been received by the microcontroller (which in the AVR can be found in the same register).
Thank you!
Solved! Go to Solution.
- Labels:
-
PSoC 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please have a look at the SPI code examples available with PSoC Creator. The API's for writing data and waiting for the data to be sent will be explained in the example project. Also have a look at the SPI component datasheet.
Thanks,
Hima
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please have a look at the SPI code examples available with PSoC Creator. The API's for writing data and waiting for the data to be sent will be explained in the example project. Also have a look at the SPI component datasheet.
Thanks,
Hima