feat(i2c_master): Add lp_i2c support in i2c master driver

This commit is contained in:
Cao Sen Miao
2024-04-03 11:36:15 +08:00
parent db3e43908a
commit 0985bfbe27
36 changed files with 293 additions and 66 deletions
+12 -4
View File
@@ -21,9 +21,9 @@ extern "C" {
*/
typedef enum {
I2C_NUM_0 = 0, /*!< I2C port 0 */
#if SOC_I2C_NUM >= 2
#if SOC_HP_I2C_NUM >= 2
I2C_NUM_1, /*!< I2C port 1 */
#endif /* SOC_I2C_NUM >= 2 */
#endif /* SOC_HP_I2C_NUM >= 2 */
#if SOC_LP_I2C_NUM >= 1
LP_I2C_NUM_0, /*< LP_I2C port 0 */
#endif /* SOC_LP_I2C_NUM >= 1 */
@@ -44,9 +44,9 @@ typedef enum {
* @brief Data structure for calculating I2C bus timing.
*/
typedef struct {
uint16_t clkm_div; /*!< I2C core clock devider */
uint16_t clkm_div; /*!< I2C core clock divider */
uint16_t scl_low; /*!< I2C scl low period */
uint16_t scl_high; /*!< I2C scl hight period */
uint16_t scl_high; /*!< I2C scl high period */
uint16_t scl_wait_high; /*!< I2C scl wait_high period */
uint16_t sda_hold; /*!< I2C scl low period */
uint16_t sda_sample; /*!< I2C sda sample time */
@@ -103,6 +103,14 @@ typedef enum {
* @brief I2C group clock source
*/
typedef soc_periph_i2c_clk_src_t i2c_clock_source_t;
#if SOC_LP_I2C_SUPPORTED
/**
* @brief LP_UART source clock
*/
typedef soc_periph_lp_i2c_clk_src_t lp_i2c_clock_source_t;
#endif
#else
/**
* @brief Default type