uartps
Vitis Drivers API Documentation
 All Data Structures Files Functions Variables Typedefs Groups Pages
xuartps_polled_example.c File Reference

Overview

This example runs on zynqmp evaluation board (zcu102), it sends data and expects to receive the same data through the device using the local loopback mode in polled mode by using XUartPs driver.

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 3.18 vlt 12/18/25 Update Doxygen comments to include SDT flow details.

#include "xparameters.h"
#include "xuartps.h"
#include "xil_printf.h"

Functions

int UartPsPolledExample (XUartPs *UartInstPtr, UINTPTR BaseAddress)
 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

int main ( void  )

Main function to call the Uart Polled mode example.

Returns
XST_SUCCESS if successful, otherwise XST_FAILURE
Note
None

References UartPsPolledExample().

int UartPsPolledExample ( XUartPs UartInstPtr,
UINTPTR  BaseAddress 
)

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

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

Parameters
BaseAddresscontains the base address of the device
Returns
XST_SUCCESS if successful, XST_FAILURE if unsuccessful
Note
- In XSCT/classic flow, DeviceId is used to look up the device configuration.
  • This function polls the UART, it may hang if the hardware is not working correctly.

References XUartPs_Config::BaseAddress, XUartPs_CfgInitialize(), XUartPs_IsSending(), XUartPs_LookupConfig(), XUARTPS_OPER_MODE_LOCAL_LOOP, XUARTPS_OPER_MODE_NORMAL, XUartPs_Recv(), XUartPs_SelfTest(), XUartPs_Send(), and XUartPs_SetOperMode().

Referenced by main().