MODIFICATION HISTORY:
Ver Who Date Changes ----- ------ -------- ---------------------------------------------- 1.00 drg/jz 01/13/10 First Release
#include "xstatus.h"
#include "xuartps.h"
#include "xil_io.h"
Functions | |
int | XUartPs_CfgInitialize (XUartPs *InstancePtr, XUartPs_Config *Config, u32 EffectiveAddr) |
unsigned int | XUartPs_Send (XUartPs *InstancePtr, u8 *BufferPtr, unsigned int NumBytes) |
unsigned int | XUartPs_Recv (XUartPs *InstancePtr, u8 *BufferPtr, unsigned int NumBytes) |
int | XUartPs_SetBaudRate (XUartPs *InstancePtr, u32 BaudRate) |
|
Initializes a specific XUartPs instance such that it is ready to be used. The data format of the device is setup for 8 data bits, 1 stop bit, and no parity by default. The baud rate is set to a default value specified by Config->DefaultBaudRate if set, otherwise it is set to 19.2K baud. The receive FIFO threshold is set for 8 bytes. The default operating mode of the driver is polled mode.
All interrupts are disabled. |
|
This function attempts to receive a specified number of bytes of data from the device and store it into the specified buffer. This function works for both polled or interrupt driven modes. It is non-blocking. In a polled mode, this function will only receive the data already in the RX FIFO. The application may need to call it repeatedly to receive the entire buffer. Polled mode is the default mode of operation for the device. In interrupt mode, this function will start the receiving, if not the entire buffer has been received, the interrupt handler will continue receiving data until the entire buffer has been received. A callback function, as specified by the application, will be called to indicate the completion of the receiving or error conditions.
|
|
This functions sends the specified buffer using the device in either polled or interrupt driven mode. This function is non-blocking, if the device is busy sending data, it will return and indicate zero bytes were sent. Otherwise, it fills the TX FIFO as much as it can, and return the number of bytes sent. In a polled mode, this function will only send as much data as TX FIFO can buffer. The application may need to call it repeatedly to send the entire buffer. In interrupt mode, this function will start sending the specified buffer, then the interrupt handler will continue sending data until the entire buffer has been sent. A callback function, as specified by the application, will be called to indicate the completion of sending.
|
|
Sets the baud rate for the device. Checks the input value for validity and also verifies that the requested rate can be configured to within the maximum error range specified by XUARTPS_MAX_BAUD_ERROR_RATE. If the provided rate is not possible, the current setting is unchanged.
|