uartpsv
Vitis Drivers API Documentation
xuartpsv.h File Reference

Data Structures

struct  XUartPsv_Config
 This typedef contains configuration information for the device. More...
 
struct  XUartPsvBuffer
 Keep track of state information about a data buffer in the interrupt mode. More...
 
struct  XUartPsvFormat
 Keep track of data format setting of a device. More...
 
struct  XUartPsv
 The XUartPsv driver instance data structure. More...
 

Macros

#define XUARTPSV_H
 by using protection macros More...
 
#define XUARTPSV_MAX_RATE   921600U
 Maximum baud rate. More...
 
#define XUARTPSV_MIN_RATE   110U
 Minimum baud rate. More...
 
#define XUARTPSV_DFT_BAUDRATE   115200U
 Default baud rate. More...
 
#define XUartPsv_GetChannelStatus(InstancePtr)
 Get the UART Channel Status Register. More...
 
#define XUartPsv_GetModeControl(InstancePtr)
 Get the UART Mode Control Register. More...
 
#define XUartPsv_SetModeControl(InstancePtr, RegisterValue)
 Set the UART Mode Control Register. More...
 
#define XUartPsv_EnableUart(InstancePtr)
 Enable the transmitter and receiver of the UART. More...
 
#define XUartPsv_DisableUart(InstancePtr)
 Disable the transmitter and receiver of the UART. More...
 
#define XUartPsv_IsTransmitEmpty(InstancePtr)
 Determine if the transmitter FIFO is empty. More...
 
Configuration options
#define XUARTPSV_OPTION_SET_BREAK   0x0080U
 These constants specify the options that may be set or retrieved with the driver, each is a unique bit mask such that multiple options may be specified. More...
 
#define XUARTPSV_OPTION_STOP_BREAK   0x0040U
 Stops break transmission. More...
 
#define XUARTPSV_OPTION_RESET_TMOUT   0x0020U
 Reset the receive timeout. More...
 
#define XUARTPSV_OPTION_RESET_TX   0x0010U
 Reset the transmitter. More...
 
#define XUARTPSV_OPTION_RESET_RX   0x0008U
 Reset the receiver. More...
 
#define XUARTPSV_OPTION_ASSERT_RTS   0x0004U
 Assert the RTS bit. More...
 
#define XUARTPSV_OPTION_ASSERT_DTR   0x0002U
 Assert the DTR bit. More...
 
#define XUARTPSV_OPTION_SET_FCM   0x0001U
 Turn on flow control mode. More...
 
Channel Operational Mode

The UART can operate in one of four modes: Normal, Local Loopback, Remote Loopback, or automatic echo.

#define XUARTPSV_OPER_MODE_NORMAL   (u8)0x00U
 Normal Mode. More...
 
#define XUARTPSV_OPER_MODE_LOCAL_LOOP   (u8)0x02U
 Local Loop back Mode. More...
 
Data format values

These constants specify the data format that the driver supports.

The data format includes the number of data bits, the number of stop bits and parity.

#define XUARTPSV_FORMAT_8_BITS   3U
 8 data bits More...
 
#define XUARTPSV_FORMAT_7_BITS   2U
 7 data bits More...
 
#define XUARTPSV_FORMAT_6_BITS   1U
 6 data bits More...
 
#define XUARTPSV_FORMAT_5_BITS   0U
 5 data bits More...
 
#define XUARTPSV_FORMAT_NO_PARITY   0U
 No parity. More...
 
#define XUARTPSV_FORMAT_EN_PARITY   1U
 Enable parity. More...
 
#define XUARTPSV_FORMAT_EVEN_PARITY   2U
 Even parity. More...
 
#define XUARTPSV_FORMAT_ODD_PARITY   0U
 Odd parity. More...
 
#define XUARTPSV_FORMAT_EN_STICK_PARITY   4U
 Stick parity. More...
 
#define XUARTPSV_FORMAT_NO_STICK_PARITY   0U
 Stick parity. More...
 
#define XUARTPSV_FORMAT_PARITY_MASK   7U
 Format parity mask. More...
 
#define XUARTPSV_FORMAT_EVEN_PARITY_SHIFT   1U
 Even parity shift. More...
 
#define XUARTPSV_FORMAT_EN_STICK_PARITY_SHIFT   5U
 Stick parity shift. More...
 
#define XUARTPSV_FORMAT_2_STOP_BIT   1U
 2 stop bits More...
 
#define XUARTPSV_FORMAT_1_STOP_BIT   0U
 1 stop bit More...
 
Callback events

These constants specify the handler events that an application can handle using its specific handler function.

Note that these constants are not bit mask, so only one event can be passed to an application at a time.

#define XUARTPSV_EVENT_RECV_DATA   1U
 Data receiving done. More...
 
#define XUARTPSV_EVENT_RECV_TOUT   2U
 A receive timeout occurred. More...
 
#define XUARTPSV_EVENT_SENT_DATA   3U
 Data transmission done. More...
 
