各位大师,我发现电机控制库关于IDDK实现FCL的官方例程中好像__meallow();函数缺失,我把鼠标放在这个函数的地方然后按住F3键,CCS软件弹出Could not find symbol'_meallow' in index.那么问题来了,例程又是如何实现他的功能的呢,会不会是这个__meallow()函数已经是内置到芯片里面,然后这个函数直接调用的呢,还是其他什么原因呢?
else if(lsw == ENC_WAIT_FOR_INDEX) //ENC_WAIT_FOR_INDEX = 1 ENC等待索引状态
{
//
// lsw = ENC_WAIT_FOR_INDEX —> Waiting for QEP index as rotor spins
// Detect the offset angle between alpha axis and QEP index location
// If QEP index pulse is found :-
// POSILAT captures POSCNT at the first INDEX pulse.
// Load POSINIT with POSILAT, so that at every future INDEX event,
// POSCNT is loaded (reset) with POSINIT
//
__meallow();
//
// Check the index occurrence
//
if(ClaQep.ptr->QFLG.all & CLA_QEP_FLAG_IEL_EVENT) // QFLG.bit.IEL
{
__mdebugstop();
//
// QPOSILAT updates on Index edge(IEL) – capture it into QPOSINIT
//
ClaQep.ptr->QPOSINIT = ClaQep.ptr->QPOSILAT;
//
// make QPOSCNT = QPOSINIT on future Index edge(s)
// ClaQep.ptr->QEPCTL.bit.IEI = IEI_RISING;
//
ClaQep.ptr->QEPCTL.all |= IEI_RISING;
//
// if QEP index pulse is found, change lsw to 'ENC_CALIBRATION_DONE'
//
lsw = ENC_CALIBRATION_DONE;
}
Annie Liu:
_meallow() 是一条 CLA 指令,允许对某些受保护的寄存器(例如 EPWM / QEP 或任何其他外设)进行写访问。 您可以在 TRM 中找到此信息。
,
Annie Liu:
您还可以在编译器用户指南 (https://www.ti.com/lit/ug/spru514w/spru514w.pdf )的第 10 章(CLA 编译器章节)中找到更多信息。有一个表格列出了可用于 CLA 编译器的所有内在函数,包括 __meallow。
TI中文支持网





