Skip to content

Commit 80b833c

Browse files
committed
fix(i2c): Use new init API
1 parent 5d0c4b3 commit 80b833c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cores/esp32/esp32-hal-i2c-slave.c

+7
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include "soc/i2c_struct.h"
4444
#include "soc/periph_defs.h"
4545
#include "hal/i2c_ll.h"
46+
#include "hal/i2c_types.h"
4647
#ifndef CONFIG_IDF_TARGET_ESP32C5
4748
#include "hal/clk_gate_ll.h"
4849
#endif
@@ -337,7 +338,13 @@ esp_err_t i2cSlaveInit(uint8_t num, int sda, int scl, uint16_t slaveID, uint32_t
337338
}
338339
#endif // !defined(CONFIG_IDF_TARGET_ESP32P4)
339340

341+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 5, 0)
342+
i2c_ll_set_mode(i2c->dev, I2C_BUS_MODE_SLAVE);
343+
i2c_ll_enable_pins_open_drain(i2c->dev, false);
344+
#else
340345
i2c_ll_slave_init(i2c->dev);
346+
#endif
347+
341348
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
342349
i2c_ll_enable_fifo_mode(i2c->dev, true);
343350
#else

0 commit comments

Comments
 (0)