Python GPIO Library for the Rock64 (R64.GPIO)
R64.GPIO aims to re-implement RPi.GPIO for the Rock64, with the goal of 100% code compatibility with the original Raspberry Pi module.

The following functions are currently implemented and working:
  • GPIO.setmode()
  • GPIO.setwarnings()
  • GPIO.setup()
  • GPIO.output()
  • GPIO.input()
  • GPIO.cleanup()
  • GPIO.PWM() (start, stop, ChangeFrequency, ChangeDutyCycle)
  • GPIO.wait_for_edge()
Not yet implemented, but planned for the near future:
  • Interrupts (GPIO.event_detect)
The latest version of R64.GPIO can be found on my github, here:
I'm currently updating the library very frequently, so make sure to grab the latest code!

Importing the R64.GPIO module:
  • Download the entire "R64" folder from the repo, then place the "R64" folder in the same directory as the Python script you're working on.
  • Within your script, substitute the normal "import RPi.GPIO as GPIO" line for "import R64.GPIO as GPIO". Syntax for implemented functions should be identical to RPi.GPIO.
You may use GPIO.setmode() to select between ROCK, BOARD, and BCM numbering.
  • ROCK numbering is the default. I've created a reference spreadsheet of Rock64 pins, their functions, and their GPIO numbers, which you can find here:
  • BOARD numbering works exactly like it does in RPi.GPIO. Simply input a pin number, and the correct ROCK GPIO will be selected for you.
  • BCM numbering attempts to emulate the physical layout of the Pi. This isn't perfect (some pins had to be mapped to the P5 header, can't use some pins with MicroSD, etc.), but I figured someone might find it useful.

Messages In This Thread
Python GPIO Library for the Rock64 (R64.GPIO) - by Leapo - 03-28-2018, 12:43 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Rock64 won't boot luminosity7 9 1,517 05-20-2023, 08:43 AM
Last Post: luminosity7
  How well does Rock64 deal with HDR and Atmos on Kodi? drvlikhell 3 752 04-29-2023, 04:24 AM
Last Post: newestssd
  OpenWRT on the Rock64 CanadianBacon 12 4,885 04-24-2023, 12:40 PM
Last Post: arunkhan
  Rock64 board not working, no HDMI no Ethernet. EDited 3 2,363 01-17-2023, 02:31 PM
Last Post: Flagtrax
  ROCK64 v3 can it boot from USB? Tsagualsa 4 848 11-29-2022, 11:31 AM
Last Post: Macgyver
  rock64 v3 spiflash Macgyver 0 329 11-28-2022, 02:18 PM
Last Post: Macgyver
  my rock64 dosen't work rookie_267 0 518 10-07-2022, 07:50 PM
Last Post: rookie_267
  Rock64 u-boot for eMMC Build Error mexicanflyer 0 575 09-18-2022, 02:29 PM
Last Post: mexicanflyer
  ROCK64 - Not start mathieu 0 777 07-11-2022, 03:49 AM
Last Post: mathieu
  Rock64 bricked shawwwn 6 4,037 01-29-2022, 05:49 AM
Last Post: shawwwn

Forum Jump:

Users browsing this thread: 2 Guest(s)