发表于:2008-08-18 11:10:54
楼主
我写了一段设置MCASP的程序.如下.先想MCASP写入配置参数.然后再读回参数.发现两者严重不一样.读回的参数中许多寄存器的值都是一样的数据.不明白是什么原因.请高手诊断一下.
#include<csl.h>
#include <csl_mcasp.h>
MCASP_Handle OpenMcasp;
MCASP_ConfigGbl mcaspCfgDataGbl = {
0x00000000, /* PFUNC - All pins as McASP */
0x00000001, /* PDIR - XMT DATA output, rest are inputs */
0x00000000, /* DITCTL - DIT mode disable */
0x00000000, /* DLBCTL - Loopback disabled */
0x00000000 /* AMUTE - Never drive AMUTE */
};
MCASP_ConfigRcv mcaspCfgDataRcv = {
0xffffffff, /* RMASK - Use all 32 bits */
0x000080f8, /* RFMT - MSB first, 32-bit slots, CPU bus, 0 bit delay */
0x00000000, /* AFSRCTL - burst, single bit frame sync, ext FS */
0x00000080, /* ACLKRCTL - Sample on rising CLK, divide by 1, ext CLK */
0x00000000, /* AHCLKRCTL - External HCLK */
0x00000001, /* RTDM - Slots 0-31 are active */
0x00000000, /* RINTCTL - No interrupts */
0x00000000 /* RCLKCHK - Not used */
};
MCASP_ConfigXmt mcaspCfgDataXmt = {
0xffffffff, /* XMASK - Use all 32 bits */
0x000080f8, /* XFMT - MSB first, 32-bit slots, CPU bus, 0 bit delay */
0x00000000, /* AFSXCTL - burst, single bit frame sync, ext FS */
0x000000c0, /* ACLKXCTL - Sample on falling CLK, divide by 1, ext CLK */
0x00000000, /* AHCLKXCTL - External HCLK */
0x00000001, /* XTDM - Slots 0-31 are active */
0x00000000, /* XINTCTL - No interrupts */
0x00000000 /* XCLKCHK - Not used */
};
MCASP_ConfigSrctl mcaspCfgDataSrctl = {
0x0000000d,
0x0000000e,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000
};
MCASP_Config mcaspCfgData = {
&mcaspCfgDataGbl,
&mcaspCfgDataRcv,
&mcaspCfgDataXmt,
&mcaspCfgDataSrctl
};
MCASP_Config mcaspCfgData1;
void InitMcasp(void)
{
//MCASP_Config Settemp;
Uint32 gblctl;
OpenMcasp = MCASP_open(MCASP_DEV0, MCASP_OPEN_RESET);
MCASP_config(OpenMcasp, &mcaspCfgData);
MCASP_getConfig(OpenMcasp,&mcaspCfgData1);
while(1);
}