GR740-UM-DS, Nov 2017, Version 1.7
279
www.cobham.com/gaisler
GR740
A message ID is matched when:
((Received-ID XOR CanRxCODE.AC) AND CanRxMASS.AM) = 0
17.9.20 Interrupt registers
The interrupt registers allow for various transmission and reception strategies, by providing means to
mask interrupts, clear interrupts, force interrupts and read interrupt status.
When an interrupt occurs the corresponding bit in the Pending Interrupt Register is set. The normal
sequence to initialize and handle a module interrupt is:
•
Set up the software interrupt-handler to accept an interrupt from the module.
•
Read the Pending Interrupt Register to clear any spurious interrupts.
•
Initialize the Interrupt Mask Register, unmasking each bit that should generate the module inter-
rupt.
•
When an interrupt occurs, read the Pending Interrupt Status Register in the software interrupt-
handler to determine the causes of the interrupt.
•
Handle the interrupt, taking into account all causes of the interrupt.
•
Clear the handled interrupt using Pending Interrupt Clear Register.
Masking interrupts: After reset, all interrupt bits are masked, since the Interrupt Mask Register is zero.
To enable generation of a module interrupt for an interrupt bit, set the corresponding bit in the Inter-
rupt Mask Register.
Clearing interrupts: All bits of the Pending Interrupt Register are cleared when it is read or when the
Pending Interrupt Masked Register is read. Reading the Pending Interrupt Masked Register yields the
contents of the Pending Interrupt Register masked with the contents of the Interrupt Mask Register.
Selected bits can be cleared by writing ones to the bits that shall be cleared to the Pending Interrupt
Clear Register.
Forcing interrupts: When the Pending Interrupt Register is written, the resulting value is the original
contents of the register logically OR-ed with the write data. This means that writing the register can
force (set) an interrupt bit, but never clear it.
Reading interrupt status: Reading the Pending Interrupt Status Register yields the same data as a read
of the Pending Interrupt Register, but without clearing the contents.
Reading interrupt status of unmasked bits: Reading the Pending Interrupt Masked Status Register
yields the contents of the Pending Interrupt Register masked with the contents of the Interrupt Mask
Register, but without clearing the contents.
The interrupt registers comprise the following:
•
Pending Interrupt Masked Status Register[CanPIMSR]R
•
Pending Interrupt Masked Register[CanPIMR]R
•
Pending Interrupt Status Register[CanPISR]R
•
Pending Interrupt Register[CanPIR]R/W
•
Interrupt Mask Register[CanIMR]R/W
•
Pending Interrupt Clear Register[CanPICR]W
Table 359.
Interrupt Registers
31
17 16 15 14 13 12 11 10
9
8
7
6
5
4
3
2
1
0
TxL
oss
Rx
Mis
s
Tx
Err
Cnt
r
Rx
Err
Cnt
r
Tx
Sy
nc
Rx
Sy
nc
Tx Rx Tx
Em
pty
Rx
Full
Tx
IR
Q
Rx
IR
Q
Tx
AH
B
Err
Rx
AH
B
Err
OR Off Pa
ss