On 05.09.18 09:34, Volker Kuhlmann wrote:
>>> Sure, I have. It's as simple as echo, no libraries needed.
>
> OK, found something.
>
> ls -1 /sys/class/gpio/
> export
> gpiochip458
> unexport
>
> echo 462 >/sys/class/gpio/export
> ls -1 /sys/class/gpio/
> export
> gpio462
> gpiochip458
> unexport
>
> https://www.kernel.org/doc/Documentation/gpio/sysfs.txt
> Is a little obtuse about the pin number needing to be added to that
> 458.
>
> How do the pin numbers in sysfs on leap 15.0 correspond to the pins on the RPi
> header? Pin 4 (462) appears not to correlate with GPIO4 (pin 7 of the
> 2x20 pin header). Searching the net is a bit fruitless as everyone seems
> to assume they're running raspbian...
You need to first make sure the pin is muxed properly as GPIO and not
associated with a special function:
/sys/kernel/debug/pinctrl/3f200000.gpio/pinmux-pins
Once that's clear, you can use the GPIO export to actually access the
GPIO function.
For that, add the "base" (458) to the BCM number from here:
https://pinout.xyz/
and add an export like you did above :).
Alex
--
To unsubscribe, e-mail: [email protected]
To contact the owner, e-mail: [email protected]