Op donderdag 16 september 2021 12:00:15 CEST schreef Peter Suetterlin: > Matthias Brugger wrote: > > [+ivan +andreas] > > > > On 16/09/2021 10:01, Guillaume Gardet wrote: > > > Did you have a look at https://en.opensuse.org/openSUSE:GPIO for > > > standard packages to access GPIO instead of downstream, RPi specific, > > > software? > > > > > > You can use 'gpioinfo gpiochip446' and 'gpioinfo gpiochip454' to get > > > info about the gpio available. > > > > > > You can try to use an offset of 446, so try to set gpio 463 (446 + 17). > > > Not sure why there is such an offset, though. Matthias, any idea? > > > > Unfortunately not. Maybe it would be something worth to investigate as > > users regularly get confused about that. > > > > I remember that we had that discussion in the past, but can't recall what > > was the outcome. Andreas do you remember? > > As a simple user without distracting background knowledge ;^> : > > The main source of irritation seems to be that the naming scheme is > different - at least compared to Raspbian. But when searching the web, > most of the hits will refer to that. > > The behavior of the /sys interface (deprecated or not) is consistent (N + > line, with N the number from gpiochipN). Just that 'for us' N is not zero. > > For the user it would be a help if that naming could (also) start with zero. > Not sure if there is a kernel boot parameter to influence that (similar to > the ethernet device naming schemes), or if it's a compile time parameter... > libgpiod seems to refer to the first one as gpiochip0 anyhow, so adjusting > the kernel name would increase consistency, IMO. > > My 2¢
I have been struggling with this on a Raspberry Pi 1B and made the Python module for that device called RPi.GPIO. However there is a difference between a RPi1 and other RPi's. RPi1 shows "export gpio321 gpiochip298 unexport" in /sys/class/gpio/, where the start of N is clearly 298. However on a RPi4 /sys/ class/gpio/ shows "export gpiochip446 gpiochip454 unexport". To me the question is: which one of 446 and 454 is the start value? On a RPi3 with Raspbian one gets in /sys/class/gpio/ "export gpiochip0 gpiochip100 gpiochip504 unexport", as mentioned earlier the start value is 0. -- fr.gr. Freek de Kruijf
