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

Difference between revisions of "Rockpi4/hardware/gpio"

Line 4: Line 4:
 
     [[rockpi4 | ROCK Pi 4]] > [[rockpi4/hardware | Hardware]] > [[rockpi4/hardware/gpio | GPIO]]
 
     [[rockpi4 | ROCK Pi 4]] > [[rockpi4/hardware | Hardware]] > [[rockpi4/hardware/gpio | GPIO]]
  
 +
Full 40PIN GPIO pinout and numbers can be found at: https://wiki.radxa.com/Rockpi4/hardware/rockpi4#gpio
  
 
Rockchip RK3399 GPIO has 5 banks, GPIO0 to GPIO4, each bank has 32pins, naming as below:
 
Rockchip RK3399 GPIO has 5 banks, GPIO0 to GPIO4, each bank has 32pins, naming as below:

Revision as of 06:28, 7 March 2019

    ROCK Pi 4 >  Hardware >  GPIO

Full 40PIN GPIO pinout and numbers can be found at: https://wiki.radxa.com/Rockpi4/hardware/rockpi4#gpio

Rockchip RK3399 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.4 kernel, the GPIO number can be calculated as below, take GPIO4_D5(PIN22 on 40PIN GPIO) as an example:

   GPIO4_D5 = 32*4 + 8*3 + 5 = 157

To set GPIO4_D5 output

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