47#include "xil_assert.h"
50#include <bsp/xil-compat.h>
57#define XPAR_XUARTLITE_USE_DCR_BRIDGE 0
59#if (XPAR_XUARTLITE_USE_DCR_BRIDGE != 0)
68#if (XPAR_XUARTLITE_USE_DCR_BRIDGE != 0)
69#define XUL_RX_FIFO_OFFSET 0
70#define XUL_TX_FIFO_OFFSET 1
71#define XUL_STATUS_REG_OFFSET 2
72#define XUL_CONTROL_REG_OFFSET 3
76#define XUL_RX_FIFO_OFFSET 0
77#define XUL_TX_FIFO_OFFSET 4
78#define XUL_STATUS_REG_OFFSET 8
79#define XUL_CONTROL_REG_OFFSET 12
85#define XUL_CR_ENABLE_INTR 0x10
86#define XUL_CR_FIFO_RX_RESET 0x02
87#define XUL_CR_FIFO_TX_RESET 0x01
91#define XUL_SR_PARITY_ERROR 0x80
92#define XUL_SR_FRAMING_ERROR 0x40
93#define XUL_SR_OVERRUN_ERROR 0x20
94#define XUL_SR_INTR_ENABLED 0x10
95#define XUL_SR_TX_FIFO_FULL 0x08
96#define XUL_SR_TX_FIFO_EMPTY 0x04
97#define XUL_SR_RX_FIFO_FULL 0x02
98#define XUL_SR_RX_FIFO_VALID_DATA 0x01
104#define XUL_FIFO_SIZE 16
109#define XUL_STOP_BITS 1
113#define XUL_PARITY_NONE 0
114#define XUL_PARITY_ODD 1
115#define XUL_PARITY_EVEN 2
124#if (XPAR_XUARTLITE_USE_DCR_BRIDGE != 0)
126#define XUartLite_In32 XIo_DcrIn
127#define XUartLite_Out32 XIo_DcrOut
131#define XUartLite_In32 Xil_In32
132#define XUartLite_Out32 Xil_Out32
153#define XUartLite_WriteReg(BaseAddress, RegOffset, Data) \
154 XUartLite_Out32((BaseAddress) + (RegOffset), (u32)(Data))
170#define XUartLite_ReadReg(BaseAddress, RegOffset) \
171 XUartLite_In32((BaseAddress) + (RegOffset))
189#define XUartLite_SetControlReg(BaseAddress, Mask) \
190 XUartLite_WriteReg((BaseAddress), XUL_CONTROL_REG_OFFSET, (Mask))
207#define XUartLite_GetStatusReg(BaseAddress) \
208 XUartLite_ReadReg((BaseAddress), XUL_STATUS_REG_OFFSET)
224#define XUartLite_IsReceiveEmpty(BaseAddress) \
225 ((XUartLite_GetStatusReg((BaseAddress)) & XUL_SR_RX_FIFO_VALID_DATA) != \
226 XUL_SR_RX_FIFO_VALID_DATA)
242#define XUartLite_IsTransmitEmpty(BaseAddress) \
243 ((XUartLite_GetStatusReg((BaseAddress)) & XUL_SR_TX_FIFO_EMPTY) == \
244 XUL_SR_TX_FIFO_EMPTY)
260#define XUartLite_IsTransmitFull(BaseAddress) \
261 ((XUartLite_GetStatusReg((BaseAddress)) & XUL_SR_TX_FIFO_FULL) == \
278#define XUartLite_IsIntrEnabled(BaseAddress) \
279 ((XUartLite_GetStatusReg((BaseAddress)) & XUL_SR_INTR_ENABLED) == \
298#define XUartLite_EnableIntr(BaseAddress) \
299 XUartLite_SetControlReg((BaseAddress), XUL_CR_ENABLE_INTR)
317#define XUartLite_DisableIntr(BaseAddress) \
318 XUartLite_SetControlReg((BaseAddress), 0)
u8 XUartLite_RecvByte(UINTPTR BaseAddress)
Definition: uartlite_l.c:92
void XUartLite_SendByte(UINTPTR BaseAddress, u8 Data)
Definition: uartlite_l.c:70