![]() |
uartpsv
Xilinx SDK Drivers API Documentation
|
This driver supports the following features:- Dynamic data format (baud rate, data bits, stop bits, parity)
Initialization & Configuration
The XUartPsv_Config structure is used by the driver to configure itself. Fields inside this structure are properties of XUartPsv based on its hardware build.
To support multiple runtime loading and initialization strategies employed by various operating systems, the driver instance can be initialized in the following way:
Baud Rate
The UART has an internal baud rate generator, which furnishes the baud rate clock for both the receiver and the transmitter. Ther input clock frequency can be either the master clock or the master clock divided by 8, configured through the mode register.
Accompanied with the baud rate divider register, the baud rate is determined by:
baud_rate = input_clock / (bgen * (bdiv + 1)
where bgen is the value of the baud rate generator, and bdiv is the value of baud rate divider.
Interrupts
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 one of the following conditions.
The application can control which interrupts are enabled using the XUartPsv_SetInterruptMask() function.
In order to use interrupts, it is necessary for the user to connect the driver interrupt handler, XUartPsv_InterruptHandler(), to the interrupt system of the application. A separate handler should be provided by the application to communicate with the interrupt system, and conduct application specific interrupt handling. An application registers its own handler through the XUartPsv_SetHandler() function.
Data Transfer
The functions, XUartPsv_Send() and XUartPsv_Recv(), are provided in the driver to allow data to be sent and received. They can be used in either polled or interrupt mode.
The default configuration for the UART after initialization is:
MODIFICATION HISTORY:
Ver Who Date Changes
1.0 sg 09/18/17 First Release