This repository has been archived by the owner on May 12, 2022. It is now read-only.
Fix _i2c_read_request function to allow direct I2C read without preliminary I2C write #15
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.
allow direct read from the device without initial register selection.
This should match the two possible I2C read supported by the
FirmataExpress firmware.
Explanation: With the current code, an I2C write occurs to select a register before the I2C read access.
This prevents usage of I2C circuits like an I2C multiplexer (like the tca9548a ) with pymata4.
The FirmataExpress supports the two different types of access (with or without the first I2C write) by looking at the number of data passed in the sysex call.
(see https://github.com/MrYsLab/FirmataExpress/blob/eff00dba368b10286a6bbfe753b0de44850e1362/examples/FirmataExpress/FirmataExpress.ino#L625)
The pull-request does not change the other I2C read functions but it is very likely that the same documentation update is needed
Before the fix (an simple 1-byte I2C read):
After the fix