|
1 | 1 | /* |
2 | | - * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD |
| 2 | + * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD |
3 | 3 | * |
4 | 4 | * SPDX-License-Identifier: Apache-2.0 |
5 | 5 | */ |
@@ -52,6 +52,9 @@ extern "C" { |
52 | 52 | .slot_mask = (mono_or_stereo == I2S_SLOT_MODE_MONO) ? \ |
53 | 53 | I2S_PDM_SLOT_LEFT : I2S_PDM_SLOT_BOTH, \ |
54 | 54 | .data_fmt = I2S_PDM_DATA_FMT_RAW, \ |
| 55 | + .hp_en = false, /* No effect, only for cpp compatibility */ \ |
| 56 | + .hp_cut_off_freq_hz = 35.5, /* No effect, only for cpp compatibility */ \ |
| 57 | + .amplify_num = 1, /* No effect, only for cpp compatibility */ \ |
55 | 58 | } |
56 | 59 | #else |
57 | 60 | /** |
@@ -270,7 +273,16 @@ esp_err_t i2s_channel_reconfig_pdm_rx_gpio(i2s_chan_handle_t handle, const i2s_p |
270 | 273 | .slot_bit_width = I2S_SLOT_BIT_WIDTH_AUTO, \ |
271 | 274 | .slot_mode = mono_or_stereo, \ |
272 | 275 | .data_fmt = I2S_PDM_DATA_FMT_RAW, \ |
| 276 | + .sd_prescale = 0, /* No effect, only for cpp compatibility */ \ |
| 277 | + .sd_scale = I2S_PDM_SIG_SCALING_MUL_1, /* No effect, only for cpp compatibility */ \ |
| 278 | + .hp_scale = I2S_PDM_SIG_SCALING_DIV_2, /* No effect, only for cpp compatibility */ \ |
| 279 | + .lp_scale = I2S_PDM_SIG_SCALING_MUL_1, /* No effect, only for cpp compatibility */ \ |
| 280 | + .sinc_scale = I2S_PDM_SIG_SCALING_MUL_1, /* No effect, only for cpp compatibility */ \ |
273 | 281 | .line_mode = I2S_PDM_TX_ONE_LINE_CODEC, \ |
| 282 | + .hp_en = false, /* No effect, only for cpp compatibility */ \ |
| 283 | + .hp_cut_off_freq_hz = 35.5, /* No effect, only for cpp compatibility */ \ |
| 284 | + .sd_dither = 0, /* No effect, only for cpp compatibility */ \ |
| 285 | + .sd_dither2 = 1, /* No effect, only for cpp compatibility */ \ |
274 | 286 | } |
275 | 287 |
|
276 | 288 | /** |
@@ -310,8 +322,17 @@ esp_err_t i2s_channel_reconfig_pdm_rx_gpio(i2s_chan_handle_t handle, const i2s_p |
310 | 322 | .slot_bit_width = I2S_SLOT_BIT_WIDTH_AUTO, \ |
311 | 323 | .slot_mode = mono_or_stereo, \ |
312 | 324 | .data_fmt = I2S_PDM_DATA_FMT_RAW, \ |
| 325 | + .sd_prescale = 0, /* No effect, only for cpp compatibility */ \ |
| 326 | + .sd_scale = I2S_PDM_SIG_SCALING_MUL_1, /* No effect, only for cpp compatibility */ \ |
| 327 | + .hp_scale = I2S_PDM_SIG_SCALING_MUL_1, /* No effect, only for cpp compatibility */ \ |
| 328 | + .lp_scale = I2S_PDM_SIG_SCALING_MUL_1, /* No effect, only for cpp compatibility */ \ |
| 329 | + .sinc_scale = I2S_PDM_SIG_SCALING_MUL_1, /* No effect, only for cpp compatibility */ \ |
313 | 330 | .line_mode = ((mono_or_stereo) == I2S_SLOT_MODE_MONO ? \ |
314 | 331 | I2S_PDM_TX_ONE_LINE_DAC : I2S_PDM_TX_TWO_LINE_DAC), \ |
| 332 | + .hp_en = true, /* No effect, only for cpp compatibility */ \ |
| 333 | + .hp_cut_off_freq_hz = 35.5, /* No effect, only for cpp compatibility */ \ |
| 334 | + .sd_dither = 0, /* No effect, only for cpp compatibility */ \ |
| 335 | + .sd_dither2 = 1, /* No effect, only for cpp compatibility */ \ |
315 | 336 | } |
316 | 337 | #else // SOC_I2S_HW_VERSION_2 |
317 | 338 | /** |
@@ -343,6 +364,11 @@ esp_err_t i2s_channel_reconfig_pdm_rx_gpio(i2s_chan_handle_t handle, const i2s_p |
343 | 364 | .slot_mode = mono_or_stereo, \ |
344 | 365 | .slot_mask = I2S_PDM_SLOT_BOTH, \ |
345 | 366 | .data_fmt = I2S_PDM_DATA_FMT_RAW, \ |
| 367 | + .sd_prescale = 0, /* No effect, only for cpp compatibility */ \ |
| 368 | + .sd_scale = I2S_PDM_SIG_SCALING_MUL_1, /* No effect, only for cpp compatibility */ \ |
| 369 | + .hp_scale = I2S_PDM_SIG_SCALING_MUL_1, /* No effect, only for cpp compatibility */ \ |
| 370 | + .lp_scale = I2S_PDM_SIG_SCALING_MUL_1, /* No effect, only for cpp compatibility */ \ |
| 371 | + .sinc_scale = I2S_PDM_SIG_SCALING_MUL_1, /* No effect, only for cpp compatibility */ \ |
346 | 372 | } |
347 | 373 | #endif // SOC_I2S_HW_VERSION_2 |
348 | 374 |
|
@@ -428,7 +454,7 @@ typedef struct { |
428 | 454 | #if SOC_I2S_HW_VERSION_1 |
429 | 455 | i2s_pdm_slot_mask_t slot_mask; /*!< Slot mask to choose left or right slot */ |
430 | 456 | #endif |
431 | | - i2s_pdm_data_fmt_t data_fmt; /*!< The data format of PDM TX mode. It determines what kind of data format is written in software. |
| 457 | + i2s_pdm_data_fmt_t data_fmt; /*!< The data format of PDM TX mode. It determines what kind of data format is written in software. |
432 | 458 | * Typically, set this field to I2S_PDM_DATA_FMT_PCM when PCM2PDM filter is supported in the hardware, |
433 | 459 | * so that you can write PCM format data in software, and then the hardware PCM2PDM filter will help to |
434 | 460 | * convert it into PDM format on the line. Otherwise if this field is set to I2S_PDM_DATA_FMT_RAW, |
|
0 commit comments