CAN Filter ExtID
Hi,
I want to setup the CAN filter but I don't understand how to do so.
I have made lot of test but nothing work fine.
I want to have only message 0x18FF01D0, 0x18FF02D0, 0x18FF03D0, 0x18FF05D0, 0x18FF07D0, 0x18FF0CD0 and a stdID 0x401.
To test to have only message 0x18FF01D0 I have set my filter as:
CAN_FilterTypeDef sFilterConfig;
sFilterConfig.FilterBank = 0;
sFilterConfig.FilterMode = CAN_FILTERMODE_IDMASK;
sFilterConfig.FilterScale = CAN_FILTERSCALE_32BIT;
sFilterConfig.FilterIdHigh = 0x18FF;
sFilterConfig.FilterIdLow = 0x01D0;
sFilterConfig.FilterMaskIdHigh = 0x18FF;
sFilterConfig.FilterMaskIdLow = 0x01D0;
sFilterConfig.FilterFIFOAssignment = 0;
sFilterConfig.FilterActivation = ENABLE;
sFilterConfig.SlaveStartFilterBank = 14;
if (HAL_CAN_ConfigFilter(&hcan1, &sFilterConfig) != HAL_OK)I have set the Id and the mask to the same value because I want to have exactly 0x18FF01D0 value and only this one.
I know the formula:
if ((ID & MASK) == COMP) then AddToFifoBut for ExtId I'm not sure if it works?
Thanks in advence for you help
