Skip to content

Commit

Permalink
BSP optional I2C pull up
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkaliszan committed Jan 14, 2025
1 parent a9620d5 commit ae27344
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bsp/esp_bsp_generic/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ menu "Board Support Package (generic)"
range -1 ENV_GPIO_OUT_RANGE_MAX
help
The GPIO pin for I2C SDA.
config BSP_I2C_GPIO_PULLUP
bool "I2C GPIO PULL UP"
default n
help
Enable I2C bus pull up.
endmenu
config BSP_I2C_NUM
int "I2C peripheral index"
Expand Down
2 changes: 2 additions & 0 deletions bsp/esp_bsp_generic/include/bsp/esp_bsp_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
/* I2C */
#define BSP_I2C_SCL (CONFIG_BSP_I2C_GPIO_SCL)
#define BSP_I2C_SDA (CONFIG_BSP_I2C_GPIO_SDA)
#define BSP_I2C_PULLUP (CONFIG_BSP_I2C_GPIO_PULLUP)


/* SD card */
#define BSP_SD_CMD (CONFIG_BSP_SD_CMD)
Expand Down
1 change: 1 addition & 0 deletions bsp/esp_bsp_generic/src/esp_bsp_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ 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,
.flags.enable_internal_pullup = BSP_I2C_PULLUP,
};
BSP_ERROR_CHECK_RETURN_ERR(i2c_new_master_bus(&i2c_config, &i2c_handle));

Expand Down

0 comments on commit ae27344

Please sign in to comment.