Software Drivers
Main Page | Data Structures | File List | Data Fields | Globals

xuartlite_l.h File Reference


Detailed Description

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_mGetControlReg 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
 


Defines

#define XUartLite_mWriteReg(BaseAddress, RegOffset, Data)
#define XUartLite_mReadReg(BaseAddress, RegOffset)
#define XUartLite_mSetControlReg(BaseAddress, Mask)
#define XUartLite_mGetStatusReg(BaseAddress)
#define XUartLite_mIsReceiveEmpty(BaseAddress)
#define XUartLite_mIsTransmitFull(BaseAddress)
#define XUartLite_mIsIntrEnabled(BaseAddress)
#define XUartLite_mEnableIntr(BaseAddress)
#define XUartLite_mDisableIntr(BaseAddress)

Functions

void XUartLite_SendByte (u32 BaseAddress, u8 Data)
u8 XUartLite_RecvByte (u32 BaseAddress)


Define Documentation

#define XUartLite_mDisableIntr BaseAddress   ) 
 

Disable the device interrupt. We cannot read the control register, so we just clear all bits. Since the only other ones are the FIFO reset bits, this works without side effects.

Parameters:
BaseAddress is the base address of the device
Returns:
None.
Note:
C-style Signature: void XUartLite_mDisableIntr(u32 BaseAddress);

#define XUartLite_mEnableIntr BaseAddress   ) 
 

Enable the device interrupt. We cannot read the control register, so we just write the enable interrupt bit and clear all others. Since the only other ones are the FIFO reset bits, this works without side effects.

Parameters:
BaseAddress is the base address of the device
Returns:
None.
Note:
C-style Signature: void XUartLite_mEnableIntr(u32 BaseAddress);

#define XUartLite_mGetStatusReg BaseAddress   ) 
 

Get the contents of the status register. Use the XUL_SR_* constants defined above to interpret the bit-mask returned.

Parameters:
BaseAddress is the base address of the device
Returns:
A 32-bit value representing the contents of the status register.
Note:
C-style Signature: u32 XUartLite_mGetStatusReg(u32 BaseAddress);

#define XUartLite_mIsIntrEnabled BaseAddress   ) 
 

Check to see if the interrupt is enabled.

Parameters:
BaseAddress is the base address of the device
Returns:
TRUE if the interrupt is enabled, FALSE otherwise.
Note:
C-style Signature: int XUartLite_mIsIntrEnabled(u32 BaseAddress);

#define XUartLite_mIsReceiveEmpty BaseAddress   ) 
 

Check to see if the receiver has data.

Parameters:
BaseAddress is the base address of the device
Returns:
TRUE if the receiver is empty, FALSE if there is data present.
Note:
C-style Signature: int XUartLite_mIsReceiveEmpty(u32 BaseAddress);

#define XUartLite_mIsTransmitFull BaseAddress   ) 
 

Check to see if the transmitter is full.

Parameters:
BaseAddress is the base address of the device
Returns:
TRUE if the transmitter is full, FALSE otherwise.
Note:
C-style Signature: int XUartLite_mIsTransmitFull(u32 BaseAddress);

#define XUartLite_mReadReg BaseAddress,
RegOffset   ) 
 

Read a value from a UartLite register. A 32 bit read is performed.

Parameters:
BaseAddress is the base address of the UartLite device.
RegOffset is the register offset from the base to read from.
Returns:
Data read from the register.
Note:
C-style signature: u32 XUartLite_mReadReg(u32 BaseAddress, u32 RegOffset)

#define XUartLite_mSetControlReg BaseAddress,
Mask   ) 
 

Set the contents of the control register. Use the XUL_CR_* constants defined above to create the bit-mask to be written to the register.

Parameters:
BaseAddress is the base address of the device
Mask is the 32-bit value to write to the control register
Returns:
None.
Note:
C-style Signature: void XUartLite_mSetControlReg(u32 BaseAddress, u32 Mask);

#define XUartLite_mWriteReg BaseAddress,
RegOffset,
Data   ) 
 

Write a value to a UartLite register. A 32 bit write is performed.

Parameters:
BaseAddress is the base address of the UartLite device.
RegOffset is the register offset from the base to write to.
Data is the data written to the register.
Returns:
None.
Note:
C-style signature: void XUartLite_mWriteReg(u32 BaseAddress, u32 RegOffset, u32 Data)


Function Documentation

u8 XUartLite_RecvByte u32  BaseAddress  ) 
 

This functions receives a single byte using the UART. It is blocking in that it waits for the receiver to become non-empty before it reads from the receive register.

Parameters:
BaseAddress is the base address of the device
Returns:
The byte of data received.
Note:
None.

void XUartLite_SendByte u32  BaseAddress,
u8  Data
 

This functions sends a single byte using the UART. It is blocking in that it waits for the transmitter to become non-full before it writes the byte to the transmit register.

Parameters:
BaseAddress is the base address of the device
Data is the byte of data to send
Returns:
None.
Note:
None.