uartns550
Vitis Drivers API Documentation
xuartns550.h File Reference

Data Structures

struct  XUartNs550_Config
 This typedef contains configuration information for the device. More...
 
struct  XUartNs550Buffer
 The following data type is used to manage the buffers that are handled when sending and receiving data in the interrupt mode. More...
 
struct  XUartNs550Format
 This data type allows the data format of the device to be set and retrieved. More...
 
struct  XUartNs550Stats
 UART statistics. More...
 
struct  XUartNs550
 The XUartNs550 driver instance data. More...
 

Macros

Configuration options
#define XUN_OPTION_RXLINE_INTR   0x0800
 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 XUN_OPTION_SET_BREAK   0x0400
 Set a break condition. More...
 
#define XUN_OPTION_LOOPBACK   0x0200
 Enable local loopback. More...
 
#define XUN_OPTION_DATA_INTR   0x0100
 Enable data interrupts. More...
 
#define XUN_OPTION_MODEM_INTR   0x0080
 Enable modem interrupts. More...
 
#define XUN_OPTION_FIFOS_ENABLE   0x0040
 Enable FIFOs. More...
 
#define XUN_OPTION_RESET_TX_FIFO   0x0020
 Reset the transmit FIFO. More...
 
#define XUN_OPTION_RESET_RX_FIFO   0x0010
 Reset the receive FIFO. More...
 
#define XUN_OPTION_ASSERT_OUT2   0x0008
 Assert out2 signal. More...
 
#define XUN_OPTION_ASSERT_OUT1   0x0004
 Assert out1 signal. More...
 
#define XUN_OPTION_ASSERT_RTS   0x0002
 Assert RTS signal. More...
 
#define XUN_OPTION_ASSERT_DTR   0x0001
 Assert DTR signal. More...
 
Data format values
#define XUN_FORMAT_8_BITS   3
 These constants specify the data format that may be set or retrieved with the driver. More...
 
#define XUN_FORMAT_7_BITS   2
 7 data bits More...
 
#define XUN_FORMAT_6_BITS   1
 6 data bits More...
 
#define XUN_FORMAT_5_BITS   0
 5 data bits More...
 
#define XUN_FORMAT_EVEN_PARITY   2
 Even Parity. More...
 
#define XUN_FORMAT_ODD_PARITY   1
 Odd Parity. More...
 
#define XUN_FORMAT_NO_PARITY   0
 No Parity. More...
 
#define XUN_FORMAT_2_STOP_BIT   1
 2 stop bits More...
 
#define XUN_FORMAT_1_STOP_BIT   0
 1 stop bit More...
 
FIFO trigger values
#define XUN_FIFO_TRIGGER_14   0xC0
 14 byte trigger level More...
 
#define XUN_FIFO_TRIGGER_08   0x80
 8 byte trigger level More...
 
#define XUN_FIFO_TRIGGER_04   0x40
 4 byte trigger level More...
 
#define XUN_FIFO_TRIGGER_01   0x00
 1 byte trigger level More...
 
Modem status values
#define XUN_MODEM_DCD_DELTA_MASK   0x08
 These constants specify the modem status that may be retrieved from the driver. More...
 
#define XUN_MODEM_DSR_DELTA_MASK   0x02
 DSR signal changed state. More...
 
#define XUN_MODEM_CTS_DELTA_MASK   0x01
 CTS signal changed state. More...
 
#define XUN_MODEM_RINGING_MASK   0x40
 Ring signal is active. More...
 
#define XUN_MODEM_DSR_MASK   0x20
 Current state of DSR signal. More...
 
#define XUN_MODEM_CTS_MASK   0x10
 Current state of CTS signal. More...
 
#define XUN_MODEM_DCD_MASK   0x80
 Current state of DCD signal. More...
 
#define XUN_MODEM_RING_STOP_MASK   0x04
 Ringing has stopped. More...
 
Callback events
#define XUN_EVENT_RECV_DATA   1
 These constants specify the handler events that are passed to a handler from the driver. More...
 
#define XUN_EVENT_RECV_TIMEOUT   2
 A receive timeout occurred. More...
 
