Configure Filter Element Size (total
number), Rx Buffer size and Rx FIFO size as well as the Element Size for both Buffer and
FIFO. Element Size can be configured based on the estimated data size per frame. These
steps are completed as part of the Message RAM configuration. Configure Filter Elements
which includes setting the Message IDs / filtering conditions desired, along with
configuring where the matching frame for each corresponding Filter Element is stored
(among Rx Buffer and Rx FIFO 0/1).
For each received frame, the module
checks against filter elements (standard or extended, depending on the received frame)
in ascending order. On getting the first match, the frame is stored as configured into
the filter element. Non-matching frames can also be configured to be stored in Rx FIFO
0/1.
Either by polling or using interrupts,
ascertain the reception of new data. For polling, there is a bit corresponding to each
possible Rx Buffer Element in the registers MCAN_NDAT1 and MCAN_NDAT2.
Consequently, for a new message in Rx FIFO, the MCAN_RXFxS.FxFL bits can be
checked to get the fill level. For using Interrupts, the procedure has been outlined
in the corresponding section.
Use Driverlib APIs to read the data from the received frame.