Serial peripheral interface (SPI) DDK
The serial peripheral interface (SPI) is a synchronous, full-duplex serial communication protocol commonly used for short-distance communication between a master device (such as a processor) and one or more slave peripherals. SPI communication typically involves four signal lines:
MOSI (Master Out, Slave In) – carries data from the master to the slave.
MISO (Master In, Slave Out) – carries data from the slave to the master.
SCLK (Serial Clock) – a clock signal generated by the master to synchronize data transfers.
CS (Chip Select) – used by the master to select and enable communication with a specific slave device. You can typically have multiple chip select lines.
Data is exchanged in both directions simultaneously. On each clock cycle, the master sends a bit to the slave on the MOSI line while receiving a bit from the slave on the MISO line. The slave device is activated by pulling its CS line low, allowing multiple slaves to share the same SPI bus with separate select lines.
The SPI driver is an executable program and requires that you implement the SPI driver functions. You must static-link the driver against the SPI DDK libio-spi.a library, which provides the main entry point function (main()) that starts the resource manager and calls the implemented functions to initialize the driver and facilitate communication. This is illustrated in the following diagram:

