Enable internal pullups via flags in i2c_master_bus_config_t
This commit is contained in:
parent
458acb5e67
commit
87cb0cf93a
1 changed files with 1 additions and 3 deletions
|
@ -25,6 +25,7 @@ i2c_master_bus_config_t i2c_bus_config = {
|
|||
.scl_io_num = GPIO_NUM_17,
|
||||
.sda_io_num = GPIO_NUM_18,
|
||||
.glitch_ignore_cnt = 7,
|
||||
.flags.enable_internal_pullup = true,
|
||||
};
|
||||
i2c_master_bus_handle_t bus_handle;
|
||||
|
||||
|
@ -144,9 +145,6 @@ void app_main(void)
|
|||
i2s_example_init_std_duplex();
|
||||
ESP_ERROR_CHECK(i2c_new_master_bus(&i2c_bus_config, &bus_handle));
|
||||
int ret;
|
||||
|
||||
gpio_set_pull_mode(GPIO_NUM_17, GPIO_PULLUP_ONLY);
|
||||
gpio_set_pull_mode(GPIO_NUM_18, GPIO_PULLUP_ONLY);
|
||||
|
||||
ESP_GOTO_ON_ERROR(i2c_master_bus_add_device(bus_handle, &chipconfig, &i2c_dev), err, TAG, "i2c new bus failed");
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue