Blog

Einführung von libgpiod

Wednesday, 15 Sep 2021  |  Nathan Drude

Variscite führt Unterstützung für libgpiod ein, den neuen und empfohlenen Weg für den Zugriff auf GPIO aus dem Userspace. libgpiod wurde in Linux 4.8 eingeführt und bietet sowohl Kommandozeilen-Dienstprogramme als auch Bibliotheksbindungen für C/C++ und Python. Variscite hat libgpiod-Unterstützung zu allen Software-Releases ab Yocto Dunfell, Boot2Qt Dunfell und Debian Bullseye hinzugefügt.

Bisher war der empfohlene Weg für den Zugriff auf GPIOs aus dem Linux-Userspace die Verwendung der GPIO sysfs-Schnittstelle, die begrenzt ist und benutzerdefinierte Userspace-Bibliotheken für höhere Programmiersprachen wie C, C++, Python usw. erfordert.

In Zukunft wird die sysfs-Schnittstelle veraltet sein. Vorerst wird sie weiter gewartet, aber es werden keine neuen Funktionen hinzugefügt. Bitte beachten Sie die Kernel-Dokumentation  für die neuesten Informationen.

Stattdessen wird nun empfohlen, libgpiod zu verwenden.
libgpiod hat mehrere wesentliche Verbesserungen gegenüber der GPIO sysfs-Schnittstelle:

  • Userspace-Bibliotheken für C/C++ und Python bieten eine standardisierte API
  • Jeder GPIO-Controller ist als Zeichengerät in /dev registriert, so dass die GPIO-Zuweisung an den Prozess gebunden ist, der ihn verwendet
  • Mehrere GPIO-Pins können auf einmal gelesen werden
  • GPIO-Controller und Pins können über den Namen gefunden werden
  • GPIO-Pin-Einstellungen können zur Laufzeit konfiguriert werden (Pull-Up, Pull-Down, etc.)
  • Überwachung von unterbrechungsgesteuerten Ereignissen (steigend, fallend, etc.)

 

DART-MX8M-PLUS System on Module (SoM)
DART-MX8M-PLUS System on Module

 

Weitere Informationen zur Verwendung von libgpiod finden Sie im Sample Guide von  DART-MX8M-PLUS GPIO  oder besuchen Sie den Abschnitt „Anleitung“ auf der gewählten SoM- und Yocto-Release-Seite im Variscite- Wiki.

Letzte Beiträge
Software releases
November 2026 Software Releases for Variscite SoMs
Stay current with software updates – Keep your Variscite SoMs performing at their best with our latest software releases.
 
Newsroom
Variscite VAR-SMARC-MX952 module shown at an angle, with its gold edge connector visible.
Variscite has announced two new SoMs built around NXP’s i.MX 952 applications processor: the DART-MX952 and the VAR-SMARC-MX952. Both bring AI/ML acceleration, vision processing, 4K display output, and hardware-level security. They come in two form factors, each with its own memory technology: DART with LPDDR4 and VAR-SMARC with LPDDR5, allowing embedded engineers to pick the combination that best suits their project.
Embedded products keep taking on more demanding features, and each one adds load to the main processor. A single design may need to handle real-time control, process images, render advanced graphics, run a touchscreen interface, and keep the system secure, often all at once and within a fixed power and cost envelope.
Blog
DART-MX8M-PLUS System on Module (SoM)
Pierluigi Passaro, Variscite’s R&D engineer, introduces the VAR-SMARC-MX8M-PLUS and DART-MX8M-PLUS, two Systems on Module based on the NXP i.MX 8M Plus. Both modules use the same processor and BSP, giving developers a common software base and a choice of form factors and interfaces.