Datasheet

Soft_SPI_Read
Soft_SPI_Write
412
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroC PRO for AVR
CHAPTER 6
Prototype
unsigned short Soft_SPI_Read(char sdata);
Returns Byte received via the SPI bus.
Description
This routine performs 3 operations simultaneously. It provides clock for the Soft-
ware SPI bus, reads a byte and sends a byte.
Parameters :
-
sdata: data to be sent.
Requires Soft SPI must be initialized before using this function. See Soft_SPI_Init routine.
Example
unsigned short data_read;
char data_send;
...
// Read a byte and assign it to data_read variable
// (data_send byte will be sent via SPI during the Read opera-
tion)
data_read = Soft_SPI_Read(data_send);
Prototype
void Soft_SPI_Write(char sdata);
Returns Nothing.
Description
This routine sends one byte via the Software SPI bus.
Parameters :
- sdata: data to be sent.
Requires Soft SPI must be initialized before using this function. See Soft_SPI_Init routine.
Example
// Write a byte to the Soft SPI bus
Soft_SPI_Write(0xAA);