Skip to content

Fix Pullup/Pulldown setting in LibgpiodV2#2476

Merged
pgrawehr merged 18 commits into
dotnet:mainfrom
pgrawehr:GpioFixing1
Feb 28, 2026
Merged

Fix Pullup/Pulldown setting in LibgpiodV2#2476
pgrawehr merged 18 commits into
dotnet:mainfrom
pgrawehr:GpioFixing1

Conversation

@pgrawehr

@pgrawehr pgrawehr commented Feb 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #2475, #2461

The "bias" mode setting on the LibgpiodV2 driver wasn't working correctly. There where two main issues:

  • When setting the mode to PullUp or PullDown, the pin needs to be (also) set to input.
  • When changing the mode (while the pin was kept open) the change was not applied because there was an early abort when the mode was already set to input.
Microsoft Reviewers: Open in CodeFlow

@dotnet-policy-service dotnet-policy-service Bot added the area-System.Device.Gpio Contains types for using general-purpose I/O (GPIO) pins label Feb 22, 2026

@Ellerbach Ellerbach left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and I know you've been testing all this on real hardware.

@raffaeler

Copy link
Copy Markdown
Contributor

Let's talk about it, my Pi5 is complaining with libgpiod2 detection used in all the tests

@pgrawehr

Copy link
Copy Markdown
Contributor Author

Confirmed that it works on the RPI5 as well. I will separately investigate whether the the automatic detection works correctly.

@pgrawehr pgrawehr merged commit 90d8965 into dotnet:main Feb 28, 2026
10 of 12 checks passed
@raffaeler

Copy link
Copy Markdown
Contributor

Yes, I confirm the tests are running with the code of this PR.
I used the 64 bit version of Raspbian Trixie on RPi5.

@github-actions github-actions Bot locked and limited conversation to collaborators Mar 31, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Device.Gpio Contains types for using general-purpose I/O (GPIO) pins

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Libgpiod3 support

3 participants