Skip to content

[I2C] Add support for multiple I2C buses#5235

Merged
TD-er merged 40 commits intoletscontrolit:megafrom
tonhuisman:feature/I2C-multiple-interfaces-support
Mar 26, 2025
Merged

[I2C] Add support for multiple I2C buses#5235
TD-er merged 40 commits intoletscontrolit:megafrom
tonhuisman:feature/I2C-multiple-interfaces-support

Conversation

@tonhuisman
Copy link
Contributor

@tonhuisman tonhuisman commented Jan 29, 2025

Resolves: #4592

Features:

  • Add support for multiple I2C buses (interfaces) (ESP32 only!), default 2, max. 3.
    • Uses software-multiplexing, to avoid having to change (and test!) many libraries and plugins.
    • Explicitly disabled for ESP8266.
  • Also enables to have an optional I2C multiplexer per I2C bus.
  • Per directly addressed I2C hardware (External Time Source, WatchDog hardware, PCF/MCP addressing without task like monitor command) an I2C Bus selector is available.

Extra fixes/features:

  • Some selectors appended undesired (default) for - None - values (fix).
  • Show GPIO Pin status for Wifi Status LED and Reset Pin, as configurable on the Hardware page (feature).
  • Show overlapping PSRAM and other (conflicting) uses in GPIO pin-selectors and on Hardware page (Boot states overview), ESP32-only, n/a on ESP8266. (fix/feature)

TODO:

  • Reset default I2C settings on upgrade
  • Testing
    • Additional testing: monitor,mcp,<n> on the PCF & MCP Direct I/O bus as configured on the Hardware page.
  • Documentation updates

@uzi18
Copy link
Contributor

uzi18 commented Jan 30, 2025

@tonhuisman @TD-er In fact for esp8266 i2c is software based so it could be also enabled via compatible soft library implementation.

@tonhuisman
Copy link
Contributor Author

tonhuisman commented Jan 30, 2025

@tonhuisman @TD-er In fact for esp8266 i2c is software based so it could be also enabled via compatible soft library implementation.

Yes, I know, but we have decided some time ago that for ESP8266 we are feature-complete, and want/need to motivate users to switch to ESP32 based boards.
This feature is mostly implemented to support the newer generation ESP32 models (S3, C5, C6, P4) with multiple I2C interfaces, on boards that actually have I2C hardware available at different GPIO pin pairs, like the LilyGO T-Beam S3. (That board even has dual SPI busses implemented, so another challenge to address 😅)

tonhuisman and others added 24 commits January 30, 2025 22:56
@tonhuisman tonhuisman changed the title [I2C] Add support for multiple I2C interfaces [I2C] Add support for multiple I2C buses Feb 12, 2025
@TD-er TD-er merged commit fb7cb37 into letscontrolit:mega Mar 26, 2025
@tonhuisman tonhuisman deleted the feature/I2C-multiple-interfaces-support branch March 26, 2025 21:50
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.

Additionals I²C bus (Master)

3 participants