Merge branch 'feature/i2s_support_change_freq_in_runtime' into 'master'

feat(i2s): support tuning rate dynamically

Closes IDF-11679

See merge request espressif/esp-idf!36537
This commit is contained in:
Kevin (Lao Kaiyao)
2025-02-18 00:27:50 +08:00
37 changed files with 1193 additions and 112 deletions

View File

@@ -320,6 +320,14 @@ Configuration
Users can initialize a channel by calling corresponding functions (i.e., :func:`i2s_channel_init_std_mode`, :func:`i2s_channel_init_pdm_rx_mode`, :func:`i2s_channel_init_pdm_tx_mode`, or :func:`i2s_channel_init_tdm_mode`) to a specific mode. If the configurations need to be updated after initialization, users have to first call :cpp:func:`i2s_channel_disable` to ensure that the channel has stopped, and then call corresponding ``reconfig`` functions, like :cpp:func:`i2s_channel_reconfig_std_slot`, :cpp:func:`i2s_channel_reconfig_std_clock`, and :cpp:func:`i2s_channel_reconfig_std_gpio`.
Advanced API
^^^^^^^^^^^^
To satisfy the high quality audio requirement, following advanced APIs are provided:
- :cpp:func:`i2s_channel_preload_data`: Preloading audio data into the I2S internal cache, enabling the TX channel to immediately send data upon activation, thereby reducing the initial audio output delay.
- :cpp:func:`i2s_channel_tune_rate`: Dynamically fine-tuning the audio rate at runtime to match the speed of the audio data producer and consumer, thereby preventing the accumulation or shortage of intermediate buffered data that caused by rate mismatches.
IRAM Safe
^^^^^^^^^