riscv-rust / e310x-hal

Implementation of the `embedded-hal` traits for E310x microcontrollers
17 stars 18 forks source link

DHT22 and open-drain output pin #46

Open holotrack opened 2 years ago

holotrack commented 2 years ago

Hello, as mentioned here: https://github.com/riscv-rust/riscv-rust-quickstart/issues/22 im moving this issue.

Im trying to use HiFive rev b board with DHT22 sensor. It needs "open-drain" output option to work. I asked on Matrix - Rust Embedded channel and what i get from there its not supported by this chip or library. As solution for this they gave me as example this link:

https://github.com/rp-rs/rp-hal/blob/main/rp2040-hal/examples/dht11.rs#L55-L88

"At a lower level, you could set input_en=1, output_val=0, pue=1 and then set output_en=1 to actively pull the line down, output_en=0 to pull it up using the weak pull-up resistor, and read input_val to read back the DHT response. But it seems like that mode is not implemented by the HAL. (Same situation as with the RP2040 and its HAL)"

Please could you update your library with such feature? To make it more useful for others.