-
Notifications
You must be signed in to change notification settings - Fork 141
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
Implement embedded-hal 1.0 I2c trait for Twi and Twim #440
Conversation
For some reason suspending causes subsequent reads to overrun.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't have time for a couple of days to test this out again, but logic looks good.
@@ -392,6 +397,185 @@ where | |||
}, | |||
) | |||
} | |||
|
|||
fn write_part(&mut self, buffer: &[u8], final_operation: bool) -> Result<(), Error> { | |||
unsafe { self.set_tx_buffer(buffer)? }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No fence required here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure. Added some more fences to be on the safe side.
I tested the |
The
Twi
implementation is untested as I don't have any nrf51 devices.Unfortunately the
Twim
implementation isn't working correctly. Adjacent operations of the same type are specified to be carried out without an SR and SAD+R/W, which is why I avoid setting thelastrx_stop
orlasttx_stop
shortcut in that case, but when testing this I've found that trying to have two read operations in a row results in an overrun error for some reason.