Data buffer transmission and receptionvia SPI using Interrupt mode. This example is based on the STM32C0xx SPI LL API. The peripheral initialization uses LL unitary service functions for optimization purposes (performance and size).
The communication is done with 2 boards through SPI.
This example shows how to configure GPIO and SPI peripherals to use a Full-Duplex communication using IT mode through the STM32C0xx COM_INSTANCE1_TYPE LL API.
This example is split in two projects, Master board and Slave board:
Example execution: On BOARD MASTER, LED1 is blinking Fast (200ms) and wait User push-button action. Press User push-button on BOARD MASTER start a Full-Duplex communication through IT. On MASTER side, Clock will be generated on SCK line, Transmission(MOSI Line) and reception (MISO Line) will be done at the same time. SLAVE SPI will received the Clock (SCK Line), so Transmission(MISO Line) and reception (MOSI Line) will be done also.
LED1 is On on both boards if data is well received.
In case of errors, LED1 is blinking Slowly (1s).
You need to perform a reset on Master board, then perform it on Slave board to have the correct behaviour of this example.
Connectivity, SPI, Full-duplex, Transmission, Reception, Slave, MISO, MOSI, Interrupt
This example runs on STM32C071RBTx devices.
This example has been tested with NUCLEO-C071RB board and can be easily tailored to any other supported device and development board.
NUCLEO-C071RB Set-up :
In order to make the program work, you must do the following :