SPI Communication
1. SPI Features
SPI (serial peripheral interface). Below are some features supported by Linux 6.1 SPI driver:
- Uses Motorola SPI protocol by default
- Supports 8-bit and 16-bit
- Software programmable clock frequency up to 50MHz
- Supports SPI 4 kinds of transmission mode configurations
- Each SPI controller supports one to two chip selects
- Framework supports both slave and master modes
2. SPI Pins

| SPI | Pin | Function |
|---|---|---|
| MOSI | 19 | Master output / Slave input |
| MISO | 21 | Master input / Slave output |
| 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. Check SPI Device
Enter the following command on the board terminal to check if SPI device is generated.
