@@ -335,8 +335,14 @@ esp_err_t i2cSlaveInit(uint8_t num, int sda, int scl, uint16_t slaveID, uint32_t
335
335
}
336
336
#endif // !defined(CONFIG_IDF_TARGET_ESP32P4)
337
337
338
+ #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL (5 , 3 , 3 )
339
+ i2c_ll_set_mode (i2c -> dev , I2C_BUS_MODE_SLAVE );
340
+ i2c_ll_enable_pins_open_drain (i2c -> dev , true);
341
+ i2c_ll_enable_fifo_mode (i2c -> dev , true);
342
+ #else
338
343
i2c_ll_slave_init (i2c -> dev );
339
344
i2c_ll_slave_set_fifo_mode (i2c -> dev , true);
345
+ #endif
340
346
i2c_ll_set_slave_addr (i2c -> dev , slaveID , false);
341
347
i2c_ll_set_tout (i2c -> dev , I2C_LL_MAX_TIMEOUT );
342
348
i2c_slave_set_frequency (i2c , frequency );
@@ -357,7 +363,11 @@ esp_err_t i2cSlaveInit(uint8_t num, int sda, int scl, uint16_t slaveID, uint32_t
357
363
358
364
i2c_ll_disable_intr_mask (i2c -> dev , I2C_LL_INTR_MASK );
359
365
i2c_ll_clear_intr_mask (i2c -> dev , I2C_LL_INTR_MASK );
366
+ #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL (5 , 3 , 3 )
367
+ i2c_ll_enable_fifo_mode (i2c -> dev , true);
368
+ #else
360
369
i2c_ll_slave_set_fifo_mode (i2c -> dev , true);
370
+ #endif
361
371
362
372
if (!i2c -> intr_handle ) {
363
373
uint32_t flags = ESP_INTR_FLAG_LOWMED | ESP_INTR_FLAG_SHARED ;
0 commit comments