Python GPIO Library for the Rock64 (R64.GPIO)
#1
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: https://github.com/Leapo/Rock64-R64.GPIO
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: https://github.com/Leapo/Rock64-R64.GPIO...rence.xlsx
  • 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.
  Reply


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
  OpenWRT on the Rock64 CanadianBacon 6 1,289 06-10-2022, 05:43 PM
Last Post: anchor00
  Rock64 bricked shawwwn 6 1,829 01-29-2022, 05:49 AM
Last Post: shawwwn
  Rock64 board not working, no HDMI no Ethernet. EDited 2 919 01-26-2022, 08:46 AM
Last Post: TRS-80
  Rock64 <--> Rock64 Serial Connection mark1250 1 694 12-23-2021, 09:27 PM
Last Post: barray
  Are you guys still using Ayufan's OMV on your Rock64? AkiraSensei 0 683 11-26-2021, 07:01 PM
Last Post: AkiraSensei
  Rock64 kernel panics clay 15 4,564 10-17-2021, 06:30 PM
Last Post: Rocklobster
  Pine Rock64 eMMC lifespan moonspell79 3 1,863 08-19-2021, 06:46 PM
Last Post: bcnaz
  Rock64 No Audio - Solved wbecks 12 22,182 08-13-2021, 01:23 PM
Last Post: blakeadam
  Trustzone support for Rock64 capablegh 1 1,324 07-17-2021, 10:15 AM
Last Post: capablegh
  rock64, compile problems "illegal instruction", "memory fault" -> ddr_333Mhz? klausfelix 0 900 07-02-2021, 03:13 PM
Last Post: klausfelix

Forum Jump:


Users browsing this thread: 1 Guest(s)