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

Block at end of LPI2C embedded-hal transactions #165

Merged
merged 2 commits into from
Jul 5, 2024
Merged

Conversation

mciantyre
Copy link
Member

Wait for the controller to become idle before returning to the transaction caller. This is a stronger guarantee than waiting until the stop bit is sent, and it meets the EH1 interface requirements.

This commit still keeps the busy check at the start of the transactions. If the bus is busy due to another controller's activity, I don't think we should block the caller while the other controller uses the bus. The caller can implement a retry policy given the characteristics of their system. EH1 lets users handle this condition with a dedicated error kind.

Additionally, this commit keeps the FIFO flushes at the start of transactions, after the busy checks. This is intended to avoid surprises in case a user inserts a high-level transaction somewhere in their low-level command sequence.

I updated one of the I2C examples to blast a device through the eh02 interfaces. It behaved reasonably on a Teensy 4 setup.

mciantyre added 2 commits July 1, 2024 07:29
Wait for the controller to become idle before returning to the
transaction caller. This is a stronger guarantee than waiting until the
stop bit is sent, and it meets the EH1 interface requirements.

This commit still keeps the busy check at the start of the transactions.
If the bus is busy due to another controller's activity, I don't think
we should block the caller while the other controller uses the bus. The
caller can implement a retry policy given the characteristics of their
system. EH1 lets users handle this condition with a dedicated error
kind.

Additionally, this commit keeps the FIFO flushes at the start of
transactions, after the busy checks. This is intended to avoid surprises
in case a user inserts a high-level transaction somewhere in their
low-level command sequence.

I updated one of the I2C examples to blast a device through the eh02
interfaces. It behaved reasonably on a Teensy 4 setup.
Re-tested with the previous commit, and the example still behaves
reasonably.
@mciantyre mciantyre merged commit 1c6779f into main Jul 5, 2024
62 checks passed
@mciantyre mciantyre deleted the lpi2c-blocking branch July 5, 2024 12:50
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.

1 participant