Configuring GPIO pin mapping for libgpiod
Hi
I installed a bare minimal Debian 11 (Bullseye) distribution on a Nano Pi M1 single board computer. I would like to use it to control external devices using its GPIO pins. I was not able to find a suitable port of Python packages such RPi.GPIO for this purpose. Besides I understand the current best practice for controlling gpio pins is to use libgpiod. The gpio device is detected by the kernel as shown below Code:
$ sudo gpiodetect Code:
$ sudo gpioinfo gpiochip0 Thank you |
Maybe not needed. Do you have a /sys/class/gpio directory?
|
As I understand libgpiod was created to avoid use of /sys/class/gpio.
|
You searched thoroughly their documentation and it all was useless? You could use a voltmeter and find out mapping by switching pins one by one, time consuming though.
|
That is a good idea indeed. I was thinking along the lines of setting up a gpiod event to monitor and then set a 3.3v volt pull up or down resistor on each pin with a switch and see which gpio lines detect it. Apart from being tedious I am not sure if this will work for all the pins though it may be enough to give me an idea of the pin layout.
The problem with their documentation is that they list the pin numbers which are (I think) "logical" pin numbers and may not correspond to the numbering that is used by the gpiod driver. There is a circuit diagram available and I am trying to figure out how the gpiod numbering corresponds with the pin numbers in the circuit diagram. |
All times are GMT -5. The time now is 07:34 PM. |