refactor(i2c): cleanup I2C definitions in soc_caps.h

This commit is contained in:
Chen Chen
2026-01-13 17:29:23 +08:00
parent b685c0e733
commit b7e82de9d8
46 changed files with 342 additions and 591 deletions
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2024-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -25,6 +25,15 @@
#ifdef __cplusplus
extern "C" {
#endif
#define I2C_LL_GET(_attr) I2C_LL_ ## _attr
#define I2C_LL_FIFO_LEN 32 /*!< I2C hardware FIFO depth */
#define I2C_LL_LP_FIFO_LEN 16 /*!< LP_I2C hardware FIFO depth */
#define I2C_LL_CMD_REG_NUM 8 /*!< Number of I2C command registers */
#define I2C_LL_SUPPORT_HW_FSM_RST (1) /*!< Support hardware FSM reset */
// #define I2C_LL_SLAVE_SUPPORT_I2CRAM_ACCESS (1) /*!< Slave support I2CRAM access */
// #define I2C_LL_SLAVE_SUPPORT_SLAVE_UNMATCH (1) /*!< Slave support slave unmatch */
/**
* @brief I2C hardware cmd register fields.
@@ -574,7 +583,7 @@ static inline void i2c_ll_get_rxfifo_cnt(i2c_dev_t *hw, uint32_t *length)
__attribute__((always_inline))
static inline void i2c_ll_get_txfifo_len(i2c_dev_t *hw, uint32_t *length)
{
*length = (hw->sr.txfifo_cnt >= SOC_I2C_FIFO_LEN) ? 0 : (SOC_I2C_FIFO_LEN - hw->sr.txfifo_cnt);
*length = (hw->sr.txfifo_cnt >= I2C_LL_GET(FIFO_LEN)) ? 0 : (I2C_LL_GET(FIFO_LEN) - hw->sr.txfifo_cnt);
}
/**