早教吧 育儿知识 作业答案 考试题库 百科 知识分享

C6000CSLfunctionsPERFMK如何理解?PERFMK(REG,FIELD,fieldval)CreatesashiftedversionoffieldvalthatyoucouldORwiththeresultofotherFMKmacrostoinitializeregisterREG.ThisallowstheusertoinitializefewfieldsinREGasanalter

题目详情
C6000 CSL functions PER_FMK如何理解?
PER_FMK (REG,FIELD,fieldval)Creates a shifted version of fieldval that you could OR with the result of other_FMK macros to initialize register REG.This allows the user to initialize few fieldsin REG as an alternative to the _RMK macro,which requires that ALL registerfields be initialized.PER_FMKS (REG,FIELD,sym)Creates a shifted version of the symbol value that you can OR with the result ofother _FMK/_FMKS macros to initialize register REG.(See also PER_FMK()macro.)
▼优质解答
答案和解析
对外设寄存器进行位运算的一个函数.主要是规范位运算操作.因为涉及外设寄存器,如果碰到诸如大小端,16位值赋值给32位值等问题,错误会很隐蔽,查起来也很麻烦.所以让你规范的使用这个函数,就大大降低这种误操作的风险.具体你可以看看ti给的利用CSL对寄存器赋值的例程.一看就应该懂怎么用了.我看的是对timer寄存器赋值的例子. 查看原帖>>