请问你们ST FAE 关于CAN的:
我只想接收一个标准ID =0x12;其它什么样的ID都不接收,请问我的设置对么?我试了很久也未发现能够正常工作,屏蔽模式能够正常收发。
CAN_FilterInitStructure.CAN_FilterNumber = 0;
CAN_FilterInitStructure.CAN_FilterMode = CAN_FilterMode_IdList;
CAN_FilterInitStructure.CAN_FilterScale = CAN_FilterScale_32bit;
CAN_FilterInitStructure.CAN_FilterIdHigh=0x0240;
CAN_FilterInitStructure.CAN_FilterIdLow =0x0000;
CAN_FilterInitStructure.CAN_FilterMaskIdHigh = 0xffff;
CAN_FilterInitStructure.CAN_FilterMaskIdLow = 0xffff;
CAN_FilterInitStructure.CAN_FilterFIFOAssignment = CAN_FIFO0;
CAN_FilterInitStructure.CAN_FilterActivation = ENABLE;
CAN_FilterInit(&CAN_FilterInitStructure);
请高手指导! |
|