| Description | The function Send transmits to and recieves one byte from the SPI interface. The prameter outb specifies the command or data to be transmitted. The function is part of the SPI Driver. The prototype is defined in the file File_Config.h. Developers must customize the function. Use the function to send or receive commands, status values, or data. |
| Example |
/* SPI Device Driver Control Block */
SPI_DRV spi0_drv = {
Init,
UnInit,
Send,
SendBuf,
RecBuf,
BusSpeed,
SetSS,
CheckMedia
};
/* Send and receive a byte on SPI interface. */
static U8 Send (U8 outb) {
SSPDR = outb;
while (!(SSPSR & RNE)); /* Wait if RNE cleared, Rx FIFO is empty. */
return (SSPDR);
}
|