I have successfully tested the SPI master loopback example on pca10001 eval board. I have a few questions regarding a real-world scenario when there is a slave SPI present.
In the loop-back test the RXD byte is immediately available when TXD is written. In a non-loopback scenario, SPI master needs to wait for a valid RX byte. I don't know how to implement this wait. Should I keep reading RXD and clear EVENTS_READY till I get a valid RX byte or is "spi_master_tx_rx" smart enough to throw away blank RX bytes until it receives a real RX byte and put it in the RXD?
What triggers receiving a new RX byte? Clearing EVENTS_READY or reading the RXD? or both?
Could you please point me to a simple example of how this is done?