Project

General

Profile

Libgpiod

Setup

To install the latest Fedora package of libgpiod and its python bindings from official fedora repositories, run:

dnf install libgpiod python3-libgpiod

These packages are dependenies of python3-libgpiod-rpi

How to build libgpiod from source:

Install dependencies:

dnf install make gcc autoconf autoconf-archive automake m4 libtool python3-devel

Clone the repository:

git clone https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/

Generate Makefiles for building libgpiod, the python bindings, and some tools:

cd libgpiod
./autogen.sh --enable-bindings-python --enable-tools
make && make install

To view documentation for libgpiod, run the following in a python interpreter:

import gpiod
help(gpiod)

For more information, view the README in the root of the repository

Useful links:

Interesting tutorial on python getters and setters using the C API
https://llllllllll.github.io/c-extension-tutorial/member-vs-getset.html