<p>This file contains the implementation of the interface functions for <aclass="el"href="struct_x_uart_ps.html">XUartPs</a> driver. Refer to the header file <aclass="el"href="xuartps_8h.html">xuartps.h</a> for more detailed information.</p>
<p>Initializes a specific <aclass="el"href="struct_x_uart_ps.html">XUartPs</a> instance such that it is ready to be used. The data format of the device is setup for 8 data bits, 1 stop bit, and no parity by default. The baud rate is set to a default value specified by Config->DefaultBaudRate if set, otherwise it is set to 19.2K baud. The receive FIFO threshold is set for 8 bytes. The default operating mode of the driver is polled mode.</p>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_uart_ps.html">XUartPs</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>Config</em> </td><td>is a reference to a structure containing information about a specific <aclass="el"href="struct_x_uart_ps.html">XUartPs</a> driver. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>EffectiveAddr</em> </td><td>is the device base address in the virtual memory address space. The caller is responsible for keeping the address mapping from EffectiveAddr to the device physical base address unchanged once this function is invoked. Unexpected errors may occur if the address mapping changes after this function is called. If address translation is not used, pass in the physical address instead.</td></tr>
<p>This function attempts to receive a specified number of bytes of data from the device and store it into the specified buffer. This function works for both polled or interrupt driven modes. It is non-blocking.</p>
<p>In a polled mode, this function will only receive the data already in the RX FIFO. The application may need to call it repeatedly to receive the entire buffer. Polled mode is the default mode of operation for the device.</p>
<p>In interrupt mode, this function will start the receiving, if not the entire buffer has been received, the interrupt handler will continue receiving data until the entire buffer has been received. A callback function, as specified by the application, will be called to indicate the completion of the receiving or error conditions.</p>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_uart_ps.html">XUartPs</a> instance </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>BufferPtr</em> </td><td>is pointer to buffer for data to be received into </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>NumBytes</em> </td><td>is the number of bytes to be received. A value of zero will stop a previous receive operation that is in progress in interrupt mode.</td></tr>
<p>This functions sends the specified buffer using the device in either polled or interrupt driven mode. This function is non-blocking, if the device is busy sending data, it will return and indicate zero bytes were sent. Otherwise, it fills the TX FIFO as much as it can, and return the number of bytes sent.</p>
<p>In a polled mode, this function will only send as much data as TX FIFO can buffer. The application may need to call it repeatedly to send the entire buffer.</p>
<p>In interrupt mode, this function will start sending the specified buffer, then the interrupt handler will continue sending data until the entire buffer has been sent. A callback function, as specified by the application, will be called to indicate the completion of sending.</p>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_uart_ps.html">XUartPs</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>BufferPtr</em> </td><td>is pointer to a buffer of data to be sent. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>NumBytes</em> </td><td>contains the number of bytes to be sent. A value of zero will stop a previous send operation that is in progress in interrupt mode. Any data that was already put into the transmit FIFO will be sent.</td></tr>
<p>The number of bytes is not asserted so that this function may be called with a value of zero to stop an operation that is already in progress. <br/>
<p>Sets the baud rate for the device. Checks the input value for validity and also verifies that the requested rate can be configured to within the maximum error range specified by XUARTPS_MAX_BAUD_ERROR_RATE. If the provided rate is not possible, the current setting is unchanged.</p>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_uart_ps.html">XUartPs</a> instance </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>BaudRate</em> </td><td>to be set</td></tr>