<li>Dynamic data format (baud rate, data bits, stop bits, parity)</li>
<li>Polled mode</li>
<li>Interrupt driven mode</li>
<li>Transmit and receive FIFOs (32 byte FIFO depth)</li>
<li>Access to the external modem control lines</li>
</ul>
<p><b>Initialization & Configuration</b></p>
<p>The <aclass="el"href="struct_x_uart_ps___config.html">XUartPs_Config</a> structure is used by the driver to configure itself. Fields inside this structure are properties of <aclass="el"href="struct_x_uart_ps.html">XUartPs</a> based on its hardware build.</p>
<p>To support multiple runtime loading and initialization strategies employed by various operating systems, the driver instance can be initialized in the following way:</p>
<li>XUartPs_CfgInitialize(InstancePtr, CfgPtr, EffectiveAddr) - Uses a configuration structure provided by the caller. If running in a system with address translation, the parameter EffectiveAddr should be the virtual address.</li>
</ul>
<p><b>Baud Rate</b></p>
<p>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.</p>
<p>Accompanied with the baud rate divider register, the baud rate is determined by: </p>
</pre><p> where bgen is the value of the baud rate generator, and bdiv is the value of baud rate divider.</p>
<p><b>Interrupts</b></p>
<p>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.</p>
<p>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.</p>
<li>Data in the receive FIFO for a configuable time without receiver activity</li>
<li>A parity error</li>
<li>A framing error</li>
<li>An overrun error</li>
<li>Transmit FIFO is full</li>
<li>Transmit FIFO is empty</li>
<li>Receive FIFO is full</li>
<li>Receive FIFO is empty</li>
<li>Data in the receive FIFO equal to the receive threshold</li>
</ul>
<p>The application can control which interrupts are enabled using the <aclass="el"href="xuartps_8h.html#ab3b65e926f6f4ac7ab41a70801ba12c3">XUartPs_SetInterruptMask()</a> function.</p>
<p>In order to use interrupts, it is necessary for the user to connect the driver interrupt handler, <aclass="el"href="xuartps_8h.html#abf86fb20a58e4a7fbd73afa49f8eb604">XUartPs_InterruptHandler()</a>, 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 <aclass="el"href="xuartps_8h.html#a9528098e589491997c7805592a4b5a7b">XUartPs_SetHandler()</a> function.</p>
<p><b>Data Transfer</b></p>
<p>The functions, <aclass="el"href="xuartps_8c.html#adff739cf6e252c42a050e92d3a265172">XUartPs_Send()</a> and <aclass="el"href="xuartps_8c.html#a74e1aeb2b28a79a9e17e431280296a60">XUartPs_Recv()</a>, are provided in the driver to allow data to be sent and received. They can be used in either polled or interrupt mode.</p>