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

Support 8-bit expanders like the PCF8574 👾 #4

Closed
wants to merge 1 commit into from
Closed

Support 8-bit expanders like the PCF8574 👾 #4

wants to merge 1 commit into from

Conversation

rgov
Copy link
Contributor

@rgov rgov commented Oct 31, 2023

This change extends the PCF8575 class to support 8-bit expanders like the PCF8574, PCA9500, and a bunch of others.

An instance of the class can be constructed with an additional gpios=8 argument. The read_gpio and write_gpio use the value passed to determine whether they should write 8 vs 16-bit values.

Note that if using 8-bit values, self._readbuf[1] remains 0, so x | (self._readbuf[1] << 8) is a no-op. Similar for self._writebuf[1].

@makermelissa
Copy link

@rgov
Copy link
Contributor Author

rgov commented Oct 31, 2023

Oh, I wasn't aware of it. I'm going to file a different bug then...

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

Successfully merging this pull request may close these issues.

2 participants