Skip to content

Conversation

@computer-whisperer
Copy link

Various possibilities for bus-lock exist with the rp2040 and rp2350 i2c peripherals. The synopsis i2c peripheral is not included with the bus-clear option, meaning detection and recovery has to be implemented in software.

This change adds detection of these conditions to both blocking and async usage, and bit-banged automatic recovery for the async variants.

Comment on lines +525 to +532
if !ignore_lockup {
if self.is_sda_low() {
return Err(Error::SDAHeldLow);
}
if self.is_scl_low() {
return Err(Error::SCLHeldLow);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the use case for this/why would you ever want to ignore a locked bus?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants