#define CAN_FILTER_EXTID_H(EXTID) ((EXTID<<3)>>16)&0xffff
#define CAN_FILTER_EXTID_L(EXTID) ((EXTID)<<3)&0xffff | CAN_ID_EXT
#define CAN_STD_ID_H_MASK_DONT_CARE 0x0000
#define CAN_STD_ID_L_MASK_DONT_CARE 0x0000
void CAN_Filter_Init(void)
{
CAN_FilterInitType CAN_FilterInitStructure;
CAN_FilterInitStructure.Filter_Num = CAN_FILTERNUM0;
CAN_FilterInitStructure.Filter_Mode = CAN_Filter_IdListMode;
CAN_FilterInitStructure.Filter_Scale = CAN_Filter_32bitScale;
CAN_FilterInitStructure.Filter_HighId = CAN_FILTER_EXTID_H(0x18FF0320);
CAN_FilterInitStructure.Filter_LowId = CAN_FILTER_EXTID_L(0x18FF0320);
CAN_FilterInitStructure.FilterMask_HighId = CAN_STD_ID_H_MASK_DONT_CARE;
CAN_FilterInitStructure.FilterMask_LowId = CAN_STD_ID_L_MASK_DONT_CARE;
CAN_FilterInitStructure.Filter_FIFOAssignment = CAN_FIFO0;
CAN_FilterInitStructure.Filter_Act = ENABLE;
CAN1_InitFilter(&CAN_FilterInitStructure);
}