Edited by mark2@opi at 2015-10-17 18:39
Hi,
I tried to adapt RPi.GIPO to OrangePi H3 boards. It is based on de Banana Pi RPi.GPIO_BP of LeMaker so all credits to them.
But after 20 years my C needs brushing up and am by no means a linux expert, got only the basics working: GPIO.setmode(GPIO.BCM/BOARD/RAW) GPIO.setup(PIN, GPIO.OUT/IN) And the soft-PWM is working too.
This basic functions use memory mapped access to GPIO Pins. I’m stuck at the event handling.
It uses GPIO Sysfs Userspace-Interface for handling events, so build a customkernel with GPIO sysfs enabled. /sys/class/gpio/export and unexport show up and RPi.GPIO.add_event_detect(PIN, GPIO.FALLING/RISING , callback=my_callback) doesn’t give runtime errors any more.
But no event handling. Compiling the libary gives errors about the “write” statements used to interface with GPIO Sysfs. (missing or wrong unistd.h ???)
EDIT 2015-10-17:
Made some progress, i forgot to edit the mapping of (fex) gpio_pin_numbers to connector pins..
But am in doubt now:
alter the mapping in RPi.GPIO_OPI
OR
edit the fex file to get an raspberry-BCM-compatible-as-possible header??
(Have not updated zip)
I hope someone who actual knows what he is doing can take over.
BTW: ALL GPIO pins connected to the he header (CON3) are mapped. Some of them have fixed functions and can not be used as regular in/out
@ steven the user manual states CON3-13 and CON3-P22 are connected to PA2; CON3-P13 is connected to PA0
|