i2c: modify examples to work out of the box on ESP32S3

On ESP32S3, the default I2C pins of the examples are already used by USB.
This commit changes the default pins.
This commit is contained in:
Omar Chebib
2021-06-16 15:19:55 +08:00
committed by bot
parent a1b5c38218
commit b8c6c5334f
16 changed files with 4543 additions and 2355 deletions

View File

@@ -23,8 +23,17 @@
static const char *TAG = "cmd_i2ctools";
#if CONFIG_IDF_TARGET_ESP32S3
static gpio_num_t i2c_gpio_sda = 1;
static gpio_num_t i2c_gpio_scl = 2;
#elif CONFIG_IDF_TARGET_ESP32C3
static gpio_num_t i2c_gpio_sda = 5;
static gpio_num_t i2c_gpio_scl = 6;
#else
static gpio_num_t i2c_gpio_sda = 18;
static gpio_num_t i2c_gpio_scl = 19;
#endif
static uint32_t i2c_frequency = 100000;
static i2c_port_t i2c_port = I2C_NUM_0;