uartpsv: xuartpsv_polled_example.c File Reference

| uartpsv Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List

Functions
xuartpsv_polled_example.c File Reference

## Overview

This file contains a design example using the XUartPsv driver in polled mode.

It sends data and expects to receive the same data through the device using the local loopback mode.

Note
  If the device does not work properly, the example may hang.

MODIFICATION HISTORY:

    Ver   Who   Date     Changes

    1.0   sd    05/23/19 First Release

## Functions
int | UartPsvPolledExample (u16 DeviceId)
| This function does a minimal test on the UartPsv device and driver as a design example. More...
int | main (void)
| Main function to call the Uart Polled mode example. More...

## Function Documentation

int main | ( | void |  | ) |

Main function to call the Uart Polled mode example.

Parameters

  None |

Returns
  XST_SUCCESS if successful, XST_FAILURE if unsuccessful

Note
  None

References UartPsvPolledExample().

int UartPsvPolledExample | ( | u16 | DeviceId | ) |

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

The purpose of this function is to illustrate how to use the XUartPsv driver.

This function does a minimal test on the XUartPs device in polled mode. This function sends data and expects to receive the same data through the device using the local loopback mode.

Parameters

  DeviceId | is the device Id of the UART device and is typically XPAR_<UartPsv_instance>_DEVICE_ID value from xparameters.h.

Returns
  XST_SUCCESS if successful, otherwise XST_FAILURE.

Note
  This function polls the UART, it may hang if the hardware is not working correctly.

References XUartPsv_Config::BaseAddress, XUartPsv::Config, XUartPsv_CfgInitialize(), XUartPsv_IsTransmitbusy, XUartPsv_LookupConfig(), XUARTPSV_OPER_MODE_LOCAL_LOOP, XUARTPSV_OPER_MODE_NORMAL, XUartPsv_Recv(), XUartPsv_Send(), and XUartPsv_SetOperMode().

Referenced by main().