IER和IFR在CCS中的定义.doc

上传人:文库蛋蛋多 文档编号:3900132 上传时间:2023-03-26 格式:DOC 页数:2 大小:14KB
返回 下载 相关 举报
IER和IFR在CCS中的定义.doc_第1页
第1页 / 共2页
IER和IFR在CCS中的定义.doc_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

《IER和IFR在CCS中的定义.doc》由会员分享,可在线阅读,更多相关《IER和IFR在CCS中的定义.doc(2页珍藏版)》请在三一办公上搜索。

1、IER和IFR在CCS中的定义看源程序(TMS320F2812)的时候在main函数中看到这样一段:/ Disable and clear all CPU interrupts:DINT;IER = 0x0000;IFR = 0x0000;就想看看这个IER和IFR的地址,结果找来找去都找不到,只在Device.h中有这样两段:extern cregister volatile unsigned int IFR;extern cregister volatile unsigned int IER;就感觉很奇怪呀,没有地址怎么操作呀?所以上网查了查,才知道答案了。在官方资料中(TMS320C28

2、x Optimizing C/C+ Compiler.pdf)中有这样的说明:The compiler extends the C/C+ language by adding the cregister keyword to allow high level language access to control registers.When you use the cregister keyword on an object, the compiler compares the name of the object to a list of standard control registers

3、 for the C28x (see Table 6-2 ). If the name matches, the compiler generates the code to reference the control register. If the name does not match, the compiler issues an error.Table 6-2. Valid Control Registers-Register Description-IER Interrupt enable registerIFR Interrupt flag registerTo use the

4、control registers in Table 6-2 , you must declare each register as follows. The c28x.h include file defines all the control registers through this syntax:extern cregister volatile unsigned int register ;原来这两个寄存器是可以用关键字cregister定义的寄存器,定义之后就可以直接调用了。你可以先定义一个头文件,专门定义这个变量(实际就是相应的寄存器),然后在相应的c源代码中直接引用这些变量了。PS:貌似在DSP62XX系列中有更多这样的寄存器AMR,IAR,IER,ICR

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 办公文档 > 其他范文


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号