embeddedsw/XilinxProcessorIPLib/drivers/uartps/doc/html/api/xuartps_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

303 lines
17 KiB
HTML
Executable file

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>
Xilinx Driver uartps v2_2: xuartps.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>xuartps.c File Reference</h1><code>#include &quot;xstatus.h&quot;</code><br/>
<code>#include &quot;<a class="el" href="xuartps_8h.html">xuartps.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>Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xuartps_8c.html#ad2ea7cbf13cc424a45c6fa01e436c7dd">XUARTPS_MAX_BAUD_ERROR_RATE</a>&nbsp;&nbsp;&nbsp;3</td></tr>
<tr><td colspan="2"><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xuartps_8c.html#a4a7b9c23687feeb9034b091dab509211">XUartPs_SendBuffer</a> (<a class="el" href="struct_x_uart_ps.html">XUartPs</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="xuartps_8c.html#a8714077a08d63ff9b41b31e1cc6aa961">XUartPs_ReceiveBuffer</a> (<a class="el" href="struct_x_uart_ps.html">XUartPs</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xuartps_8c.html#a220fd9dda66e2a7ba1147816baf30830">XUartPs_CfgInitialize</a> (<a class="el" href="struct_x_uart_ps.html">XUartPs</a> *InstancePtr, <a class="el" href="struct_x_uart_ps___config.html">XUartPs_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="xuartps_8c.html#adff739cf6e252c42a050e92d3a265172">XUartPs_Send</a> (<a class="el" href="struct_x_uart_ps.html">XUartPs</a> *InstancePtr, u8 *BufferPtr, 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="xuartps_8c.html#a74e1aeb2b28a79a9e17e431280296a60">XUartPs_Recv</a> (<a class="el" href="struct_x_uart_ps.html">XUartPs</a> *InstancePtr, u8 *BufferPtr, unsigned int NumBytes)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xuartps_8c.html#a3c1712af7736b36db4ba272e97326436">XUartPs_SetBaudRate</a> (<a class="el" href="struct_x_uart_ps.html">XUartPs</a> *InstancePtr, u32 BaudRate)</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>This file contains the implementation of the interface functions for <a class="el" href="struct_x_uart_ps.html">XUartPs</a> driver. Refer to the header file <a class="el" href="xuartps_8h.html">xuartps.h</a> for more detailed information.</p>
<pre>
MODIFICATION HISTORY:</pre><pre> Ver Who Date Changes
----- ------ -------- ----------------------------------------------
1.00 drg/jz 01/13/10 First Release
2.2 hk 06/23/14 SW reset of RX and TX should be done when changing
baud rate. CR# 804281.
</pre> <hr/><h2>Define Documentation</h2>
<a class="anchor" id="ad2ea7cbf13cc424a45c6fa01e436c7dd"></a><!-- doxytag: member="xuartps.c::XUARTPS_MAX_BAUD_ERROR_RATE" ref="ad2ea7cbf13cc424a45c6fa01e436c7dd" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XUARTPS_MAX_BAUD_ERROR_RATE&nbsp;&nbsp;&nbsp;3</td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="a220fd9dda66e2a7ba1147816baf30830"></a><!-- doxytag: member="xuartps.c::XUartPs_CfgInitialize" ref="a220fd9dda66e2a7ba1147816baf30830" args="(XUartPs *InstancePtr, XUartPs_Config *Config, u32 EffectiveAddr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int XUartPs_CfgInitialize </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_uart_ps.html">XUartPs</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_ps___config.html">XUartPs_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>Initializes a specific <a class="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-&gt;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>
<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_ps.html">XUartPs</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 <a class="el" href="struct_x_uart_ps.html">XUartPs</a> driver. </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, pass in the physical address instead.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd></dd></dl>
<ul>
<li>XST_SUCCESS if initialization was successful</li>
<li>XST_UART_BAUD_ERROR if the baud rate is not possible because the inputclock frequency is not divisible with an acceptable amount of error</li>
</ul>
<dl class="note"><dt><b>Note:</b></dt><dd></dd></dl>
<p>The default configuration for the UART after initialization is:</p>
<ul>
<li>19,200 bps or XPAR_DFT_BAUDRATE if defined</li>
<li>8 data bits</li>
<li>1 stop bit</li>
<li>no parity</li>
<li>FIFO's are enabled with a receive threshold of 8 bytes</li>
<li>The RX timeout is enabled with a timeout of 1 (4 char times)</li>
</ul>
<p>All interrupts are disabled. </p>
</div>
</div>
<a class="anchor" id="a8714077a08d63ff9b41b31e1cc6aa961"></a><!-- doxytag: member="xuartps.c::XUartPs_ReceiveBuffer" ref="a8714077a08d63ff9b41b31e1cc6aa961" args="(XUartPs *InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned int XUartPs_ReceiveBuffer </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_uart_ps.html">XUartPs</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="a74e1aeb2b28a79a9e17e431280296a60"></a><!-- doxytag: member="xuartps.c::XUartPs_Recv" ref="a74e1aeb2b28a79a9e17e431280296a60" args="(XUartPs *InstancePtr, u8 *BufferPtr, unsigned int NumBytes)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned int XUartPs_Recv </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_uart_ps.html">XUartPs</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>BufferPtr</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 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>
<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_ps.html">XUartPs</a> instance </td></tr>
<tr><td valign="top"></td><td valign="top"><em>BufferPtr</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></dd></dl>
<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. </p>
</div>
</div>
<a class="anchor" id="adff739cf6e252c42a050e92d3a265172"></a><!-- doxytag: member="xuartps.c::XUartPs_Send" ref="adff739cf6e252c42a050e92d3a265172" args="(XUartPs *InstancePtr, u8 *BufferPtr, unsigned int NumBytes)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned int XUartPs_Send </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_uart_ps.html">XUartPs</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>BufferPtr</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 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>
<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_ps.html">XUartPs</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>BufferPtr</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></dd></dl>
<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/>
<br/>
</p>
</div>
</div>
<a class="anchor" id="a4a7b9c23687feeb9034b091dab509211"></a><!-- doxytag: member="xuartps.c::XUartPs_SendBuffer" ref="a4a7b9c23687feeb9034b091dab509211" args="(XUartPs *InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned int XUartPs_SendBuffer </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_uart_ps.html">XUartPs</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="a3c1712af7736b36db4ba272e97326436"></a><!-- doxytag: member="xuartps.c::XUartPs_SetBaudRate" ref="a3c1712af7736b36db4ba272e97326436" args="(XUartPs *InstancePtr, u32 BaudRate)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int XUartPs_SetBaudRate </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_uart_ps.html">XUartPs</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u32&nbsp;</td>
<td class="paramname"> <em>BaudRate</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<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>
<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_ps.html">XUartPs</a> instance </td></tr>
<tr><td valign="top"></td><td valign="top"><em>BaudRate</em>&nbsp;</td><td>to be set</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
<li>XST_SUCCESS if everything configured as expected</li>
<li>XST_UART_BAUD_ERROR if the requested rate is not available because there was too much error</li>
</ul>
</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>