rm-hull / OPi.GPIO

RPi.GPIO drop-in replacement library for Orange Pi Zero and other SBCs
https://opi-gpio.readthedocs.io/
MIT License
184 stars 99 forks source link

OPi.GPIO and libgpiod instead /sysfs #91

Open sp2ong opened 3 months ago

sp2ong commented 3 months ago

OPi.GPIO is a very good support for writing python applications to interact with GPIO on SBC based on H3/H5 etc. Currently, the latest OS distributions based on Debian 12 and higher using kernel 6.x do not have access to GPIO via /sysfs, only via libgpiod. Does OPi.GPIO support interaction with GPIO via libgpiod?

I found info https://linux-sunxi.org/GPIO Accessing the GPIO pins through character device with mainline kernel The sysfs GPIO interface is now deprecated in favor of character devices /dev/gpiochipX

I found a project called RPI.GPIO2

https://github.com/underground-software/RPi.GPIO2/tree/master?tab=readme-ov-file

which allows you to maintain the communication syntax with GPIO but by using libgpiod. Maybe it would be possible to make OPi.GPIO2 versions in a similar way, so that we could still use our python scripts on 6.x series krenels and use the settings and communication with GPIO via libgpiod?