You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
401: Add OpenDrainIO pin state (with InputPin capability) r=jonas-schievink a=Finomnis
As already reported in #339, there is currently no way to create an I/O pin in nrf-hal.
There are several reasons why having this would be useful. My personal usecase is the DHT22/AM2302 sensor. Controlling it requires a single-wire pulled-up open drain IO.
Sadly, this means that all libraries that can interface with it [require `InputPin + OutputPin`](https://docs.rs/dht-sensor/0.2.1/dht_sensor/trait.InputOutputPin.html).
# Solution
There is no inherent reason why nrf chips shouldn't be able to implement this. The input buffer is always available and allows reading back the pin values during every pin configuration. Although for energy saving reasons, the input buffer is currently disabled during the `OpenDrain` state.
My proposal is to add an `OpenDrainIO` state that does not disable the input buffer and implements `InputPin`.
Co-authored-by: Finomnis <[email protected]>
0 commit comments