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:
I'm currently updating the library very frequently, so make sure to grab the latest code!
Importing the R64.GPIO 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()
- Interrupts (GPIO.event_detect)
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.
- 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.