embeddedsw/XilinxProcessorIPLib/drivers/uartns550/doc/html/api/xuartns550_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

321 lines
21 KiB
HTML
Executable file

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>
Xilinx Driver uartns550 v3_1: xuartns550.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>xuartns550.c File Reference</h1><code>#include &quot;xstatus.h&quot;</code><br/>
<code>#include &quot;<a class="el" href="xuartns550_8h.html">xuartns550.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="xuartns550__i_8h.html">xuartns550_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>Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xuartns550_8c.html#ad99395b30fbe6d0f90fc2937db2cfcce">XUN_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">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xuartns550_8c.html#a37a67d6e3901ba6bee3df7c51dab093b">XUartNs550_CfgInitialize</a> (<a class="el" href="struct_x_uart_ns550.html">XUartNs550</a> *InstancePtr, <a class="el" href="struct_x_uart_ns550___config.html">XUartNs550_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="xuartns550_8c.html#a421921af6a8df7c51ddbfa5d2301ad1b">XUartNs550_Send</a> (<a class="el" href="struct_x_uart_ns550.html">XUartNs550</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="xuartns550_8c.html#a35fc171801e394fce29cbcb09dc1ff99">XUartNs550_Recv</a> (<a class="el" href="struct_x_uart_ns550.html">XUartNs550</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="xuartns550_8c.html#a9046228564fdafeb5715dce1c0b46766">XUartNs550_SendBuffer</a> (<a class="el" href="struct_x_uart_ns550.html">XUartNs550</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="xuartns550_8c.html#a6df754edf91aea638537a15536d4d34e">XUartNs550_ReceiveBuffer</a> (<a class="el" href="struct_x_uart_ns550.html">XUartNs550</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xuartns550_8c.html#ab8e499e36ea8619d0a2ffba8a2ecd0c0">XUartNs550_SetBaudRate</a> (<a class="el" href="struct_x_uart_ns550.html">XUartNs550</a> *InstancePtr, u32 BaudRate)</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>This file contains the required functions for the 16450/16550 UART driver. Refer to the header file <a class="el" href="xuartns550_8h.html">xuartns550.h</a> for more detailed information.</p>
<pre>
MODIFICATION HISTORY:</pre><pre> Ver Who Date Changes
----- ---- -------- -----------------------------------------------
1.00a ecm 08/16/01 First release
1.00b jhl 03/11/02 Repartitioned driver for smaller files.
1.00b rmm 05/14/03 Fixed diab compiler warnings relating to asserts.
1.01a jvb 12/13/05 I changed Initialize() into CfgInitialize(), and made
CfgInitialize() take a pointer to a config structure
instead of a device id. I moved Initialize() into
xgpio_sinit.c, and had Initialize() call CfgInitialize()
after it retrieved the config structure using the device
id. I removed include of xparameters.h along with any
dependencies on xparameters.h and the _g.c config table.
1.11a sv 03/20/07 Updated to use the new coding guidelines.
2.00a ktn 10/20/09 Converted all register accesses to 32 bit access.
Updated to use HAL Processor APIs. _m is removed from the
name of all the macro definitions. XUartNs550_mClearStats
macro is removed, XUartNs550_ClearStats function should be
used in its place.
2.01a bss 01/13/12 Removed unneccessary read of the LCR register in the
XUartNs550_CfgInitialize function. Removed compiler
warnings for unused variables in the
XUartNs550_StubHandler.
</pre> <hr/><h2>Define Documentation</h2>
<a class="anchor" id="ad99395b30fbe6d0f90fc2937db2cfcce"></a><!-- doxytag: member="xuartns550.c::XUN_MAX_BAUD_ERROR_RATE" ref="ad99395b30fbe6d0f90fc2937db2cfcce" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XUN_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="a37a67d6e3901ba6bee3df7c51dab093b"></a><!-- doxytag: member="xuartns550.c::XUartNs550_CfgInitialize" ref="a37a67d6e3901ba6bee3df7c51dab093b" args="(XUartNs550 *InstancePtr, XUartNs550_Config *Config, u32 EffectiveAddr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int XUartNs550_CfgInitialize </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_uart_ns550.html">XUartNs550</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_ns550___config.html">XUartNs550_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_ns550.html">XUartNs550</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. If the device has FIFOs (16550), they are enabled and the a 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_ns550.html">XUartNs550</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 16450/16550 device. XUartNs550_Init initializes an InstancePtr object for a specific device specified by the contents f Config. XUartNs550_Init 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 initialization was successful.</li>
<li>XST_UART_BAUD_ERROR if the baud rate is not possible because the input clock frequency is not divisible with an acceptable amount of error.</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="a6df754edf91aea638537a15536d4d34e"></a><!-- doxytag: member="xuartns550.c::XUartNs550_ReceiveBuffer" ref="a6df754edf91aea638537a15536d4d34e" args="(XUartNs550 *InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned int XUartNs550_ReceiveBuffer </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_uart_ns550.html">XUartNs550</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_ns550.html">XUartNs550</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. Interrupt mode must be enabled using the SetOptions function.</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_ns550.html">XUartNs550</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="a35fc171801e394fce29cbcb09dc1ff99"></a><!-- doxytag: member="xuartns550.c::XUartNs550_Recv" ref="a35fc171801e394fce29cbcb09dc1ff99" args="(XUartNs550 *InstancePtr, u8 *BufferPtr, unsigned int NumBytes)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned int XUartNs550_Recv </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_uart_ns550.html">XUartNs550</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 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, 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 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. Interrupt mode must be enabled using the SetOptions function.</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_ns550.html">XUartNs550</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="a421921af6a8df7c51ddbfa5d2301ad1b"></a><!-- doxytag: member="xuartns550.c::XUartNs550_Send" ref="a421921af6a8df7c51ddbfa5d2301ad1b" args="(XUartNs550 *InstancePtr, u8 *BufferPtr, unsigned int NumBytes)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned int XUartNs550_Send </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_uart_ns550.html">XUartNs550</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 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, 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 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_ns550.html">XUartNs550</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/>
This function and the <a class="el" href="xuartns550_8h.html#ac2270082fbb7d7b2c32bd9208dae5be3">XUartNs550_SetOptions()</a> function modify shared data such that there may be a need for mutual exclusion in a multithreaded environment and if <a class="el" href="xuartns550_8h.html#ac2270082fbb7d7b2c32bd9208dae5be3">XUartNs550_SetOptions()</a> if called from a handler. </p>
</div>
</div>
<a class="anchor" id="a9046228564fdafeb5715dce1c0b46766"></a><!-- doxytag: member="xuartns550.c::XUartNs550_SendBuffer" ref="a9046228564fdafeb5715dce1c0b46766" args="(XUartNs550 *InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned int XUartNs550_SendBuffer </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_uart_ns550.html">XUartNs550</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_ns550.html">XUartNs550</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_ns550.html">XUartNs550</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 tranmitter and/or FIFO).</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="ab8e499e36ea8619d0a2ffba8a2ecd0c0"></a><!-- doxytag: member="xuartns550.c::XUartNs550_SetBaudRate" ref="ab8e499e36ea8619d0a2ffba8a2ecd0c0" args="(XUartNs550 *InstancePtr, u32 BaudRate)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int XUartNs550_SetBaudRate </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_uart_ns550.html">XUartNs550</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">
</div>
</div>
</div>
<p class="Copyright">
Copyright &copy; 1995-2014 Xilinx, Inc. All rights reserved.
</p>
</body>
</html>