refactor(i2c): Add reset and clock control to i2c ll layer

This commit is contained in:
Cao Sen Miao
2023-10-26 14:04:00 +08:00
committed by BOT
parent 5847ba0b9a
commit a44f8179de
15 changed files with 392 additions and 27 deletions

View File

@@ -128,6 +128,30 @@ static inline void i2c_ll_update(i2c_dev_t *hw)
hw->ctr.conf_upgate = 1;
}
/**
* @brief Enable the bus clock for I2C module
*
* @param i2c_port I2C port id
* @param enable true to enable, false to disable
*/
static inline void i2c_ll_enable_bus_clock(int i2c_port, bool enable)
{
(void)i2c_port;
PCR.i2c_conf.i2c_clk_en = enable;
}
/**
* @brief Reset the I2C module
*
* @param i2c_port Group ID
*/
static inline void i2c_ll_reset_register(int i2c_port)
{
(void)i2c_port;
PCR.i2c_conf.i2c_rst_en = 1;
PCR.i2c_conf.i2c_rst_en = 0;
}
/**
* @brief Configure the I2C bus timing related register.
*