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 full features #40

Open
btsimonh opened this issue Jan 22, 2023 · 2 comments
Open

i2c full features #40

btsimonh opened this issue Jan 22, 2023 · 2 comments

Comments

@btsimonh
Copy link

I'd like to use more comprehensive i2c support, e.g. commands to read and write registers.
Use case is PCA9685 for control of servos.

Was there some reason why this is not a good addition?

(I've started coding it, but don't have much low level i2c experience, so it would be good to know if there are glaring gotchas..)
br,
Simon

@guymcswain
Copy link
Owner

guymcswain commented Jan 22, 2023 via email

@btsimonh
Copy link
Author

Yes, the implementation follows that pattern - those functions are already in your release version, so were easy to duplicate :).
The other implementation I saw was in one of the outstanding PRs, where the OP added a i2c 'class' similar to the gpio class. It's neater like that, but can easily be based on the first style anyway, so I'll focus on that.

For mine, I've successfully used

i2cWriteByteData
i2cReadByteData
i2cWriteWordData
i2cReadWordData

but
i2cWriteI2cBlockData
leads to a later error response from pigpiod, so i've not got it quite right.

Do you know if there is a way to log communications between pigs and pigpiod - if so I could check the exact protocol used, and see what I'm doing wrong....

I'll PR at least the functions that work once I've used them for a while successfully.
I might also try exposing the request object so that such features could be added after the pigpio-client instance has been created.... which may help in development instead of modifying the library itself.

br,
Simon

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