diff --git a/components/hal/esp32/include/hal/i2c_ll.h b/components/hal/esp32/include/hal/i2c_ll.h index dcc24d803f..617eeda149 100644 --- a/components/hal/esp32/include/hal/i2c_ll.h +++ b/components/hal/esp32/include/hal/i2c_ll.h @@ -325,8 +325,8 @@ static inline void i2c_ll_set_slave_addr(i2c_dev_t *hw, uint16_t slave_addr, boo hw->slave_addr.en_10bit = addr_10bit_en; if (addr_10bit_en) { uint16_t addr_14_7 = (slave_addr & 0xff) << 7; - uint8_t addr_6_0 = ((slave_addr & 0x300) >> 8) || 0x78; - hw->slave_addr.addr = addr_14_7 || addr_6_0; + uint8_t addr_6_0 = ((slave_addr & 0x300) >> 8) | 0x78; + hw->slave_addr.addr = addr_14_7 | addr_6_0; } else { hw->slave_addr.addr = slave_addr; } diff --git a/components/soc/esp32/include/soc/Kconfig.soc_caps.in b/components/soc/esp32/include/soc/Kconfig.soc_caps.in index c15f33fa61..fddab15bd5 100644 --- a/components/soc/esp32/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32/include/soc/Kconfig.soc_caps.in @@ -387,6 +387,10 @@ config SOC_I2C_SUPPORT_APB bool default y +config SOC_I2C_SUPPORT_10BIT_ADDR + bool + default y + config SOC_I2C_STOP_INDEPENDENT bool default y diff --git a/components/soc/esp32/include/soc/soc_caps.h b/components/soc/esp32/include/soc/soc_caps.h index 60b621eeba..8d3f86a29d 100644 --- a/components/soc/esp32/include/soc/soc_caps.h +++ b/components/soc/esp32/include/soc/soc_caps.h @@ -206,6 +206,7 @@ #define SOC_I2C_SUPPORT_SLAVE (1) #define SOC_I2C_SUPPORT_APB (1) +#define SOC_I2C_SUPPORT_10BIT_ADDR (1) // On ESP32, the stop bit should be independent, we can't put trans data and stop command together #define SOC_I2C_STOP_INDEPENDENT (1)