uartns550: xuartns550_polled_example.c File Reference

| uartns550 Xilinx SDK Drivers API Documentation

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

Functions
xuartns550_polled_example.c File Reference

## Overview

This file contains a design example using the Uart 16450/550 driver (XUartNs550) and hardware device using polled mode.

MODIFICATION HISTORY:

    Ver   Who  Date     Changes

    1.00a jhl  02/13/02 First release
    1.00b ecm  01/25/05 Modified for TestApp integration, updated boilerplate.
    1.00b sv   06/08/05 Minor changes to comply to Doxygen and coding guidelines
    2.00a ktn  10/20/09 Updated to use HAL processor APIs and minor modifications
                  as per coding guidelines.
                  Updated this example to wait for valid data in receive
                  fifo instead of Tx fifo empty to update receive buffer
    3.4   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.

## Functions
int | UartNs550PolledExample (u16 DeviceId)
| This function does a minimal test on the UART 16450/550 device and driver as a design example. More...
int | main (void)
| Main function to call the example. More...

## Function Documentation

int main | ( | void |  | ) |

Main function to call the example.

This function is not included if the example is generated from the TestAppGen test tool.

Parameters

  None. |

Returns
  XST_SUCCESS if successful, otherwise XST_FAILURE.

Note
  None.

References UartNs550PolledExample().

int UartNs550PolledExample | ( | u16 | DeviceId | ) |

This function does a minimal test on the UART 16450/550 device and driver as a design example.

The purpose of this function is to illustrate how to use the XUartNs550 component.

This function sends data and expects to receive the data through the UART using the local loopback mode of the UART hardware.

This function polls the UART and does not require the use of interrupts.

Parameters

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

Returns
  XST_SUCCESS if successful, XST_FAILURE if unsuccessful.

Note
  This function polls the UART such that it may be not return if the hardware is not working correctly.

References XUartNs550_GetOptions(), XUartNs550_Initialize(), XUartNs550_Recv(), XUartNs550_SelfTest(), XUartNs550_Send(), XUartNs550_SetOptions(), XUN_OPTION_FIFOS_ENABLE, and XUN_OPTION_LOOPBACK.

Referenced by main().