canps: xcanps_polled_example.c File Reference

| canps Xilinx SDK Drivers API Documentation

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

Functions
xcanps_polled_example.c File Reference

## Overview

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

This example shows the using the driver/device in polled mode.

Note

None.

    MODIFICATION HISTORY:

    Ver   Who    Date       Changes

    1.00a xd/sv  01/12/10 First release
    2.1 adk                 23/08/14 Fixed CR:798792 Peripheral test for CANPS IP in
                                             SDK claims a 40kbps baud rate but it's not.

## Functions
int | CanPsPolledExample (u16 DeviceId)
| The entry point for showing the XCanPs driver in polled mode. More...
int | main ()
| This function is the main function of the Can polled example. More...

## Function Documentation

int CanPsPolledExample | ( | u16 | DeviceId | ) |

The entry point for showing the XCanPs driver in polled mode.

The example configures the device for internal loop back mode, then sends a Can frame, receives the same Can frame, and verifies the frame contents.

Parameters

  DeviceId | is the XPAR_<CANPS_instance>_DEVICE_ID value from xparameters.h

Returns
  XST_SUCCESS if successful, otherwise driver-specific error code.

Note

If the device is not working correctly, this function may enter an infinite loop and will never return to the caller.

References XCanPs_Config::BaseAddr, XCanPs_EnterMode(), XCanPs_GetMode(), XCanPs_LookupConfig(), XCANPS_MODE_CONFIG, XCANPS_MODE_LOOPBACK, XCanPs_SelfTest(), XCanPs_SetBaudRatePrescaler(), and XCanPs_SetBitTiming().

Referenced by main().

int main | ( |  | ) |

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

Parameters

  None |

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

Note
  None

References CanPsPolledExample().