在线时间42 小时
UID3397665
注册时间2017-6-26
NXP金币0
TA的每日心情 | 奋斗 2018-7-12 20:45 |
---|
签到天数: 75 天 连续签到: 1 天 [LV.6]常住居民II
中级会员
 
- 积分
- 441
- 最后登录
- 2018-10-25
|
参见sdk 的IIS ---dma_transfer DEMO
修改了gpio配置和万里的板子一致后,模式执行StartSoundPlayback(); 是有正弦波信号从 cn7 输出的,
可是执行StartDigitalLoopback(); cn8接麦克,cn7听不到数据。。。
仿真发现是可以进入TxCallback,RxCallback的,观察 s_Buffer 这个缓冲区也是有数据变化的,就是没声音输出
- static void StartDigitalLoopback(void)
- {
- PRINTF("Setup digital loopback\r\n");
- s_TxTransfer.data = &s_Buffer[0];
- s_TxTransfer.dataSize = sizeof(s_Buffer);
- s_RxTransfer.data = &s_Buffer[0];
- s_RxTransfer.dataSize = sizeof(s_Buffer);
- I2S_TxTransferCreateHandleDMA(DEMO_I2S_TX, &s_TxHandle, &s_DmaTxHandle, TxCallback, (void *)&s_TxTransfer);
- I2S_RxTransferCreateHandleDMA(DEMO_I2S_RX, &s_RxHandle, &s_DmaRxHandle, RxCallback, (void *)&s_RxTransfer);
- /* need to queue two receive buffers so when the first one is filled,
- * the other is immediatelly starts to be filled */
- I2S_RxTransferReceiveDMA(DEMO_I2S_RX, &s_RxHandle, s_RxTransfer);
- I2S_RxTransferReceiveDMA(DEMO_I2S_RX, &s_RxHandle, s_RxTransfer);
- /* need to queue two transmit buffers so when the first one
- * finishes transfer, the other immediatelly starts */
- I2S_TxTransferSendDMA(DEMO_I2S_TX, &s_TxHandle, s_TxTransfer);
- I2S_TxTransferSendDMA(DEMO_I2S_TX, &s_TxHandle, s_TxTransfer);
- }
- static void TxCallback(I2S_Type *base, i2s_dma_handle_t *handle, status_t completionStatus, void *userData)
- {
- /* Enqueue the same original buffer all over again */
- i2s_transfer_t *transfer = (i2s_transfer_t *)userData;
- I2S_TxTransferSendDMA(base, handle, *transfer);
- }
- static void RxCallback(I2S_Type *base, i2s_dma_handle_t *handle, status_t completionStatus, void *userData)
- {
- /* Enqueue the same original buffer all over again */
- i2s_transfer_t *transfer = (i2s_transfer_t *)userData;
- I2S_RxTransferReceiveDMA(base, handle, *transfer);
- }
复制代码
百思不得其解啊。。。
readme说执行这个的话从cn8 外界麦克输入信号,cn7有输出的
Modify i2s_dma_transfer.c to change condition to call StartDigitalLoopback() instead of StartSoundPlayback() function.
Headphones will play what is input into Audio Line-In connector of MAO shield.
|
|