#define XUN_EVENT_SENT_DATA   3
 Data has been sent. More...
 
#define XUN_EVENT_RECV_ERROR   4
 A receive error was detected. More...
 
#define XUN_EVENT_MODEM   5
 A change in modem status. More...
 
Error values
#define XUN_ERROR_BREAK_MASK   0x10
 These constants specify the errors that may be retrieved from the driver using the XUartNs550_GetLastErrors function. More...
 
#define XUN_ERROR_FRAMING_MASK   0x08
 Receive framing error. More...
 
#define XUN_ERROR_PARITY_MASK   0x04
 Receive parity error. More...
 
#define XUN_ERROR_OVERRUN_MASK   0x02
 Receive overrun error. More...
 
#define XUN_ERROR_NONE   0x00
 No error. More...
 

Typedefs

typedef void(* XUartNs550_Handler )(void *CallBackRef, u32 Event, unsigned int EventData)
 This data type defines a handler which the application must define when using interrupt mode. More...
 

Functions

int XUartNs550_Initialize (XUartNs550 *InstancePtr, u16 DeviceId)
 Initializes a specific XUartNs550 instance such that it is ready to be used. More...
 
XUartNs550_ConfigXUartNs550_LookupConfig (u16 DeviceId)
 Looks up the device configuration based on the unique device ID. More...
 
int XUartNs550_CfgInitialize (XUartNs550 *InstancePtr, XUartNs550_Config *Config, UINTPTR EffectiveAddr)
 Initializes a specific XUartNs550 instance such that it is ready to be used. More...
 
unsigned int XUartNs550_Send (XUartNs550 *InstancePtr, u8 *BufferPtr, unsigned int NumBytes)
 This functions sends the specified buffer of data using the UART in either polled or interrupt driven modes. More...
 
unsigned int XUartNs550_Recv (XUartNs550 *InstancePtr, u8 *BufferPtr, unsigned int NumBytes)
 This function will attempt to receive a specified number of bytes of data from the UART and store it into the specified buffer. More...
 
int XUartNs550_SetOptions (XUartNs550 *InstancePtr, u16 Options)
 Sets the options for the specified driver instance. More...
 
u16 XUartNs550_GetOptions (XUartNs550 *InstancePtr)
 Gets the options for the specified driver instance. More...
 
int XUartNs550_SetFifoThreshold (XUartNs550 *InstancePtr, u8 TriggerLevel)
 This functions sets the receive FIFO trigger level. More...
 
u8 XUartNs550_GetFifoThreshold (XUartNs550 *InstancePtr)
 This function gets the receive FIFO trigger level. More...
 
int XUartNs550_IsSending (XUartNs550 *InstancePtr)
 This function determines if the specified UART is sending data. More...
 
u8 XUartNs550_GetLastErrors (XUartNs550 *InstancePtr)
 This function returns the last errors that have occurred in the specified UART. More...
 
u8 XUartNs550_GetModemStatus (XUartNs550 *InstancePtr)
 This function gets the modem status from the specified UART. More...
 
int XUartNs550_SetDataFormat (XUartNs550 *InstancePtr, XUartNs550Format *FormatPtr)
 Sets the data format for the specified UART. More...
 
void XUartNs550_GetDataFormat (XUartNs550 *InstancePtr, XUartNs550Format *FormatPtr)
 Gets the data format for the specified UART. More...
 
void XUartNs550_SetHandler (XUartNs550 *InstancePtr, XUartNs550_Handler FuncPtr, void *CallBackRef)
 This function sets the handler that will be called when an event (interrupt) occurs in the driver. More...
 
void XUartNs550_InterruptHandler (XUartNs550 *InstancePtr)
 This function is the interrupt handler for the 16450/16550 UART driver. More...
 
void XUartNs550_GetStats (XUartNs550 *InstancePtr, XUartNs550Stats *StatsPtr)
 This functions returns a snapshot of the current statistics in the area provided. More...
 
void XUartNs550_ClearStats (XUartNs550 *InstancePtr)
 This function zeros the statistics for the given instance. More...
 
int XUartNs550_SelfTest (XUartNs550 *InstancePtr)
 This functions runs a self-test on the driver and hardware device. More...