GPIO library - RPi.GPIO_OPI
Edited by mark2@opi at 2015-10-17 18:39Hi,
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 wrongunistd.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
PYHON GPIO check it out.
http://www.orangepi.org/orangepibbsen/forum.php?mod=viewthread&tid=523&pid=4766&page=1&extra=page%3D1#pid4766
jacer replied at 2015-10-17 19:54
PYHON GPIO check it out.
http://www.orangepi.org/orangepibbsen/forum.php?mod=viewthread&tid=523&pid ...
Nice, Thanx
Go trough your examples;
connector.gpio3pxx are used, in the mapping header gpio1 is defined
jacer replied at 2015-10-17 19:54
PYHON GPIO check it out.
http://www.orangepi.org/orangepibbsen/forum.php?mod=viewthread&tid=523&pid ...
interrupt driven gpi not working
page:
[1]