Please enable javascript, or click here to visit my ecommerce web site powered by Shopify.
Jump to: navigation, search

Difference between revisions of "Rock3/hardware/gpio"

(Created page with "{{rock3_header}} {{Languages|rock3/hardware/gpio}} ROCK 3 > Hardware > GPIO == <span id="gpio">General purpose...")
 
(More details about 40-pin Header)
 
(2 intermediate revisions by the same user not shown)
Line 13: Line 13:
 
         <div class="panel-body">
 
         <div class="panel-body">
  
{| class="wikitable"  
+
{| class="wikitable" style="vertical-align:middle;"
|-
+
|- style="font-weight:bold; text-align:center;"
! style="text-align:center; vertical-align:middle; font-weight:bold;" | GPIO number
+
! GPIO number
 
! Function4
 
! Function4
! style="vertical-align:middle;" | Function3
+
! Function3
! style="vertical-align:middle;" | Function2
+
! Function2
! style="vertical-align:middle;" | Function1
+
! Function1
! style="vertical-align:middle;" | Pin#
+
! Pin#
! style="vertical-align:middle;" |
+
!  
! style="vertical-align:middle;" | Pin#
+
! Pin#
! style="vertical-align:middle;" | Function1
+
! Function1
! style="vertical-align:middle;" | Function2
+
! Function2
! style="vertical-align:middle;" | Function3
+
! Function3
 
! Function4
 
! Function4
! style="vertical-align:middle;" | GPIO number
+
! GPIO number
 
|-
 
|-
| style="vertical-align:middle;" |
 
 
|  
 
|  
| style="vertical-align:middle;" |
 
| style="vertical-align:middle;" |
 
| style="vertical-align:middle;" | +3.3V
 
| style="vertical-align:middle; background-color:#FF0;" | 1
 
| style="vertical-align:middle;" |
 
| style="vertical-align:middle; background-color:#F00;" | 2
 
| style="vertical-align:middle;" | +5.0V
 
| style="vertical-align:middle;" |
 
| style="vertical-align:middle;" |
 
 
|  
 
|  
| style="vertical-align:middle;" |  
+
|
 +
|
 +
| +3.3V
 +
| style="background-color:#FF0;" | 1
 +
|
 +
| style="background-color:#F00;" | 2
 +
| +5.0V
 +
|
 +
|
 +
|
 +
|  
 
|-
 
|-
| style="vertical-align:middle;" | 71
+
| 32
 
| CAN1_RX_M0
 
| CAN1_RX_M0
| style="vertical-align:middle;" | UART3_RX_M0
+
| UART3_RX_M0
| style="vertical-align:middle;" | I2C3_SDA_M0
+
| I2C3_SDA_M0
| style="vertical-align:middle;" | GPIO1_A0
+
| GPIO1_A0
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 3
+
| style="background-color:#008000; color:#FFF;" | 3
| style="vertical-align:middle;" |  
+
|  
| style="vertical-align:middle; background-color:#F00;" | 4
+
| style="background-color:#F00;" | 4
| style="vertical-align:middle;" | +5.0V
+
| +5.0V
| style="vertical-align:middle;" |  
+
|  
| style="vertical-align:middle;" |  
+
|  
 +
|  
 
|  
 
|  
| style="vertical-align:middle;" |
 
 
|-
 
|-
| style="vertical-align:middle;" | 72
+
| 33
 
| CAN1_TX_M0
 
| CAN1_TX_M0
| style="vertical-align:middle;" | UART3_TX_M0
+
| UART3_TX_M0
| style="vertical-align:middle;" | I2C3_SCL_M0
+
| I2C3_SCL_M0
| style="vertical-align:middle;" | GPIO1_A1
+
| GPIO1_A1
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 5
+
| style="background-color:#008000; color:#FFF;" | 5
| style="vertical-align:middle;" |  
+
|  
| style="vertical-align:middle; color:#FFF;" | 6
+
| style="background-color:#000; color:#FFF" | 6
| style="vertical-align:middle;" | GND
+
| GND
| style="vertical-align:middle;" |  
+
|  
| style="vertical-align:middle;" |  
+
|  
 +
|  
 
|  
 
|  
| style="vertical-align:middle;" |
 
 
|-
 
|-
| style="vertical-align:middle;" | 13
+
| 111
 +
|
 +
| UART3_TX_M1
 +
| PWM12_M0
 +
| GPIO3_B7
 +
| style="background-color:#008000; color:#FFF;" | 7
 +
|
 +
| style="background-color:#008000; color:#FFF;" | 8
 +
| GPIO0_D1
 +
| style="background-color:#FFA500;" | UART2_TXD
 
|  
 
|  
| style="vertical-align:middle;" | UART3_TX_M1
 
| style="vertical-align:middle;" | PWM12_M0
 
| style="vertical-align:middle;" | GPIO3_B7
 
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 7
 
| style="vertical-align:middle;" |
 
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 8
 
| style="vertical-align:middle;" | GPIO0_D1
 
| style="vertical-align:middle; background-color:#FFA500;" | UART2_TXD
 
| style="vertical-align:middle;" |
 
 
|  
 
|  
| style="vertical-align:middle;" | 148
+
| 25
 
|-
 
|-
| style="vertical-align:middle;" |
 
 
|  
 
|  
| style="vertical-align:middle;" |
 
| style="vertical-align:middle;" |
 
| style="vertical-align:middle;" | GND
 
| style="vertical-align:middle; color:#FFF;" | 9
 
| style="vertical-align:middle;" |
 
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 10
 
| style="vertical-align:middle;" | GPIO0_D0
 
| style="vertical-align:middle; background-color:#FFA500;" | UART2_RXD
 
| style="vertical-align:middle;" |
 
 
|  
 
|  
| style="vertical-align:middle;" | 147
+
|
 +
|
 +
| GND
 +
| style="background-color:#000; color:#FFF" | 9
 +
|
 +
| style="background-color:#008000; color:#FFF;" | 10
 +
| GPIO0_D0
 +
| style="background-color:#FFA500;" | UART2_RXD
 +
|
 +
|
 +
| 24
 
|-
 
|-
| style="vertical-align:middle;" | 146
+
| 116
 +
|
 +
| UART7_TX_M1
 +
| PWM14_M0
 +
| GPIO3_C4
 +
| style="background-color:#008000; color:#FFF;" | 11
 +
|
 +
| style="background-color:#008000; color:#FFF;" | 12
 +
| GPIO3_A3
 +
|
 
|  
 
|  
| style="vertical-align:middle;" | UART7_TX_M1
 
| style="vertical-align:middle;" | PWM14_M0
 
| style="vertical-align:middle;" | GPIO3_C4
 
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 11
 
| style="vertical-align:middle;" |
 
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 12
 
| style="vertical-align:middle;" | GPIO3_A3
 
| style="vertical-align:middle;" |
 
| style="vertical-align:middle;" |
 
 
|  
 
|  
| style="vertical-align:middle;" | 9
+
| 99
 
|-
 
|-
| style="vertical-align:middle;" | 150
+
| 117
 +
|
 +
| UART7_RX_M1
 +
| PWM15_IR_M0
 +
| GPIO3_C5
 +
| style="background-color:#008000; color:#FFF;" | 13
 +
|
 +
| style="background-color:#000; color:#FFF" | 14
 +
| GND
 +
|
 +
|
 
|  
 
|  
| style="vertical-align:middle;" | UART7_RX_M1
 
| style="vertical-align:middle;" | PWM15_IR_M0
 
| style="vertical-align:middle;" | GPIO3_C5
 
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 13
 
| style="vertical-align:middle;" |
 
| style="vertical-align:middle; color:#FFF;" | 14
 
| style="vertical-align:middle;" | GND
 
| style="vertical-align:middle;" |
 
| style="vertical-align:middle;" |
 
 
|  
 
|  
| style="vertical-align:middle;" |
 
 
|-
 
|-
| style="vertical-align:middle;" | 149
+
| 16
 
|  
 
|  
| style="vertical-align:middle;" | UART0_RX
+
| UART0_RX
| style="vertical-align:middle;" | PWM1_M0
+
| PWM1_M0
| style="vertical-align:middle;" | GPIO0_C0
+
| GPIO0_C0
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 15
+
| style="background-color:#008000; color:#FFF;" | 15
| style="vertical-align:middle;" |
+
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 16
+
| style="vertical-align:middle;" | GPIO3_A1
+
| style="vertical-align:middle;" | SPI1_CS0_M1
+
| style="vertical-align:middle;" |
+
 
|  
 
|  
| style="vertical-align:middle;" | 8
+
| style="background-color:#008000; color:#FFF;" | 16
 +
| GPIO3_A1
 +
| SPI1_CS0_M1
 +
|
 +
|
 +
| 97
 
|-
 
|-
| style="vertical-align:middle;" |  
+
| 17
 +
|
 +
| UART0_TX
 +
| PWM2_M0
 +
| GPIO0_C1
 +
| style="background-color:#FF0;" | 17
 
|  
 
|  
| style="vertical-align:middle;" | UART0_TX
+
| style="background-color:#008000; color:#FFF;" | 18
| style="vertical-align:middle;" | PWM2_M0
+
| GPIO3_B2
| style="vertical-align:middle;" | GPIO0_C1
+
| UART4_TX_M1
| style="vertical-align:middle; background-color:#FF0;" | 17
+
| PWM9_M0
| style="vertical-align:middle;" |
+
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 18
+
| style="vertical-align:middle;" | GPIO3_B2
+
| style="vertical-align:middle;" | UART4_TX_M1
+
| style="vertical-align:middle;" | PWM9_M0
+
 
|  
 
|  
| style="vertical-align:middle;" | 70
+
| 106
 
|-
 
|-
| style="vertical-align:middle;" | 40
+
| 147
 
| CAN1_TX_M1
 
| CAN1_TX_M1
| style="vertical-align:middle;" | SPI3_MOSI_M1
+
| SPI3_MOSI_M1
| style="vertical-align:middle;" | PWM15_IR_M1
+
| PWM15_IR_M1
| style="vertical-align:middle;" | GPIO4_C3
+
| GPIO4_C3
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 19
+
| style="background-color:#008000; color:#FFF;" | 19
| style="vertical-align:middle;" |  
+
|  
| style="vertical-align:middle; color:#FFF;" | 20
+
| style="background-color:#000; color:#FFF" | 20
| style="vertical-align:middle;" | GND
+
| GND
| style="vertical-align:middle;" |  
+
|  
| style="vertical-align:middle;" |  
+
|  
 +
|  
 
|  
 
|  
| style="vertical-align:middle;" |
 
 
|-
 
|-
| style="vertical-align:middle;" | 39
+
| 149
 
| UART9_TX_M1
 
| UART9_TX_M1
| style="vertical-align:middle;" | SPI3_MISO_M1
+
| SPI3_MISO_M1
| style="vertical-align:middle;" | PWM12_M1
+
| PWM12_M1
| style="vertical-align:middle;" | GPIO4_C5
+
| GPIO4_C5
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 21
+
| style="background-color:#008000; color:#FFF;" | 21
| style="vertical-align:middle;" |  
+
|  
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 22
+
| style="background-color:#008000; color:#FFF;" | 22
| style="vertical-align:middle;" | ADC_IN5
+
| ADC_IN5
| style="vertical-align:middle;" |  
+
|  
| style="vertical-align:middle;" |  
+
|  
 +
|  
 
|  
 
|  
| style="vertical-align:middle;" | 124
 
 
|-
 
|-
| style="vertical-align:middle;" | 41
+
| 146
 
| CAN1_TX_M1
 
| CAN1_TX_M1
| style="vertical-align:middle;" | SPI3_CLK_M1
+
| SPI3_CLK_M1
| style="vertical-align:middle;" | PWM14_M1
+
| PWM14_M1
| style="vertical-align:middle;" | GPIO4_C2
+
| GPIO4_C2
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 23
+
| style="background-color:#008000; color:#FFF;" | 23
| style="vertical-align:middle;" |  
+
|  
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 24
+
| style="background-color:#008000; color:#FFF;" | 24
| style="vertical-align:middle;" | GPIO4_C6
+
| GPIO4_C6
| style="vertical-align:middle;" | PWM13_M1
+
| PWM13_M1
| style="vertical-align:middle;" | SPI3_CS0_M1
+
| SPI3_CS0_M1
 
| UART9_RX_M1
 
| UART9_RX_M1
| style="vertical-align:middle;" | 42
+
| 150
 
|-
 
|-
| style="vertical-align:middle;" |
 
 
|  
 
|  
| style="vertical-align:middle;" |
 
| style="vertical-align:middle;" |
 
| style="vertical-align:middle;" | GND
 
| style="vertical-align:middle; color:#FFF;" | 25
 
| style="vertical-align:middle;" |
 
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 26
 
| style="vertical-align:middle;" | GPIO4_D1
 
| style="vertical-align:middle;" | SPI3_CS1_M1
 
| style="vertical-align:middle;" |
 
 
|  
 
|  
| style="vertical-align:middle;" |  
+
|
 +
|
 +
| GND
 +
| style="background-color:#000; color:#FFF" | 25
 +
|
 +
| style="background-color:#008000; color:#FFF;" | 26
 +
| GPIO4_D1
 +
| SPI3_CS1_M1
 +
|
 +
|
 +
| 153
 
|-
 
|-
| style="vertical-align:middle;" | 64
+
| 14
 
| PWM2_M1
 
| PWM2_M1
| style="vertical-align:middle;" | SPI0_MOSI_M0
+
| SPI0_MOSI_M0
| style="vertical-align:middle;" | I2C2_SDA_M0
+
| I2C2_SDA_M0
| style="vertical-align:middle;" | GPIO0_B6
+
| GPIO0_B6
| style="vertical-align:middle; background-color:#00F; color:#FFF;" | 27
+
| style="background-color:#00F; color:#FFF;" | 27
| style="vertical-align:middle;" |  
+
|  
| style="vertical-align:middle; background-color:#00F; color:#FFF;" | 28
+
| style="background-color:#00F; color:#FFF;" | 28
| style="vertical-align:middle;" | GPIO0_B5
+
| GPIO0_B5
| style="vertical-align:middle;" | I2C2_CLK_M0
+
| I2C2_CLK_M0
| style="vertical-align:middle;" | SPI0_CLK_M0
+
| SPI0_CLK_M0
 
| PWM1_M1
 
| PWM1_M1
| style="vertical-align:middle;" | 65
+
| 13
 
|-
 
|-
| style="vertical-align:middle;" | 74
+
| 95
 +
|
 +
| UART8_TX_M1
 +
| SPI2_MISO_M1
 +
| GPIO2_D7
 +
| style="background-color:#008000; color:#FFF;" | 29
 +
|
 +
| style="background-color:#000; color:#FFF" | 30
 +
| GND
 +
|
 +
|
 
|  
 
|  
| style="vertical-align:middle;" | UART8_TX_M1
 
| style="vertical-align:middle;" | SPI2_MISO_M1
 
| style="vertical-align:middle;" | GPIO2_D7
 
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 29
 
| style="vertical-align:middle;" |
 
| style="vertical-align:middle; color:#FFF;" | 30
 
| style="vertical-align:middle;" | GND
 
| style="vertical-align:middle;" |
 
| style="vertical-align:middle;" |
 
 
|  
 
|  
| style="vertical-align:middle;" |
 
 
|-
 
|-
| style="vertical-align:middle;" | 73
+
| 96
 +
|
 +
| UART8_RX_M1
 +
| SPI2_CLK_M1
 +
| GPIO3_A0
 +
| style="background-color:#008000; color:#FFF;" | 31
 
|  
 
|  
| style="vertical-align:middle;" | UART8_RX_M1
+
| style="background-color:#008000; color:#FFF;" | 32
| style="vertical-align:middle;" | SPI2_CLK_M1
+
| GPIO3_C2
| style="vertical-align:middle;" | GPIO3_A0
+
| SPI1_MISO_M1
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 31
+
| UART5_TX_M1
| style="vertical-align:middle;" |
+
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 32
+
| style="vertical-align:middle;" | GPIO3_C2
+
| style="vertical-align:middle;" | SPI1_MISO_M1
+
| style="vertical-align:middle;" | UART5_TX_M1
+
 
|  
 
|  
| style="vertical-align:middle;" | 125
+
| 114
 
|-
 
|-
| style="vertical-align:middle;" | 157
+
| 115
 +
|
 +
| UART5_RX_M1
 +
| SPI1_CLK_M1
 +
| GPIO3_C3
 +
| style="background-color:#008000; color:#FFF;" | 33
 +
|
 +
| style="background-color:#000; color:#FFF" | 34
 +
| GND
 +
|
 +
|
 
|  
 
|  
| style="vertical-align:middle;" | UART5_RX_M1
 
| style="vertical-align:middle;" | SPI1_CLK_M1
 
| style="vertical-align:middle;" | GPIO3_C3
 
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 33
 
| style="vertical-align:middle;" |
 
| style="vertical-align:middle; color:#FFF;" | 34
 
| style="vertical-align:middle;" | GND
 
| style="vertical-align:middle;" |
 
| style="vertical-align:middle;" |
 
 
|  
 
|  
| style="vertical-align:middle;" |
 
 
|-
 
|-
| style="vertical-align:middle;" | 68
+
| 100
 
|  
 
|  
| style="vertical-align:middle;" |
 
| style="vertical-align:middle;" |
 
| style="vertical-align:middle;" | GPIO3_A4
 
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 35
 
| style="vertical-align:middle;" |
 
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 36
 
| style="vertical-align:middle;" | GPIO3_A2
 
| style="vertical-align:middle;" |
 
| style="vertical-align:middle;" |
 
 
|  
 
|  
| style="vertical-align:middle;" | 66
+
|
 +
| GPIO3_A4
 +
| style="background-color:#008000; color:#FFF;" | 35
 +
|
 +
| style="background-color:#008000; color:#FFF;" | 36
 +
| GPIO3_A2
 +
|
 +
|
 +
|
 +
| 98
 
|-
 
|-
| style="vertical-align:middle;" | 126
+
| 112
 
|  
 
|  
| style="vertical-align:middle;" | UART3_RX_M1
+
| UART3_RX_M1
| style="vertical-align:middle;" | PWM13_M0
+
| PWM13_M0
| style="vertical-align:middle;" | GPIO3_C0
+
| GPIO3_C0
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 37
+
| style="background-color:#008000; color:#FFF;" | 37
| style="vertical-align:middle;" |
+
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 38
+
| style="vertical-align:middle;" | GPIO3_A6
+
| style="vertical-align:middle;" |
+
| style="vertical-align:middle;" |
+
 
|  
 
|  
| style="vertical-align:middle;" | 67
+
| style="background-color:#008000; color:#FFF;" | 38
 +
| GPIO3_A6
 +
|
 +
|
 +
|
 +
| 102
 
|-
 
|-
| style="vertical-align:middle;" |
 
 
|  
 
|  
| style="vertical-align:middle;" |
 
| style="vertical-align:middle;" |
 
| style="vertical-align:middle;" | GND
 
| style="vertical-align:middle; color:#FFF;" | 39
 
| style="vertical-align:middle;" |
 
| style="vertical-align:middle; background-color:#008000; color:#FFF;" | 40
 
| style="vertical-align:middle;" | GPIO3_A5
 
| style="vertical-align:middle;" |
 
| style="vertical-align:middle;" |
 
 
|  
 
|  
| style="vertical-align:middle;" | 34
+
|
 +
|
 +
| GND
 +
| style="background-color:#000; color:#FFF" | 39
 +
|
 +
| style="background-color:#008000; color:#FFF;" | 40
 +
| GPIO3_A5
 +
|
 +
|
 +
|
 +
| 101
 
|}
 
|}
  
