RTEMS  5.0.0

The SPI driver provides the interface to configure and use the SPI peripheral.

The Serial Peripheral Interface (SPI) circuit is a synchronous serial data link that provides communication with external devices in Master or Slave Mode.

To use the SPI, the user has to follow these few steps:

  1. Enable the SPI pins required by the application (see pio.h).
  2. Configure the SPI using the SPI_Configure(). This enables the peripheral clock. The mode register is loaded with the given value.
  3. Configure all the necessary chip selects with SPI_ConfigureNPCS().
  4. Enable the SPI by calling SPI_Enable().
  5. Send/receive data using SPI_Write() and SPI_Read(). Note that SPI_Read() must be called after SPI_Write() to retrieve the last value read.
  6. Disable the SPI by calling SPI_Disable().

For more accurate information, please look at the SPI section of the Datasheet.

Related files :
spi.c
spi.h.