我在SPC560P上测试CAN过滤功能,但我不清楚CAN Mask如何工作。
配置如下:
Rx ID = 0,Rx Individual Mask = 0xFFFFFF8; BCC = 1;从我的理解,然后CAN节点可以从0到7接收ID,但不能,只能仍然可以接收ID = 0;停下来
检查BUF00 Rx标志;
但是,当我设置Rx Individual Mask = 0时;可以接收所有CAN ID(在BUF00 Rx标志处停止检查);
那么,CAN ID掩码如何工作?
-----------------
CAN_0.RXIMR [0] .R = 0xFFFFFFF8; / * Rx个人面具* /
CAN_0.BUF [0] .ID.B.STD_ID = 0x0; / * Rx ID = 0 * /
/ *检查ID接收* /
if(1 == CAN_0.IFRL.B.BUF00I){
CAN_0.IFRL.B.BUF00I = 1;
// rx完成了
}
以上来自于谷歌翻译
以下为原文
I am tes
ting CAN filtering Function on SPC560P,But am not clear about how CAN Mask working.
Configure as following:
Rx ID =0, Rx Individual Mask = 0xFFFFFF8; BCC = 1; From my understanding, then the CAN Node can Receive ID from 0 to 7, but cannot , only still can receive ID = 0; stop at
BUF00 Rx Flag checked;
But , when I set Rx Individual Mask = 0; all CAN ID can be received (stop at BUF00 Rx Flag checked);
So, How the CAN ID Mask Working?
-----------------
CAN_0.RXIMR[0].R = 0xFFFFFFF8; /*Rx Individual Mask*/
CAN_0.BUF[0].ID.B.STD_ID = 0x0; /*Rx ID = 0*/
/*Check ID Receive*/
if(1== CAN_0.IFRL.B.BUF00I){
CAN_0.IFRL.B.BUF00I = 1;
// rx completed
}