eldruin / lsm303agr-rs

Platform agnostic Rust driver for the LSM303AGR ultra-compact high-performance eCompass module: ultra-low-power 3D accelerometer and 3D magnetometer
Apache License 2.0
18 stars 14 forks source link

Support async #30

Closed hdoordt closed 2 months ago

hdoordt commented 2 months ago

Hi @eldruin thanks for another great driver crate!

I'm looking to use this driver in an async context. Would you be in favour of adding driver implementations based on embedded-hal-async traits? If so, what would you suggest be the best way to go about it?

eldruin commented 2 months ago

Hi, you are welcome. I would indeed be interested in adding async support here. At the moment the best approach I have seen is using maybe-async-cfg. You can probably draw a lot of inspiration from https://github.com/eldruin/pwm-pca9685-rs/pull/16 .

hdoordt commented 2 months ago

Sounds good! I'll have a stab at it and open a PR once I'm happy