查看: 3899|回复: 0

[求助] lpc54114 的sdk 执行StartDigitalLoopback() 听不到声音

[复制链接]
  • TA的每日心情
    奋斗
    2018-7-12 20:45
  • 签到天数: 75 天

    连续签到: 1 天

    [LV.6]常住居民II

    7

    主题

    213

    帖子

    0

    中级会员

    Rank: 3Rank: 3

    积分
    441
    最后登录
    2018-10-25
    发表于 2017-7-11 10:34:39 | 显示全部楼层 |阅读模式

    参见sdk 的IIS  ---dma_transfer   DEMO
    修改了gpio配置和万里的板子一致后,模式执行StartSoundPlayback();  是有正弦波信号从 cn7 输出的,

    可是执行StartDigitalLoopback();   cn8接麦克,cn7听不到数据。。。

    仿真发现是可以进入TxCallback,RxCallback的,观察 s_Buffer 这个缓冲区也是有数据变化的,就是没声音输出
    1. static void StartDigitalLoopback(void)
    2. {
    3.     PRINTF("Setup digital loopback\r\n");

    4.     s_TxTransfer.data = &s_Buffer[0];
    5.     s_TxTransfer.dataSize = sizeof(s_Buffer);

    6.     s_RxTransfer.data = &s_Buffer[0];
    7.     s_RxTransfer.dataSize = sizeof(s_Buffer);

    8.     I2S_TxTransferCreateHandleDMA(DEMO_I2S_TX, &s_TxHandle, &s_DmaTxHandle, TxCallback, (void *)&s_TxTransfer);
    9.     I2S_RxTransferCreateHandleDMA(DEMO_I2S_RX, &s_RxHandle, &s_DmaRxHandle, RxCallback, (void *)&s_RxTransfer);

    10.     /* need to queue two receive buffers so when the first one is filled,
    11.      * the other is immediatelly starts to be filled */
    12.     I2S_RxTransferReceiveDMA(DEMO_I2S_RX, &s_RxHandle, s_RxTransfer);
    13.     I2S_RxTransferReceiveDMA(DEMO_I2S_RX, &s_RxHandle, s_RxTransfer);

    14.     /* need to queue two transmit buffers so when the first one
    15.      * finishes transfer, the other immediatelly starts */
    16.     I2S_TxTransferSendDMA(DEMO_I2S_TX, &s_TxHandle, s_TxTransfer);
    17.     I2S_TxTransferSendDMA(DEMO_I2S_TX, &s_TxHandle, s_TxTransfer);
    18. }

    19. static void TxCallback(I2S_Type *base, i2s_dma_handle_t *handle, status_t completionStatus, void *userData)
    20. {
    21.     /* Enqueue the same original buffer all over again */
    22.     i2s_transfer_t *transfer = (i2s_transfer_t *)userData;
    23.     I2S_TxTransferSendDMA(base, handle, *transfer);
    24. }

    25. static void RxCallback(I2S_Type *base, i2s_dma_handle_t *handle, status_t completionStatus, void *userData)
    26. {
    27.     /* Enqueue the same original buffer all over again */
    28.     i2s_transfer_t *transfer = (i2s_transfer_t *)userData;
    29.     I2S_RxTransferReceiveDMA(base, handle, *transfer);
    30. }
    复制代码


    百思不得其解啊。。。


    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.
    我知道答案 目前已有0人回答
    该会员没有填写今日想说内容.
    回复

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /3 下一条

    Archiver|手机版|小黑屋|恩智浦技术社区

    GMT+8, 2025-7-21 06:36 , Processed in 0.082264 second(s), 21 queries , MemCache On.

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.

    快速回复 返回顶部 返回列表