|
DeterministicESPAsyncWebServer v6.27.1
Zero-allocation, bounded-execution async HTTP server for ESP32
|
The one owner of the shared I2C bus bring-up for the peripheral drivers. More...
Go to the source code of this file.
Functions | |
| void | detws_i2c_begin () |
| Bring up the shared I2C bus on DETWS_I2C_SDA_PIN / DETWS_I2C_SCL_PIN (-1 = default). | |
The one owner of the shared I2C bus bring-up for the peripheral drivers.
The sensor / peripheral drivers (RTC, SHT3x, MPR121, ADS1115, INA219, PCA9685) all share a single I2C bus, so they all initialize it through detws_i2c_begin() rather than calling Wire.begin() themselves. That gives one place to choose the pins: DETWS_I2C_SDA_PIN / DETWS_I2C_SCL_PIN (default -1 = the platform default GPIO 21 / 22). Move them off 21/22 when those pins are needed elsewhere - most importantly a wired-Ethernet PHY: the LAN8720 RMII on the classic ESP32 (WROOM/WROVER) and the ESP32-P4 uses GPIO 21 and 22 (the S3/C3 have no RMII EMAC and use an SPI Ethernet such as the W5500 instead). Re-begin is idempotent, so per-driver calls are harmless.
Host builds compile this to nothing (there is no Wire); the I2C transfer is ESP32-only.
Definition in file i2c.h.
|
inline |
Bring up the shared I2C bus on DETWS_I2C_SDA_PIN / DETWS_I2C_SCL_PIN (-1 = default).
Definition at line 33 of file i2c.h.
References DETWS_I2C_SCL_PIN, and DETWS_I2C_SDA_PIN.