完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
在我的应用程序中,我想使用两个编解码器 ES8311,但我无法初始化两个 I2S 通道,只能初始化其中一个。而且我无法在启动 I2S 通道的情况下初始化 USB 堆栈。
I2S初始化代码: 代码:全选 #define TRANSCEIVER_I2S_NUM (0) #define HEADPHONES_I2S_NUM (1) ... static esp_err_t transceiver_i2s_driver_init(void) { i2s_chan_config_t chan_cfg = I2S_CHANNEL_DEFAULT_CONFIG((i2s_port_t)TRANSCEIVER_I2S_NUM, I2S_ROLE_MASTER); chan_cfg.auto_clear = true; // Auto clear the legacy data in the DMA buffer ESP_ERROR_CHECK(i2s_new_channel(&chan_cfg, &transceiver_tx_handle, &transceiver_rx_handle)); i2s_std_config_t std_cfg = { .clk_cfg = I2S_STD_CLK_DEFAULT_CONFIG(EXAMPLE_SAMPLE_RATE), .slot_cfg = I2S_STD_PHILIPS_SLOT_DEFAULT_CONFIG(I2S_DATA_BIT_WIDTH_16BIT, I2S_SLOT_MODE_STEREO), .gpio_cfg = { .mclk = (gpio_num_t)CONFIG_TRANSCEIVER_I2S_MCK, .bclk = (gpio_num_t)CONFIG_TRANSCEIVER_I2S_BCK, .ws = (gpio_num_t)CONFIG_TRANSCEIVER_I2S_WS, .dout = (gpio_num_t)CONFIG_TRANSCEIVER_I2S_DOUT, .din = (gpio_num_t)CONFIG_TRANSCEIVER_I2S_DIN, .invert_flags = { .mclk_inv = false, .bclk_inv = false, .ws_inv = false, }, }, }; std_cfg.clk_cfg.mclk_multiple = (i2s_mclk_multiple_t)EXAMPLE_MCLK_MULTIPLE; ESP_ERROR_CHECK(i2s_channel_init_std_mode(transceiver_tx_handle, &std_cfg)); ESP_ERROR_CHECK(i2s_channel_init_std_mode(transceiver_rx_handle, &std_cfg)); ESP_ERROR_CHECK(i2s_channel_enable(transceiver_tx_handle)); ESP_ERROR_CHECK(i2s_channel_enable(transceiver_rx_handle)); return ESP_OK; } static esp_err_t headphones_i2s_driver_init(void) { i2s_chan_config_t chan_cfg = I2S_CHANNEL_DEFAULT_CONFIG((i2s_port_t)HEADPHONES_I2S_NUM, I2S_ROLE_MASTER); chan_cfg.auto_clear = true; // Auto clear the legacy data in the DMA buffer ESP_ERROR_CHECK(i2s_new_channel(&chan_cfg, &headphones_tx_handle, &headphones_rx_handle)); i2s_std_config_t std_cfg = { .clk_cfg = I2S_STD_CLK_DEFAULT_CONFIG(EXAMPLE_SAMPLE_RATE), .slot_cfg = I2S_STD_PHILIPS_SLOT_DEFAULT_CONFIG(I2S_DATA_BIT_WIDTH_16BIT, I2S_SLOT_MODE_STEREO), .gpio_cfg = { .mclk = (gpio_num_t)CONFIG_HEADPHONES_I2S_MCK, .bclk = (gpio_num_t)CONFIG_HEADPHONES_I2S_BCK, .ws = (gpio_num_t)CONFIG_HEADPHONES_I2S_WS, .dout = (gpio_num_t)CONFIG_HEADPHONES_I2S_DOUT, .din = (gpio_num_t)CONFIG_HEADPHONES_I2S_DIN, .invert_flags = { .mclk_inv = false, .bclk_inv = false, .ws_inv = false, }, }, }; std_cfg.clk_cfg.mclk_multiple = (i2s_mclk_multiple_t)EXAMPLE_MCLK_MULTIPLE; ESP_ERROR_CHECK(i2s_channel_init_std_mode(headphones_tx_handle, &std_cfg)); ESP_ERROR_CHECK(i2s_channel_init_std_mode(headphones_rx_handle, &std_cfg)); ESP_ERROR_CHECK(i2s_channel_enable(headphones_tx_handle)); ESP_ERROR_CHECK(i2s_channel_enable(headphones_rx_handle)); return ESP_OK; } 当我尝试初始化它们时输出: 代码:全选 E (1730) gdma: gdma_install_tx_interrupt(800): alloc interrupt failed E (1730) gdma: gdma_register_tx_event_callbacks(399): install interrupt service failed E (1730) gdma: gdma_install_rx_interrupt(773): alloc interrupt failed E (1740) gdma: gdma_register_rx_event_callbacks(435): install interrupt service failed 我认为它与选择 DMA 通道有关... 你能帮我解决这个问题吗,尤其是 DMA 通道选择 |
|
相关推荐
|
|
只有小组成员才能发言,加入小组>>
1936个成员聚集在这个小组
加入小组我的项目我做主,使用GN+Ninja来完成构建系统(VSCode开发RT106X)
36433 浏览 0 评论
NXP IMX8应用处理器快速入门必备:技巧、使用、设计指南
5051 浏览 1 评论
6118 浏览 1 评论
6822 浏览 0 评论
NXP i.MX6UL开发板(linux系统烧录+规格+硬件+模块移植)使用手册
4255 浏览 0 评论
655浏览 2评论
求助,S32G上Core M启动后如何让Core A在Flash指定位置加载uboot?
646浏览 2评论
ESP32-WROVER-IE + LAN8720以太网,GPIO0电压只有1.6v,无法正常进入spi flash boot模式如何解决?
647浏览 2评论
求分享适用于PN7160 Android的NFC工厂测试应用程序
738浏览 2评论
853浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-30 01:03 , Processed in 1.118825 second(s), Total 74, Slave 58 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号