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

Difference between revisions of "RockpiE/hardware/gpio"

(More details about 40-pin Header)
(IO Voltage)
Line 72: Line 72:
  
 
== IO Voltage ==
 
== IO Voltage ==
RK3328 have two IO voltages, '''1.8V/3.3V'''.
+
 
 +
RK3328 have two IO voltages, '''1.8V/3.3V'''. For ROCK Pi E, the voltage level of GPIOs showed in the tables above are '''3.3V''' and tolerance of those  are '''3.6V'''.
  
 
== GPIO number ==
 
== GPIO number ==

Revision as of 10:05, 20 November 2019

    ROCK Pi E >  Hardware >  GPIO

General purpose input-output (GPIO) connector

ROCK Pi E has one 40-pin expansion header. Each pin is distinguished by color.


Hardware V10

26-pin Header

GPIO number Func4 Func3 Func2 Func1 Pin# Pin# Func1 Func2 Func3 Func4 GPIO number
+3.3V 1 2 +5.0V
68 I2C1_SDA GPIO2_A4 3 4 +5.0V
69 I2C1_SCL GPIO2_A5 5 6 GND
100 UART1_TX SDMMC0EXT_D0 TSP_D0 GPIO3_A4 7 8 GPIO2_A0 UART2_TX_M1 POWERSTATE0 64
GND 9 10 GPIO2_A1 UART2_RX_M1 POWERSTATE1 65
96 SPI_CLK_M2 SDMMC0EXT_CMD TSP_VALID GPIO3_A0 11 12 GPIO2_D2 90
104 SPI_CSN0_M2 TSP_D4 GPIO3_B0 13 14 GND
98 SPI_RXD_M2 SDMMC0EXT_CLK TSP_CLK GPIO3_A2 15 16 USB20DM
+3.3V 17 18 USB20DP
27 SPDIF_TX_M0 GPIO0_D3 19 20 GND
83 CARD_CLK_M1 PDM_SDI0_M0 I2S1_SDI GPIO2_C3 21 22 GPIO2_B4 SPI_CSN1_M0 FLASH_VOL_SEL 76
60 CLK32KOUT_M1 GPIO1_D4 23 24 GPIO2_A3 EFUSE_PWREN POWERSTATE3 67
GND 25 26 GPIO2_C7 I2S1_SDO PDM_FSYNC_M0 87
97 SPI_TXD_M2 SDMMC0EXT_DET TSP_FAIL GPIO3_A1 27 28 GPIO2_C1 I2S1_LRCK_TX SPDIF_TX_M1 TSP_D6_M1 81
80 TSP_D5_M1 I2S1_LRCK_RX GPIO2_C0 29 30 GND
79 TSP_SYNC_M1 I2S1_MCLK GPIO2_B7 31 32 GPIO3_A6 TSP_D2 SDMMC0EXT_D2 UART1_RX 102
82 TSP_D7_M1 PDM_CLK_M0 I2S1_SCLK GPIO2_C2 33 34 GND
ADC_IN1 35 36 GPIO2_C5 I2S1_SDIO2 PDM_SDI2_M0 CARD_DET_M1 85
66 POWERSTATE2 IR_RX GPIO2_A2 39 38 GPIO2_C4 2S1_SDIO1 PDM_SDI1_M0 CARD_RST_M1 84
GND 39 40 GPIO2_C6 I2S1_SDIO3 PDM_SDI3_M0 CARD_IO_M1 86

More details about 40-pin Header

  • Pin#12(GPIO2_D2) is also the sleep pin of PMIC RK805. Be careful when you try to control it.
  • Pins marked with color orange are designed for debug console.

IO Voltage

RK3328 have two IO voltages, 1.8V/3.3V. For ROCK Pi E, the voltage level of GPIOs showed in the tables above are 3.3V and tolerance of those are 3.6V.

GPIO number

Rockchip RK3328 GPIO has 4 banks, GPIO0 to GPIO3, 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.4 kernel, the GPIO number can be calculated as below, take GPIO2_A2(PIN39 on 40PIN GPIO) as an example:

   GPIO2_A2 = 32*2 + 8*0 + 2 = 66

To set GPIO2_A2 output

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