-
Notifications
You must be signed in to change notification settings - Fork 369
I2C: sample SDA earlier #3040
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: sample SDA earlier #3040
Conversation
| let scl_high = half_cycle - scl_wait_high; | ||
| let sda_hold = half_cycle / 4; | ||
| let sda_sample = half_cycle / 2 + scl_wait_high; | ||
| let sda_sample = half_cycle / 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be fair, I should probably remove the half_cycle/2 term instead. Technically, we can sample at any point after the rising edge, and scl_wait_high is supposed to be somewhat dependent on the hardware (i.e. it should be tunable, maybe). scl_wait_high represents the rising edge of the clock signal, after which the clock signal is high for scl_high. We should probably aim at the start/middle of the interval covered by scl_high.
Still, this should be good enough to test.
|
@bugadani I just ran into this issue and can confirm that the proposed change does resolve it. Any chance we can revive this PR? As far as I can see, the Background I have a ESP32-C6 board from Waveshare and was trying to read the touch driver. The provided ESP-IDF code works flawlessly, however, when using I started probing the bus with my oscilloscope and to my surprise, the readout started working. I went to see if anyone has reported such an issue and ended up here. |
|
I completely forgot about this. This PR was abandoned because it failed to fix an issue where I thought this would be relevant. We can certainly revisit this |
|
May I help with any additional testing or can we just treat |
|
Of course, any testing you do, any issues you can find, are welcome. |
|
I mean in order to be able merge this PR. |
|
Ah, this has been already done in #4268 |
|
Thanks a lot, I missed that! |
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 📝
cargo xtask fmt-packagescommand to ensure that all changed code is formatted correctly.CHANGELOG.mdin the proper section.Extra:
Pull Request Details 📖
Description
Please provide a clear and concise description of your changes, including the motivation behind these changes. The context is crucial for the reviewers.
Testing
Describe how you tested your changes.