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

Overview

Low-level driver identifiers and functions for the UART Lite device.

This header file contains identifiers and low-level driver functions (or macros) that can be used to access the device. High-level driver functions are defined in xuartlite.h.

MODIFICATION HISTORY:
Ver   Who  Date     Changes


1.00b rpm 04/25/02 First release 1.00b rpm 07/07/03 Removed references to XUartLite_GetControlReg macro since the control register is write-only 1.12a mta 03/21/07 Updated to new coding style 1.13a sv 01/21/08 Updated driver to support access through DCR bus 2.00a ktn 10/20/09 Updated to use HAL Processor APIs. The macros have been renamed to remove _m from the name. 3.2 sk 11/10/15 Used UINTPTR instead of u32 for Baseaddress CR# 867425. Changed the prototypes of XUartLite_SendByte, XUartLite_RecvByte APIs. 3.14 vn 09/09/26 Align Doxygen comments with AMD standards

#include "xil_types.h"
#include "xil_assert.h"
#include "xil_io.h"

Macros

#define XUartLite_WriteReg(BaseAddress, RegOffset, Data)   XUartLite_Out32((BaseAddress) + (RegOffset), (u32)(Data))
 Writes a value to a UartLite register. More...
 
#define XUartLite_ReadReg(BaseAddress, RegOffset)   XUartLite_In32((BaseAddress) + (RegOffset))
 Reads a value from a UartLite register. More...
 
#define XUartLite_SetControlReg(BaseAddress, Mask)   XUartLite_WriteReg((BaseAddress), XUL_CONTROL_REG_OFFSET, (Mask))
 Sets the contents of the control register. More...
 
#define XUartLite_GetStatusReg(BaseAddress)   XUartLite_ReadReg((BaseAddress), XUL_STATUS_REG_OFFSET)
 Returns the contents of the status register. More...
 
#define XUartLite_IsReceiveEmpty(BaseAddress)
 Checks if the receiver has data. More...
 
#define XUartLite_IsTransmitFull(BaseAddress)
 Checks if the transmitter is full. More...
 
#define XUartLite_IsIntrEnabled(BaseAddress)
 Checks if the interrupt is enabled. More...
 
#define XUartLite_EnableIntr(BaseAddress)   XUartLite_SetControlReg((BaseAddress), XUL_CR_ENABLE_INTR)
 Enables the device interrupt. More...
 
#define XUartLite_DisableIntr(BaseAddress)   XUartLite_SetControlReg((BaseAddress), 0)
 Disables the device interrupt. More...
 
DCR bus bridge configuration

Set to 1 if the UartLite device is accessed through a DCR bus connected to a bridge.

#define XPAR_XUARTLITE_USE_DCR_BRIDGE   0
 DCR bus bridge access flag. More...
 
UART Lite register offsets
#define XUL_RX_FIFO_OFFSET   0
 Receive FIFO, read only. More...
 
#define XUL_TX_FIFO_OFFSET   4
 Transmit FIFO, write only. More...
 
#define XUL_STATUS_REG_OFFSET   8
 Status register, read only. More...
 
#define XUL_CONTROL_REG_OFFSET   12
 Control register, write only. More...
 
Control register bit positions
#define XUL_CR_ENABLE_INTR   0x10
 Enable interrupt. More...
 
#define XUL_CR_FIFO_RX_RESET   0x02
 Reset receive FIFO. More...
 
#define XUL_CR_FIFO_TX_RESET   0x01
 Reset transmit FIFO. More...
 
Status register bit positions
#define XUL_SR_PARITY_ERROR   0x80
 Parity error detected. More...
 
#define XUL_SR_FRAMING_ERROR   0x40
 Framing error detected. More...
 
#define XUL_SR_OVERRUN_ERROR   0x20
 Overrun error detected. More...
 
#define XUL_SR_INTR_ENABLED   0x10
 Interrupt enabled. More...
 
#define XUL_SR_TX_FIFO_FULL   0x08
 Transmit FIFO full. More...
 
#define XUL_SR_TX_FIFO_EMPTY   0x04
 Transmit FIFO empty. More...
 
#define XUL_SR_RX_FIFO_FULL   0x02
 Receive FIFO full. More...
 
#define XUL_SR_RX_FIFO_VALID_DATA   0x01
 Data in receive FIFO. More...
 
FIFO and serial line constants

Fixed hardware parameters for the UartLite IP.

#define XUL_FIFO_SIZE   16
 Transmit/receive FIFO size in bytes. More...
 
#define XUL_STOP_BITS   1
 Stop bits, fixed at 1. More...
 
Parity definitions
#define XUL_PARITY_NONE   0
 No parity. More...
 
#define XUL_PARITY_ODD   1
 Odd parity. More...
 
#define XUL_PARITY_EVEN   2
 Even parity. More...
 
I/O access method macros

Define the appropriate I/O access method to memory mapped I/O or DCR.

#define XUartLite_In32   Xil_In32
 Memory-mapped 32-bit input operation. More...
 
#define XUartLite_Out32   Xil_Out32
 Memory-mapped 32-bit output operation. More...
 

Functions

void XUartLite_SendByte (UINTPTR BaseAddress, u8 Data)
 Sends a single byte using the UART. More...
 
u8 XUartLite_RecvByte (UINTPTR BaseAddress)
 Receives a single byte using the UART. More...