-
Notifications
You must be signed in to change notification settings - Fork 234
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
I2C contract violation #825
Comments
@WBosonic, thanks for the report. I agree this looks wrong. However, are you sure it's an SP (stop) you see between the write operations? I'd expect a SR (repeated start), triggered by https://github.com/rp-rs/rp-hal/blob/main/rp2040-hal/src/i2c/controller.rs#L294:
@ithinuel, if I read the git history correctly, that was added in #764. Do you remember why? |
Ah yes it is an SR (I encountered this bug a while ago and misremembered). From what I see the user facing I2C transaction does not actually check if the transaction type is the same as the one before. |
If I understand the datasheet correctly, it doesn't need to:
So the fix could be as easy as removing |
Yes, provided that |
The sensor I am writing a driver for requires I2C communication of the form
where
INDEX
is some internal 16 bit register and DATA can be any number of bytes.The I2C transaction contract states:
Therefore I would expect this code to work
Instead it appears an SP is sent between the two
Write
operations forcing unnecessary copies:Given that I need to send around 80kB of data this seems wasteful.
The text was updated successfully, but these errors were encountered: