AnsweredAssumed Answered

LPC43xx CAN interrupt direction (LPCOpen)

Question asked by quex on May 8, 2017
Latest reply on May 12, 2017 by quex

Hello,

what is the right way to identify whether the active CAN interrupt on LPC43xx is caused by message transmission or reception if I do not want to or can't keep track of which message object is used for tx/rx?

 

In the interrupt routine I call Chip_CCAN_GetIntID (LPC_CCAN_T *pCCAN) that gives me the number of message object which is the source of the interrupt.

 

Then I can read the status register using Chip_CCAN_GetStatus (LPC_CCAN_T *pCCAN) and use the TXOK and RXOK bits to detect if the interrupt was triggered by transmission or direction; however, both of these bits could be 1 at the same time which would prevent the direction identification.

 

The other way I can think of would be using the Chip_CCAN_GetMsgObject function and then reading the DIR bit of the IFx_ARB2 register.

 

Is there any more elegant way? E.g. would it be possible to use the ND1/2 registers?

 

Thanks in advance for any ideas / clarification

Outcomes