Push the writeThenRead method down to I2C implementations - #746
Merged
Conversation
|
Contributor
|
What's the benefit of this? |
Contributor
Author
Followup to #744 partially addressing Tom's request: Make clear what should be implemented by making it abstract. writeThenRead is supposed to have different bus behaviour than a sequence of a write and a read and this should be implemented in i2c providers properly. The only device I am aware of where this matters is BMP 280 in SPI mode but there it was hard to find and debug so we'd like to adjust this long term for i2c, too |
Contributor
|
The i2c seeproms are an example of the restart behavior expected. We have
had forum requests to access some devices that require a number of command
bytes be written and then the restart creates the data being read.
…On Wed, Aug 19, 2026 at 3:10 PM Stefan Haustein ***@***.***> wrote:
*stefanhaustein* left a comment (Pi4J/pi4j#746)
<#746 (comment)>
What's the benefit of this?
Followup to #744 <#744> partially
addressing Tom's request: Make clear what should be implemented by making
it abstract. writeThenRead is supposed to have different bus behaviour than
a sequence of a write and a read and this should be implemented in i2c
providers properly. The only device I am aware of where this matters is BMP
280 in SPI mode but there it was hard to find and debug so we'd like to
adjust this long term for i2c, too
—
Reply to this email directly, view it on GitHub
<#746?email_source=notifications&email_token=AK5A324B57VJY2TRTKRSI7T5KYCTHA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMZUG42DGMBQGA32M4TFMFZW63VQOJSXM2LFO5PXEZLROVSXG5DFMSSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-5347430007>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AK5A325X4XBCEXBVL5JTLOL5KYCTHAVCNFSNUABFKJSXA33TNF2G64TZHMYTSMRVHEYTMMZRHNEXG43VMU5TKMJZGU2DCMJZHEZKC5QC>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
eitch
approved these changes
Aug 20, 2026
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.



Remove it from I2C, so implementations are forced to provide an implementation
For now, I am just pushing the existing code to all I2C implementations
This allows cleaning up implementations individually in clean isolated changes.