Leosac  0.8.0
Open Source Access Control
Module: Libgpiod

Driving GPIO pin through Linux's Character Device GPIO and libgpiod.

Libgpiod Module Documentation

Introduction

Welcome to the main documentation page for the Libgpiod module. This page is about Libgpiod from an end-user point of view.
It describes how to configure the Libgpiod module for Leosac.

This module provide support for FGPIO device by supporting the Linux Kernel Libgpiod interface. It allows the application to deals with GPIO pin that are in fact controlled through libgpiod.

Configuration Options

Below are the configuration options available.

Options Options Options Description Mandatory
consumer The GPIOs consumer name (default: leosac) NO
gpios List of GPIOs pins we configure YES
—> gpio Configuration informations for one GPIO pin. YES
—> —> name Name of the GPIO pin YES
—> —> device GPIO chip device. YES
—> —> offset Offset of the GPIO pin. YES
—> —> direction Direction of the pin. This in either in or out YES
—> —> interrupt_mode What interrupt do we care about? See below for details NO
—> —> value Default value of the PIN. Either 1 or 0 NO

Interrupt Mode

The configuration option interrupt_mode can take 4 values:

  • Falling
  • Rising
  • Both
  • None. This is the default. This parameter is ignored for output pin.

Default Value

The default value (ignored for input pin) is set for the pin when the module starts. It is also restored when the module stops.

Example

This is a example of Libgpiod possible configuration for Libgpiod module into Leosac:

<module>
<name>LIBGPIOD</name>
<file>liblibgpiod.so</file>
<level>2</level>
<module_config>
<consumer>leosac</consumer>
<gpios>
<gpio>
<name>wiegand_data_high</name>
<device>gpiochip0</device>
<offset>15</offset>
<direction>in</direction>
<interrupt_mode>falling</interrupt_mode>
</gpio>
<gpio>
<name>wiegand_data_low</name>
<device>gpiochip0</device>
<offset>14</offset>
<direction>in</direction>
<interrupt_mode>falling</interrupt_mode>
</gpio>
<gpio>
<name>a_random_gpio</name>
<device>gpiochip0</device>
<offset>3</offset>
<direction>out</direction>
<value>0</value>
</gpio>
</gpios>
</module_config>
</module>

Notes

See also
For technical description of the module, see the main class for the module .