This is a pair of plugins provinding interfaces to Raspberry Pi GPIO pins using the libgpiod library. The plugin rpio_out allows setting GPIO pin values, while rpio_in allows reading GPIO pin values.
This plugin has been updated for MADS v2
- libgpiod, version 1.6.x, install with
sudo apt install libgpiod-dev
Currently, the supported platforms are:
- Linux
Linux:
cmake -Bbuild -DCMAKE_INSTALL_PREFIX="$(mads -p)"
cmake --build build -j4
sudo cmake --install buildThe plugin supports the following settings in the INI file:
[rpio_in]
chip_path = "/dev/gpiochip0"
offsets = [5, 15, 10, 12]
pulldown = true
event_mode = "none" # options: none, rising, falling, both
period = 500 # in milliseconds
polling_timeout = 500 # in milliseconds
[rpio_out]
chip_path = "/dev/gpiochip0"All settings are optional; if omitted, the default values are used.
NOTE: The rpio_out sink plugin expects a JSON object with the following format:
{
"pins": {
"10": 1,
"12": 0
}
}Where the keys are the GPIO pin numbers (as strings!) and the values are either 0 or 1 (as integers).
Demo executables read and set GPIO pin values.