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
  Pine Rock64 eMMC lifespan moonspell79 3 281 08-19-2021, 06:46 PM
Last Post: bcnaz
  Rock64 No Audio - Solved wbecks 12 16,786 08-13-2021, 01:23 PM
Last Post: blakeadam
Question Hardware issues with Rock64 grobbs 11 2,415 07-24-2021, 10:23 AM
Last Post: robinkyle11
  Trustzone support for Rock64 capablegh 1 284 07-17-2021, 10:15 AM
Last Post: capablegh
  rock64, compile problems "illegal instruction", "memory fault" -> ddr_333Mhz? klausfelix 0 254 07-02-2021, 03:13 PM
Last Post: klausfelix
Information Serial Console for the Rock64 MarkHaysHarris777 33 33,310 06-24-2021, 12:24 PM
Last Post: mikeklien
  lost eletronic component rock64 marvin1986 1 518 06-01-2021, 06:27 PM
Last Post: 8bit
Shocked Rock64 - Reboots after few minutes addezai 2 735 04-22-2021, 07:03 PM
Last Post: addezai
  Rock64 Long Term stability ramprasad 4 2,341 03-16-2021, 07:23 PM
Last Post: Rocklobster
  Safest way to send shutdown signal to headless Rock64 SMB server? bmurphr1 3 1,515 03-14-2021, 06:01 PM
Last Post: clach04

Forum Jump:

Users browsing this thread: 1 Guest(s)