Add libgpiod v2 support and fix Pi 5 compatibility#150
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The existing
libgpiodpath only supported the v1 API, which is incompatible with Raspberry Pi OS on Debian 12+ wherelibgpiodv2 is the default. This PR adds full v2 support alongside the existing v1 path, with the version selected automatically at build time.We now use
pkg-configto detect the installedlibgpiodmajor version at configure time and setsGPIOD_V1orGPIOD_V2accordingly.bcm2835.cis excluded from the build when--use_libgpiod=trueis passed.The v2 path uses the new
gpiod_chip_request_linesAPI withOPEN_DRAINoutput mode, which is required for the single-wire DHT protocol on the RP1 southbridge. GPIO chip discovery now enumerates available chips by their kernel label (pinctrl-rp1) , with a device-path fallback for forward compatibility. The v1 path is updated to release and re-request lines on direction change for compatibility withlibgpiod< 1.5.Installation section restructured to clearly separate the Pi 5 /
libgpiodpath from the default BCM2835 path. Node.js installation appendix updated to use NodeSource.Closes #149.