embeddedsw/XilinxProcessorIPLib/drivers/wdttb/doc/html/api/xwdttb_8c.html

318 lines
15 KiB
HTML
Raw Normal View History

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>
xwdttb.c File Reference
</title>
<link href="$DriverApiDocsCssPath" 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.4.5 -->
<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 id="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>
<h1>xwdttb.c File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
Contains the required functions of the <a class="el" href="struct_x_wdt_tb.html">XWdtTb</a> driver. See xwdttb.h for a description of the driver.<p>
<pre>
MODIFICATION HISTORY:</pre><p>
<pre> Ver Who Date Changes
----- ---- -------- -----------------------------------------------
1.00a ecm 08/16/01 First release
1.00b jhl 02/21/02 Repartitioned the driver for smaller files
1.00b rpm 04/26/02 Made LookupConfig public
1.10b mta 03/23/07 Updated to new coding style
2.00a ktn 10/22/09 Updated to use the HAL processor APIs/macros.
</pre>
<p>
<code>#include &quot;xil_types.h&quot;</code><br>
<code>#include &quot;xil_assert.h&quot;</code><br>
<code>#include &quot;xparameters.h&quot;</code><br>
<code>#include &quot;xil_io.h&quot;</code><br>
<code>#include &quot;xwdttb.h&quot;</code><br>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xwdttb_8c.html#b1450a75db1142a3b345eaa9f12b347a">XWdtTb_Initialize</a> (<a class="el" href="struct_x_wdt_tb.html">XWdtTb</a> *InstancePtr, u16 DeviceId)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xwdttb_8c.html#3700138295e2e21680eb3737d8a7222c">XWdtTb_Start</a> (<a class="el" href="struct_x_wdt_tb.html">XWdtTb</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xwdttb_8c.html#07127fc18579364e10030070b10701dd">XWdtTb_Stop</a> (<a class="el" href="struct_x_wdt_tb.html">XWdtTb</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xwdttb_8c.html#0483aef5b5aa86c9557d2ae856d196c7">XWdtTb_IsWdtExpired</a> (<a class="el" href="struct_x_wdt_tb.html">XWdtTb</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xwdttb_8c.html#e0166b70e02683c0c346c6cbece62075">XWdtTb_RestartWdt</a> (<a class="el" href="struct_x_wdt_tb.html">XWdtTb</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">u32&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xwdttb_8c.html#159b023693d9614f60512608d5030b02">XWdtTb_GetTbValue</a> (<a class="el" href="struct_x_wdt_tb.html">XWdtTb</a> *InstancePtr)</td></tr>
<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="struct_x_wdt_tb___config.html">XWdtTb_Config</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xwdttb_8c.html#0b2363efcacee2dd80ad76e3f6af6aa5">XWdtTb_ConfigTable</a> []</td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="159b023693d9614f60512608d5030b02"></a><!-- doxytag: member="xwdttb.c::XWdtTb_GetTbValue" ref="159b023693d9614f60512608d5030b02" args="(XWdtTb *InstancePtr)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">u32 XWdtTb_GetTbValue </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_wdt_tb.html">XWdtTb</a> *&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>InstancePtr</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Returns the current contents of the timebase.<p>
<dl compact><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_wdt_tb.html">XWdtTb</a> instance to be worked on.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The contents of the timebase.</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>None. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="b1450a75db1142a3b345eaa9f12b347a"></a><!-- doxytag: member="xwdttb.c::XWdtTb_Initialize" ref="b1450a75db1142a3b345eaa9f12b347a" args="(XWdtTb *InstancePtr, u16 DeviceId)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int XWdtTb_Initialize </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_wdt_tb.html">XWdtTb</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>u16&nbsp;</td>
<td class="mdname" nowrap> <em>DeviceId</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Initialize a specific watchdog timer/timebase instance/driver. This function must be called before other functions of the driver are called.<p>
<dl compact><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_wdt_tb.html">XWdtTb</a> instance to be worked on. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>DeviceId</em>&nbsp;</td><td>is the unique id of the device controlled by this <a class="el" href="struct_x_wdt_tb.html">XWdtTb</a> instance. Passing in a device id associates the generic <a class="el" href="struct_x_wdt_tb.html">XWdtTb</a> instance to a specific device, as chosen by the caller or application developer.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd><ul>
<li>XST_SUCCESS if initialization was successful</li><li>XST_DEVICE_IS_STARTED if the device has already been started</li><li>XST_DEVICE_NOT_FOUND if the configuration for device ID was not found</li></ul>
</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>None. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="0483aef5b5aa86c9557d2ae856d196c7"></a><!-- doxytag: member="xwdttb.c::XWdtTb_IsWdtExpired" ref="0483aef5b5aa86c9557d2ae856d196c7" args="(XWdtTb *InstancePtr)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int XWdtTb_IsWdtExpired </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_wdt_tb.html">XWdtTb</a> *&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>InstancePtr</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Check if the watchdog timer has expired. This function is used for polled mode and it is also used to check if the last reset was caused by the watchdog timer.<p>
<dl compact><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_wdt_tb.html">XWdtTb</a> instance to be worked on.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>TRUE if the watchdog has expired, and FALSE otherwise.</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>None. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="e0166b70e02683c0c346c6cbece62075"></a><!-- doxytag: member="xwdttb.c::XWdtTb_RestartWdt" ref="e0166b70e02683c0c346c6cbece62075" args="(XWdtTb *InstancePtr)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void XWdtTb_RestartWdt </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_wdt_tb.html">XWdtTb</a> *&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>InstancePtr</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Restart the watchdog timer. An application needs to call this function periodically to keep the timer from asserting the reset output.<p>
<dl compact><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_wdt_tb.html">XWdtTb</a> instance to be worked on.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>None.</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>None. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="3700138295e2e21680eb3737d8a7222c"></a><!-- doxytag: member="xwdttb.c::XWdtTb_Start" ref="3700138295e2e21680eb3737d8a7222c" args="(XWdtTb *InstancePtr)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void XWdtTb_Start </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_wdt_tb.html">XWdtTb</a> *&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>InstancePtr</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Start the watchdog timer of the device.<p>
<dl compact><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_wdt_tb.html">XWdtTb</a> instance to be worked on.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>None.</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>The Timebase is reset to 0 when the Watchdog Timer is started. The Timebase is always incrementing </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="07127fc18579364e10030070b10701dd"></a><!-- doxytag: member="xwdttb.c::XWdtTb_Stop" ref="07127fc18579364e10030070b10701dd" args="(XWdtTb *InstancePtr)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int XWdtTb_Stop </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_wdt_tb.html">XWdtTb</a> *&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>InstancePtr</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Disable the watchdog timer.<p>
It is the caller's responsibility to disconnect the interrupt handler of the watchdog timer from the interrupt source, typically an interrupt controller, and disable the interrupt in the interrupt controller.<p>
<dl compact><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_wdt_tb.html">XWdtTb</a> instance to be worked on.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd><ul>
<li>XST_SUCCESS if the watchdog was stopped successfully</li><li>XST_NO_FEATURE if the watchdog cannot be stopped</li></ul>
</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd></dd></dl>
The hardware configuration controls this functionality. If it is not allowed by the hardware the failure will be returned and the timer will continue without interruption. </td>
</tr>
</table>
<hr><h2>Variable Documentation</h2>
<a class="anchor" name="0b2363efcacee2dd80ad76e3f6af6aa5"></a><!-- doxytag: member="xwdttb.c::XWdtTb_ConfigTable" ref="0b2363efcacee2dd80ad76e3f6af6aa5" args="[]" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_wdt_tb___config.html">XWdtTb_Config</a> <a class="el" href="xwdttb__g_8c.html#2c52fbfb5229af7b1e620f80dc40ad02">XWdtTb_ConfigTable</a>[] </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
This table contains configuration information for each watchdog timer device in the system. </td>
</tr>
</table>
Copyright @ 1995-2014 Xilinx, Inc. All rights reserved.