Line 322: Line 322:
 
* SPI: x1, SPI3
 
* SPI: x1, SPI3
 
* I2C: x2, I2C2/I2C3
 
* I2C: x2, I2C2/I2C3
* UART: x2, UART0/UART3/UART5/UART7/UART9
+
* UART: x5, UART0/UART3/UART5/UART7/UART9
 
* ADC: x1, ADC_IN5
 
* ADC: x1, ADC_IN5
 
* CAN: x1, CAN1
 
* CAN: x1, CAN1
Line 328: Line 328:
 
=== IO Voltage ===
 
=== IO Voltage ===
  
RK3568 have three IO voltages, 1.8V/3.0V/3.3V. For ROCK Pi N10, below is the default voltage:
+
RK3568 have three IO voltages, 1.8V/3.3V. For ROCK 3, the high level voltage of GPIO pin on 40-PIN HEADER is 3.3V.
  
 
<pre>
 
<pre>
 
| GPIO      | Voltage Level | Tolerance |
 
| GPIO      | Voltage Level | Tolerance |
 
| ---------- | ------------- | --------- |
 
| ---------- | ------------- | --------- |
| GPIO3_C0  | 3.3V          | 3.465V    |
+
| GPIO3_C0  | 3.3V          | 3.63V    |
| ADC_IN0   | 1.8V          | 1.98V    |
+
| ADC_IN5   | 1.8V          | 1.98V    |
 
