GPIOs

GPIO Pins

Assigned ToPin Nr.Pin Nr.Assigned To
3.3 V125 V
GPIO1_C4 (I2C8_SDA) ^a^345 V
GPIO1_C5 (I2C8_SCL) ^a^56GND
GPIO4_D0 (CPU_GPCLK)78GPIO4_C4 (UART2_TX)
GND910GPIO4_C3 (UART2_RX)
GPIO1_C61112GPIO3_D0 (I2S0_CLK)
GPIO1_C21314GND
GPIO1_A11516GPIO1_A4
3.3 V1718GPIO4_C5 [SPDIF]
[UART4_TX] GPIO1_B0 (SPI1_TXD)1920GND
[UART4_RX] GPIO1_A7 (SPI1_RXD)2122GPIO4_D1
GPIO1_B1 (SPI1_CLK)2324GPIO1_B2 (SPI1_CSN0)
GND2526GPIO1_B5
GPIO1_B3 (I2C4_SDA)2728GPIO1_B4 (I2C4_SCL)
GPIO4_D32930GND
GPIO4_D43132GPIO3_D4 (I2S0_SDI1SDO3)
GPIO3_D5 (I2S0_SDI2SDO2)3334GND
GPIO3_D2 (I2S0_LRCKTX)3536GPIO3_D6 (I2S0_SDI3SDO1)
GPIO3_D1 (I2S0_LRCKRX)3738GPIO3_D3 (I2S0_SDI0)
GND3940GPIO3_D7 (I2S0_SDO0)

Notes:

  • pulled high to 3.3V through 2.2kOhm resistor

Linux /dev/gpiochip Assignments

Pin Nr.ChipLine
3120
5121
7424
8420
10419
11122
12324
13118
1511
1614
18421
1918
2117
22425
2319
24110
26113
27111
28112
29427
31428
32328
33329
35326
36330
37325
38327
40331

On Linux, using the new /dev/gpiochip API, the _n_ in GPIO_n___XX_ appears to correlate to the number of the /dev/gpiochip_n_, and the _XX_ to the definition RK_P_XX_ of lines in include/dt-bindings/pinctrl/rockchip.h of the Linux kernel source. Having these named in the dts would be nice.

You can use libgpiod to drive them, and test them with the included tools (gpioinfo, gpioset, …)

For example, gpioset 4 25=1 (run as root) would turn pin 22 on. Do beware that poking the wrong GPIO pin can lock up your system.

The conversion table at right is also available as a C header file.