GP2040-CE icon indicating copy to clipboard operation
GP2040-CE copied to clipboard

Add support for GPIO Expanders

Open Fortinbra opened this issue 2 years ago • 2 comments

Adding support for the PCA9535 16bit GPIO expander from Texas Instruments https://www.ti.com/document-viewer/PCA9535/datasheet/GUID-2E758BF2-C717-41D1-BC2E-80CE2E71C3C9

This will allow us to expand the number of digital pins by 16 per each expander added to the I²C bus.

Fortinbra avatar Jan 01 '23 22:01 Fortinbra

Would be great if also MCP23017 support could be integrated. These I2C port expanders include (switchable) pull up resistors.

schnoog avatar Mar 25 '23 10:03 schnoog

Initial PoC is at https://github.com/n-i-x/GP2040-CE/tree/i2c_expander

It supports PCA95xx expanders currently.

The branch needs to be updated to the new protobuf to continue progress.

Initial latency testing shows no major impact to latency.

TODO:

  • Update branch to protobuf and migrate settings to it
  • Convert pca object to a more generic expander interface to allow for additional expander types/protocols
  • Support multiple expanders
  • Support keyboard input (requires modifying the keyboard addon)
  • Move addon init code out of this branch and into a more generic PR (I think there is another task for this)
  • (long term) support operating on the same i2c bus as OLED displays

n-i-x avatar May 28 '23 16:05 n-i-x

This work has been completed via #1025

TheTrainGoes avatar Jun 11 '24 13:06 TheTrainGoes