Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add impl of hal::blocking::i2c::Transactional to avr_hal_generic::i2c::I2c #338

Open
linclelinkpart5 opened this issue Sep 20, 2022 · 2 comments · May be fixed by #361
Open

Add impl of hal::blocking::i2c::Transactional to avr_hal_generic::i2c::I2c #338

linclelinkpart5 opened this issue Sep 20, 2022 · 2 comments · May be fixed by #361
Labels
hal-api API design for the different components of avr-hal hal-generic Related to MCU generic parts of avr-hal help wanted Extra attention is needed

Comments

@linclelinkpart5
Copy link

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?

@Rahix
Copy link
Owner

Rahix commented Sep 28, 2022

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. rust-embedded/embedded-hal#392), so if it doesn't bother you, implementing the ones that exist right now would also not be bad.

@Rahix Rahix added help wanted Extra attention is needed hal-api API design for the different components of avr-hal hal-generic Related to MCU generic parts of avr-hal labels Sep 28, 2022
@linclelinkpart5
Copy link
Author

linclelinkpart5 commented Nov 5, 2022

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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hal-api API design for the different components of avr-hal hal-generic Related to MCU generic parts of avr-hal help wanted Extra attention is needed
Projects
None yet
2 participants