Hello everyone,
Question
I want my CAN to receive every message with ID 0x1000 to 0x1FFF, how can I do it ?
Ugly solution
NB: My CAN(s) can already receive messages with CAN_receive() by calling CAN_rx_object() with the correct ID.
U32 i = 0; for (i = 0x1000; i < 0x1FFF; i++) { CAN_rx_object(CAN_CTRL, CAN_CH, i, DATA_TYPE | EXTENDED_TYPE); } /* ... */
Is there something more elegant to do so ?
Best regards,
Vincent
-- Apendix Device: LM3Sxxxx (LM3S9B96) CAN : Basic CAN
To begin, thanks a lot for your replies ! It helped me a lot to find the solution.
Are you sure that, the CAN controller of LM3S9B96 is Basic CAN?
You are right, LM3S9B96 is a Full CAN with receive FIFO.
You should be able to configure one message object to only receive ID 0x1000 to 0x1FFF. However, it seems RL-CAN can not do this for you.
I had to go under RL-CAN, precisely in the file CAN_LM3Sxxxx.c, function:
CAN_ERROR CAN_hw_rx_object (U32 ctrl, U32 ch, U32 id, U32 object_para)
As CAN is provided at source level you can easily extend functionality to be able to use mask instead of single IDs.
For this kind of device family, it was mainly about setting mask value. Imagine mask as a 29 bit value where a '1' means keep the value and '0' is "I don't care". exemple I want my CAN to receive every message with ID 0x1000 to 0x1FFF
U32 msk = 0x00001000