SPI Communication
1. SPI Feature Overview
SPI (Serial Peripheral Interface). The following are some features supported by the Linux 6.1 SPI driver:
- Defaults to the Motorola SPI protocol
- Supports 8-bit and 16-bit
- Software-programmable clock frequency and transfer rates up to 50 MHz
- Supports the 4 SPI transfer modes
- Each SPI controller supports one or two chip selects
- The framework supports both slave and master modes
2. SPI Pins

| SPI | Pin | Function |
|---|---|---|
| MOSI | 19 | Master Out / Slave In |
| MISO | 21 | Master In / Slave Out |
| CLOCK | 23 | Clock signal line |
| CS0 | 24 | Chip select signal line 0 |
| CS1 | 26 | Chip select signal line 1 |
Warning
spidev3.0 controls CS0.
3. DTS Configuration
Enable SPI in the device tree.
&spi3 {
status = "okay";
spidev:spidev@0 {
compatible = "rockchip,spidev";
reg = <0>;
spi-max-frequency = <10000000>;
status = "okay";
};
};4. Checking SPI Devices
Run the following command on the board terminal to check whether the SPI device has been created.
