I2C: Fullfill the I2C clock tree, and support 26M XTAL on ESP32-C2

This commit is contained in:
Cao Sen Miao
2022-07-14 19:22:07 +08:00
parent d1dc30fd70
commit 53580a62b5
16 changed files with 184 additions and 98 deletions

View File

@@ -11,6 +11,7 @@
#include "hal/misc.h"
#include "soc/i2c_periph.h"
#include "soc/i2c_struct.h"
#include "soc/clk_tree_defs.h"
#include "hal/i2c_types.h"
#ifdef __cplusplus
@@ -81,8 +82,6 @@ typedef struct {
#define I2C_LL_SLAVE_TX_INT (I2C_TXFIFO_EMPTY_INT_ENA_M)
// I2C slave RX interrupt bitmap
#define I2C_LL_SLAVE_RX_INT (I2C_RXFIFO_FULL_INT_ENA_M | I2C_TRANS_COMPLETE_INT_ENA_M)
// I2C source clock frequency
#define I2C_LL_CLK_SRC_FREQ(src_clk) (80*1000*1000)
// I2C max timeout value
#define I2C_LL_MAX_TIMEOUT I2C_TIME_OUT_REG_V
@@ -791,7 +790,7 @@ static inline void i2c_ll_master_clr_bus(i2c_dev_t *hw)
*
* @return None
*/
static inline void i2c_ll_set_source_clk(i2c_dev_t *hw, i2c_sclk_t src_clk)
static inline void i2c_ll_set_source_clk(i2c_dev_t *hw, i2c_clock_source_t src_clk)
{
;//Not support on ESP32
}