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 SetConfig implementation for STM32 I2C v2 #3928

Merged
merged 1 commit into from
Mar 28, 2025

Conversation

agrif
Copy link
Contributor

@agrif agrif commented Feb 27, 2025

The I2C peripheral needs to be disabled to change the timings register. This PR fixes the SetConfig implementation to disable the peripheral, set the timings, then re-enable it.

I took a glance at the v1 I2C implementation to see if this might be easy to add there, but that peripheral is sufficiently different that I did not feel comfortable changing it without a device to test on, which I don't have.

Fixes #3914.

Copy link
Contributor

@mkj mkj left a comment

Choose a reason for hiding this comment

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

Looks good.

Other methods require &mut self so I don't think there's any concern about clearing PE affecting other calls.

@Dirbaio Dirbaio added this pull request to the merge queue Mar 28, 2025
Merged via the queue into embassy-rs:main with commit 3a3ab6c Mar 28, 2025
10 checks passed
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.

SetConfig does not work on STM32 I2C
3 participants