Software Drivers

uartns550 v3_1

This driver supports the following features in the Xilinx 16450/16550 compatible UART.

The only difference between the 16450 and the 16550 is the addition of transmit and receive FIFOs in the 16550.

Initialization & Configuration

The XUartNs550_Config structure is used by the driver to configure itself. This configuration structure is typically created by the tool-chain based on HW build properties.

To support multiple runtime loading and initialization strategies employed by various operating systems, the driver instance can be initialized in one of the following ways:

Baud Rate

The UART has an internal baud rate generator that is clocked at a specified input clock frequency. Not all baud rates can be generated from some clock frequencies. The requested baud rate is checked using the provided clock for the system, and checked against the acceptable error range. An error may be returned from some functions indicating the baud rate was in error because it could not be generated.

Interrupts

The device does not have any way to disable the receiver such that the receive FIFO may contain unwanted data. The FIFOs are not flushed when the driver is initialized, but a function is provided to allow the user to reset the FIFOs if desired.

The driver defaults to no interrupts at initialization such that interrupts must be enabled if desired. An interrupt is generated for any of the following conditions.

The application can control which interrupts are enabled using the SetOptions function.

In order to use interrupts, it is necessary for the user to connect the driver interrupt handler, XUartNs550_InterruptHandler(), to the interrupt system of the application. This function does not save and restore the processor context such that the user must provide it. A handler must be set for the driver such that the handler is called when interrupt events occur. The handler is called from interrupt context and is designed to allow application specific processing to be performed.

The functions, XUartNs550_Send() and XUartNs550_Recv(), are provided in the driver to allow data to be sent and received. They are designed to be used in polled or interrupt modes.

Note:

The default configuration for the UART after initialization is:

 MODIFICATION HISTORY:
 Ver   Who  Date     Changes
 ----- ---- -------- -----------------------------------------------
 1.00a ecm  08/16/01 First release
 1.00b jhl  03/11/02 Repartitioned the driver for smaller files.
 1.01a jvb  12/14/05 I separated dependency on the static config table and
                     xparameters.h from the driver initialization by moving
                     _Initialize and _LookupConfig to _sinit.c. I also added
                     the new _CfgInitialize routine.
 1.11a sv   03/20/07 Updated to use the new coding guidelines.
 1.11a sv   07/25/08 Corrected the definitions of XUN_MODEM_DCD_DELTA_MASK
		      and XUN_MODEM_DCD_MASK.
 1.12a sdm  08/22/08 Removed support for static interrupt handlers from the MDD
		      file
 1.12a sdm  12/15/08 Deprecated the CLOCK_HZ parameter in mdd and updated the
		      Tcl to obtain the bus frequency during libgen
 1.13a sdm  07/10/09 a) Updated the driver Tcl to obtain the external clock
                        frequency from MHS, when C_HAS_EXTERNAL_XIN = 1.
                     b) Added receive line interrupt option to OptionsTable[]
                        in xuartns550_options.c
 2.00a ktn  10/20/09 Converted all register accesses to 32 bit access.
		      Updated to use HAL Processor APIs. _m is removed from the
		      name of all the macro definitions. XUartNs550_mClearStats
		      macro is removed, XUartNs550_ClearStats function should be
		      used in its place.
 2.01a bss  01/13/12 Updated the XUartNs550_SelfTest to use Xil_AssertNonvoid
		      in place of XASSERT_NONVOID for CR 641344.
		      Removed unneccessary read of the LCR register in the
                     XUartNs550_CfgInitialize function. Removed compiler
		      warnings for unused variables in the
		      XUartNs550_StubHandler.
 2.02a adk 09/16/13 Fixed CR:735289 changes are made in the xuartns550_intr.c
		     file.
 3.0   adk  19/12/13 Updated as per the New Tcl API's
 3.1   adk  20/08/14 Fixed CR:816989 Canonical Definition for Multiple
		      Instances of UARTSNS550 have the same Device Id.
		      Changes are made in the driver tcl file.