Skip to content

Commit 7c69ef1

Browse files
committed
BSP optional I2C pull up
1 parent a9620d5 commit 7c69ef1

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

bsp/esp_bsp_generic/Kconfig

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,14 @@ menu "Board Support Package (generic)"
2020
range -1 ENV_GPIO_OUT_RANGE_MAX
2121
help
2222
The GPIO pin for I2C SDA.
23+
config BSP_I2C_PULLUP
24+
bool "I2C GPIO PULL UP"
25+
default n
26+
help
27+
Enable I2C bus pull up.
2328
endmenu
24-
config BSP_I2C_NUM
29+
30+
config BSP_I2C_NUM
2531
int "I2C peripheral index"
2632
default 1
2733
range 0 1

bsp/esp_bsp_generic/src/esp_bsp_generic.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@ esp_err_t bsp_i2c_init(void)
324324
.sda_io_num = BSP_I2C_SDA,
325325
.scl_io_num = BSP_I2C_SCL,
326326
.clk_source = I2C_CLK_SRC_DEFAULT,
327+
#ifdef CONFIG_BSP_I2C_GPIO_PULLUP
328+
.flags.enable_internal_pullup = 1,
329+
#endif
327330
};
328331
BSP_ERROR_CHECK_RETURN_ERR(i2c_new_master_bus(&i2c_config, &i2c_handle));
329332

0 commit comments

Comments
 (0)