Internal Workings - Phylex/atmelspi GitHub Wiki

#Internal Workings. The internal workings site gives an in detail walk-through of the library and it's procedures.

The Interrupt call (stm32)

When the input-Buffer-Full flag is set, this triggers an Interrupt. This flag effectively means that the transfer of the previously loaded byte has been completed and now an "answer" has been received. The answer is immediately stored for further processing, before the transmit procedure is started. The Interrupt Service Routine (ISR) in turn starts loading a new byte into the transmit (TX) register. If it detects, that the byte last sent was the last byte of a packet, it pulls up the Slave Select line (SS), while it sets the tail pointer of the ring-buffer to the next packet and checks if it has caught up with the head. If everything checks out it loads the new byte into the TX-register and the SPI- hardware gets to work. Now that the transmit phase of the ISR is completed, it gets to work with the receive part. The received byte is now stored in the packet that