Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NULL FUNCSEL handling on Raspberry Pi 5 #143

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

lukeburong
Copy link
Contributor

Fixes #142

This introduces a new variant to gpio::Mode called Null (though something like Disabled may be more appropriate - I just stuck with the datasheet).

After implementing this, the example code from #142 gives the following results on a Raspberry Pi 5:

pinctrl 25 before:

25: no    pn | -- // GPIO25 = none

pinctrl 25 after:

25: ip    pn | lo // GPIO25 = input

And with set_reset_on_drop(true), the pin mode is restored correctly on drop:

pinctrl 25 before:

25: no    pn | -- // GPIO25 = none

pinctrl 25 after:

25: no    pn | -- // GPIO25 = none

The new variant shouldn't affect anything not using the RP1 (much like Alt6 - Alt8 which are also only used in rp1.rs)

@golemparts golemparts merged commit bc82495 into golemparts:master Apr 10, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Input pin mode not set correctly on Raspberry Pi 5
2 participants