</pre>
 
</pre>
  

Latest revision as of 11:22, 23 August 2021

    ROCK 3 >  Hardware >  GPIO

General purpose input-output (GPIO) connector

ROCK 3 has a 40-pin expansion header. Each pin is distinguished by color.

Hardware V1.2

GPIO number Function4 Function3 Function2 Function1 Pin# Pin# Function1 Function2 Function3 Function4 GPIO number
+3.3V 1 2 +5.0V
32 CAN1_RX_M0 UART3_RX_M0 I2C3_SDA_M0 GPIO1_A0 3 4 +5.0V
33 CAN1_TX_M0 UART3_TX_M0 I2C3_SCL_M0 GPIO1_A1 5 6 GND
111 UART3_TX_M1 PWM12_M0 GPIO3_B7 7 8 GPIO0_D1 UART2_TXD 25
GND 9 10 GPIO0_D0 UART2_RXD 24
116 UART7_TX_M1 PWM14_M0 GPIO3_C4 11 12 GPIO3_A3 99
117 UART7_RX_M1 PWM15_IR_M0 GPIO3_C5 13 14 GND
16 UART0_RX PWM1_M0 GPIO0_C0 15 16 GPIO3_A1 SPI1_CS0_M1 97
17 UART0_TX PWM2_M0 GPIO0_C1 17 18 GPIO3_B2 UART4_TX_M1 PWM9_M0 106
147 CAN1_TX_M1 SPI3_MOSI_M1 PWM15_IR_M1 GPIO4_C3 19 20 GND
149 UART9_TX_M1 SPI3_MISO_M1 PWM12_M1 GPIO4_C5 21 22 ADC_IN5
146 CAN1_TX_M1 SPI3_CLK_M1 PWM14_M1 GPIO4_C2 23 24 GPIO4_C6 PWM13_M1 SPI3_CS0_M1 UART9_RX_M1 150
GND 25 26 GPIO4_D1 SPI3_CS1_M1 153
14 PWM2_M1 SPI0_MOSI_M0 I2C2_SDA_M0 GPIO0_B6 27 28 GPIO0_B5 I2C2_CLK_M0 SPI0_CLK_M0 PWM1_M1 13
95 UART8_TX_M1 SPI2_MISO_M1 GPIO2_D7 29 30 GND
96 UART8_RX_M1 SPI2_CLK_M1 GPIO3_A0 31 32 GPIO3_C2 SPI1_MISO_M1 UART5_TX_M1 114
115 UART5_RX_M1 SPI1_CLK_M1 GPIO3_C3 33 34 GND
100 GPIO3_A4 35 36 GPIO3_A2 98
112 UART3_RX_M1 PWM13_M0 GPIO3_C0 37 38 GPIO3_A6 102
GND 39 40 GPIO3_A5 101

