Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion i2cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,13 +423,19 @@ static esp_err_t i2c_setup_port(i2c_dev_t *dev) // dev is non-const to update de
.i2c_port = dev->port,
.sda_io_num = sda_pin,
.scl_io_num = scl_pin,
.clk_source = I2C_CLK_SRC_DEFAULT,
.glitch_ignore_cnt = 7,
.flags.enable_internal_pullup = (sda_pullup || scl_pullup),
// Bus speed is not set here. It's per-device or a global target for the bus can be set
// if desired, but i2c_master supports per-device speeds.
};

#if SOC_LP_I2C_SUPPORTED
bus_config.clk_source = dev->port == (i2c_port_num_t)LP_I2C_NUM_0
? LP_I2C_SCLK_DEFAULT
: I2C_CLK_SRC_DEFAULT;
#else
bus_config.clk_source = I2C_CLK_SRC_DEFAULT;
#endif
res = i2c_new_master_bus(&bus_config, &port_state->bus_handle);
if (res == ESP_OK)
{
Expand Down
Loading