Add impl of `hal::blocking::i2c::Transactional` to `avr_hal_generic::i2c::I2c`
I'd love to be able to use the Transactional IO model of embedded_hal for I2c (https://docs.rs/embedded-hal/latest/embedded_hal/blocking/i2c/trait.Transactional.html), would it be possible to add this in? I'm happy to do the work if there are no objections or concerns.
The only question I have is related to multiple read operations -- in the linked docs for Transactional, it states: If the last operation is a Read the master does not send an acknowledge for the last byte. Would this mean that read operations that are not the last one in the batch send an ACK versus a NACK? Or would each read operation send a NACK?
Hi, yeah, this is something that is still missing. If you want to work on this, go ahead!
I personally was waiting for the dust to settle around the embedded-hal alpha where these traits have changed considerably. In this case, it would be i2c::blocking::I2c (version 1.0.0-alpha.8). But it looks like this is still going to take some more time (e.g. https://github.com/rust-embedded/embedded-hal/pull/392), so if it doesn't bother you, implementing the ones that exist right now would also not be bad.
Sounds great! In that case I'll check out the status of new new i2c::blocking::I2c in rust-embedded/embedded-hal/pull/392, and see how things are. I don't mind revisiting this later on again to update, if needed. :)