diff --git a/bsp/esp_bsp_generic/Kconfig b/bsp/esp_bsp_generic/Kconfig index 16146a84..342543e8 100644 --- a/bsp/esp_bsp_generic/Kconfig +++ b/bsp/esp_bsp_generic/Kconfig @@ -20,8 +20,14 @@ menu "Board Support Package (generic)" range -1 ENV_GPIO_OUT_RANGE_MAX help The GPIO pin for I2C SDA. + config BSP_I2C_PULLUP + bool "I2C GPIO PULL UP" + default n + help + Enable I2C bus pull up. endmenu - config BSP_I2C_NUM + + config BSP_I2C_NUM int "I2C peripheral index" default 1 range 0 1 diff --git a/bsp/esp_bsp_generic/src/esp_bsp_generic.c b/bsp/esp_bsp_generic/src/esp_bsp_generic.c index 50d464a8..f0f23d23 100644 --- a/bsp/esp_bsp_generic/src/esp_bsp_generic.c +++ b/bsp/esp_bsp_generic/src/esp_bsp_generic.c @@ -324,6 +324,9 @@ esp_err_t bsp_i2c_init(void) .sda_io_num = BSP_I2C_SDA, .scl_io_num = BSP_I2C_SCL, .clk_source = I2C_CLK_SRC_DEFAULT, +#ifdef CONFIG_BSP_I2C_GPIO_PULLUP + .flags.enable_internal_pullup = 1, +#endif }; BSP_ERROR_CHECK_RETURN_ERR(i2c_new_master_bus(&i2c_config, &i2c_handle));