
ID TECH SecureHead SPI with TMIV User Manual
Page | 48
}
_SPI_SS = 1; // Read out all the data from SPI slave, set chip select pin to idle
for(i = 0; i < spilength; i++){ // Send out data from UART port.
put_byte(Command_INbuf[i]);
}
}
{
// .............
Other subroutine to handle other tasks
}
if(SPIMasterCommandReady){ // If SPI master wants to send a command to SPI slave
_SPI_SS = 1; // To Generate a falling edge. Not useful for clock phase
0, but clock phase 1 needs this falling edge.
delay10us(); // Wait for high level get steady.
_SPI_SS = 0; // Pull chip select pin low, ready to start SPI communication.
for(j = 0; j < Command_Length; j++){ // Send out whole command string.
spi_Sendout(Command_OUTbuf[j]);
chip select pin to idle high.
}
{
tasks
}