Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork738
Update Wire peripheral handler#605
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
3cfed0e to29fd437Comparestonehippo commentedFeb 23, 2021
I found a couple of issues that I've resolved, namely that NACKs needed to be sent at the end of the read or write logic to close down the connection. Should be all set now. I'm using a version of this code locally to test out a custom peripheral and so far, it's working as expected (with the NACK fix in place). |
stonehippo commentedFeb 23, 2021
I've found bug here (the write NACK prevents reads). I'll fix that and push a revision to the PR. |
stonehippo commentedFeb 23, 2021
Ok, last bug (that I've found) smooshed. Would love a review of this and to see it get merged in. |
reufer commentedFeb 23, 2021
works for me! |
stonehippo commentedOct 13, 2021
It’s been a while since I submitted this PR. The checks failed due to issue that had nothing to do with the changes here. Any idea how to get this re-checked and maybe merged in?@per1234? |
The existing onService method for I2C peripheral (slave) implementation
swapped the sense of onRequest (master read) and onReceive (master
write) handlers. It also didn't handle writes correctly, requiring two
write operations to get bytes out of the buffer and in the onReceive
handler.
This implementation follows the SERCOM I2C flow defined for the
default clock-stretching case (CTRLB.SCLSM=0) as described in the
SAMD21 datasheet.