麻烦老师们解释一下下面这段程序:void F281X_EV1_QEP_NO_INDEX_Calc(QEP *p){int32 Tmp;// Check the rotational directionp->DirectionQep = 0x4000&EvaRegs.GPTCONA.all;p->DirectionQep = p->DirectionQep>>14;// Check the timer 2 counter for QE

来源:学生作业帮助网 编辑:作业帮 时间:2024/07/19 00:39:59
麻烦老师们解释一下下面这段程序:void F281X_EV1_QEP_NO_INDEX_Calc(QEP *p){int32 Tmp;// Check the rotational directionp->DirectionQep = 0x4000&EvaRegs.GPTCONA.all;p->DirectionQep = p->DirectionQep>>14;// Check the timer 2 counter for QE
xSQOP+ˠhČ`Qޚ2*kZ Jɦ&A& J= ?v<znLgs=?[v"95vN_. E~fV"->)O8ă7Q!vRn'cBTT2>=+P9-0J`d%UC4d5/*0.R^k=NI eٮش8,MLJCy}!$Q:b1|YlA_/V]ɗtt2<%]aQ:+"⹣h"BRsڔ!QɊy9r"w!sL(86v`<!; ؔ  .%Cwn:zԶ.xVE De6kw$)YK_"%EY{';P#S>zFdgp$0=u){eX'fU{0m5K 4. *0kbƏ=s,qz+FAUdU07͍u,|_R-xAK Lɪ{OݷC+}f>*"0f<@[XMv`T Q$ _>'/n쳃;)9XoZi'Mn3yގ

麻烦老师们解释一下下面这段程序:void F281X_EV1_QEP_NO_INDEX_Calc(QEP *p){int32 Tmp;// Check the rotational directionp->DirectionQep = 0x4000&EvaRegs.GPTCONA.all;p->DirectionQep = p->DirectionQep>>14;// Check the timer 2 counter for QE
麻烦老师们解释一下下面这段程序:
void F281X_EV1_QEP_NO_INDEX_Calc(QEP *p)
{
int32 Tmp;
// Check the rotational direction
p->DirectionQep = 0x4000&EvaRegs.GPTCONA.all;
p->DirectionQep = p->DirectionQep>>14;
// Check the timer 2 counter for QEP
p->RawTheta = EvaRegs.T2CNT;
// Compute the mechanical angle in Q15
Tmp = __qmpy32by16(p->MechScaler,p->RawTheta,31); // Q15 = Q30*Q0
p->MechTheta = (int16)(Tmp); // Q15 -> Q15
p->MechTheta &= 0x7FFF; // Wrap around 0x07FFF
// Compute the electrical angle in Q15
p->ElecTheta = p->PolePairs*p->MechTheta; // Q0*Q15 = Q15
p->ElecTheta &= 0x7FFF;
}
本人刚学DSP,求解释光电编码器QEP程序,

麻烦老师们解释一下下面这段程序:void F281X_EV1_QEP_NO_INDEX_Calc(QEP *p){int32 Tmp;// Check the rotational directionp->DirectionQep = 0x4000&EvaRegs.GPTCONA.all;p->DirectionQep = p->DirectionQep>>14;// Check the timer 2 counter for QE
(QEP无效F281X_EV1_QEP_NO_INDEX_Calc * p)
{
int32 Tmp;
/ /支票的旋转方向
p - > DirectionQep = 0x4000&EvaRegs.GPTCONA.all;
DirectionQep p - > > > = p - > DirectionQep 14;
/ /检查柜台办理QEP定时器2
p - > RawTheta = EvaRegs.T2CNT;
/ /计算力学角度在Q15
__qmpy32by16 Tmp = >(p - p - >,RawTheta MechScaler、31);/ / Q15 Q0 = Q30 *
MechTheta p - > =(int16)(Tmp);/ / Q15 Q15 - >
p - > MechTheta & = 0x7FFF 0x07FFF;/ /包裹
/ /计算电子角度在Q15
ElecTheta p - > > = p - p - > MechTheta PolePairs * * Q15;/ / Q0 = Q15
p - > ElecTheta & = 0x7FFF;