#define XUARTPSV_EVENT_RECV_ERROR   4U
 A receive error detected. More...
 
#define XUARTPSV_EVENT_MODEM   5U
 Modem status changed. More...
 
#define XUARTPSV_EVENT_PARE_FRAME_BRKE   6U
 A receive parity, frame,break error detected. More...
 
#define XUARTPSV_EVENT_RECV_ORERR   7U
 A receive overrun error detected. More...
 

Typedefs

typedef void(* XUartPsv_Handler )(void *CallBackRef, u32 Event, u32 EventData)
 This data type defines a handler that an application defines to communicate with interrupt system to retrieve state information about an application. More...
 

Functions

XUartPsv_ConfigXUartPsv_LookupConfig (u16 DeviceId)
 Looks up the device configuration based on the unique device ID. More...
 
s32 XUartPsv_CfgInitialize (XUartPsv *InstancePtr, XUartPsv_Config *Config, UINTPTR EffectiveAddr)
 Initializes a specific XUartPsv instance such that it is ready to be used. More...
 
u32 XUartPsv_Send (XUartPsv *InstancePtr, u8 *BufferPtr, u32 NumBytes)
 This functions sends the specified buffer using the device in either polled or interrupt driven mode. More...
 
u32 XUartPsv_Recv (XUartPsv *InstancePtr, u8 *BufferPtr, u32 NumBytes)
 This function attempts to receive a specified number of bytes of data from the device and store it into the specified buffer. More...
 
s32 XUartPsv_SetBaudRate (XUartPsv *InstancePtr, u32 BaudRate)
 Sets the baud rate for the device. More...
 
void XUartPsv_ProgramCtrlReg (XUartPsv *InstancePtr, u32 CtrlRegister)
 This function reprograms the control register according to the following sequence mentioned in the TRM. More...
 
void XUartPsv_CleanupRx (XUartPsv *InstancePtr)
 This function is a cleanup function to allow reseting Rx NextBytePtr, RemainingBytes and RequestedBytes. More...
 
void XUartPsv_CleanupTx (XUartPsv *InstancePtr)
 This function is a cleanup function to allow reseting Tx NextBytePtr, RemainingBytes and RequestedBytes. More...
 
void XUartPsv_SetOptions (XUartPsv *InstancePtr, u16 Options)
 Sets the options for the specified driver instance. More...
 
u16 XUartPsv_GetOptions (XUartPsv *InstancePtr)
 Gets the options for the specified driver instance. More...
 
void XUartPsv_SetFifoThreshold (XUartPsv *InstancePtr, u8 TriggerLevel)
 This functions sets the Tx and Rx FIFO trigger level to the 'TriggerLevel' argument. More...
 
void XUartPsv_SetTxFifoThreshold (XUartPsv *InstancePtr, u8 TriggerLevel)
 This functions sets the Tx FIFO trigger level to the 'TriggerLevel' argument. More...
 
void XUartPsv_SetRxFifoThreshold (XUartPsv *InstancePtr, u8 TriggerLevel)
 This functions sets the Rx FIFO trigger level to the 'TriggerLevel' argument. More...
 
u8 XUartPsv_GetFifoThreshold (XUartPsv *InstancePtr)
 This function gets the Tx and Rx FIFO trigger level. More...
 
u16 XUartPsv_GetModemStatus (XUartPsv *InstancePtr)
 This function gets the modem status from the specified UART. More...
 
u32 XUartPsv_IsSending (XUartPsv *InstancePtr)
 This function determines if the specified UART is sending data. More...
 
u8 XUartPsv_GetOperMode (XUartPsv *InstancePtr)
 This function gets the operational mode of the UART. More...
 
void XUartPsv_SetOperMode (XUartPsv *InstancePtr, u8 OperationMode)
 This function sets the operational mode of the UART. More...
 
s32 XUartPsv_SetDataFormat (XUartPsv *InstancePtr, XUartPsvFormat *FormatPtr)
 Sets the data format for the device. More...
 
void XUartPsv_GetDataFormat (XUartPsv *InstancePtr, XUartPsvFormat *FormatPtr)
 Gets the data format for the specified UART. More...
 
u32 XUartPsv_GetInterruptMask (XUartPsv *InstancePtr)
 This function gets the interrupt mask. More...
 
void XUartPsv_SetInterruptMask (XUartPsv *InstancePtr, u32 Mask)
 This function sets the interrupt mask. More...
 
void XUartPsv_InterruptHandler (XUartPsv *InstancePtr)
 This function is the interrupt handler for the driver. More...
 
void XUartPsv_SetHandler (XUartPsv *InstancePtr, XUartPsv_Handler FuncPtr, void *CallBackRef)
 This function sets the handler that will be called when an event (interrupt) occurs that needs application's attention. More...
 
s32 XUartPsv_SelfTest (XUartPsv *InstancePtr)
 This function runs a self-test on the driver and hardware device. More...
 

Variables

XUartPsv_Config XUartPsv_ConfigTable []
 Config structure. More...