canfd: xcanfd_intr_example.c File Reference

| canfd Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Functions
xcanfd_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.0   nsk 06/04/15 First release
    1.2   ms  01/23/17 Modified 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.
          ms  04/05/17 Added tabspace for return statements in functions
                       for proper documentation while generating doxygen.
    2.1   ask 07/03/18 Added timeout, and Code to handle Timestamp Counter
                 Overflow Interrupt for CR# 992606, CR# 1004222 and
                 fixed gcc warnings.
                    ask    08/08/18 Changed the Can ID to 11 bit value as standard Can ID
                                                 is 11 bit.
            ask    09/12/18 Added timeout, and Code to handle Timestamp Counter
                                 Overflow Interrupt. Made logic generic for both
                                                 scugic and intc vectors.
    2.1     nsk  03/09/19 Fix build error in example

## Functions
int | main ()
| This function is the main function of the Can interrupt example. More...

## Function Documentation

int main | ( | void |  | ) |

This function is the main function of the Can interrupt example.

Parameters

  None. |

Returns
  - XST_SUCCESS if the example has completed successfully.
  - XST_FAILURE if the example has failed.

Note
  None.