mirror of
https://github.com/espressif/esp-idf.git
synced 2025-12-05 08:27:30 +00:00
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user