embeddedsw/XilinxProcessorIPLib/drivers/uartlite/doc/html/api/xuartlite_8c.html
Kedareswara rao Appana 2a550bf65e doxygen: Update doxygen for the drivers to include .h files in documentation.
This patch updates the doxygen for the drivers
trafgen,ttcps,uartlite,uartns550,uartps to include .h files
in the listof files provided in the index.html file.

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
2014-09-02 11:21:43 +05:30

332 lines
22 KiB
HTML
Executable file

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>
Xilinx Driver uartlite v3_0: xuartlite.c File Reference
</title>
<link href="doxygen_kalyanidocs/doc/css/driver_api_doxygen.css" rel="stylesheet" type="text/css">
</head>
<h3 class="PageHeader">Xilinx Processor IP Library</h3>
<hl>Software Drivers</hl>
<hr class="whs1">
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>xuartlite.c File Reference</h1><code>#include &quot;<a class="el" href="xuartlite_8h.html">xuartlite.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="xuartlite__i_8h.html">xuartlite_i.h</a>&quot;</code><br/>
<code>#include &quot;xil_io.h&quot;</code><br/>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xuartlite_8c.html#ac8b83fd67305cebe15aba35b5b1b1e4d">XUartLite_CfgInitialize</a> (<a class="el" href="struct_x_uart_lite.html">XUartLite</a> *InstancePtr, <a class="el" href="struct_x_uart_lite___config.html">XUartLite_Config</a> *Config, u32 EffectiveAddr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xuartlite_8c.html#acd990348cf8483d47934d3263dc6fe90">XUartLite_Send</a> (<a class="el" href="struct_x_uart_lite.html">XUartLite</a> *InstancePtr, u8 *DataBufferPtr, unsigned int NumBytes)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xuartlite_8c.html#aa30ed8bfedba1acdc67dc94e77d5a41d">XUartLite_Recv</a> (<a class="el" href="struct_x_uart_lite.html">XUartLite</a> *InstancePtr, u8 *DataBufferPtr, unsigned int NumBytes)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xuartlite_8c.html#a7932155bf2bc603fc0a972f5aefec77e">XUartLite_ResetFifos</a> (<a class="el" href="struct_x_uart_lite.html">XUartLite</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xuartlite_8c.html#a40bc490d296a7a929f1cc5d07bb29b3c">XUartLite_IsSending</a> (<a class="el" href="struct_x_uart_lite.html">XUartLite</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xuartlite_8c.html#a155b5a1fba111533992e283445ad8f73">XUartLite_SendBuffer</a> (<a class="el" href="struct_x_uart_lite.html">XUartLite</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xuartlite_8c.html#a74efaecba1b6b1406c8c82abbb628cc8">XUartLite_ReceiveBuffer</a> (<a class="el" href="struct_x_uart_lite.html">XUartLite</a> *InstancePtr)</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Contains required functions for the <a class="el" href="struct_x_uart_lite.html">XUartLite</a> driver. See the <a class="el" href="xuartlite_8h.html">xuartlite.h</a> header file for more details on this driver.</p>
<pre>
MODIFICATION HISTORY:</pre><pre> Ver Who Date Changes
----- ---- -------- -----------------------------------------------
1.00a ecm 08/31/01 First release
1.00b jhl 02/21/02 Repartitioned the driver for smaller files
1.00b rmm 05/13/03 Fixed diab compiler warnings relating to asserts
1.01a jvb 12/13/05 Changed Initialize() into CfgInitialize(), and made
CfgInitialize() take a pointer to a config structure
instead of a device id. Moved Initialize() into
xgpio_sinit.c, and had Initialize() call CfgInitialize()
after it retrieved the config structure using the device
id. Removed include of xparameters.h along with any
dependencies on xparameters.h and the _g.c config table.
1.01a wsy 05/08/06 fix CR220811 and CR224103.
1.12a mta 03/31/07 Updated to new coding conventions
1.13a sv 01/21/08 Updated driver to support access through DCR bus
1.14a sdm 09/26/08 Updated code to avoid race condition in
XUartLite_SendBuffer
2.00a ktn 10/20/09 Updated to use HAL Processor APIs. The macros have been
renamed to remove _m from the name. XUartLite_mClearStats
macro is removed and XUartLite_ClearStats function should
be used in its place.
2.00a hvm 08/11/11 Removed the SetOptions related information in the
Recv and RecvBuffer function header notes section.
CR620849.
2.01a adk 18/04/13 Updated the code to avoid unused variable
warnings when compiling with the -Wextra -Wall flags
In the file <a class="el" href="xuartlite_8c.html">xuartlite.c</a>. CR:704999.
</pre> <hr/><h2>Function Documentation</h2>
<a class="anchor" id="ac8b83fd67305cebe15aba35b5b1b1e4d"></a><!-- doxytag: member="xuartlite.c::XUartLite_CfgInitialize" ref="ac8b83fd67305cebe15aba35b5b1b1e4d" args="(XUartLite *InstancePtr, XUartLite_Config *Config, u32 EffectiveAddr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int XUartLite_CfgInitialize </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_uart_lite.html">XUartLite</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="struct_x_uart_lite___config.html">XUartLite_Config</a> *&nbsp;</td>
<td class="paramname"> <em>Config</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u32&nbsp;</td>
<td class="paramname"> <em>EffectiveAddr</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initialize a <a class="el" href="struct_x_uart_lite.html">XUartLite</a> instance. The receive and transmit FIFOs of the UART are not flushed, so the user may want to flush them. The hardware device does not have any way to disable the receiver such that any valid data may be present in the receive FIFO. This function disables the UART interrupt. The baudrate and format of the data are fixed in the hardware at hardware build time.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the <a class="el" href="struct_x_uart_lite.html">XUartLite</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Config</em>&nbsp;</td><td>is a reference to a structure containing information about a specific UART Lite device. This function initializes an InstancePtr object for a specific device specified by the contents of Config. This function can initialize multiple instance objects with the use of multiple calls giving different Config information on each call. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>EffectiveAddr</em>&nbsp;</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, use Config-&gt;BaseAddress for this parameters, passing the physical address instead.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
<li>XST_SUCCESS if everything starts up as expected.</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>The Config pointer argument is not used by this function, but is provided to keep the function signature consistent with other drivers. </dd></dl>
</div>
</div>
<a class="anchor" id="a40bc490d296a7a929f1cc5d07bb29b3c"></a><!-- doxytag: member="xuartlite.c::XUartLite_IsSending" ref="a40bc490d296a7a929f1cc5d07bb29b3c" args="(XUartLite *InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int XUartLite_IsSending </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_uart_lite.html">XUartLite</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This function determines if the specified UART is sending data. If the transmitter register is not empty, it is sending data.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the <a class="el" href="struct_x_uart_lite.html">XUartLite</a> instance.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A value of TRUE if the UART is sending data, otherwise FALSE.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="a74efaecba1b6b1406c8c82abbb628cc8"></a><!-- doxytag: member="xuartlite.c::XUartLite_ReceiveBuffer" ref="a74efaecba1b6b1406c8c82abbb628cc8" args="(XUartLite *InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned int XUartLite_ReceiveBuffer </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_uart_lite.html">XUartLite</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This function receives a buffer that has been previously specified by setting up the instance variables of the instance. This function is designed to be an internal function for the <a class="el" href="struct_x_uart_lite.html">XUartLite</a> component such that it may be called from a shell function that sets up the buffer or from an interrupt handler.</p>
<p>This function will attempt to receive a specified number of bytes of data from the UART and store it into the specified buffer. This function is designed for either polled or interrupt driven modes. It is non-blocking such that it will return if there is no data has already received by the UART.</p>
<p>In a polled mode, this function will only receive as much data as the UART can buffer, either in the receiver or in the FIFO if present and enabled. The application may need to call it repeatedly to receive a buffer. Polled mode is the default mode of operation for the driver.</p>
<p>In interrupt mode, this function will start receiving and then the interrupt handler of the driver will continue until the buffer has been received. A callback function, as specified by the application, will be called to indicate the completion of receiving the buffer or when any receive errors or timeouts occur.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the <a class="el" href="struct_x_uart_lite.html">XUartLite</a> instance.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The number of bytes received.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="aa30ed8bfedba1acdc67dc94e77d5a41d"></a><!-- doxytag: member="xuartlite.c::XUartLite_Recv" ref="aa30ed8bfedba1acdc67dc94e77d5a41d" args="(XUartLite *InstancePtr, u8 *DataBufferPtr, unsigned int NumBytes)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned int XUartLite_Recv </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_uart_lite.html">XUartLite</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u8 *&nbsp;</td>
<td class="paramname"> <em>DataBufferPtr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int&nbsp;</td>
<td class="paramname"> <em>NumBytes</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This function will attempt to receive a specified number of bytes of data from the UART and store it into the specified buffer. This function is designed for either polled or interrupt driven modes. It is non-blocking such that it will return if no data has already received by the UART.</p>
<p>In a polled mode, this function will only receive as much data as the UART can buffer in the FIFO. The application may need to call it repeatedly to receive a buffer. Polled mode is the default mode of operation for the driver.</p>
<p>In interrupt mode, this function will start receiving and then the interrupt handler of the driver will continue receiving data until the buffer has been received. A callback function, as specified by the application, will be called to indicate the completion of receiving the buffer or when any receive errors or timeouts occur.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the <a class="el" href="struct_x_uart_lite.html">XUartLite</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>DataBufferPtr</em>&nbsp;</td><td>is pointer to buffer for data to be received into. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>NumBytes</em>&nbsp;</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>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The number of bytes received.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>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. </dd></dl>
</div>
</div>
<a class="anchor" id="a7932155bf2bc603fc0a972f5aefec77e"></a><!-- doxytag: member="xuartlite.c::XUartLite_ResetFifos" ref="a7932155bf2bc603fc0a972f5aefec77e" args="(XUartLite *InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void XUartLite_ResetFifos </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_uart_lite.html">XUartLite</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This function resets the FIFOs, both transmit and receive, of the UART such that they are emptied. Since the UART does not have any way to disable it from receiving data, it may be necessary for the application to reset the FIFOs to get rid of any unwanted data.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the <a class="el" href="struct_x_uart_lite.html">XUartLite</a> instance .</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>None.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="acd990348cf8483d47934d3263dc6fe90"></a><!-- doxytag: member="xuartlite.c::XUartLite_Send" ref="acd990348cf8483d47934d3263dc6fe90" args="(XUartLite *InstancePtr, u8 *DataBufferPtr, unsigned int NumBytes)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned int XUartLite_Send </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_uart_lite.html">XUartLite</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u8 *&nbsp;</td>
<td class="paramname"> <em>DataBufferPtr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int&nbsp;</td>
<td class="paramname"> <em>NumBytes</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This functions sends the specified buffer of data using the UART in either polled or interrupt driven modes. This function is non-blocking such that it will return before the data has been sent by the UART. If the UART is busy sending data, it will return and indicate zero bytes were sent.</p>
<p>In a polled mode, this function will only send as much data as the UART can buffer in the FIFO. The application may need to call it repeatedly to send a buffer.</p>
<p>In interrupt mode, this function will start sending the specified buffer and then the interrupt handler of the driver will continue sending data until the buffer has been sent. A callback function, as specified by the application, will be called to indicate the completion of sending the buffer.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the <a class="el" href="struct_x_uart_lite.html">XUartLite</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>DataBufferPtr</em>&nbsp;</td><td>is pointer to a buffer of data to be sent. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>NumBytes</em>&nbsp;</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>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The number of bytes actually sent.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>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. </dd></dl>
</div>
</div>
<a class="anchor" id="a155b5a1fba111533992e283445ad8f73"></a><!-- doxytag: member="xuartlite.c::XUartLite_SendBuffer" ref="a155b5a1fba111533992e283445ad8f73" args="(XUartLite *InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned int XUartLite_SendBuffer </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_uart_lite.html">XUartLite</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This function sends a buffer that has been previously specified by setting up the instance variables of the instance. This function is designed to be an internal function for the <a class="el" href="struct_x_uart_lite.html">XUartLite</a> component such that it may be called from a shell function that sets up the buffer or from an interrupt handler.</p>
<p>This function sends the specified buffer of data to the UART in either polled or interrupt driven modes. This function is non-blocking such that it will return before the data has been sent by the UART.</p>
<p>In a polled mode, this function will only send as much data as the UART can buffer, either in the transmitter or in the FIFO if present and enabled. The application may need to call it repeatedly to send a buffer.</p>
<p>In interrupt mode, this function will start sending the specified buffer and then the interrupt handler of the driver will continue until the buffer has been sent. A callback function, as specified by the application, will be called to indicate the completion of sending the buffer.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the <a class="el" href="struct_x_uart_lite.html">XUartLite</a> instance.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>NumBytes is the number of bytes actually sent (put into the UART transmitter and/or FIFO).</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
</div>
<p class="Copyright">
Copyright &copy; 1995-2014 Xilinx, Inc. All rights reserved.
</p>
</body>
</html>