Hello everyone,
my question can seem pretty simple but I would like someone to confirm the way to clear a CAN mailbox interrupt as I've found confusing information in datasheet and example code.
I am using the eCana in SCC configuration with Mbx [0-9] configured in Rx and the others in Tx.
In the Rx Can Callback, I clear the Mailbox interrupt as following:
EALLOW;
ECanaShadow.CANRMP.all = ECanaRegs.CANRMP.all;
ECanaShadow.CANRMP.all |= bit;
ECanaRegs.CANRMP.all = ECanaShadow.CANRMP.all;
EDIS;
Is it the right way to do ?
The datasheet content which confuse me are below:
2.7 Received-Message-Pending Register (CANRMP)
The bits in the CANRMP and the CANRML registers are cleared by a write to register CANRMP, with a 1 at the corresponding bit location.
So it is reset by writing 1 (‘inverted’ reset).
3.2.4 Receiving a Message
Before the CPU reads the message from the mailbox, it should first clear the RMP bit (RMP.3 = 1).
It seems there is double meaning in the articles 1.5.2 and 3.2.4 (before and after reading).