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

Improve downgrade ergonimics #180

Open
Sh3Rm4n opened this issue Dec 9, 2020 · 1 comment
Open

Improve downgrade ergonimics #180

Sh3Rm4n opened this issue Dec 9, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@Sh3Rm4n
Copy link
Member

Sh3Rm4n commented Dec 9, 2020

Rename downgrade to erase_pin or similar to conform to C-ERASED-PIN

@Sh3Rm4n Sh3Rm4n added the enhancement New feature or request label Dec 9, 2020
@Sh3Rm4n Sh3Rm4n changed the title Rename downgrade to erase_pin or similar to conform to C-ERASED-PIN Improve downgrade ergonimics Mar 28, 2021
@Sh3Rm4n
Copy link
Member Author

Sh3Rm4n commented Mar 28, 2021

nrf-hal names the generic pin Pin and not PXx. Also downgrade() has the name degrade() and has to be called only once to get the generic form, and not e.g.

let pin: PXx<Output<OpenDain>> = dp.gpioa.pa8.into_open_drain_output(gpioa.moder, gpioa.otyper).downgrade().downgrade()

Also:

How to change a generic pin from output to input? No method like into_open_drain_output() is implemented.
That is because we have to know which gpio bank the pin belongs to, to pass mutable access to the moder and otyper registers of that pin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant