esp-rs / esp-idf-hal

embedded-hal implementation for Rust on ESP32 and ESP-IDF
https://docs.esp-rs.org/esp-idf-hal/
Apache License 2.0
446 stars 169 forks source link

I2CDriver does not implement i2c::Transactional #197

Open JohnTheCoolingFan opened 1 year ago

JohnTheCoolingFan commented 1 year ago

Some libraries (for example, pn532) rely on implementation of i2c::Transactional from embedded_hal.

MabezDev commented 1 year ago

Transactions should build on top of the existing read/write implementations, so this should be straight forward to implement.

Vollbrecht commented 1 year ago

related changes in embedded-hal upstream: 8b984d299a1926350d52fa2645a84190ef025dbe

Vollbrecht commented 1 year ago

@MabezDev i can try to implement the trait, though it backs the question if we should actively implement e-hal_02 traits for backwards comparability (where there were not already implemented before), or should wait for the drivers themself to implement the current traits. How do you guys handle this in no_std?

MabezDev commented 1 year ago

How do you guys handle this in no_std?

We implement both where possible, but I don't think its a super strict rule. For example, we don't implement any of the transaction stuff for i2c in the no_std hals currently.