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.
#include "xuartlite.h"
#include "xuartlite_i.h"
#include "xil_io.h"
Functions | |
int | XUartLite_CfgInitialize (XUartLite *InstancePtr, XUartLite_Config *Config, u32 EffectiveAddr) |
unsigned int | XUartLite_Send (XUartLite *InstancePtr, u8 *DataBufferPtr, unsigned int NumBytes) |
unsigned int | XUartLite_Recv (XUartLite *InstancePtr, u8 *DataBufferPtr, unsigned int NumBytes) |
void | XUartLite_ResetFifos (XUartLite *InstancePtr) |
int | XUartLite_IsSending (XUartLite *InstancePtr) |
unsigned int | XUartLite_SendBuffer (XUartLite *InstancePtr) |
unsigned int | XUartLite_ReceiveBuffer (XUartLite *InstancePtr) |
|
Initialize a XUartLite instance. The receive and transmit FIFOs of the UART are not flushed, so the user may want to flush them. The hardware device does not have any way to disable the receiver such that any valid data may be present in the receive FIFO. This function disables the UART interrupt. The baudrate and format of the data are fixed in the hardware at hardware build time.
|
|
This function determines if the specified UART is sending data. If the transmitter register is not empty, it is sending data.
|
|
This function receives a buffer that has been previously specified by setting up the instance variables of the instance. This function is designed to be an internal function for the XUartLite component such that it may be called from a shell function that sets up the buffer or from an interrupt handler. This function will attempt to receive a specified number of bytes of data from the UART and store it into the specified buffer. This function is designed for either polled or interrupt driven modes. It is non-blocking such that it will return if there is no data has already received by the UART. In a polled mode, this function will only receive as much data as the UART can buffer, either in the receiver or in the FIFO if present and enabled. The application may need to call it repeatedly to receive a buffer. Polled mode is the default mode of operation for the driver. In interrupt mode, this function will start receiving and then the interrupt handler of the driver will continue until the buffer has been received. A callback function, as specified by the application, will be called to indicate the completion of receiving the buffer or when any receive errors or timeouts occur.
|
|
This function will attempt to receive a specified number of bytes of data from the UART and store it into the specified buffer. This function is designed for either polled or interrupt driven modes. It is non-blocking such that it will return if no data has already received by the UART. In a polled mode, this function will only receive as much data as the UART can buffer in the FIFO. The application may need to call it repeatedly to receive a buffer. Polled mode is the default mode of operation for the driver. In interrupt mode, this function will start receiving and then the interrupt handler of the driver will continue receiving data until the buffer has been received. A callback function, as specified by the application, will be called to indicate the completion of receiving the buffer or when any receive errors or timeouts occur.
|
|
This function resets the FIFOs, both transmit and receive, of the UART such that they are emptied. Since the UART does not have any way to disable it from receiving data, it may be necessary for the application to reset the FIFOs to get rid of any unwanted data.
|
|
This functions sends the specified buffer of data using the UART in either polled or interrupt driven modes. This function is non-blocking such that it will return before the data has been sent by the UART. If the UART is busy sending data, it will return and indicate zero bytes were sent. In a polled mode, this function will only send as much data as the UART can buffer in the FIFO. The application may need to call it repeatedly to send a buffer. In interrupt mode, this function will start sending the specified buffer and then the interrupt handler of the driver will continue sending data until the buffer has been sent. A callback function, as specified by the application, will be called to indicate the completion of sending the buffer.
|
|
This function sends a buffer that has been previously specified by setting up the instance variables of the instance. This function is designed to be an internal function for the XUartLite component such that it may be called from a shell function that sets up the buffer or from an interrupt handler. This function sends the specified buffer of data to the UART in either polled or interrupt driven modes. This function is non-blocking such that it will return before the data has been sent by the UART. In a polled mode, this function will only send as much data as the UART can buffer, either in the transmitter or in the FIFO if present and enabled. The application may need to call it repeatedly to send a buffer. In interrupt mode, this function will start sending the specified buffer and then the interrupt handler of the driver will continue until the buffer has been sent. A callback function, as specified by the application, will be called to indicate the completion of sending the buffer.
|