From d4481517f7d5151d2521d2ca5066960720fff15f Mon Sep 17 00:00:00 2001 From: laokaiyao Date: Mon, 10 Feb 2025 16:13:04 +0800 Subject: [PATCH] fix(i2s): fixed the pdm2pcm capability on c5 and c61 --- .../test_apps/i2s/main/test_i2s.c | 32 +++++++- components/hal/esp32c5/include/hal/i2s_ll.h | 76 +---------------- components/hal/esp32c61/include/hal/i2s_ll.h | 81 +------------------ .../esp32c5/include/soc/Kconfig.soc_caps.in | 8 -- components/soc/esp32c5/include/soc/soc_caps.h | 2 - components/soc/esp32c5/register/soc/i2s_reg.h | 52 +----------- .../soc/esp32c5/register/soc/i2s_struct.h | 41 +--------- .../esp32c61/include/soc/Kconfig.soc_caps.in | 8 -- .../soc/esp32c61/include/soc/soc_caps.h | 2 - .../soc/esp32c61/register/soc/i2s_reg.h | 36 +-------- .../soc/esp32c61/register/soc/i2s_struct.h | 33 +------- 11 files changed, 42 insertions(+), 329 deletions(-) diff --git a/components/esp_driver_i2s/test_apps/i2s/main/test_i2s.c b/components/esp_driver_i2s/test_apps/i2s/main/test_i2s.c index 98908519fe..04cbdb4fb7 100644 --- a/components/esp_driver_i2s/test_apps/i2s/main/test_i2s.c +++ b/components/esp_driver_i2s/test_apps/i2s/main/test_i2s.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -986,3 +986,33 @@ TEST_CASE("I2S_asynchronous_read_write", "[i2s]") TEST_ASSERT(received); } + +#if SOC_I2S_SUPPORTS_PDM2PCM +TEST_CASE("I2S_PDM2PCM_existence_test", "[i2s]") +{ + i2s_chan_handle_t rx_handle; + i2s_chan_config_t rx_chan_cfg = I2S_CHANNEL_DEFAULT_CONFIG(I2S_NUM_AUTO, I2S_ROLE_MASTER); + TEST_ESP_OK(i2s_new_channel(&rx_chan_cfg, NULL, &rx_handle)); + + i2s_pdm_rx_config_t pdm_rx_cfg = { + .clk_cfg = I2S_PDM_RX_CLK_DEFAULT_CONFIG(16000), + .slot_cfg = I2S_PDM_RX_SLOT_PCM_FMT_DEFAULT_CONFIG(I2S_DATA_BIT_WIDTH_16BIT, I2S_SLOT_MODE_MONO), + .gpio_cfg = { + .clk = MASTER_BCK_IO, + .din = DATA_IN_IO, + .invert_flags = { + .clk_inv = false, + }, + }, + }; + TEST_ESP_OK(i2s_channel_init_pdm_rx_mode(rx_handle, &pdm_rx_cfg)); + TEST_ESP_OK(i2s_channel_enable(rx_handle)); + + uint8_t *r_buf[64] = {}; + size_t r_bytes = 0; + // If PDM2PCM is not supported in the hardware, it will fail to read. + TEST_ESP_OK(i2s_channel_read(rx_handle, r_buf, 64, &r_bytes, 1000)); + TEST_ESP_OK(i2s_channel_disable(rx_handle)); + TEST_ESP_OK(i2s_del_channel(rx_handle)); +} +#endif diff --git a/components/hal/esp32c5/include/hal/i2s_ll.h b/components/hal/esp32c5/include/hal/i2s_ll.h index 45cc720a76..b9c41f31a7 100644 --- a/components/hal/esp32c5/include/hal/i2s_ll.h +++ b/components/hal/esp32c5/include/hal/i2s_ll.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -743,7 +743,6 @@ static inline void i2s_ll_rx_enable_tdm(i2s_dev_t *hw) { hw->rx_conf.rx_pdm_en = false; hw->rx_conf.rx_tdm_en = true; - hw->rx_pdm2pcm_conf.rx_pdm2pcm_en = false; } /** @@ -946,80 +945,9 @@ static inline uint32_t i2s_ll_tx_get_pdm_fs(i2s_dev_t *hw) */ static inline void i2s_ll_rx_enable_pdm(i2s_dev_t *hw, bool pdm_enable) { + (void)pdm_enable; hw->rx_conf.rx_pdm_en = 0; hw->rx_conf.rx_tdm_en = 1; - hw->rx_pdm2pcm_conf.rx_pdm2pcm_en = pdm_enable; -} - -/** - * @brief Configure RX PDM downsample - * - * @param hw Peripheral I2S hardware instance address. - * @param dsr PDM downsample configuration parameter - */ -static inline void i2s_ll_rx_set_pdm_dsr(i2s_dev_t *hw, i2s_pdm_dsr_t dsr) -{ - hw->rx_pdm2pcm_conf.rx_pdm_sinc_dsr_16_en = dsr; -} - -/** - * @brief Get RX PDM downsample configuration - * - * @param hw Peripheral I2S hardware instance address. - * @param dsr Pointer to accept PDM downsample configuration - */ -static inline void i2s_ll_rx_get_pdm_dsr(i2s_dev_t *hw, i2s_pdm_dsr_t *dsr) -{ - *dsr = (i2s_pdm_dsr_t)hw->rx_pdm2pcm_conf.rx_pdm_sinc_dsr_16_en; -} - -/** - * @brief Configure RX PDM amplify number - * @note This is the amplification number of the digital amplifier, - * which is added after the PDM to PCM conversion result and mainly used for - * amplify the small PDM signal under the VAD scenario - * pcm_result = pdm_input * amplify_num - * pcm_result = 0 if amplify_num = 0 - * - * @param hw Peripheral I2S hardware instance address. - * @param amp_num PDM RX amplify number - */ -static inline void i2s_ll_rx_set_pdm_amplify_num(i2s_dev_t *hw, uint32_t amp_num) -{ - hw->rx_pdm2pcm_conf.rx_pdm2pcm_amplify_num = amp_num; -} - -/** - * @brief Set I2S RX PDM high pass filter param0 - * - * @param hw Peripheral I2S hardware instance address. - * @param param The fourth parameter of PDM RX IIR_HP filter stage 1 is (504 + I2S_RX_IIR_HP_MULT12_0[2:0]) - */ -static inline void i2s_ll_rx_set_pdm_hp_filter_param0(i2s_dev_t *hw, uint32_t param) -{ - hw->rx_pdm2pcm_conf.rx_iir_hp_mult12_0 = param; -} - -/** - * @brief Set I2S RX PDM high pass filter param5 - * - * @param hw Peripheral I2S hardware instance address. - * @param param The fourth parameter of PDM RX IIR_HP filter stage 2 is (504 + I2S_RX_IIR_HP_MULT12_5[2:0]) - */ -static inline void i2s_ll_rx_set_pdm_hp_filter_param5(i2s_dev_t *hw, uint32_t param) -{ - hw->rx_pdm2pcm_conf.rx_iir_hp_mult12_5 = param; -} - -/** - * @brief Enable I2S RX PDM high pass filter - * - * @param hw Peripheral I2S hardware instance address. - * @param enable Set true to enable I2S RX PDM high pass filter, set false to bypass it - */ -static inline void i2s_ll_rx_enable_pdm_hp_filter(i2s_dev_t *hw, bool enable) -{ - hw->rx_pdm2pcm_conf.rx_pdm_hp_bypass = !enable; } /** diff --git a/components/hal/esp32c61/include/hal/i2s_ll.h b/components/hal/esp32c61/include/hal/i2s_ll.h index 85414173ff..919117b5f8 100644 --- a/components/hal/esp32c61/include/hal/i2s_ll.h +++ b/components/hal/esp32c61/include/hal/i2s_ll.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -941,88 +941,13 @@ static inline uint32_t i2s_ll_tx_get_pdm_fs(i2s_dev_t *hw) * @brief Enable RX PDM mode. * * @param hw Peripheral I2S hardware instance address. - * @param pdm2pcm Set true to RX enable PDM mode + * @param pdm2pcm Set true to RX enable PDM mode (ignored) */ static inline void i2s_ll_rx_enable_pdm(i2s_dev_t *hw, bool pdm2pcm) { + (void)pdm2pcm; hw->rx_conf.rx_pdm_en = 0; hw->rx_conf.rx_tdm_en = 1; - hw->rx_pdm2pcm_conf.rx_pdm2pcm_en = pdm2pcm; -} - -/** - * @brief Configure RX PDM downsample - * - * @param hw Peripheral I2S hardware instance address. - * @param dsr PDM downsample configuration parameter - */ -static inline void i2s_ll_rx_set_pdm_dsr(i2s_dev_t *hw, i2s_pdm_dsr_t dsr) -{ - hw->rx_pdm2pcm_conf.rx_pdm_sinc_dsr_16_en = dsr; -} - -/** - * @brief Get RX PDM downsample configuration - * - * @param hw Peripheral I2S hardware instance address. - * @param dsr Pointer to accept PDM downsample configuration - */ -static inline void i2s_ll_rx_get_pdm_dsr(i2s_dev_t *hw, i2s_pdm_dsr_t *dsr) -{ - *dsr = (i2s_pdm_dsr_t)hw->rx_pdm2pcm_conf.rx_pdm_sinc_dsr_16_en; -} - -/** - * @brief Configure RX PDM amplify number - * @note This is the amplification number of the digital amplifier, - * which is added after the PDM to PCM conversion result and mainly used for - * amplify the small PDM signal under the VAD scenario - * pcm_result = pdm_input * amplify_num - * pcm_result = 0 if amplify_num = 0 - * - * @param hw Peripheral I2S hardware instance address. - * @param amp_num PDM RX amplify number - */ -static inline void i2s_ll_rx_set_pdm_amplify_num(i2s_dev_t *hw, uint32_t amp_num) -{ - hw->rx_pdm2pcm_conf.rx_pdm2pcm_amplify_num = amp_num; -} - -/** - * @brief Set I2S RX PDM high pass filter param0 (only for compatibility) - * - * @param hw Peripheral I2S hardware instance address. - * @param param no effect - */ -static inline void i2s_ll_rx_set_pdm_hp_filter_param0(i2s_dev_t *hw, uint32_t param) -{ - // Can't configure HP filter param on this target - (void) hw; - (void) param; -} - -/** - * @brief Set I2S RX PDM high pass filter param5 (only for compatibility) - * - * @param hw Peripheral I2S hardware instance address. - * @param param no effect - */ -static inline void i2s_ll_rx_set_pdm_hp_filter_param5(i2s_dev_t *hw, uint32_t param) -{ - // Can't configure HP filter param on this target - (void) hw; - (void) param; -} - -/** - * @brief Enable I2S RX PDM high pass filter - * - * @param hw Peripheral I2S hardware instance address. - * @param enable Set true to enable I2S RX PDM high pass filter, set false to bypass it - */ -static inline void i2s_ll_rx_enable_pdm_hp_filter(i2s_dev_t *hw, bool enable) -{ - hw->rx_pdm2pcm_conf.rx_pdm_hp_bypass = !enable; } /** diff --git a/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in index 3c30d04ff8..6166697b2e 100644 --- a/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c5/include/soc/Kconfig.soc_caps.in @@ -719,14 +719,6 @@ config SOC_I2S_SUPPORTS_PDM_RX bool default y -config SOC_I2S_SUPPORTS_PDM2PCM - bool - default y - -config SOC_I2S_SUPPORTS_PDM_RX_HP_FILTER - bool - default y - config SOC_I2S_SUPPORTS_TX_SYNC_CNT bool default y diff --git a/components/soc/esp32c5/include/soc/soc_caps.h b/components/soc/esp32c5/include/soc/soc_caps.h index 71c5510c7e..3a90f3781a 100644 --- a/components/soc/esp32c5/include/soc/soc_caps.h +++ b/components/soc/esp32c5/include/soc/soc_caps.h @@ -296,8 +296,6 @@ #define SOC_I2S_SUPPORTS_PDM_TX (1) // Support to output raw PDM format data #define SOC_I2S_SUPPORTS_PCM2PDM (1) // Support to write PCM format but output PDM format data with the help of PCM to PDM filter #define SOC_I2S_SUPPORTS_PDM_RX (1) // Support to input raw PDM format data -#define SOC_I2S_SUPPORTS_PDM2PCM (1) // Support to input PDM format but read PCM format data with the help of PDM to PCM filter -#define SOC_I2S_SUPPORTS_PDM_RX_HP_FILTER (1) #define SOC_I2S_SUPPORTS_TX_SYNC_CNT (1) #define SOC_I2S_PDM_MAX_TX_LINES (2) #define SOC_I2S_PDM_MAX_RX_LINES (1U) diff --git a/components/soc/esp32c5/register/soc/i2s_reg.h b/components/soc/esp32c5/register/soc/i2s_reg.h index 330382b7ed..62199e9d66 100644 --- a/components/soc/esp32c5/register/soc/i2s_reg.h +++ b/components/soc/esp32c5/register/soc/i2s_reg.h @@ -1,5 +1,5 @@ /** - * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -836,56 +836,6 @@ extern "C" { #define I2S_TX_IIR_HP_MULT12_0_V 0x00000007U #define I2S_TX_IIR_HP_MULT12_0_S 23 -/** I2S_RX_PDM2PCM_CONF_REG register - * I2S RX configure register - */ -#define I2S_RX_PDM2PCM_CONF_REG(i) (REG_I2S_BASE(i) + 0x4c) -/** I2S_RX_PDM2PCM_EN : R/W; bitpos: [19]; default: 0; - * 1: Enable PDM2PCM RX mode. 0: DIsable. - */ -#define I2S_RX_PDM2PCM_EN (BIT(19)) -#define I2S_RX_PDM2PCM_EN_M (I2S_RX_PDM2PCM_EN_V << I2S_RX_PDM2PCM_EN_S) -#define I2S_RX_PDM2PCM_EN_V 0x00000001U -#define I2S_RX_PDM2PCM_EN_S 19 -/** I2S_RX_PDM_SINC_DSR_16_EN : R/W; bitpos: [20]; default: 0; - * Configure the down sampling rate of PDM RX filter group1 module. 1: The down - * sampling rate is 128. 0: down sampling rate is 64. - */ -#define I2S_RX_PDM_SINC_DSR_16_EN (BIT(20)) -#define I2S_RX_PDM_SINC_DSR_16_EN_M (I2S_RX_PDM_SINC_DSR_16_EN_V << I2S_RX_PDM_SINC_DSR_16_EN_S) -#define I2S_RX_PDM_SINC_DSR_16_EN_V 0x00000001U -#define I2S_RX_PDM_SINC_DSR_16_EN_S 20 -/** I2S_RX_PDM2PCM_AMPLIFY_NUM : R/W; bitpos: [24:21]; default: 1; - * Configure PDM RX amplify number. - */ -#define I2S_RX_PDM2PCM_AMPLIFY_NUM 0x0000000FU -#define I2S_RX_PDM2PCM_AMPLIFY_NUM_M (I2S_RX_PDM2PCM_AMPLIFY_NUM_V << I2S_RX_PDM2PCM_AMPLIFY_NUM_S) -#define I2S_RX_PDM2PCM_AMPLIFY_NUM_V 0x0000000FU -#define I2S_RX_PDM2PCM_AMPLIFY_NUM_S 21 -/** I2S_RX_PDM_HP_BYPASS : R/W; bitpos: [25]; default: 0; - * I2S PDM RX bypass hp filter or not. - */ -#define I2S_RX_PDM_HP_BYPASS (BIT(25)) -#define I2S_RX_PDM_HP_BYPASS_M (I2S_RX_PDM_HP_BYPASS_V << I2S_RX_PDM_HP_BYPASS_S) -#define I2S_RX_PDM_HP_BYPASS_V 0x00000001U -#define I2S_RX_PDM_HP_BYPASS_S 25 -/** I2S_RX_IIR_HP_MULT12_5 : R/W; bitpos: [28:26]; default: 6; - * The fourth parameter of PDM RX IIR_HP filter stage 2 is (504 + - * LP_I2S_RX_IIR_HP_MULT12_5[2:0]) - */ -#define I2S_RX_IIR_HP_MULT12_5 0x00000007U -#define I2S_RX_IIR_HP_MULT12_5_M (I2S_RX_IIR_HP_MULT12_5_V << I2S_RX_IIR_HP_MULT12_5_S) -#define I2S_RX_IIR_HP_MULT12_5_V 0x00000007U -#define I2S_RX_IIR_HP_MULT12_5_S 26 -/** I2S_RX_IIR_HP_MULT12_0 : R/W; bitpos: [31:29]; default: 7; - * The fourth parameter of PDM RX IIR_HP filter stage 1 is (504 + - * LP_I2S_RX_IIR_HP_MULT12_0[2:0]) - */ -#define I2S_RX_IIR_HP_MULT12_0 0x00000007U -#define I2S_RX_IIR_HP_MULT12_0_M (I2S_RX_IIR_HP_MULT12_0_V << I2S_RX_IIR_HP_MULT12_0_S) -#define I2S_RX_IIR_HP_MULT12_0_V 0x00000007U -#define I2S_RX_IIR_HP_MULT12_0_S 29 - /** I2S_RX_TDM_CTRL_REG register * I2S TX TDM mode control register */ diff --git a/components/soc/esp32c5/register/soc/i2s_struct.h b/components/soc/esp32c5/register/soc/i2s_struct.h index 3c6d1c9c18..a7ddcc6fe8 100644 --- a/components/soc/esp32c5/register/soc/i2s_struct.h +++ b/components/soc/esp32c5/register/soc/i2s_struct.h @@ -1,5 +1,5 @@ /** - * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -295,43 +295,6 @@ typedef union { uint32_t val; } i2s_rx_recomb_dma_chn_reg_t; -/** Type of rx_pdm2pcm_conf register - * I2S RX configure register - */ -typedef union { - struct { - uint32_t reserved_0:19; - /** rx_pdm2pcm_en : R/W; bitpos: [19]; default: 0; - * 1: Enable PDM2PCM RX mode. 0: DIsable. - */ - uint32_t rx_pdm2pcm_en:1; - /** rx_pdm_sinc_dsr_16_en : R/W; bitpos: [20]; default: 0; - * Configure the down sampling rate of PDM RX filter group1 module. 1: The down - * sampling rate is 128. 0: down sampling rate is 64. - */ - uint32_t rx_pdm_sinc_dsr_16_en:1; - /** rx_pdm2pcm_amplify_num : R/W; bitpos: [24:21]; default: 1; - * Configure PDM RX amplify number. - */ - uint32_t rx_pdm2pcm_amplify_num:4; - /** rx_pdm_hp_bypass : R/W; bitpos: [25]; default: 0; - * I2S PDM RX bypass hp filter or not. - */ - uint32_t rx_pdm_hp_bypass:1; - /** rx_iir_hp_mult12_5 : R/W; bitpos: [28:26]; default: 6; - * The fourth parameter of PDM RX IIR_HP filter stage 2 is (504 + - * LP_I2S_RX_IIR_HP_MULT12_5[2:0]) - */ - uint32_t rx_iir_hp_mult12_5:3; - /** rx_iir_hp_mult12_0 : R/W; bitpos: [31:29]; default: 7; - * The fourth parameter of PDM RX IIR_HP filter stage 1 is (504 + - * LP_I2S_RX_IIR_HP_MULT12_0[2:0]) - */ - uint32_t rx_iir_hp_mult12_0:3; - }; - uint32_t val; -} i2s_rx_pdm2pcm_conf_reg_t; - /** Type of rx_tdm_ctrl register * I2S TX TDM mode control register */ @@ -1038,7 +1001,7 @@ typedef struct { volatile i2s_rx_recomb_dma_chn_reg_t rx_recomb_dma_ch[4]; volatile i2s_tx_pcm2pdm_conf_reg_t tx_pcm2pdm_conf; volatile i2s_tx_pcm2pdm_conf1_reg_t tx_pcm2pdm_conf1; - volatile i2s_rx_pdm2pcm_conf_reg_t rx_pdm2pcm_conf; + uint32_t reserved_048; volatile i2s_rx_tdm_ctrl_reg_t rx_tdm_ctrl; volatile i2s_tx_tdm_ctrl_reg_t tx_tdm_ctrl; volatile i2s_rx_timing_reg_t rx_timing; diff --git a/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in index c69697d56b..ddf26f2788 100644 --- a/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c61/include/soc/Kconfig.soc_caps.in @@ -595,14 +595,6 @@ config SOC_I2S_SUPPORTS_PDM_RX bool default y -config SOC_I2S_SUPPORTS_PDM2PCM - bool - default y - -config SOC_I2S_SUPPORTS_PDM_RX_HP_FILTER - bool - default y - config SOC_I2S_SUPPORTS_TX_SYNC_CNT bool default y diff --git a/components/soc/esp32c61/include/soc/soc_caps.h b/components/soc/esp32c61/include/soc/soc_caps.h index 487522db1d..d683ad9189 100644 --- a/components/soc/esp32c61/include/soc/soc_caps.h +++ b/components/soc/esp32c61/include/soc/soc_caps.h @@ -249,8 +249,6 @@ #define SOC_I2S_SUPPORTS_PDM_TX (1) // Support to output raw PDM format data #define SOC_I2S_SUPPORTS_PCM2PDM (1) // Support to write PCM format but output PDM format data with the help of PCM to PDM filter #define SOC_I2S_SUPPORTS_PDM_RX (1) // Support to input raw PDM format data -#define SOC_I2S_SUPPORTS_PDM2PCM (1) // Support to input PDM format but read PCM format data with the help of PDM to PCM filter -#define SOC_I2S_SUPPORTS_PDM_RX_HP_FILTER (1) #define SOC_I2S_SUPPORTS_TX_SYNC_CNT (1) #define SOC_I2S_PDM_MAX_TX_LINES (2) #define SOC_I2S_PDM_MAX_RX_LINES (1U) diff --git a/components/soc/esp32c61/register/soc/i2s_reg.h b/components/soc/esp32c61/register/soc/i2s_reg.h index cea489c0bc..9c999162fa 100644 --- a/components/soc/esp32c61/register/soc/i2s_reg.h +++ b/components/soc/esp32c61/register/soc/i2s_reg.h @@ -1,5 +1,5 @@ /** - * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -661,40 +661,6 @@ extern "C" { #define I2S_TX_IIR_HP_MULT12_0_V 0x00000007U #define I2S_TX_IIR_HP_MULT12_0_S 23 -/** I2S_RX_PDM2PCM_CONF_REG register - * I2S RX configure register - */ -#define I2S_RX_PDM2PCM_CONF_REG (DR_REG_I2S_BASE + 0x48) -/** I2S_RX_PDM2PCM_EN : R/W; bitpos: [19]; default: 0; - * 1: Enable PDM2PCM RX mode. 0: DIsable. - */ -#define I2S_RX_PDM2PCM_EN (BIT(19)) -#define I2S_RX_PDM2PCM_EN_M (I2S_RX_PDM2PCM_EN_V << I2S_RX_PDM2PCM_EN_S) -#define I2S_RX_PDM2PCM_EN_V 0x00000001U -#define I2S_RX_PDM2PCM_EN_S 19 -/** I2S_RX_PDM_SINC_DSR_16_EN : R/W; bitpos: [20]; default: 0; - * Configure the down sampling rate of PDM RX filter group1 module. 1: The down - * sampling rate is 128. 0: down sampling rate is 64. - */ -#define I2S_RX_PDM_SINC_DSR_16_EN (BIT(20)) -#define I2S_RX_PDM_SINC_DSR_16_EN_M (I2S_RX_PDM_SINC_DSR_16_EN_V << I2S_RX_PDM_SINC_DSR_16_EN_S) -#define I2S_RX_PDM_SINC_DSR_16_EN_V 0x00000001U -#define I2S_RX_PDM_SINC_DSR_16_EN_S 20 -/** I2S_RX_PDM2PCM_AMPLIFY_NUM : R/W; bitpos: [24:21]; default: 1; - * Configure PDM RX amplify number. - */ -#define I2S_RX_PDM2PCM_AMPLIFY_NUM 0x0000000FU -#define I2S_RX_PDM2PCM_AMPLIFY_NUM_M (I2S_RX_PDM2PCM_AMPLIFY_NUM_V << I2S_RX_PDM2PCM_AMPLIFY_NUM_S) -#define I2S_RX_PDM2PCM_AMPLIFY_NUM_V 0x0000000FU -#define I2S_RX_PDM2PCM_AMPLIFY_NUM_S 21 -/** I2S_RX_PDM_HP_BYPASS : R/W; bitpos: [25]; default: 0; - * I2S PDM RX bypass hp filter or not. - */ -#define I2S_RX_PDM_HP_BYPASS (BIT(25)) -#define I2S_RX_PDM_HP_BYPASS_M (I2S_RX_PDM_HP_BYPASS_V << I2S_RX_PDM_HP_BYPASS_S) -#define I2S_RX_PDM_HP_BYPASS_V 0x00000001U -#define I2S_RX_PDM_HP_BYPASS_S 25 - /** I2S_RX_TDM_CTRL_REG register * I2S TX TDM mode control register */ diff --git a/components/soc/esp32c61/register/soc/i2s_struct.h b/components/soc/esp32c61/register/soc/i2s_struct.h index e9afdbf28b..744922d29b 100644 --- a/components/soc/esp32c61/register/soc/i2s_struct.h +++ b/components/soc/esp32c61/register/soc/i2s_struct.h @@ -1,5 +1,5 @@ /** - * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -240,34 +240,6 @@ typedef union { uint32_t val; } i2s_rx_conf1_reg_t; -/** Type of rx_pdm2pcm_conf register - * I2S RX configure register - */ -typedef union { - struct { - uint32_t reserved_0:19; - /** rx_pdm2pcm_en : R/W; bitpos: [19]; default: 0; - * 1: Enable PDM2PCM RX mode. 0: DIsable. - */ - uint32_t rx_pdm2pcm_en:1; - /** rx_pdm_sinc_dsr_16_en : R/W; bitpos: [20]; default: 0; - * Configure the down sampling rate of PDM RX filter group1 module. 1: The down - * sampling rate is 128. 0: down sampling rate is 64. - */ - uint32_t rx_pdm_sinc_dsr_16_en:1; - /** rx_pdm2pcm_amplify_num : R/W; bitpos: [24:21]; default: 1; - * Configure PDM RX amplify number. - */ - uint32_t rx_pdm2pcm_amplify_num:4; - /** rx_pdm_hp_bypass : R/W; bitpos: [25]; default: 0; - * I2S PDM RX bypass hp filter or not. - */ - uint32_t rx_pdm_hp_bypass:1; - uint32_t reserved_26:6; - }; - uint32_t val; -} i2s_rx_pdm2pcm_conf_reg_t; - /** Type of rx_tdm_ctrl register * I2S TX TDM mode control register */ @@ -973,8 +945,7 @@ typedef struct { uint32_t reserved_030[4]; volatile i2s_tx_pcm2pdm_conf_reg_t tx_pcm2pdm_conf; volatile i2s_tx_pcm2pdm_conf1_reg_t tx_pcm2pdm_conf1; - volatile i2s_rx_pdm2pcm_conf_reg_t rx_pdm2pcm_conf; - uint32_t reserved_04c; + uint32_t reserved_048[2]; volatile i2s_rx_tdm_ctrl_reg_t rx_tdm_ctrl; volatile i2s_tx_tdm_ctrl_reg_t tx_tdm_ctrl; volatile i2s_rx_timing_reg_t rx_timing;