Hi all,
Is there any example for the use of the CSR102x SPI API in slave configuration?
The embedded doc is very poor about this.
Here is my test code:
[...]
/* SPI slave init */
status = SpiOpen(PIO_SPI_MOSI,
PIO_SPI_MISO,
PIO_SPI_SCLK,
SPI_BUS_MODE_SLAVE);
/* Config the CS line */
status = SpiConfigCsel(PIO_SPI_CS,
0,
0,
SPI_CSEL_ACTIVE_LOW,
SPI_CSEL_MODE_XFER);
status = SpiConfigData(8, SPI_DATA_ENDIAN_LITTLE, SPI_DATA_IDLE_HIGH, 0);
status = SpiRead(spi_rx_buffer, 2, 1, 0);
[...]
This code should trigger a SPI_EVENT_SLAVE_AFTER_N_RX_WORDS event (sys_event_spi in AppProcessSystemEvent) upon reception of SPI data.
The SPI signals (clk, miso, mosi) observed with an oscilloscope seem correct but no event is triggered.
Thanks in advance for your help!
--
Jean-Pierre
Hi Jean-Pierre,
Although SPI slave functionality is documented in the SDK (I suppose you are using 3.0.3), it is not actually supported yet.
We plan to support it in the next 3.0.X release, and release example code in 3.1.X release.