|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
本帖最后由 cjsb37 于 2013-4-29 09:00 编辑
我按照参考书上的示例程序编写自己的初始化程序:void init_board(void)
{
*(volatile unsigned int *)CLKMD=0x0000;
while(*(volatile unsigned int *)CLKMD & 0x0001){};
*(volatile unsigned int *)CLKMD=CLKMD_VAL;
*(volatile unsigned int *)PMST=PMST_VAL;
*(volatile unsigned int *)SWWSR=SWWSR_VAL;
*(volatile unsigned int *)SWCR=SWCR_VAL;
*(volatile unsigned int *)BSCR=BSCR_VAL;
*(volatile unsigned int *)ST1=ST1_VAL;
//设置CPU寄存器
*(volatile unsigned int *)SPSA0=SPCR10;
//以下初始化MCBSP0
*(volatile unsigned int *)SPSD0=SPCR10_VAL;
*(volatile unsigned int *)SPSA0=SPCR20;
*(volatile unsigned int *)SPSD0=SPCR20_VAL;
*(volatile unsigned int *)SPSA0=RCR10;
*(volatile unsigned int *)SPSD0=RCR10_VAL;
*(volatile unsigned int *)SPSA0=RCR20;
*(volatile unsigned int *)SPSD0=RCR20_VAL;
*(volatile unsigned int *)SPSA0=XCR10;
*(volatile unsigned int *)SPSD0=XCR10_VAL;
*(volatile unsigned int *)SPSA0=XCR20;
*(volatile unsigned int *)SPSD0=XCR20_VAL;
*(volatile unsigned int *)SPSA0=SRGR10;
*(volatile unsigned int *)SPSD0=SRGR10_VAL;
*(volatile unsigned int *)SPSA0=SRGR20;
*(volatile unsigned int *)SPSD0=SRGR20_VAL;
*(volatile unsigned int *)SPSA0=PCR0;
*(volatile unsigned int *)SPSD0=PCR0_VAL;
}
结果每一行都报错:
"initialize.h", line 5: error: expected an expression
"initialize.h", line 6: error: expected a ")"
"initialize.h", line 7: error: expected an expression
"initialize.h", line 8: error: expected an expression
"initialize.h", line 9: error: expected an expression
"initialize.h", line 10: error: expected an expression
"initialize.h", line 11: error: expected an expression
"initialize.h", line 12: error: expected an expression
"initialize.h", line 13: error: expected an expression
"initialize.h", line 14: error: expected an expression
"initialize.h", line 15: error: expected an expression
"initialize.h", line 16: error: expected an expression
"initialize.h", line 17: error: expected an expression
"initialize.h", line 18: error: expected an expression
"initialize.h", line 19: error: expected an expression
"initialize.h", line 20: error: expected an expression
"initialize.h", line 21: error: expected an expression
"initialize.h", line 22: error: expected an expression
"initialize.h", line 23: error: expected an expression
"initialize.h", line 24: error: expected an expression
"initialize.h", line 25: error: expected an expression
"initialize.h", line 26: error: expected an expression
"initialize.h", line 27: error: expected an expression
"initialize.h", line 28: error: expected an expression
"initialize.h", line 29: error: expected an expression
"initialize.h", line 30: error: expected an expression
26 errors detected in the compilation of "control.c".
寄存器名是在另一个头文件中定义的,如:
#define ST1 0x0007;//Status register 0
#define ST0 0x0006;//Status register 1
#define PMST 0x001d;//Processor mode status (PMST) register
#define SWWSR 0x0028;//Software Wait-State Register
#define SWCR 0x002b;//Software Wait-State Control Register
#define BSCR 0x0029;//Bank-Switching Control Register
#define CLKMD 0x0058;//Clock Mode Register (CLKMD)
请高手解答 我用的是CCS 2.21
|
|