More details about 40-pin Header

  • Pins marked with color orange are designed for debug console.
  • PWM; x6, PWM1/PWM2/PWM12/PWM13/PWM14/PWM15
  • SPI: x1, SPI3
  • I2C: x2, I2C2/I2C3
  • UART: x5, UART0/UART3/UART5/UART7/UART9
  • ADC: x1, ADC_IN5
  • CAN: x1, CAN1

IO Voltage

RK3568 have three IO voltages, 1.8V/3.3V. For ROCK 3, the high level voltage of GPIO pin on 40-PIN HEADER is 3.3V.

| GPIO       | Voltage Level | Tolerance |
| ---------- | ------------- | --------- |
| GPIO3_C0   | 3.3V          | 3.63V     |
| ADC_IN5    | 1.8V          | 1.98V     |

GPIO number

Rockchip RK3568 GPIO has 5 banks, GPIO0 to GPIO4, each bank has 32pins, naming as below:

GPIO0_A0 ~ A7 
GPIO0_B0 ~ B7
GPIO0_C0 ~ C7
GPIO0_D0 ~ D7
   
GPIO1_A0 ~ A7
....
GPIO1_D0 ~ D7

For Rockchip 4.19 kernel, the GPIO number can be calculated as below, take GPIO4_D1 (PIN26 on 4-0PIN HEADER) as an example:

GPIO4_D1 = 4*32 + 3*8 + 1 = 153
(A=0, B=1, C=2, D=3)

To set GPIO4_D1 output

cd /sys/class/gpio
echo 153 > export
cd gpio153
echo out > direction
echo 1 > value     # output high
echo 0 > value     # output low