基于dsPIC33FJ128MC506的CAN通信(07-100)
——
fltEnRegAddr = (unsigned int *)(&C1FEN1);
本文引用地址:http://www.amcfsurvey.com/article/92042.htm/* 将ID按规定分配到相关的寄存器中*/
if(exide==1) { //扩展帧的ID
eid15_0 = (identifier & 0xFFFF);
eid17_16= (identifier>>16) & 0x3;
sid10_0 = (identifier>>18) & 0x7FF;
*sidRegAddr=(sid10_0)<<5 + 0x8 + eid17_16;
*(sidRegAddr+2)= eid15_0;
}else{ //标准帧的ID
sid10_0 = (identifier & 0x7FF);
*sidRegAddr=(sid10_0)<<5;
*(sidRegAddr+2)=0;
}
*bufPntRegAddr = (bufPnt << (4*(n&3))); // 写缓冲指针寄存器CiBUFPNTn内容*maskSelRegAddr = (maskSel << (2*(n&7))); // 确定关连屏蔽寄存器
CiFMSKSELn *fltEnRegAddr = (0x1 << n); //使能第n个滤波器
C1CTRL1bits.WIN=0; //恢复寄存器地址选择位
}
/*
评论