| prd Vitis Drivers API Documentation

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

Macros | Functions
xprd_example.c File Reference

## Overview

This file contains an example using the XPrd driver to test the registers on the device.

Note
  None

MODIFICATION HISTORY:

    Ver      Who   Date           Changes

    1.0   ms    07/14/2016     First Release
          ms    04/05/2017     Modified comment lines notation in functions to
                               avoid unnecessary description displayed
                               while generating doxygen.
    2.2   Nava  06/22/2023     Added support for system device-tree flow.

## Macros
#define | XPRD_DEVICE_ID XPAR_PR_DECOUPLER_0_DEVICE_ID
| The following constants map to the XPAR parameters created in the xparameters.h file. More...

## Functions
u32 | XPrd_Example (u16 DeviceId)
| This function does a minimal test on the PR Decoupler device and driver as a design example. More...
u32 | XPrd_TestDecouplerState (XGpio DecouplerGpio)
| This function is used to test the SetDecouplerState and GetDecouplerState. More...
int | main (void)
| This is the main function to call the example. More...

## Macro Definition Documentation

#define XPRD_DEVICE_ID XPAR_PR_DECOUPLER_0_DEVICE_ID

The following constants map to the XPAR parameters created in the xparameters.h file.

They are defined here such that a user can easily change all the needed parameters in one place.

Referenced by main().

## Function Documentation

int main | ( | void |  | ) |

This is the main function to call the example.

Parameters

  None. |

Returns
  - XST_SUCCESS if successful.
  - XST_FAILURE if failed.

Note
  None.

References XPRD_DEVICE_ID, and XPrd_Example().

u32 XPrd_Example | ( | u16 | DeviceId | ) |

This function does a minimal test on the PR Decoupler device and driver as a design example.

Parameters

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

Returns
  - XST_SUCCESS if successful
  - XST_FAILURE if failed

Note
  None.

References XPrd_CfgInitialize(), XPrd_LookupConfig(), XPrd_SelfTest(), and XPrd_TestDecouplerState().

Referenced by main().

u32 XPrd_TestDecouplerState | ( | XGpio | DecouplerGpio | ) |

This function is used to test the SetDecouplerState and GetDecouplerState.

Parameters

  DecouplerGpio | is the Instance of the GPIO that's connected to the USR_ACCESS primitive.

Returns
  - XST_SUCCESS if successful
  - XST_FAILURE if failed

Note
  None.

References XPrd_GetDecouplerState(), and XPrd_SetDecouplerState().

Referenced by XPrd_Example().