uartlite
Vitis Drivers API Documentation
xuartlite_polled_example.c File Reference

Overview

This file contains a design example using the UartLite driver (XUartLite) and hardware device using the polled mode.

Note

The user must provide a physical loopback such that data which is transmitted will be received.

MODIFICATION HISTORY:

Ver   Who  Date  Changes


1.00a jhl 02/13/02 First release 1.00a sv 06/13/05 Minor changes to comply to Doxygen and coding guidelines 2.00a ktn 10/20/09 Updated this example to wait for valid data in receive fifo instead of Tx fifo empty to update receive buffer and minor changes as per coding guidelines. 3.2 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. 3.9 gm 07/08/23 Added SDT support

Functions

int UartLitePolledExample (u16 DeviceId)
 This function does a minimal test on the UartLite device and driver as a design example. More...
 
int main (void)
 Main function to call the Uartlite polled example. More...
 

Function Documentation

int main ( void  )

Main function to call the Uartlite polled example.

Returns
XST_SUCCESS if successful, otherwise XST_FAILURE.
Note
None.

References UartLitePolledExample().

int UartLitePolledExample ( u16  DeviceId)

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

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

This function sends data and expects to receive the data through the UartLite such that a physical loopback must be done with the transmit and receive signals of the UartLite.

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

Parameters
DeviceIdis the Device ID of the UartLite and is the XPAR_<uartlite_instance>_DEVICE_ID value from xparameters.h.
Returns
XST_SUCCESS if successful, XST_FAILURE if unsuccessful.
Note

This function calls the UartLite driver functions in a blocking mode such that if the transmit data does not loopback to the receive, this function may not return.

References XUartLite_Initialize(), XUartLite_Recv(), XUartLite_SelfTest(), and XUartLite_Send().

Referenced by main().