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
  lost eletronic component rock64 marvin1986 1 210 06-01-2021, 06:27 PM
Last Post: 8bit
Shocked Rock64 - Reboots after few minutes addezai 2 321 04-22-2021, 07:03 PM
Last Post: addezai
Question Hardware issues with Rock64 grobbs 10 1,269 04-08-2021, 05:24 AM
Last Post: t4_4t
  Rock64 Long Term stability ramprasad 4 1,713 03-16-2021, 07:23 PM
Last Post: Rocklobster
  Rock64 No Audio - Solved wbecks 11 14,925 03-15-2021, 03:15 PM
Last Post: lowry
  Safest way to send shutdown signal to headless Rock64 SMB server? bmurphr1 3 1,036 03-14-2021, 06:01 PM
Last Post: clach04
  Rock64 as a router (OpenWRT,etc) bob-anon 2 1,591 03-12-2021, 01:16 AM
Last Post: arkadione
  Rock64 enable 1-wire to read DS18B20 or Dallas temperature sensor Perry 2 1,183 02-12-2021, 08:02 PM
Last Post: Perry
  Will Mobian Run On Rock64? Porcupine 1 591 01-13-2021, 12:39 PM
Last Post: tophneal
  Rock64 v2 as Openmediavault server - buffers / shutdown problems helpmerock 2 1,028 12-29-2020, 09:46 AM
Last Post: helpmerock

Forum Jump:

Users browsing this thread: 1 Guest(s)