GPIOD Usage
GPIOD Introduction
The GPIO sysfs interface has been deprecated since Linux 4.8. Userspace should instead use libgpiod
to interact with GPIO character devices.
Key features
- Easy to use:
libgpiod
provides a simple API that makes controlling and operating GPIO devices easy to understand. Developers only need to understand basic GPIO concepts and function interfaces to use it. - Independence:
libgpiod
is a standalone user-space library that does not depend on any particular hardware platform or chip. It is suitable for a wide range of embedded platforms that support GPIO control, such as the Radxa ROCK series, Raspberry Pi, BeagleBone, and so on. - Multiple Programming Languages Support:
libgpiod
supports C language natively, and also provides Python bindings (python3-libgpiod
) and wrappers for other languages, which makes it easy to use in different programming languages. - Efficient Event Listening:
libgpiod
provides functionality for asynchronous event listening, such as waiting for GPIO state changes. This allows developers to implement efficient event-driven applications. - GPIO specification support:
libgpiod
provides support for different GPIO specifications and numbering methods, including GPIO numbering and physical pin numbering.