Closed davidlattimore closed 2 years ago
Do you happen to know if something like this is available in some other HAL?
Good idea. Looks like stm32f4xx-hal and stm32l4xx-hal both implement into_open_drain_output_in_state, which takes an embedded_hal::digital::v2::PinState
.
The other crates I looked at had no obvious support: stm32h7xx-hal stm32f3xx-hal stm32g4xx-hal stm32l1xx-hal stm32f0xx-hal
Then it makes sense to do it the same way. Can you make a PR.
@dotcypress would you be happy with such change?
Yes, we definitely need to fix that. Let me think, probably provided solution is fine.
Somewhat related to #87 (but more general)....
Sometimes you have a pin that has an external pull-up and you'd like to configure the pin as an output (generally an open-drain output) without momentarily pulling the pin low. I'd like it if we could have an API that allowed this. Possibilities that come to mind:
preset_low
/preset_high
.Thoughts?