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

fix(i2c): Send repeated starts in byte-by-byte I2C transactions #782

Merged
merged 1 commit into from
Nov 24, 2024

Conversation

jbeaurivage
Copy link
Contributor

Summary

The embedded_hal::i2c::I2c specification mandates that a repeated start (instead of a stop+start) is sent between transactions of a different type (read/write) when using I2c::transaction or I2c::read_write. Currently, the HAL, while it respects not sending a stop+start between two operations of the same type, does send stop+start between transactions of a different type.

This PR fixes that behavior, and enables sending repeated starts between transactions of different types.

Unfortunately, in DMA mode, the hardware is only capable of sending stop+starts. If a user absolutely needs repeated starts, the only workaround is to use the I2C without DMA.

Checklist

  • All new or modified code is well documented, especially public items
  • No new warnings or clippy suggestions have been introduced

@sajattack sajattack merged commit b4ba293 into atsamd-rs:master Nov 24, 2024
108 checks passed
@jbeaurivage jbeaurivage deleted the i2c-repeated-start branch November 24, 2024 15:44
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