Skip to content

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

Merged
jonas-schievink merged 1 commit intonrf-rs:masterfrom
Dirbaio:gpio-disconnected
Oct 6, 2020
Merged

gpio: change Input<Disconnected> to Disconnected.#245
jonas-schievink merged 1 commit intonrf-rs:masterfrom
Dirbaio:gpio-disconnected

Conversation

@Dirbaio
Copy link
Copy Markdown
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
Copy Markdown
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