embeddedsw/XilinxProcessorIPLib/drivers/can/doc/html/api/xcan_8c.html
Kedareswara rao Appana f20ccd3175 doxygen: Update doxygen for the drivers to include .h files in documentation.
This patch updates the doxygen for the drivers
axivdma, can, canps ,devcfg , bram  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:31 +05:30

831 lines
46 KiB
HTML
Executable file

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>
Xilinx Driver can v3_0: xcan.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>xcan.c File Reference</h1><code>#include &quot;xil_types.h&quot;</code><br/>
<code>#include &quot;xil_assert.h&quot;</code><br/>
<code>#include &quot;xil_io.h&quot;</code><br/>
<code>#include &quot;xenv.h&quot;</code><br/>
<code>#include &quot;<a class="el" href="xcan_8h.html">xcan.h</a>&quot;</code><br/>
<code>#include &quot;xparameters.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="xcan_8c.html#acbd9f5e256dcbd948afe916d13bc7b35">XCan_Initialize</a> (<a class="el" href="struct_x_can.html">XCan</a> *InstancePtr, u16 DeviceId)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8c.html#a2b8e3ee4379e7a73c80a11d3877fb077">XCan_VmInitialize</a> (<a class="el" href="struct_x_can.html">XCan</a> *InstancePtr, u16 DeviceId, u32 VirtAddr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8c.html#a6c52fb4d4b12d62e3e713ad182f00d8b">XCan_Reset</a> (<a class="el" href="struct_x_can.html">XCan</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u8&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8c.html#a6b437133a6a2f40f56cf3c80102f5b0d">XCan_GetMode</a> (<a class="el" href="struct_x_can.html">XCan</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8c.html#a994a0b0bd9c938e99de9d7ffceb10ef3">XCan_EnterMode</a> (<a class="el" href="struct_x_can.html">XCan</a> *InstancePtr, u8 OperationMode)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u32&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8c.html#a502a294405726d96834c2abf574a96e8">XCan_GetStatus</a> (<a class="el" href="struct_x_can.html">XCan</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8c.html#a1a905b9f2f47e605267817c58edd1112">XCan_GetBusErrorCounter</a> (<a class="el" href="struct_x_can.html">XCan</a> *InstancePtr, u8 *RxErrorCount, u8 *TxErrorCount)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u32&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8c.html#a242ec83578f9966bd7d562ed7f5dedd3">XCan_GetBusErrorStatus</a> (<a class="el" href="struct_x_can.html">XCan</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8c.html#a757aecce4c0c06ff8f4cb3dd4d0c79fa">XCan_ClearBusErrorStatus</a> (<a class="el" href="struct_x_can.html">XCan</a> *InstancePtr, u32 Mask)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8c.html#ad4717011f46b8e9d5e15c0bfb04c33c8">XCan_Send</a> (<a class="el" href="struct_x_can.html">XCan</a> *InstancePtr, u32 *FramePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8c.html#a1d8ac17789423c440872ffd4585b8c3c">XCan_Recv</a> (<a class="el" href="struct_x_can.html">XCan</a> *InstancePtr, u32 *FramePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8c.html#a8ba9b10678fbc6bd6093fdc5e9eb3edd">XCan_SendHighPriority</a> (<a class="el" href="struct_x_can.html">XCan</a> *InstancePtr, u32 *FramePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8c.html#ae04419e368e843d5bf7384b8f32ba9b6">XCan_AcceptFilterEnable</a> (<a class="el" href="struct_x_can.html">XCan</a> *InstancePtr, u32 FilterIndexes)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8c.html#a8bc758e3b0a5fc41bcb17b49fa1e7ed4">XCan_AcceptFilterDisable</a> (<a class="el" href="struct_x_can.html">XCan</a> *InstancePtr, u32 FilterIndexes)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u32&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8c.html#a02c9fb502d3fd8a0537c9efdf456defd">XCan_AcceptFilterGetEnabled</a> (<a class="el" href="struct_x_can.html">XCan</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8c.html#a3079df9559ea328b414b0f8438c7991e">XCan_AcceptFilterSet</a> (<a class="el" href="struct_x_can.html">XCan</a> *InstancePtr, u32 FilterIndex, u32 MaskValue, u32 IdValue)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8c.html#ab2385a83eb4e0e5f7bae366ac8ec86ec">XCan_AcceptFilterGet</a> (<a class="el" href="struct_x_can.html">XCan</a> *InstancePtr, u32 FilterIndex, u32 *MaskValue, u32 *IdValue)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_x_can___config.html">XCan_Config</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8c.html#a17e81d7c9c9f5e22d204a169873d9d5b">XCan_LookupConfig</a> (u16 DeviceId)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_x_can___config.html">XCan_Config</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8c.html#ad6eac1dc169e07562c39d620f10af36a">XCan_GetConfig</a> (unsigned int InstanceIndex)</td></tr>
<tr><td colspan="2"><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_x_can___config.html">XCan_Config</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8c.html#aa7cf63c4b2796eb251614e16d8dc1554">XCan_ConfigTable</a> []</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>The <a class="el" href="struct_x_can.html">XCan</a> driver. Functions in this file are the minimum required functions for this driver. See <a class="el" href="xcan_8h.html">xcan.h</a> for a detailed description of the driver.</p>
<pre>
MODIFICATION HISTORY:</pre><pre> Ver Who Date Changes
----- ---- -------- -------------------------------------------------------
1.00a xd 04/12/05 First release
1.10a mta 05/13/07 Updated to new coding style
2.00a ktn 10/22/09 Updated to use the HAL APIs/macros.
The macros have been renamed to remove _m from the name in
all the driver files.
</pre> <hr/><h2>Function Documentation</h2>
<a class="anchor" id="a8bc758e3b0a5fc41bcb17b49fa1e7ed4"></a><!-- doxytag: member="xcan.c::XCan_AcceptFilterDisable" ref="a8bc758e3b0a5fc41bcb17b49fa1e7ed4" args="(XCan *InstancePtr, u32 FilterIndexes)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void XCan_AcceptFilterDisable </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_can.html">XCan</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>FilterIndexes</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 routine disables individual acceptance filters. Up to 4 filters could be disabled. If all acceptance filters are disabled then all received frames are stored in the RX FIFO.</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_can.html">XCan</a> instance to be worked on. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>FilterIndexes</em>&nbsp;</td><td>specifies which filter(s) to disable. Use any XCAN_AFR_UAF*_MASK to disable one filter, and "Or" multiple XCAN_AFR_UAF*_MASK values if multiple filters need to be disabled. Any filter not specified in this parameter will keep its previous enable/disable setting. If all acceptance filters are disabled then all received frames are stored in the RX FIFO.</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></dd></dl>
<p>Acceptance Filter Register is an optional register in Xilinx CAN device. If it is NOT existing in the device, this function should NOT be used. Calling this function in this case will cause an assertion failure. </p>
</div>
</div>
<a class="anchor" id="ae04419e368e843d5bf7384b8f32ba9b6"></a><!-- doxytag: member="xcan.c::XCan_AcceptFilterEnable" ref="ae04419e368e843d5bf7384b8f32ba9b6" args="(XCan *InstancePtr, u32 FilterIndexes)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void XCan_AcceptFilterEnable </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_can.html">XCan</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>FilterIndexes</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 routine enables individual acceptance filters. Up to 4 filters could be enabled.</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_can.html">XCan</a> instance to be worked on. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>FilterIndexes</em>&nbsp;</td><td>specifies which filter(s) to enable. Use any XCAN_AFR_UAF*_MASK to enable one filter, and "Or" multiple XCAN_AFR_UAF*_MASK values if multiple filters need to be enabled. Any filter not specified in this parameter will keep its previous enable/disable setting.</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></dd></dl>
<p>Acceptance Filter Register is an optional register in Xilinx CAN device. If it is NOT existing in the device, this function should NOT be used. Calling this function in this case will cause an assertion failure. </p>
</div>
</div>
<a class="anchor" id="ab2385a83eb4e0e5f7bae366ac8ec86ec"></a><!-- doxytag: member="xcan.c::XCan_AcceptFilterGet" ref="ab2385a83eb4e0e5f7bae366ac8ec86ec" args="(XCan *InstancePtr, u32 FilterIndex, u32 *MaskValue, u32 *IdValue)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void XCan_AcceptFilterGet </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_can.html">XCan</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>FilterIndex</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u32 *&nbsp;</td>
<td class="paramname"> <em>MaskValue</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u32 *&nbsp;</td>
<td class="paramname"> <em>IdValue</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 reads the values of the Acceptance Filter Mask and ID Register for the specified Acceptance Filter. Use XCAN_IDR_* defined in <a class="el" href="xcan__l_8h.html">xcan_l.h</a> to interpret the values. Read <a class="el" href="xcan_8h.html">xcan.h</a> and device specification for details.</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_can.html">XCan</a> instance to be worked on. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>FilterIndex</em>&nbsp;</td><td>defines which Acceptance Filter Mask Register to get Mask and ID from. Use any single XCAN_FILTER_* value. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>MaskValue</em>&nbsp;</td><td>will store the Mask value read from the chosen Acceptance Filter Mask Register after this function returns. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>IdValue</em>&nbsp;</td><td>will store the ID value read from the chosen Acceptance Filter ID Register after this function returns.</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></dd></dl>
<p>Acceptance Filter Mask and ID Registers are optional registers in Xilinx CAN device. If they are NOT existing in the device, this function should NOT be used. Calling this function in this case will cause an assertion failure. </p>
</div>
</div>
<a class="anchor" id="a02c9fb502d3fd8a0537c9efdf456defd"></a><!-- doxytag: member="xcan.c::XCan_AcceptFilterGetEnabled" ref="a02c9fb502d3fd8a0537c9efdf456defd" args="(XCan *InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">u32 XCan_AcceptFilterGetEnabled </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_can.html">XCan</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 returns enabled acceptance filters. Use XCAN_AFR_UAF*_MASK defined in <a class="el" href="xcan__l_8h.html">xcan_l.h</a> to interpret the returned value. If no acceptance filters are enabled then all received frames are stored in the RX FIFO.</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_can.html">XCan</a> instance to be worked on.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The value stored in Acceptance Filter Register.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd></dd></dl>
<p>Acceptance Filter Register is an optional register in Xilinx CAN device. If it is NOT existing in the device, this function should NOT be used. Calling this function in this case will cause an assertion failure. </p>
</div>
</div>
<a class="anchor" id="a3079df9559ea328b414b0f8438c7991e"></a><!-- doxytag: member="xcan.c::XCan_AcceptFilterSet" ref="a3079df9559ea328b414b0f8438c7991e" args="(XCan *InstancePtr, u32 FilterIndex, u32 MaskValue, u32 IdValue)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int XCan_AcceptFilterSet </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_can.html">XCan</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>FilterIndex</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u32&nbsp;</td>
<td class="paramname"> <em>MaskValue</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u32&nbsp;</td>
<td class="paramname"> <em>IdValue</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 sets values to the Acceptance Filter Mask Register (AFMR) and Acceptance Filter ID Register (AFIR) for the specified Acceptance Filter. Use XCAN_IDR_* defined in <a class="el" href="xcan__l_8h.html">xcan_l.h</a> to create the values to set the filter. Read <a class="el" href="xcan_8h.html">xcan.h</a> and device specification for details.</p>
<p>This function should be called only after:</p>
<ul>
<li>The given filter is disabled by calling <a class="el" href="xcan_8c.html#a8bc758e3b0a5fc41bcb17b49fa1e7ed4">XCan_AcceptFilterDisable()</a>;</li>
<li>And the CAN device is ready to accept writes to AFMR and AFIR, i.e., <a class="el" href="xcan_8h.html#adcfdfbba7de0499f02921ab6b5626c9b">XCan_IsAcceptFilterBusy()</a> returns FALSE.</li>
</ul>
<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_can.html">XCan</a> instance to be worked on. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>FilterIndex</em>&nbsp;</td><td>defines which Acceptance Filter Mask and ID Register to set. Use any single XCAN_AFR_UAF*_MASK value. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>MaskValue</em>&nbsp;</td><td>is the value to write to the chosen Acceptance Filter Mask Register. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>IdValue</em>&nbsp;</td><td>is the value to write to the chosen Acceptance Filter ID Register.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
<li>XST_SUCCESS if the values were set successfully.</li>
<li>XST_FAILURE if the given filter was not disabled, or the CAN device was not ready to accept writes to AFMR and AFIR.</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd></dd></dl>
<p>Acceptance Filter Mask and ID Registers are optional registers in Xilinx CAN device. If they are NOT existing in the device, this function should NOT be used. Calling this function in this case will cause an assertion failure. </p>
</div>
</div>
<a class="anchor" id="a757aecce4c0c06ff8f4cb3dd4d0c79fa"></a><!-- doxytag: member="xcan.c::XCan_ClearBusErrorStatus" ref="a757aecce4c0c06ff8f4cb3dd4d0c79fa" args="(XCan *InstancePtr, u32 Mask)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void XCan_ClearBusErrorStatus </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_can.html">XCan</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>Mask</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 clears Error Status bit(s) previously set in Error Status Register (ESR). Use the XCAN_ESR_* constants defined in <a class="el" href="xcan__l_8h.html">xcan_l.h</a> to create the value to pass in. If a bit was cleared in Error Status Register before this function is called, it will not be touched.</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_can.html">XCan</a> instance to be worked on.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>Mask</em>&nbsp;</td><td>is he 32-bit mask used to clear bits in Error Status Register. Multiple XCAN_ESR_* values could be 'OR'ed to clear multiple bits</td></tr>
</table>
</dd>
</dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="a994a0b0bd9c938e99de9d7ffceb10ef3"></a><!-- doxytag: member="xcan.c::XCan_EnterMode" ref="a994a0b0bd9c938e99de9d7ffceb10ef3" args="(XCan *InstancePtr, u8 OperationMode)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void XCan_EnterMode </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_can.html">XCan</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>OperationMode</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 allows the CAN device to enter one of the following operation modes:</p>
<ul>
<li>Configuration Mode: Pass in parameter XCAN_MODE_CONFIG</li>
<li>Sleep Mode: Pass in parameter XCAN_MODE_SLEEP</li>
<li>Normal Mode: Pass in parameter XCAN_MODE_NORMAL</li>
<li>Loop Back Mode: Pass in parameter XCAN_MODE_LOOPBACK.</li>
</ul>
<p>Read <a class="el" href="xcan_8h.html">xcan.h</a> and device specification for detailed description of each operation 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_can.html">XCan</a> instance to be worked on. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>OperationMode</em>&nbsp;</td><td>specify which operation mode to enter. Valid value is any of XCAN_MODE_* defined in <a class="el" href="xcan_8h.html">xcan.h</a>. Please note no multiple modes could be entered at the same time.</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></dd></dl>
<p>This function does NOT ensure CAN device enters the specified operation mode before returns the control to the caller. The caller is responsible for checking current operation mode using <a class="el" href="xcan_8c.html#a6b437133a6a2f40f56cf3c80102f5b0d">XCan_GetMode()</a>. </p>
</div>
</div>
<a class="anchor" id="a1a905b9f2f47e605267817c58edd1112"></a><!-- doxytag: member="xcan.c::XCan_GetBusErrorCounter" ref="a1a905b9f2f47e605267817c58edd1112" args="(XCan *InstancePtr, u8 *RxErrorCount, u8 *TxErrorCount)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void XCan_GetBusErrorCounter </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_can.html">XCan</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>RxErrorCount</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u8 *&nbsp;</td>
<td class="paramname"> <em>TxErrorCount</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 reads Receive and Transmit error counters.</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_can.html">XCan</a> instance to be worked on. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>RxErrorCount</em>&nbsp;</td><td>will contain Receive Error Counter value after this function returns. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>TxErrorCount</em>&nbsp;</td><td>will contain Transmit Error Counter value after this function returns.</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="a242ec83578f9966bd7d562ed7f5dedd3"></a><!-- doxytag: member="xcan.c::XCan_GetBusErrorStatus" ref="a242ec83578f9966bd7d562ed7f5dedd3" args="(XCan *InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">u32 XCan_GetBusErrorStatus </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_can.html">XCan</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 reads Error Status value from Error Status Register (ESR). Use the XCAN_ESR_* constants defined in <a class="el" href="xcan__l_8h.html">xcan_l.h</a> to interpret the returned value.</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_can.html">XCan</a> instance to be worked on.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The 32-bit value read from Error Status Register.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="ad6eac1dc169e07562c39d620f10af36a"></a><!-- doxytag: member="xcan.c::XCan_GetConfig" ref="ad6eac1dc169e07562c39d620f10af36a" args="(unsigned int InstanceIndex)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="struct_x_can___config.html">XCan_Config</a>* XCan_GetConfig </td>
<td>(</td>
<td class="paramtype">unsigned int&nbsp;</td>
<td class="paramname"> <em>InstanceIndex</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This function looks for the device configuration based on the device index. The table XCan_ConfigTable[] contains the configuration information for each device in the system.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstanceIndex</em>&nbsp;</td><td>is a 0-based integer indexing all CAN devices in the system.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A pointer to the configuration table entry corresponding to the given device ID, or NULL if no match is found.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="a6b437133a6a2f40f56cf3c80102f5b0d"></a><!-- doxytag: member="xcan.c::XCan_GetMode" ref="a6b437133a6a2f40f56cf3c80102f5b0d" args="(XCan *InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">u8 XCan_GetMode </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_can.html">XCan</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This routine returns current operation mode the CAN device is in.</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_can.html">XCan</a> instance to be worked on.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
<li>XCAN_MODE_CONFIG if the device is in Configuration Mode.</li>
<li>XCAN_MODE_SLEEP if the device is in Sleep Mode.</li>
<li>XCAN_MODE_NORMAL if the device is in Normal Mode.</li>
<li>XCAN_MODE_LOOPBACK if the device is in Loop Back Mode.</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="a502a294405726d96834c2abf574a96e8"></a><!-- doxytag: member="xcan.c::XCan_GetStatus" ref="a502a294405726d96834c2abf574a96e8" args="(XCan *InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">u32 XCan_GetStatus </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_can.html">XCan</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 returns Status value from Status Register (SR). Use the XCAN_SR_* constants defined in <a class="el" href="xcan__l_8h.html">xcan_l.h</a> to interpret the returned value.</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_can.html">XCan</a> instance to be worked on.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The 32-bit value read from Status Register.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="acbd9f5e256dcbd948afe916d13bc7b35"></a><!-- doxytag: member="xcan.c::XCan_Initialize" ref="acbd9f5e256dcbd948afe916d13bc7b35" args="(XCan *InstancePtr, u16 DeviceId)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int XCan_Initialize </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_can.html">XCan</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u16&nbsp;</td>
<td class="paramname"> <em>DeviceId</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 routine initializes a specific <a class="el" href="struct_x_can.html">XCan</a> instance/driver. This function should only be used when no Virtual Memory support is needed. To use virtual memory, the caller should invoke <a class="el" href="xcan_8c.html#a2b8e3ee4379e7a73c80a11d3877fb077">XCan_VmInitialize()</a>. See the description of <a class="el" href="xcan_8c.html#a2b8e3ee4379e7a73c80a11d3877fb077">XCan_VmInitialize()</a> for detailed information.</p>
<p>This initialization entails:</p>
<ul>
<li>Search for device configuration given the device ID.</li>
<li>Initialize Base Address field of the <a class="el" href="struct_x_can.html">XCan</a> structure using the device address in the found device configuration.</li>
<li>Populate all other data fields in the <a class="el" href="struct_x_can.html">XCan</a> structure</li>
<li>Reset the device.</li>
</ul>
<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_can.html">XCan</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_can.html">XCan</a> instance. Passing in a device ID associates the generic <a class="el" href="struct_x_can.html">XCan</a> instance to a specific device, as chosen by the caller or application developer.</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_DEVICE_NOT_FOUND if device configuration information was not found for a device with the supplied device ID.</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="a17e81d7c9c9f5e22d204a169873d9d5b"></a><!-- doxytag: member="xcan.c::XCan_LookupConfig" ref="a17e81d7c9c9f5e22d204a169873d9d5b" args="(u16 DeviceId)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="struct_x_can___config.html">XCan_Config</a>* XCan_LookupConfig </td>
<td>(</td>
<td class="paramtype">u16&nbsp;</td>
<td class="paramname"> <em>DeviceId</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This function looks for the device configuration based on the unique device ID. The table XCan_ConfigTable[] contains the configuration information for each device in the system.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>DeviceId</em>&nbsp;</td><td>is the unique device ID of the device being looked up.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A pointer to the configuration table entry corresponding to the given device ID, or NULL if no match is found.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="a1d8ac17789423c440872ffd4585b8c3c"></a><!-- doxytag: member="xcan.c::XCan_Recv" ref="a1d8ac17789423c440872ffd4585b8c3c" args="(XCan *InstancePtr, u32 *FramePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int XCan_Recv </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_can.html">XCan</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>FramePtr</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 receives a CAN Frame. This function first checks if RX FIFO is empty, if not, it then reads a frame from the RX FIFO into the given buffer. This function returns error code immediately if there is no frame in the RX FIFO.</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_can.html">XCan</a> instance to be worked on. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>FramePtr</em>&nbsp;</td><td>is a pointer to a 32-bit aligned buffer where the CAN frame to be written.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
<li>XST_SUCCESS if RX FIFO was not empty and a frame was read from RX FIFO successfully and written into the given buffer;</li>
<li>XST_NO_DATA if there is no frame to be received from the FIFO</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="a6c52fb4d4b12d62e3e713ad182f00d8b"></a><!-- doxytag: member="xcan.c::XCan_Reset" ref="a6c52fb4d4b12d62e3e713ad182f00d8b" args="(XCan *InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void XCan_Reset </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_can.html">XCan</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 CAN device. Calling this function resets the device immediately, and any pending transmission or reception is terminated at once. Both Object Layer and Transfer Layer are reset. This function does not reset the Physical Layer. All registers are reset to the default values, and no previous status will be restored. TX FIFO, RX FIFO and TX High Priority Buffer are also reset.</p>
<p>When a reset is required due to an internal error, the driver notifies the upper layer software of this need through the error status code or interrupts The upper layer software is responsible for calling this Reset function and then re-configuring the device.</p>
<p>The CAN device will be in Configuration Mode immediately after this function returns.</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_can.html">XCan</a> instance to be worked on.</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="ad4717011f46b8e9d5e15c0bfb04c33c8"></a><!-- doxytag: member="xcan.c::XCan_Send" ref="ad4717011f46b8e9d5e15c0bfb04c33c8" args="(XCan *InstancePtr, u32 *FramePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int XCan_Send </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_can.html">XCan</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>FramePtr</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 sends a CAN Frame. This function first checks if TX FIFO is full. If not, it then writes the given frame into the TX FIFO; otherwise, it returns error code immediately. This function does not wait for the given frame being sent to CAN bus.</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_can.html">XCan</a> instance to be worked on. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>FramePtr</em>&nbsp;</td><td>is a pointer to a 32-bit aligned buffer containing the CAN frame to be sent.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
<li>XST_SUCCESS if TX FIFO was not full and the given frame was written into the FIFO;</li>
<li>XST_FIFO_NO_ROOM if there is no room in the TX FIFO for the given frame</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="a8ba9b10678fbc6bd6093fdc5e9eb3edd"></a><!-- doxytag: member="xcan.c::XCan_SendHighPriority" ref="a8ba9b10678fbc6bd6093fdc5e9eb3edd" args="(XCan *InstancePtr, u32 *FramePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int XCan_SendHighPriority </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_can.html">XCan</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>FramePtr</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 routine sends a CAN High Priority frame. This function first checks if TX High Priority Buffer is empty. If yes, it then writes the given frame into the Buffer. If not, This function returns immediately. This function does not wait for the given frame being sent to CAN bus.</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_can.html">XCan</a> instance to be worked on. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>FramePtr</em>&nbsp;</td><td>is a pointer to a 32-bit aligned buffer containing the CAN High Priority frame to be sent.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
<li>XST_SUCCESS if TX High Priority Buffer was not full and the given frame was written into the buffer;</li>
<li>XST_FIFO_NO_ROOM if there is no room in the TX High Priority Buffer for this frame.</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd></dd></dl>
<p>If the frame needs to be sent immediately and not delayed by processor's interrupts handling, the caller should disable interrupt at processor level before invoking this function. </p>
</div>
</div>
<a class="anchor" id="a2b8e3ee4379e7a73c80a11d3877fb077"></a><!-- doxytag: member="xcan.c::XCan_VmInitialize" ref="a2b8e3ee4379e7a73c80a11d3877fb077" args="(XCan *InstancePtr, u16 DeviceId, u32 VirtAddr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int XCan_VmInitialize </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_can.html">XCan</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u16&nbsp;</td>
<td class="paramname"> <em>DeviceId</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u32&nbsp;</td>
<td class="paramname"> <em>VirtAddr</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 routine initializes of a specific <a class="el" href="struct_x_can.html">XCan</a> instance/driver. This function should only be used if Virtual Memory support is necessary. The caller is responsible for calculating the correct device base address in Virtual memory address space and passing it into this function.</p>
<p>This initialization entails:</p>
<ul>
<li>Search for device configuration given the device ID.</li>
<li>Initialize Base Address field of the <a class="el" href="struct_x_can.html">XCan</a> structure using the given virtual address parameter value.</li>
<li>Populate all other data fields in the <a class="el" href="struct_x_can.html">XCan</a> structure.</li>
<li>Reset the device.</li>
</ul>
<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_can.html">XCan</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_can.html">XCan</a> instance. Passing in a device ID associates the generic <a class="el" href="struct_x_can.html">XCan</a> instance to a specific device, as chosen by the caller or application developer. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>VirtAddr</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 VirtAddr 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.</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_DEVICE_NOT_FOUND if device configuration information was not found for a device with the supplied device ID.</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<hr/><h2>Variable Documentation</h2>
<a class="anchor" id="aa7cf63c4b2796eb251614e16d8dc1554"></a><!-- doxytag: member="xcan.c::XCan_ConfigTable" ref="aa7cf63c4b2796eb251614e16d8dc1554" args="[]" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="struct_x_can___config.html">XCan_Config</a> <a class="el" href="xcan__g_8c.html#ae614abb463a25471e68ccaf5515c88a8">XCan_ConfigTable</a>[]</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This table contains configuration information for each CAN device in the system. </p>
</div>
</div>
</div>
<p class="Copyright">
Copyright &copy; 1995-2014 Xilinx, Inc. All rights reserved.
</p>
</body>
</html>