can
Vitis Drivers API Documentation
xcan_intr_example.c File Reference

Overview

Contains an example of how to use the XCan driver directly.

The example here shows using the driver/device in interrupt mode.

Note

This code assumes that Xilinx interrupt controller (XIntc) is used in the system to forward the CAN device interrupt output to the processor and no operating system is being used.

The Baud Rate Prescaler Register (BRPR) and Bit Timing Register (BTR) are setup such that CAN baud rate equals 40Kbps, assuming that the the CAN clock is 24MHz. The user needs to modify these values based on the desired baud rate and the CAN clock frequency. For more information see the CAN 2.0A, CAN 2.0B, ISO 11898-1 specifications.

MODIFICATION HISTORY:
Ver   Who       Date     Changes


1.00a xd/sv 01/12/09 First release 2.00a ktn 10/22/09 Updated to use the HAL APIs/macros. The macros have been renamed to remove _m from the name. 2.00a bss 01/11/11 Updated the example to be used with the SCUGIC in Zynq. 2.00a bss 01/16/12 Updated the example to fix CR 694533, replaced INTC_DEVID with INTC_DEVICE_ID. 3.2 ms 01/23/17 Added xil_printf statement in main function to ensure that "Successfully ran" and "Failed" strings are available in all examples. This is a fix for CR-965028. 3.3 ask 08/01/18 Fixed Cppcheck and GCC warnings in can driver 3.7 ht 07/04/23 Added support for system device-tree flow.

Functions

int main (void)
 This function is the main function of the Can interrupt example. More...
 

Function Documentation