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

i2c device with 16 bit register addressing #33

Open
achrn opened this issue Nov 6, 2022 · 1 comment
Open

i2c device with 16 bit register addressing #33

achrn opened this issue Nov 6, 2022 · 1 comment

Comments

@achrn
Copy link

achrn commented Nov 6, 2022

Hi, thanks for the library.
I think this is supposed to be a 'pull request', but unfortunately I don't 'do' github.

I wanted to use the 'simple' functions, but the device I have uses a 16 bit register address space. Therefore, I've added read and write functions for uint16_t reg values. All the changes are within i2c_device.h. In the attached they are all flagged with '\achrn', though if you merge this into the library I don't expect those labels need to remain - it's just a search label to assist review.

My additions assume the 16 bit register address is bigendian.

I've only tested with one device - a ST VL6180X ( a time-of-flight proximity sensor). https://www.st.com/en/imaging-and-photonics-solutions/vl6180x.html It's the only thing I have that has 16 bit register addresses.
i2c_device.h.txt

@Richard-Gemmell
Copy link
Owner

Cool. Thanks for this.
I'm in the middle of writing an automated test suite at the moment. I'll add this to my "to do" list and merge it later. That might take a couple of months. :)

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

2 participants