有木有大神指导下~
我想滤标准CAN ID为 0x079B 的数据(一帧数据,多字节)
这是我的滤波器设置:
CAN_FilterInitTypeDef CAN_FilterInitStructure;
u16 maskValue = 0x7FF;
CAN_FilterInitStructure.CAN_FilterNumber = 1;
CAN_FilterInitStructure.CAN_FilterMode = CAN_FilterMode_IdMask;
CAN_FilterInitStructure.CAN_FilterScale = CAN_FilterScale_16bit;
CAN_FilterInitStructure.CAN_FilterIdHigh = id1 << 5;
CAN_FilterInitStructure.CAN_FilterIdLow = id2 << 5;
CAN_FilterInitStructure.CAN_FilterMaskIdHigh = maskValue << 5;
CAN_FilterInitStructure.CAN_FilterMaskIdLow = maskValue << 5;
CAN_FilterInitStructure.CAN_FilterFIFOAssignment = CAN_FIFO0;
CAN_FilterInitStructure.CAN_FilterActivation = ENABLE;
请问,为什么我没有滤到?是不是我的设置有问题?还是我需要在设置别的STM32库函数?
CAN_FilterInit( &CAN_FilterInitStructure ); |