我用mcasp的tdm模式配置i2s,然后用edma3来传输数据,但是目前还不能正确传输。
edma3配置如下:
void EDMA3_SendInitialCfg(void)
{
edma3ccRegs->EMCR = (Uint32) 0x0002;
edma3ccRegs->SECR = (Uint32) 0x0002;
edma3ccRegs->EESR = (Uint32) 0x0002;
//edma3ccRegs->DRA[1].DRAE=(Uint32) 0x0002;
edma3ccRegs->DMAQNUM[0] = (CSL_EDMA3CC_DMAQNUM_E1_Q0 << CSL_EDMA3CC_DMAQNUM_E1_SHIFT);
edma3ccRegs->PARAMSET[1].OPT = (CSL_EDMA3CC_OPT_TCINTEN_ENABLE << CSL_EDMA3CC_OPT_TCINTEN_SHIFT)|\
(0x01 << CSL_EDMA3CC_OPT_TCC_SHIFT)|\
(CSL_EDMA3CC_OPT_SYNCDIM_ASYNC << CSL_EDMA3CC_OPT_SYNCDIM_SHIFT);
edma3ccRegs->PARAMSET[1].SRC = (Uint32) &xmt;
edma3ccRegs->PARAMSET[1].A_B_CNT = (Uint32) 0x00020004;
edma3ccRegs->PARAMSET[1].DST = 0x01D00000;//XBUFADD; //XBUF地址(通道目的地址)
edma3ccRegs->PARAMSET[1].SRC_DST_BIDX = (0x0000 << CSL_EDMA3CC_SRC_DST_BIDX_DSTBIDX_SHIFT)|\
(0x0004 << CSL_EDMA3CC_SRC_DST_BIDX_SRCBIDX_SHIFT);
edma3ccRegs->PARAMSET[1].LINK_BCNTRLD = 0x0002FFFF;
edma3ccRegs->PARAMSET[1].SRC_DST_CIDX = (Uint32)0x04;
edma3ccRegs->PARAMSET[1].CCNT = (Uint32)0x0f;
edma3ccRegs->IESR = (Uint32) 0x0002;
}
void EDMA3_ReceiveStartCfg(void)
{
edma3ccRegs->EMCR = (Uint32) 0x0001;
edma3ccRegs->SECR = (Uint32) 0x0001;
edma3ccRegs->EESR = (Uint32) 0x0001;
edma3ccRegs->DRA[1].DRAE=(Uint32) 0x0001;
edma3ccRegs->DMAQNUM[0] = (CSL_EDMA3CC_DMAQNUM_E0_Q0 << CSL_EDMA3CC_DMAQNUM_E0_SHIFT);
edma3ccRegs->PARAMSET[0].OPT = (CSL_EDMA3CC_OPT_TCINTEN_ENABLE << CSL_EDMA3CC_OPT_TCINTEN_SHIFT)|\
//(CSL_EDMA3CC_OPT_FWID_32BIT << CSL_EDMA3CC_OPT_FWID_SHIFT);
(0x00 << CSL_EDMA3CC_OPT_TCC_SHIFT)|\
(CSL_EDMA3CC_OPT_SYNCDIM_ASYNC << CSL_EDMA3CC_OPT_SYNCDIM_SHIFT);
edma3ccRegs->PARAMSET[0].SRC = 0x01D00000;//RBUFADD; //RBUF地址(通道源地址)
edma3ccRegs->PARAMSET[0].A_B_CNT = (Uint32) 0x00020004;
edma3ccRegs->PARAMSET[0].DST = (Uint32) &rcv;
edma3ccRegs->PARAMSET[0].SRC_DST_BIDX = (0x0004 << CSL_EDMA3CC_SRC_DST_BIDX_DSTBIDX_SHIFT)|\
(0x0000 << CSL_EDMA3CC_SRC_DST_BIDX_SRCBIDX_SHIFT);
edma3ccRegs->PARAMSET[0].LINK_BCNTRLD = 0x0002FFFF;
edma3ccRegs->PARAMSET[0].SRC_DST_CIDX = (Uint32)0x04;
edma3ccRegs->PARAMSET[0].CCNT = (Uint32)0x0f;
edma3ccRegs->IESR = (Uint32) 0x0001;
}
主函数中
while (!(edma3ccRegs->IPR & 0x0002));
mcasp0Regs->XBUF0 = xmt[i];
while (!(edma3ccRegs->IPR & 0x0001));
rcv[i] = mcasp0Regs->RBUF0;
程序死在while (!(edma3ccRegs->IPR & 0x0002));
IPR寄存始终为0,请问哪里配置的有问题,不胜感激!
xw_shen:
我顶啊,帮忙看看吧,不胜感激~