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

gpio: change Input<Disconnected> to Disconnected. #245

Merged
merged 1 commit into from
Oct 6, 2020

Conversation

Dirbaio
Copy link
Member

@Dirbaio Dirbaio commented Oct 6, 2020

This changes the default Pin state from Pin<Input<Disconnected>> to Pin<Disconnected>.

This is desirable because it makes is_high, is_low not available in Disconnected state, since they don't actually work. Nordic docs state this:

The input buffer of a GPIO pin can be disconnected from the pin to enable power savings when the pin is not used as an input, see GPIO port and the GPIO pin details. Inputs must be connected to get a valid input value in the IN register, and for the sense mechanism to get access to the pin.

I will add an into_disconnected function in a future PR, since it's desirable to disconnect input pins when not in use to save power.

Copy link
Contributor

@jonas-schievink jonas-schievink left a comment

Choose a reason for hiding this comment

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

Thanks! I thought you'd have to change more than that, neat.

@jonas-schievink jonas-schievink merged commit fbfddda into nrf-rs:master Oct 6, 2020
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.

2 participants