dbrgn / shtcx-rs

Platform agnostic Rust driver for the Sensirion SHTCx temperature/humidity sensors.
Apache License 2.0
12 stars 4 forks source link

Async implementation #32

Open elpiel opened 8 months ago

elpiel commented 8 months ago

I would like to ask if there is interest in making an async version of the crate?

I'm using the sensor in an embassy project and while some other sensors use async version of the I2C bus and I can use embassy_embedded_hal::shared_bus::asynch::i2c::I2cDevice to share the bus across multiple tasks, it's not possible to use a driver crate with a blocking I2C impl.

dbrgn commented 8 months ago

So far I haven't yet played with embassy. I assume it uses the traits from embedded-hal-async, right?

elpiel commented 8 months ago

Yes, indeed. There's already a RC version for -async so it might get stabilised especially with AFIT (async fn. In traits) hitting 1.75

elpiel commented 6 months ago

@dbrgn both embedded-hal and embedded-hal-async are on v1.0.0 It would be amazing to update the crate and support the stable version of the hal crates.

dbrgn commented 6 months ago

Support for e-h 1.0 is tracked in #31. Once that's in, it probably makes sense to add an optional feature for embedded-hal-async as well.

elpiel commented 3 months ago

Can you expect an async version soon?

dbrgn commented 2 months ago

Can you expect an async version soon?

Only if somebody steps up and contributes an initial implementation.

Something that should be taken into account is that #38 should probably be handled before adding async support (since it might have interactions, potentially even benefits).