User manual

Table Of Contents
Zynq-7000 AP SoC Technical Reference Manual www.xilinx.com 578
UG585 (v1.11) September 27, 2016
Chapter 18: CAN Controller
Example: Read Message from RxFIFO Using Interrupt Method
The can.ISR[RXOK] and/or can.ISR[RXNEMP] bit fields can generate the interrupt.
1. Program RxFIFO watermark level interrupt. Write to can.WIR[FW] to set watermark
can.ISR[RXFWMFLL] interrupt.
2. Proceed to step 3 when an interrupt is received.
3. Wait until a message is received. Read can.ISR[RXOK] or can.ISR[RXFWMFLL].
4. Read message from the RxFIFO. Read all four of the registers (can.RXFIFO_ID, can.RXFIFO_DLC,
can.RXFIFO_DATA1, can.RXFIFO_DATA2).
5. Determine if RxFIFO is not empty. Read can.ISR[RXNEMP].
6. Repeat until the RxFIFO is empty.
7. Clear the interrupt.
18.3.8 Register Overview
The control and status registers are listed in see Table 18-6. Each of these registers is 32-bits wide.
Any read operations to reserved bits or bits that are not used return 0. A 0 should be written to
reserved bits and bit fields not used. Writes to reserved locations are ignored.
Table 18-6: CAN Register Overview
Function
Register Names
(CAN registers, except
where noted)
Overview
Configuration and Control SRR
MSR
BRPR
BTR
ECR
TCR
Enable/disable and reset the controller.
Setup baud rate and timing.
Clear timestamp counter.
Interrupt Processing ISR
IER
ICR
WIR
Enable/disable the interrupt detection,
mark interrupt sent to the interrupt
controller, read raw interrupt status.
Status ECR
ESR
SR
Inform about the status of the controller.
Transmit FIFO TXFIFO_ID
TXFIFO_DLC
TXFIFO_DATA1
TXFIFO_DATA2
Write message to be transmitted.
Transmit High Priority Buffer TXHPB_ID
TXHPB_DLC
TXHPB_DATA1
TXHPB_DATA2
Store one high priority transmit message.