pw_i2c_mcuxpresso: Add flag to reset interface once after timeout
In the face of SCL or SDA transients on the I2C lines, the host
interface has a tendency to lock up and refuse to send any
transactions along the wires after the lines return to normal
operation. In these cases, we really need to rebuild the entire
FlexCOMM and I2C interface.
- On a `DeadlineExceeded` result from
`InitiateNonBlockingTransferUntil`, reset the interface if the
config is enabled to do so, and return the `DeadlineExceeded`
error to allow the caller to retry the transaction or handle it
themselves.
- Split `Enable` and `Disabled` into locked and unlocked forms and
add `ResetLocked` which uses the pre-locked forms to allow for an
interface reset.
Bug: b/462589833
Bug: b/466512349
Test: While audio playback is occurring in 5s bursts on an RT595-based
board, short the SCL line between the RT595 and an I2C amp using a
piece of wire. Verify behavior with a logic analyzer.
Test: attempt to read a register from a non-existent device
Change-Id: I0bafb0e5fa9f4765c00df6bb5f9b6b9e7cb6552d
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/353132
Copybara-Verified: Copybara Prod <copybara-worker-blackhole@google.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Pigweed-Auto-Submit: Austin Foxley <afoxley@google.com>
Tests-Not-Needed: Austin Foxley <afoxley@google.com>
Commit-Queue: Austin Foxley <afoxley@google.com>
Docs-Not-Needed: June Tate-Gans <jtgans@google.com>
Reviewed-by: Austin Foxley <afoxley@google.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.
For more information please see our website: https://pigweed.dev/.