I'm looking to clarify MCAN operation on the SAME70 based on the example code I've reviewed and the CAN section in the datasheet. The datasheet specifies two FIFO buffers which can be used for RX message storage. My questions are as follows:
- Can I configure MCAN0 to store both standard and extended messages in FIFO0 and MCAN1 to store both standard and extended messages in FIFO1?
- If the above isn't possible (the code I've reviewed seems to use one FIFO for standard and the other for extended), given that there are only 2 available FIFOs across two MCAN interfaces, is there a way to determine from which interface the stored message originated? E.g. if FIFO0 is for standard MCAN0/MCAN1 messages (and FIFO1 for extended MCAN0/MCAN1 messages), when I retrieve a given message from the FIFO, am I able to determine whether it's an MCAN0 or MCAN1 message?
I imagine I could keep an index reference array for each of the MCAN0/1 interfaces, so when a new message is received by the MCAN0/1 handler, I assign the index of that particular FIFO message to either the MCAN0 or MCAN1 index array? This would require interrupt handling of every received message, whereas I'd prefer to let a number of messages accumulate and process them in batches (likely using the watermark interrupt) if possible.
EDIT: I realised that the MCAN_RX_FIFO_0_NEW_MESSAGE/MCAN_RX_FIFO_1_NEW_MESSAGE interrupt would cause both the MCAN0_INT0_Handler() and MCAN1_INT0_Handler() handlers to be called, so I don't think the above would work?
Any clarification would be greatly appreciated!