Atmel Xplained Pro Evaluation Kit ATSAM4E-XPRO ATSAM4E-XPRO Data Sheet

Product codes
ATSAM4E-XPRO
Page of 1506
669
SAM4E [DATASHEET]
Atmel-11157D-ATARM-SAM4E16-SAM4E8-Datasheet_12-Jun-14
Figure 33-10. Possible Initialization Procedure
33.8.2 CAN Controller Interrupt Handling
There are two different types of interrupts. One type of interrupt is a message-object related interrupt, the other is
a system interrupt that handles errors or system-related interrupt sources.
All interrupt sources can be masked by writing the corresponding field in the CAN_IDR. They can be unmasked by
writing to the CAN_IER. After a power-up reset, all interrupt sources are disabled (masked). The current mask
status can be checked by reading the CAN_IMR.
The CAN_SR gives all interrupt source states. 
The following events may initiate one of the two interrupts:
Message object interrupt
̶
Data registers in the mailbox object are available to the application. In Receive Mode, a new message 
was received. In Transmit Mode, a message was transmitted successfully. 
̶
A sent transmission was aborted.
System interrupts
̶
Bus off interrupt: The CAN module enters the bus off state.
̶
Error passive interrupt: The CAN module enters Error Passive Mode.
̶
Error Active Mode: The CAN module is neither in Error Passive Mode nor in Bus Off mode.
̶
Warn Limit interrupt: The CAN module is in Error-active Mode, but at least one of its error counter 
value exceeds 96.
̶
Wake-up interrupt: This interrupt is generated after a wake-up and a bus synchronization.
̶
Sleep interrupt: This interrupt is generated after a Low-power Mode enable once all pending 
messages in transmission have been sent.
Errors ?
No
Yes
(ABM == 1 and CANEN == 1)
CANEN = 1 (ABM ==  0)
ABM = 0 and CANEN = 0
(CAN_SR or CAN_MSRx)
Change CAN_BR value
End of Initialization
Configure a Mailbox in Reception Mode
Enable CAN Controller Interrupt Line
Enable CAN Controller Clock
(Interrupt Controller)
(PMC)