I2C writeto_then_readfrom in a single transaction on u2if - #888
Merged
Conversation
Previous commit failed CI due to changes made by formatter.
Contributor
Author
|
Looks to now pass tests on my branch CI. Would it be better to do this with a fallback to the old (two separate HID reports) method to accommodate U2IF devices using older firmware? |
Contributor
Yes, I think it would be best for this to have fallback for devices with the older firmware. Thanks for working on this! |
…unctions in series Allows usage on older versions of U2IF firmware
Contributor
Author
|
Hi @FoamyGuy, I've added the fallback. Let me know what you think! |
- Fix end_w/end_r falsy check: use 'is not None' to handle end=0 correctly - Differentiate error message for write_then_read vs regular write - Remove commented-out debug print statements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Implemented WRITE_THEN_READ on I2C interface in U2IF (associated PR: adafruit/u2if#12)
This allows reading from specific registers in I2C devices without sending two separate commands from the host, which significantly increases latency between the pointer write and read and causes timeouts in certain I2C devices (like the ones I've been using).