The Raspberry Pi SPI Interface
Serial Peripheral Interface (SPI) is a full-duplex serial protocol for communicating with high-speed peripherals.
The SPI Controller on Raspberry Pi™ hardware can drive two SPI peripheral devices. The SPI Controller has four pins:
GPIO 11 (SPI0_SCLK)outputs a serial clock signal to synchronize communications.
GPIO 10 (SPI0_SDO)outputs data to the SPI peripheral device.
GPIO 9 (SPI0_SDI)receives data from the SPI peripheral device.
GPIO 8 (SPI0_CE0)enables one SPI peripheral device.
GPIO 7 (SPI0_CE1)enables the other SPI peripheral device.
You can connect two SPI devices, such as displays, sensors, and flash storage to the SPI pins on the Raspberry Pi hardware. Connect both devices to the SCLK, SDO, and SDI pins. Connect each device to one of the CE pins.
SPI on Raspberry Pi hardware supports:
Modes 0, 1, 2 or 3
8 bits per word
Data speeds (Hz): 500000, 1000000, 2000000, 4000000, 8000000, 16000000, 32000000
For more information, see: