Fix STM32 I2C v2 async transfer not doing a repeated start #197
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of changes
Found a minor I2C issue when doing testing with the CI shield v2. When you do an I2C async transfer that is both a write and a read, it should do the write first, then a repeated start, then the read. This is worth doing for 3 reasons:
However, the stm32 I2C HAL was not doing repeated starts, and instead was generating something like
Now, with this patch, a single transfer call always does a repeated start:
(this is using the Sigrok logic analyzer on the new CI shield to decode and evaluate I2C data).
Impact of changes
Async transfers containing a write and a read now do repeated starts on STM32 I2C v2 hardware.
Migration actions required
Documentation
Docs have been slightly updated to clarify that this transfer() does a repeated start.
Pull request type
Test results
Reviewers