你好,
我有下面的代码片段,用于初始化来自Id2s的D2HTP://wwwyCysP.com /Fiel/13461/1下载页面196。
*配置I2S接口。*/
CYU3PMESET((UIT88T**)和;I2SCFG,0,SIZEOF(I2SCFG));
I2SCFG.ISMONOO=CyFrE;
I2SCFG.ILSBB1=CyFrE;
I2SCFG.ISDMA=Cyress;
I2SCFG.PADMODE=CYU-U3PII2S1PADYMO正常;
I2SCFG.SAMPLERATE=CYU-U3PII2SYSAMPPLYRATER 44×1KHz;
I2SCFG采样宽度=CyuU3pII2sWithth1616BIT;
状态= CYU3PI2SSETCONFIG(和;I2SCFG,NULL);
如果PAD模式是正常的,那么在32位样本数据中,LSB应该用零填充。
在上面的示例代码中,它将I2S配置为PAD模式正常,样本宽度为16位。它创建的DMA是自动DMA(第196页,第8章,第8节,第4.13页)。如果它的自动DMA模式,零如何填充到样本数据?
2)汽车DMA是否存在缓冲区溢出现象?如果发生,请给我一个处理I2S自动DMA缓冲区欠载的例子代码。
以上来自于百度翻译
以下为原文
Hi,
I have got following code snippet for ini
tialising I2S with DMA from
http://www.cypress.com/file/134661/download page no 196.
/* Configure the I2S interface. */
CyU3PMemSet ((uint8_t *)&i2sCfg, 0, sizeof (i2sCfg));
i2sCfg.isMono = CyFalse;
i2sCfg.isL***First = CyFalse;
i2sCfg.isDma = CyTrue;
i2sCfg.padMode = CY_U3P_I2S_PAD_MODE_NORMAL;
i2sCfg.sampleRate = CY_U3P_I2S_SAMPLE_RATE_44_1KHz;
i2sCfg.sampleWidth = CY_U3P_I2S_WIDTH_16_BIT;
status = CyU3PI2sSetConfig (&i2sCfg, NULL);
It is mentioned that if the pad mode is NORMAL, then in the 32 bit sample data, its LSB shall be padded with zeroes.
In the above example code, it configures the I2S as PAD MODE NORMAL and sample width is 16 bit. The DMA it creates is auto DMA (Page no 196, sec 8.8.4.13). If its auto DMA mode, how does the zeroes get padded to the sample data?
2) Can buffer underrun occur for Auto DMA? If it occurs, can you please give me example code which handles the buffer underrun for I2S Auto DMA?