The SPI Slave Example demonstrates the use of the SPIS peripheral. It uses the SPIS driver - legacy layer .
In the main loop, the application prepares the SPIS for a transfer and waits until the transfer is completed. Every time a transfer is completed, the LED is toggled.
Setup
You can find the source code and the project file of the example in the following folder:
<InstallFolder>\examples\peripheral\spis
Hardware configuration:
- Slave SCLK pin must be connected to Master SCLK.
- Slave CS pin must be connected to Master CS.
- Slave MOSI pin must be connected to Master MOSI.
- Slave MISO pin must be connected to Master MISO.
The default pin assignments for the SCLK, MOSI, and MISO lines can be found in
sdk_config.h
. The default pin assignment for the CS pin can be found in
main.c
.
Testing
Test the SPI Slave Example application by performing the following steps:
- Compile and program the application.
- Observe that no LED is toggled.
- Connect the board to another board that runs the SPI Master Example .
- Observe that the LED is toggled every 200 ms.