arch/xtensa: Bugfix I2C Slave build error for esp32[-|-s2|-s3]
Fix build error for Xtensa based Espressif devices Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
This commit is contained in:
parent
f07141244c
commit
af8e43e7f2
1 changed files with 16 additions and 3 deletions
|
|
@ -139,6 +139,12 @@
|
|||
#define I2C_SLAVE_POLL_RATE 10
|
||||
#endif
|
||||
|
||||
#if !SOC_RCC_IS_INDEPENDENT
|
||||
# define I2C_RCC_ATOMIC() PERIPH_RCC_ATOMIC()
|
||||
#else
|
||||
# define I2C_RCC_ATOMIC()
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
|
@ -599,7 +605,11 @@ static void esp_i2c_slave_init(struct esp_i2c_priv_s *priv)
|
|||
|
||||
/* Enable I2C hardware */
|
||||
|
||||
periph_module_enable(i2c_periph_signal[priv->id].module);
|
||||
I2C_RCC_ATOMIC()
|
||||
{
|
||||
i2c_ll_enable_bus_clock(priv->id, true);
|
||||
i2c_ll_reset_register(priv->id);
|
||||
}
|
||||
|
||||
i2c_hal_init(priv->ctx, priv->id);
|
||||
|
||||
|
|
@ -610,7 +620,7 @@ static void esp_i2c_slave_init(struct esp_i2c_priv_s *priv)
|
|||
/* Initialize I2C Slave */
|
||||
|
||||
i2c_hal_slave_init(priv->ctx);
|
||||
i2c_ll_slave_tx_auto_start_en(priv->ctx->dev, true);
|
||||
i2c_ll_slave_enable_auto_start(priv->ctx->dev, true);
|
||||
i2c_ll_set_source_clk(priv->ctx->dev, I2C_CLK_SRC_DEFAULT);
|
||||
i2c_ll_set_slave_addr(priv->ctx->dev, priv->addr, false);
|
||||
i2c_ll_set_rxfifo_full_thr(priv->ctx->dev, I2C_FIFO_FULL_THRESH_VAL);
|
||||
|
|
@ -642,7 +652,10 @@ static void esp_i2c_slave_deinit(struct esp_i2c_priv_s *priv)
|
|||
const struct esp_i2c_config_s *config = priv->config;
|
||||
|
||||
i2c_hal_deinit(priv->ctx);
|
||||
periph_module_disable(i2c_periph_signal[priv->id].module);
|
||||
I2C_RCC_ATOMIC()
|
||||
{
|
||||
i2c_ll_enable_bus_clock(priv->id, false);
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue