SWSPI
 
Component SWSPI
Software synchronous serial communication
Component Level: High
Typical Usage:
(Examples of a typical usage of the component in user code. For more information please see the page Component Code Typical Usage.)

Required component name is "SPI1".
This example sends zeros repeatedly until it receives a character with code 13 from the slave.

 MAIN.C

byte ch;
byte err;
void main(void)
{
  do {
    SPI1_SendChar(0);          // Send zero
    err = SPI1_RecvChar(&ch);  // Get received char
    
  /* Do until it receives char with code 13 */ 
  } while ( (err != ERR_OK) || (ch != 13) );
    :
}