mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
feat(i2s): add BLE destination config for esp32s31
This commit is contained in:
@@ -291,6 +291,15 @@ I2S 的数据传输(包括数据发送和接收)由 DMA 实现。在传输
|
||||
|
||||
:cpp:func:`i2s_channel_write` 和 :cpp:func:`i2s_channel_read` 都是阻塞函数,在源缓冲区的数据发送完毕前,或是整个目标缓冲区都被加载数据占用时,它们会一直保持等待状态。在等待时间达到最大阻塞时间时,返回 ``ESP_ERR_TIMEOUT`` 错误。要实现异步发送或接收数据,可以通过 :cpp:func:`i2s_channel_register_event_callback` 注册回调,随即便可在回调函数中直接访问 DMA 缓冲区,无需通过这两个阻塞函数来发送或接收数据。但请注意,该回调是一个中断回调,不要在该回调中添加复杂的逻辑、进行浮点运算或调用不可重入函数。
|
||||
|
||||
.. only:: SOC_I2S_SUPPORTS_BT_DEST
|
||||
|
||||
在 {IDF_TARGET_NAME} 上,可在调用 :cpp:func:`i2s_new_channel` 时通过 :cpp:member:`i2s_chan_config_t::tx_destination` 与 :cpp:member:`i2s_chan_config_t::rx_destination` 分别为 TX 与 RX 方向选择数据路径;每个方向可在 **DMA** 与 **Bluetooth** 二者中择一:
|
||||
|
||||
- **DMA(默认)**:使用 DMA 作为 TX/RX 数据通路,与前文所述机制一致。
|
||||
- **Bluetooth**:使用 **蓝牙** 作为 TX/RX 数据通路。依赖 DMA 缓冲的常用操作(例如 :cpp:func:`i2s_channel_write`、:cpp:func:`i2s_channel_read`、:cpp:func:`i2s_channel_preload_data`、:cpp:func:`i2s_channel_register_event_callback` 等)在该方向上不可用。仅 **I2S0** 可选用 Bluetooth 路径。
|
||||
|
||||
与蓝牙协议栈及音频链路的衔接,请参阅 :doc:`ESP-IDF 蓝牙 API 参考 <../bluetooth/index>`。
|
||||
|
||||
配置
|
||||
^^^^
|
||||
|
||||
|
||||
Reference in New Issue
Block a user