docs(i2s): add note for ws setting under DEFAULT config

Closes https://github.com/espressif/esp-idf/issues/18744
This commit is contained in:
Chen Chen
2026-06-23 17:30:58 +08:00
parent 41582e1777
commit dcea873c15
2 changed files with 16 additions and 0 deletions

View File

@@ -356,6 +356,10 @@ Different slot communication formats can be generated by the following helper ma
- :c:macro:`I2S_STD_PCM_SLOT_DEFAULT_CONFIG`
- :c:macro:`I2S_STD_MSB_SLOT_DEFAULT_CONFIG`
.. note::
The standard mode slot helper macros set :cpp:member:`i2s_std_slot_config_t::ws_width` according to the ``bits_per_sample`` argument. If :cpp:member:`i2s_std_slot_config_t::slot_bit_width` is manually changed after using a helper macro, update :cpp:member:`i2s_std_slot_config_t::ws_width` as needed. For Philips and MSB formats, set ``ws_width`` to the slot bit width to keep the WS duty cycle at 50%. For PCM short format, ``ws_width`` should remain 1 BCLK.
The clock config helper macro is:
- :c:macro:`I2S_STD_CLK_DEFAULT_CONFIG`
@@ -806,6 +810,10 @@ Here is the table of the data received in the buffer with different :cpp:member:
- :c:macro:`I2S_TDM_PCM_SHORT_SLOT_DEFAULT_CONFIG`
- :c:macro:`I2S_TDM_PCM_LONG_SLOT_DEFAULT_CONFIG`
.. note::
The TDM Philips and MSB slot helper macros use ``I2S_TDM_AUTO_WS_WIDTH`` by default, which sets the WS width to half of the frame width. If :cpp:member:`i2s_tdm_slot_config_t::ws_width` is manually changed, make sure the configured WS width matches the expected timing of the selected format.
The clock config helper macro is:
- :c:macro:`I2S_TDM_CLK_DEFAULT_CONFIG`

View File

@@ -356,6 +356,10 @@ I2S 驱动例程请参考 :example:`peripherals/i2s` 目录。以下为每种模
- :c:macro:`I2S_STD_PCM_SLOT_DEFAULT_CONFIG`
- :c:macro:`I2S_STD_MSB_SLOT_DEFAULT_CONFIG`
.. note::
标准模式的声道辅助宏会根据 ``bits_per_sample`` 参数设置 :cpp:member:`i2s_std_slot_config_t::ws_width`。如果使用辅助宏后手动修改 :cpp:member:`i2s_std_slot_config_t::slot_bit_width`,请根据需要同步更新 :cpp:member:`i2s_std_slot_config_t::ws_width`。对于 Philips 和 MSB 格式,应将 ``ws_width`` 设置为声道位宽,以保持 WS 占空比为 50%。对于 PCM 短帧同步格式,``ws_width`` 应保持为 1 个 BCLK。
时钟配置的辅助宏为:
- :c:macro:`I2S_STD_CLK_DEFAULT_CONFIG`
@@ -806,6 +810,10 @@ STD RX 模式
- :c:macro:`I2S_TDM_PCM_SHORT_SLOT_DEFAULT_CONFIG`
- :c:macro:`I2S_TDM_PCM_LONG_SLOT_DEFAULT_CONFIG`
.. note::
TDM Philips 和 MSB 声道辅助宏默认使用 ``I2S_TDM_AUTO_WS_WIDTH``,该配置会将 WS 宽度设置为帧宽的一半。如果手动修改 :cpp:member:`i2s_tdm_slot_config_t::ws_width`,请确保配置的 WS 宽度符合所选格式的预期时序。
时钟配置的辅助宏为:
- :c:macro:`I2S_TDM_CLK_DEFAULT_CONFIG`