-
Notifications
You must be signed in to change notification settings - Fork 51
infallible IO #206
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
infallible IO #206
Conversation
@usbalbin Why |
Not sure. I guess it could make sense for an |
I already removed it. But you use it in tests. |
|
||
impl<MODE> InputPin for $PXx<Output<MODE>> { | ||
impl embedded_hal_old::digital::v2::InputPin for $PXx<Output<OpenDrain>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already removed it. But you use it in tests.
Oh, but those could probably use https://github.com/stm32-rs/stm32g4xx-hal/blob/main/tests/nucleo-g474.rs#L368 ?
(I have a branch somewhere that breaks out the common test functions into examples/utils/mod.rs
so as not to duplicate them between the test files. Will try to clean that up at some point)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, but those could probably use https://github.com/stm32-rs/stm32g4xx-hal/blob/main/tests/nucleo-g474.rs#L368 ?
On PushPull
pin? I think no. You can use ODR to check is_set_high
. But the only way (I think) to see real voltage on the pin is to connect it to another Input
pin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would interpret rm0440 9.3.10 as the input machinery still being active. But I may be missing something
9.3.10 Output configuration
When the I/O port is programmed as output:
• The output buffer is enabled:
– Open drain mode: A “0” in the Output register activates the N-MOS whereas a “1”
in the Output register leaves the port in Hi-Z (the P-MOS is never activated)
– Push-pull mode: A “0” in the Output register activates the N-MOS whereas a “1” in
the Output register activates the P-MOS
• The Schmitt trigger input is activated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still active in Alternate mode too. However not in Analog mode.
Thanks! :) |
Yet one change related to #186