uartps
Xilinx SDK Drivers API Documentation
xuartps_polled_example.c File Reference

Overview

This file contains an example using the XUartPs driver in polled mode.

This function sends data and expects to receive the data thru 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.00a drg/jz 01/13/10 First Release 1.03a sg 07/16/12 Modified the device ID to use the first Device Id Removed the printf at the start of the main

Functions

int UartPsPolledExample (u16 DeviceId)
 This function does a minimal test on the XUartPs device in polled mode. More...
 
int main (void)
 Main function to call the Uart Polled mode example. More...
 

Function Documentation

◆ main()

int main ( void  )

Main function to call the Uart Polled mode example.

Parameters
None
Returns
XST_SUCCESS if succesful, otherwise XST_FAILURE
Note
None

References UartPsPolledExample().

◆ UartPsPolledExample()

int UartPsPolledExample ( u16  DeviceId)

This function does a minimal test on the XUartPs device in polled mode.

This function sends data and expects to receive the data thru the UART using the local loopback mode.

Parameters
DeviceIdis the unique device id from hardware build.
Returns
XST_SUCCESS if successful, XST_FAILURE if unsuccessful
Note
This function polls the UART, it may hang if the hardware is not working correctly.

References XUartPs_Config::BaseAddress, XUartPs_CfgInitialize(), XUartPs_LookupConfig(), XUARTPS_OPER_MODE_LOCAL_LOOP, XUartPs_SelfTest(), and XUartPs_SetOperMode().

Referenced by main().