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

I2C: add apply_config, implement SetConfig, add with_sda and with_scl #2477

Merged
merged 4 commits into from
Nov 8, 2024

Conversation

bugadani
Copy link
Contributor

@bugadani bugadani commented Nov 7, 2024

Thank you for your contribution!

We appreciate the time and effort you've put into this pull request.
To help us review it efficiently, please ensure you've gone through the following checklist:

Submission Checklist 📝

  • I have updated existing examples or added new ones (if applicable).
  • I have used cargo xtask fmt-packages command to ensure that all changed code is formatted correctly.
  • My changes were added to the CHANGELOG.md in the proper section.
  • I have added necessary changes to user code to the Migration Guide.
  • My changes are in accordance to the esp-rs API guidelines

Extra:

Pull Request Details 📖

Description

Part 3 of #2437

cc #2416 and closes #1919

with_sda and with_scl are now consistent with SPI and allow reconfiguring the bus (though a bit of a replace_with hackery may be needed).

This PR also aims to clarify the meaning of the timeout configuration.

@bugadani bugadani force-pushed the i2c-config branch 3 times, most recently from b93bbf8 to 81de02f Compare November 8, 2024 11:57
@bugadani bugadani marked this pull request as ready for review November 8, 2024 12:51
@bjoernQ
Copy link
Contributor

bjoernQ commented Nov 8, 2024

I remember some devices (e.g. MPU6050) are very sensitive to seeing activity on SDA/SCL during pin init .... probably everything is fine but there was a reason why setting the pins was done like it was - I just want to double check that

@bugadani
Copy link
Contributor Author

bugadani commented Nov 8, 2024

Please do, but the pins aren't connected to the peripheral during configuration, so I don't think anything was changed here meaningfully.

Copy link
Contributor

@bjoernQ bjoernQ left a comment

Choose a reason for hiding this comment

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

works fine even with that MPU6050 - code looks good to me

Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@MabezDev MabezDev added this pull request to the merge queue Nov 8, 2024
Merged via the queue into esp-rs:main with commit 2c14e59 Nov 8, 2024
28 checks passed
@bugadani bugadani deleted the i2c-config branch November 8, 2024 23:07
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.

Implement embassy_embedded_hal::SetConfig
3 participants