Blog

Introducing libgpiod

Wednesday, 15 Sep 2021  |  Nathan Drude

Variscite is introducing support for libgpiod, the new and recommended way for accessing GPIO from userspace. libgpiod was introduced in Linux 4.8 and provides both command line utilities and library bindings for C/C++ and Python. Variscite has added libgpiod support to all software releases starting from Yocto Dunfell, Boot2Qt Dunfell, and Debian Bullseye.

Previously, the recommended way of accessing GPIOs from Linux userspace was using the GPIO sysfs interface, which is limited and requires custom userspace libraries for higher level programming languages like C, C++, Python, etc.

Moving forward, the sysfs interface is being deprecated. For now, it will continue to be maintained, but no new features will be added. Please monitor the kernel documentation for the latest information.

Instead, it is now recommended to use libgpiod.
libgpiod has several significant improvements over the GPIO sysfs interface:

  • Userspace libraries for C/C++ and Python provide a standardized API
  • Each GPIO controller is registered as a character device in /dev so GPIO allocation is tied to the process that is using it
  • Multiple GPIO pins can be read at once
  • GPIO controllers and pins can be found by name
  • GPIO pin settings can be configured at runtime (pull-up, pull-down, etc.)
  • Interrupt driven event monitoring (rising, falling, etc.)
DART-MX8M-PLUS
DART-MX8M-PLUS System on Module

 

For more information about using libgpiod, check out the DART-MX8M-PLUS GPIO sample guide or visit the ‘how to’ section on the chosen SoM and Yocto release page within Variscite’s wiki website.

Latest Posts
Software releases
Variscite monthly software updates - October 2026
Stay current with software updates – Keep your Variscite SoMs performing at their best with our latest software releases.
 
Newsroom
Variscite and SecEdge: firmware-based TPM solution for i.MX SoMs
Adding TPM 2.0 to an embedded product usually starts with a hardware question: where does the security chip go? On Variscite’s i.MX-based modules, there is now another answer. Variscite and SecEdge are bringing SecEdge’s TPM 2.0 firmware, anchored in the processor’s own security hardware, to Variscite’s i.MX System on Module portfolio.
Blog
VAR-SOM-MX8M-MINI System on Module (SoM)
Pierluigi Passaro, Variscite’s R&D expert, introduces the VAR-SOM-MX8M-MINI and the VAR-SOM-MX8M-NANO – two cost-optimized modules designed for applications that require power-efficient processing, graphics capabilities, and real-time performance. Both SoMs are available with flexible memory, storage, and wireless configurations, allowing developers to pay only for the features they need.