uartlite
Vitis Drivers API Documentation
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
xuartlite.c File Reference

Overview

Implements the required functions for the XUartLite driver.

See the xuartlite.h header file for more details on this driver.

MODIFICATION HISTORY:
Ver   Who  Date     Changes


1.00a ecm 08/31/01 First release 1.00b jhl 02/21/02 Repartitioned the driver for smaller files 1.00b rmm 05/13/03 Fixed diab compiler warnings relating to asserts 1.01a jvb 12/13/05 Changed Initialize() into CfgInitialize(), and made CfgInitialize() take a pointer to a config structure instead of a device id. Moved Initialize() into xgpio_sinit.c, and had Initialize() call CfgInitialize() after it retrieved the config structure using the device id. Removed include of xparameters.h along with any dependencies on xparameters.h and the _g.c config table. 1.01a wsy 05/08/06 fix CR220811 and CR224103. 1.12a mta 03/31/07 Updated to new coding conventions 1.13a sv 01/21/08 Updated driver to support access through DCR bus 1.14a sdm 09/26/08 Updated code to avoid race condition in XUartLite_SendBuffer 2.00a ktn 10/20/09 Updated to use HAL Processor APIs. The macros have been renamed to remove _m from the name. XUartLite_mClearStats macro is removed and XUartLite_ClearStats function should be used in its place. 2.00a hvm 08/11/11 Removed the SetOptions related information in the Recv and RecvBuffer function header notes section. CR620849. 2.01a adk 18/04/13 Updated the code to avoid unused variable warnings when compiling with the -Wextra -Wall flags In the file xuartlite.c. CR:704999. 3.1 nsk 21/07/15 Updated XUartLite_ReceiveBuffer function to update the receive data into user buffer in critical region. CR#865787. 3.2 sk 11/10/15 Used UINTPTR instead of u32 for Baseaddress CR# 867425. Changed the prototype of XUartLite_CfgInitialize API. 3.6 rna 02/19/21 Added 'XUartLite_GetSR' internal API to read Status register and update the error stats. 3.8 gm 09/25/22 Use XUartLite_GetSR instead of accessing status register directly. 3.13 vlt 01/27/26 Fixed codespell issues 3.14 vn 08/26/26 Fix Doxygen warnings 3.14 vn 09/09/26 Align Doxygen comments with AMD standards

 
#include "xuartlite.h"
#include "xuartlite_i.h"
#include "xil_io.h"

Functions

int XUartLite_CfgInitialize (XUartLite *InstancePtr, XUartLite_Config *Config, UINTPTR EffectiveAddr)
 Initializes a XUartLite instance. More...
 
unsigned int XUartLite_Send (XUartLite *InstancePtr, u8 *DataBufferPtr, unsigned int NumBytes)
 Sends the specified buffer of data using the UART. More...
 
unsigned int XUartLite_Recv (XUartLite *InstancePtr, u8 *DataBufferPtr, unsigned int NumBytes)
 Receives a specified number of bytes of data from the UART. More...
 
void XUartLite_ResetFifos (XUartLite *InstancePtr)
 Resets the FIFOs, both transmit and receive, of the UART. More...
 
int XUartLite_IsSending (XUartLite *InstancePtr)
 Determines if the specified UART is sending data. More...
 
unsigned int XUartLite_SendBuffer (XUartLite *InstancePtr)
 Sends a previously specified buffer of data to the UART. More...
 
unsigned int XUartLite_ReceiveBuffer (XUartLite *InstancePtr)
 Receives a previously specified buffer of data from the UART. More...
 
u8 XUartLite_GetSR (XUartLite *InstancePtr)
 Reads the status register and updates the error stats before returning the status register value. More...