3690
правок
Строка 70: | Строка 70: | ||
* <code>gpiomon</code> — отслеживание событий gpio | * <code>gpiomon</code> — отслеживание событий gpio | ||
Примеры использования gpiod можно посмотреть в [https://www.acmesystems.it/gpiod] и [https://github.com/brgl/libgpiod] | Пример работы: | ||
<syntaxhighlight lang="bash"> | |||
~# systemctl stop wb-mqtt-gpio # stop WB GPIO<==>MQTT bridge | |||
~# gpiofind "A1 IN" # find gpiochip and offset for a given label | |||
gpiochip0 231 | |||
~# gpioget `gpiofind "A1 IN"` # get the current GPIO value, using data returned by gpiofind | |||
1 | |||
~# gpiofind "A1 OUT" # find chip and offset for another GPIO | |||
gpiochip0 109 | |||
~# gpioset gpiochip0 109=1 # enable A1 OUT | |||
~# gpioset gpiochip0 109=0 # disable A1 OUT | |||
~# gpioset `gpiofind "A1 OUT"`=0 # now the same using gpiofind | |||
</syntaxhighlight> | |||
Примеры использования gpiod можно посмотреть в [https://www.acmesystems.it/gpiod] и [https://github.com/brgl/libgpiod]. | |||
===Интерфейс sysfs=== | ===Интерфейс sysfs=== |