
AIV-QM97V1FL Series User Manual
63
Parameters:
This function takes a pointer to a variable of type ‘CanFilter’
as the parameter. Users set up the ‘filterId’. There are six
filters so the ‘filterId’ could be 0 ~ 5. Filter0 and filter1 are
associated with mask0. Filter2 ~ filter5 are associated with
mask1.
By setting up ‘filterType’, users indicate the type of the
filter. Filter type could be ‘STD_ID’ or ‘EXT_ID’.
Depending on the filter type, the ‘filter’ field in the CanFilter
variable could be 0x0 ~ 0x7FF (11 bits) when filter type is
‘STD_ID’. If the filter type is ‘EXT_ID’, the ‘filter’ field in the
CanFilter variable could be 0x0 ~ 0x1FFFFFFF (29 bits).
For example:
struct CanFilter varFilter;
i32 result;
varFilter.filterId = 3;
varFilter.filterType = STD_ID;
varFilter.filter = 0x555;
result = setCanFilter(&varFilter);
if(result != 0)
printf(“Fail to set up the filter!\n”);
Return Value:
If this function sets the filter successfully, it returns 0, any
other returned value stands for error.