Skip to content
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

More robust multi-byte reads #2

Open
jschornick opened this issue Feb 11, 2014 · 0 comments
Open

More robust multi-byte reads #2

jschornick opened this issue Feb 11, 2014 · 0 comments

Comments

@jschornick
Copy link
Owner

The original multibyte read simple read 2+ registers progressively, each in an entirely separate read_byte_data() call. This works for some devices like the DMCC, which only refresh their registers after an explicit call. Other devices are constantly refreshing, thus reading separate bytes could lead to the combined binary value being corrupt.

For those devices, multibyte reads in the form of read_word_data() and block read calls appear to be the expected interface. Unfortunately, not all devices are well behaved(*) under these conditions. To add to the confusion, some devices appear to need to be put in an auto-increment mode before multi-byte reads work, but more testing is required.

In the meantime, I'll be combining a flag and a call to read_word_data() to solve the immediate pain. This will likely need to be expanded upon to handle data larger than 2-bytes, as well as any other protocol variants discovered.

(*) The DMCC for example, locks up the I2C bus if anything more than a byte is read per call. Yay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant