embeddedsw/XilinxProcessorIPLib/drivers/can/doc/html/api/xcan_8h.html

1754 lines
97 KiB
HTML
Raw Normal View History

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>
Xilinx Driver can v3_0: xcan.h 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.h File Reference</h1><code>#include &quot;xstatus.h&quot;</code><br/>
<code>#include &quot;<a class="el" href="xcan__l_8h.html">xcan_l.h</a>&quot;</code><br/>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_x_can___config.html">XCan_Config</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_x_can.html">XCan</a></td></tr>
<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="xcan_8h.html#a210cbde2b1f30faf704c052508e57202">XCAN_H</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#a5d6a612e7746553fce2ca0685595deee">XCan_IsTxDone</a>(InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#a16bf9b91c18418196abe8271eed806ce">XCan_IsTxFifoFull</a>(InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#a2092c4148ae5c6498597afc619bb4261">XCan_IsHighPriorityBufFull</a>(InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#a1723fe89d70a9e010af7cda90c9b697e">XCan_IsRxEmpty</a>(InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#adcfdfbba7de0499f02921ab6b5626c9b">XCan_IsAcceptFilterBusy</a>(InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#a874d1b170d939f5ab18bf88fbad00b43">XCan_CreateIdValue</a>(StandardId, SubRemoteTransReq, IdExtension, ExtendedId, RemoteTransReq)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#a2389175edaafb057e5a5cf089f6cdec1">XCan_CreateDlcValue</a>(DataLengCode)&nbsp;&nbsp;&nbsp;(((DataLengCode) &lt;&lt; XCAN_DLCR_DLC_SHIFT) &amp; XCAN_DLCR_DLC_MASK)</td></tr>
<tr><td colspan="2"><div class="groupHeader">CAN operation modes</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p><a class="anchor" id="amgrp760e965317160106d81dfdf2ffff90ef"></a> </p>
<br/><br/></div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#ac2ff2f17841fcf789f5e214205aa844a">XCAN_MODE_CONFIG</a>&nbsp;&nbsp;&nbsp;0x00000001</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#a67ad8870dd83393eb315bf8b56032117">XCAN_MODE_NORMAL</a>&nbsp;&nbsp;&nbsp;0x00000002</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#ad11c39965154f3eeb280a07fdfcc38bc">XCAN_MODE_LOOPBACK</a>&nbsp;&nbsp;&nbsp;0x00000004</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#ae0bc526fa48c6a149ef2017d304c4c79">XCAN_MODE_SLEEP</a>&nbsp;&nbsp;&nbsp;0x00000008</td></tr>
<tr><td colspan="2"><div class="groupHeader">Callback identifiers used as parameters to XCan_SetHandler()</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p><a class="anchor" id="amgrpa4efeba31398d5c3c63e86d7f7844a85"></a> </p>
<br/><br/></div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#a0951d27e2a23e485fb9d04019714ff19">XCAN_HANDLER_SEND</a>&nbsp;&nbsp;&nbsp;1</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#ac3819485b065f3726f30fab00768891a">XCAN_HANDLER_RECV</a>&nbsp;&nbsp;&nbsp;2</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#a95c42c89b517eab2aa63b584178e19d7">XCAN_HANDLER_ERROR</a>&nbsp;&nbsp;&nbsp;3</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#a2b8a36e69531ded498ee4aae48144703">XCAN_HANDLER_EVENT</a>&nbsp;&nbsp;&nbsp;4</td></tr>
<tr><td colspan="2"><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef void(*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#a35ad388bd264c6d4226356cdfe14f8dc">XCan_SendRecvHandler</a> )(void *CallBackRef)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef void(*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#a15913601b8c17e959d80a0a28469e537">XCan_ErrorHandler</a> )(void *CallBackRef, u32 ErrorMask)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef void(*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#ae08cf54d17b722be5c51117d983dd776">XCan_EventHandler</a> )(void *CallBackRef, u32 Mask)</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="xcan_8h.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_8h.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_8h.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_8h.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_8h.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_8h.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_8h.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_8h.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_8h.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_8h.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_8h.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_8h.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_8h.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_8h.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_8h.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_8h.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_8h.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_8h.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_8h.html#ad6eac1dc169e07562c39d620f10af36a">XCan_GetConfig</a> (unsigned int InstanceIndex)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#a75aabbb82d96151cadfd3c26a2a285e9">XCan_SetBaudRatePrescaler</a> (<a class="el" href="struct_x_can.html">XCan</a> *InstancePtr, u8 Prescaler)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u8&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#aee29a9e04aa8993561e0c11d1222c1f9">XCan_GetBaudRatePrescaler</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_8h.html#af60120410396727f6e9304ce9ba65980">XCan_SetBitTiming</a> (<a class="el" href="struct_x_can.html">XCan</a> *InstancePtr, u8 SyncJumpWidth, u8 TimeSegment2, u8 TimeSegment1)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#ab70138a7e54403355ec194f468f945fd">XCan_GetBitTiming</a> (<a class="el" href="struct_x_can.html">XCan</a> *InstancePtr, u8 *SyncJumpWidth, u8 *TimeSegment2, u8 *TimeSegment1)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#aa18e848a6ffc670e024972ffc71b2ba8">XCan_SelfTest</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_8h.html#a1abd3a018094fd4d586599d708c33e4f">XCan_InterruptEnable</a> (<a class="el" href="struct_x_can.html">XCan</a> *InstancePtr, u32 Mask)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#a163cd737c7421ddbd0ff492883e32558">XCan_InterruptDisable</a> (<a class="el" href="struct_x_can.html">XCan</a> *InstancePtr, u32 Mask)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u32&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#a5670f843250e65969ce6ef36d0e06e24">XCan_InterruptGetEnabled</a> (<a class="el" href="struct_x_can.html">XCan</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u32&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#a26bb19c641bfce1cb3dac4f5c0b7f71d">XCan_InterruptGetStatus</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_8h.html#ac53101769980d4aa036844100ac732af">XCan_InterruptClear</a> (<a class="el" href="struct_x_can.html">XCan</a> *InstancePtr, u32 Mask)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#aafc4a0e025e8e3eb800778eba5a00c66">XCan_IntrHandler</a> (void *InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcan_8h.html#a3a7838a033b61a842b06e3ee4b06a614">XCan_SetHandler</a> (<a class="el" href="struct_x_can.html">XCan</a> *InstancePtr, u32 HandlerType, void *CallBackFunc, void *CallBackRef)</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="a2389175edaafb057e5a5cf089f6cdec1"></a><!-- doxytag: member="xcan.h::XCan_CreateDlcValue" ref="a2389175edaafb057e5a5cf089f6cdec1" args="(DataLengCode)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XCan_CreateDlcValue</td>
<td>(</td>
<td class="paramtype">DataLengCode&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;(((DataLengCode) &lt;&lt; XCAN_DLCR_DLC_SHIFT) &amp; XCAN_DLCR_DLC_MASK)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This macro calculates value for Data Length Code register given Data Length Code 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>DataLengCode</em>&nbsp;</td><td>indicates Data Length Code value.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Value that can be assigned to Data Length Code register.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>C-Style signature: u32 <a class="el" href="xcan_8h.html#a2389175edaafb057e5a5cf089f6cdec1">XCan_CreateDlcValue(u32 DataLengCode)</a>;</dd></dl>
<p>Read the CAN specification for meaning of Data Length Code. </p>
</div>
</div>
<a class="anchor" id="a874d1b170d939f5ab18bf88fbad00b43"></a><!-- doxytag: member="xcan.h::XCan_CreateIdValue" ref="a874d1b170d939f5ab18bf88fbad00b43" args="(StandardId, SubRemoteTransReq, IdExtension, ExtendedId, RemoteTransReq)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XCan_CreateIdValue</td>
<td>(</td>
<td class="paramtype">StandardId, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">SubRemoteTransReq, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">IdExtension, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">ExtendedId, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">RemoteTransReq&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">((((StandardId) &lt;&lt; <a class="code" href="xcan__l_8h.html#a8f9c7951fae58fd2cf90131e0631304e">XCAN_IDR_ID1_SHIFT</a>) &amp; <a class="code" href="xcan__l_8h.html#ada1163dd1ad028100277856729da0c76">XCAN_IDR_ID1_MASK</a>) | \
(((SubRemoteTransReq) &lt;&lt; <a class="code" href="xcan__l_8h.html#a392ae006c23ac043f35d7381b769a466">XCAN_IDR_SRR_SHIFT</a>) &amp; <a class="code" href="xcan__l_8h.html#a2525f6a15bbfb9db8502779b1f876a49">XCAN_IDR_SRR_MASK</a>) | \
(((IdExtension) &lt;&lt; <a class="code" href="xcan__l_8h.html#a5a37127b76e4f9356f56edd8f3b0d178">XCAN_IDR_IDE_SHIFT</a>) &amp; <a class="code" href="xcan__l_8h.html#af39813df4090219175f47904f099c617">XCAN_IDR_IDE_MASK</a>) | \
(((ExtendedId) &lt;&lt; <a class="code" href="xcan__l_8h.html#ab713a9e27487c69a7672da10f97b7019">XCAN_IDR_ID2_SHIFT</a>) &amp; <a class="code" href="xcan__l_8h.html#a7fd399769caeac6b7a857eb608ded32d">XCAN_IDR_ID2_MASK</a>) | \
((RemoteTransReq) &amp; <a class="code" href="xcan__l_8h.html#a5c4236ed24ee27b58a4068b14455535d">XCAN_IDR_RTR_MASK</a>))
</pre></div><p>This macro calculates CAN message identifier value given identifier field values.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>StandardId</em>&nbsp;</td><td>contains Standard Message ID value. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>SubRemoteTransReq</em>&nbsp;</td><td>contains Substitute Remote Transmission Request value. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>IdExtension</em>&nbsp;</td><td>contains Identifier Extension value. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>ExtendedId</em>&nbsp;</td><td>contains Extended Message ID value. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>RemoteTransReq</em>&nbsp;</td><td>contains Remote Transmission Request value.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Message Identifier value.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>C-Style signature: u32 XCan_CreateIdValue(u32 StandardId, u32 SubRemoteTransReq, u32 IdExtension, u32 ExtendedId, u32 RemoteTransReq);</dd></dl>
<p>Read the CAN specification for meaning of each parameter. </p>
</div>
</div>
<a class="anchor" id="a210cbde2b1f30faf704c052508e57202"></a><!-- doxytag: member="xcan.h::XCAN_H" ref="a210cbde2b1f30faf704c052508e57202" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XCAN_H</td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="a95c42c89b517eab2aa63b584178e19d7"></a><!-- doxytag: member="xcan.h::XCAN_HANDLER_ERROR" ref="a95c42c89b517eab2aa63b584178e19d7" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XCAN_HANDLER_ERROR&nbsp;&nbsp;&nbsp;3</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Handler type for error interrupt </p>
</div>
</div>
<a class="anchor" id="a2b8a36e69531ded498ee4aae48144703"></a><!-- doxytag: member="xcan.h::XCAN_HANDLER_EVENT" ref="a2b8a36e69531ded498ee4aae48144703" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XCAN_HANDLER_EVENT&nbsp;&nbsp;&nbsp;4</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Handler type for all other interrupts </p>
</div>
</div>
<a class="anchor" id="ac3819485b065f3726f30fab00768891a"></a><!-- doxytag: member="xcan.h::XCAN_HANDLER_RECV" ref="ac3819485b065f3726f30fab00768891a" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XCAN_HANDLER_RECV&nbsp;&nbsp;&nbsp;2</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Handler type for frame reception interrupt </p>
</div>
</div>
<a class="anchor" id="a0951d27e2a23e485fb9d04019714ff19"></a><!-- doxytag: member="xcan.h::XCAN_HANDLER_SEND" ref="a0951d27e2a23e485fb9d04019714ff19" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XCAN_HANDLER_SEND&nbsp;&nbsp;&nbsp;1</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Handler type for frame sending interrupt </p>
</div>
</div>
<a class="anchor" id="adcfdfbba7de0499f02921ab6b5626c9b"></a><!-- doxytag: member="xcan.h::XCan_IsAcceptFilterBusy" ref="adcfdfbba7de0499f02921ab6b5626c9b" args="(InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XCan_IsAcceptFilterBusy</td>
<td>(</td>
<td class="paramtype">InstancePtr&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">((<a class="code" href="xcan__l_8h.html#a2ee91da70cd3c92169c780186a9d6c51">XCan_ReadReg</a>(((InstancePtr)-&gt;BaseAddress), <a class="code" href="xcan__l_8h.html#a64573916e0c04f2a49f77e20801a41bf">XCAN_SR_OFFSET</a>) &amp; \
<a class="code" href="xcan__l_8h.html#a73da923dd04f1f036ca7e24e6fdc14b7">XCAN_SR_ACFBSY_MASK</a>) ? TRUE : FALSE)
</pre></div><p>This macro checks if the CAN device is ready for the driver to change Acceptance Filter Identifier Registers (AFIR) and Acceptance Filter Mask Registers (AFMR).</p>
<p>AFIR and AFMR for a filter are changeable only after the filter is disabled and this routine returns FALSE.</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>TRUE if the device is busy and NOT ready to accept writes to AFIR and AFMR.</li>
<li>FALSE if the device is ready to accept writes to AFIR and AFMR.</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>C-Style signature: int <a class="el" href="xcan_8h.html#adcfdfbba7de0499f02921ab6b5626c9b">XCan_IsAcceptFilterBusy(XCan *InstancePtr)</a>; </dd></dl>
</div>
</div>
<a class="anchor" id="a2092c4148ae5c6498597afc619bb4261"></a><!-- doxytag: member="xcan.h::XCan_IsHighPriorityBufFull" ref="a2092c4148ae5c6498597afc619bb4261" args="(InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XCan_IsHighPriorityBufFull</td>
<td>(</td>
<td class="paramtype">InstancePtr&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">((<a class="code" href="xcan__l_8h.html#a2ee91da70cd3c92169c780186a9d6c51">XCan_ReadReg</a>(((InstancePtr)-&gt;BaseAddress), <a class="code" href="xcan__l_8h.html#a64573916e0c04f2a49f77e20801a41bf">XCAN_SR_OFFSET</a>) &amp; \
<a class="code" href="xcan__l_8h.html#ae3786b56d4ddf066d41dd3ecbbee85b8">XCAN_SR_TXBFLL_MASK</a>) ? TRUE : FALSE)
</pre></div><p>This macro checks if the Transmission High Priority Buffer is full.</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>TRUE if TX High Priority Buffer is full.</li>
<li>FALSE if TX High Priority Buffer is not full.</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>C-Style signature: int <a class="el" href="xcan_8h.html#a2092c4148ae5c6498597afc619bb4261">XCan_IsHighPriorityBufFull(XCan *InstancePtr)</a>; </dd></dl>
</div>
</div>
<a class="anchor" id="a1723fe89d70a9e010af7cda90c9b697e"></a><!-- doxytag: member="xcan.h::XCan_IsRxEmpty" ref="a1723fe89d70a9e010af7cda90c9b697e" args="(InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XCan_IsRxEmpty</td>
<td>(</td>
<td class="paramtype">InstancePtr&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">((<a class="code" href="xcan__l_8h.html#a2ee91da70cd3c92169c780186a9d6c51">XCan_ReadReg</a>(((InstancePtr)-&gt;BaseAddress), <a class="code" href="xcan__l_8h.html#a0816aca8c9bca41953439ad0c14cbf4a">XCAN_ISR_OFFSET</a>) &amp; \
<a class="code" href="xcan__l_8h.html#a5b1cb15de038ddda4b5a500ae3d829f4">XCAN_IXR_RXNEMP_MASK</a>) ? FALSE : TRUE)
</pre></div><p>This macro checks if the receive FIFO is empty.</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>TRUE if RX FIFO is empty.</li>
<li>FALSE if RX FIFO is not empty.</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>C-Style signature: int <a class="el" href="xcan_8h.html#a1723fe89d70a9e010af7cda90c9b697e">XCan_IsRxEmpty(XCan *InstancePtr)</a>; </dd></dl>
</div>
</div>
<a class="anchor" id="a5d6a612e7746553fce2ca0685595deee"></a><!-- doxytag: member="xcan.h::XCan_IsTxDone" ref="a5d6a612e7746553fce2ca0685595deee" args="(InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XCan_IsTxDone</td>
<td>(</td>
<td class="paramtype">InstancePtr&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">((<a class="code" href="xcan__l_8h.html#a2ee91da70cd3c92169c780186a9d6c51">XCan_ReadReg</a>(((InstancePtr)-&gt;BaseAddress), <a class="code" href="xcan__l_8h.html#a0816aca8c9bca41953439ad0c14cbf4a">XCAN_ISR_OFFSET</a>) &amp; \
<a class="code" href="xcan__l_8h.html#aa3b70e481b672854a2a8436dfaad2ed2">XCAN_IXR_TXOK_MASK</a>) ? TRUE : FALSE)
</pre></div><p>This macro checks if the transmission is complete.</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>TRUE if the transmission is done (completed).</li>
<li>FALSE if the transmission is not completed.</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>C-Style signature: int <a class="el" href="xcan_8h.html#a5d6a612e7746553fce2ca0685595deee">XCan_IsTxDone(XCan *InstancePtr)</a>; </dd></dl>
</div>
</div>
<a class="anchor" id="a16bf9b91c18418196abe8271eed806ce"></a><!-- doxytag: member="xcan.h::XCan_IsTxFifoFull" ref="a16bf9b91c18418196abe8271eed806ce" args="(InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XCan_IsTxFifoFull</td>
<td>(</td>
<td class="paramtype">InstancePtr&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">((<a class="code" href="xcan__l_8h.html#a2ee91da70cd3c92169c780186a9d6c51">XCan_ReadReg</a>(((InstancePtr)-&gt;BaseAddress), <a class="code" href="xcan__l_8h.html#a64573916e0c04f2a49f77e20801a41bf">XCAN_SR_OFFSET</a>) &amp; \
<a class="code" href="xcan__l_8h.html#ad1399331118c8dd22db86571ce270096">XCAN_SR_TXFLL_MASK</a>) ? TRUE : FALSE)
</pre></div><p>This macro checks if the transmission FIFO is full.</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>TRUE if TX FIFO is full.</li>
<li>FALSE if TX FIFO is not full.</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>C-Style signature: int <a class="el" href="xcan_8h.html#a16bf9b91c18418196abe8271eed806ce">XCan_IsTxFifoFull(XCan *InstancePtr)</a>; </dd></dl>
</div>
</div>
<a class="anchor" id="ac2ff2f17841fcf789f5e214205aa844a"></a><!-- doxytag: member="xcan.h::XCAN_MODE_CONFIG" ref="ac2ff2f17841fcf789f5e214205aa844a" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XCAN_MODE_CONFIG&nbsp;&nbsp;&nbsp;0x00000001</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Configuration mode </p>
</div>
</div>
<a class="anchor" id="ad11c39965154f3eeb280a07fdfcc38bc"></a><!-- doxytag: member="xcan.h::XCAN_MODE_LOOPBACK" ref="ad11c39965154f3eeb280a07fdfcc38bc" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XCAN_MODE_LOOPBACK&nbsp;&nbsp;&nbsp;0x00000004</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Loop Back mode </p>
</div>
</div>
<a class="anchor" id="a67ad8870dd83393eb315bf8b56032117"></a><!-- doxytag: member="xcan.h::XCAN_MODE_NORMAL" ref="a67ad8870dd83393eb315bf8b56032117" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XCAN_MODE_NORMAL&nbsp;&nbsp;&nbsp;0x00000002</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Normal mode </p>
</div>
</div>
<a class="anchor" id="ae0bc526fa48c6a149ef2017d304c4c79"></a><!-- doxytag: member="xcan.h::XCAN_MODE_SLEEP" ref="ae0bc526fa48c6a149ef2017d304c4c79" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XCAN_MODE_SLEEP&nbsp;&nbsp;&nbsp;0x00000008</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sleep mode </p>
</div>
</div>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="a15913601b8c17e959d80a0a28469e537"></a><!-- doxytag: member="xcan.h::XCan_ErrorHandler" ref="a15913601b8c17e959d80a0a28469e537" args=")(void *CallBackRef, u32 ErrorMask)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* <a class="el" href="xcan_8h.html#a15913601b8c17e959d80a0a28469e537">XCan_ErrorHandler</a>)(void *CallBackRef, u32 ErrorMask)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Callback type for error interrupt.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>CallBackRef</em>&nbsp;</td><td>is a callback reference passed in by the upper layer when setting the callback functions, and passed back to the upper layer when the callback is invoked. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>ErrorMask</em>&nbsp;</td><td>is a bit mask indicating the cause of the error. Its value equals 'OR'ing one or more XCAN_ESR_* values defined in <a class="el" href="xcan__l_8h.html">xcan_l.h</a> </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ae08cf54d17b722be5c51117d983dd776"></a><!-- doxytag: member="xcan.h::XCan_EventHandler" ref="ae08cf54d17b722be5c51117d983dd776" args=")(void *CallBackRef, u32 Mask)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* <a class="el" href="xcan_8h.html#ae08cf54d17b722be5c51117d983dd776">XCan_EventHandler</a>)(void *CallBackRef, u32 Mask)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Callback type for all kinds of interrupts except sending frame interrupt, receiving frame interrupt, and error interrupt.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>CallBackRef</em>&nbsp;</td><td>is a callback reference passed in by the upper layer when setting the callback functions, and passed back to the upper layer when the callback is invoked. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Mask</em>&nbsp;</td><td>is a bit mask indicating the pending interrupts. Its value equals 'OR'ing one or more XCAN_IXR_* defined in <a class="el" href="xcan__l_8h.html">xcan_l.h</a> </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a35ad388bd264c6d4226356cdfe14f8dc"></a><!-- doxytag: member="xcan.h::XCan_SendRecvHandler" ref="a35ad388bd264c6d4226356cdfe14f8dc" args=")(void *CallBackRef)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* <a class="el" href="xcan_8h.html#a35ad388bd264c6d4226356cdfe14f8dc">XCan_SendRecvHandler</a>)(void *CallBackRef)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Callback type for frame sending and reception interrupts.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>CallBackRef</em>&nbsp;</td><td>is a callback reference passed in by the upper layer when setting the callback functions, and passed back to the upper layer when the callback is invoked. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="a8bc758e3b0a5fc41bcb17b49fa1e7ed4"></a><!-- doxytag: member="xcan.h::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.h::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.h::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.h::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.h::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.h::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.h::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="aee29a9e04aa8993561e0c11d1222c1f9"></a><!-- doxytag: member="xcan.h::XCan_GetBaudRatePrescaler" ref="aee29a9e04aa8993561e0c11d1222c1f9" args="(XCan *InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">u8 XCan_GetBaudRatePrescaler </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 gets Baud Rate Prescaler value. The system clock for the CAN controller is divided by (Prescaler + 1) to generate the quantum clock needed for sampling and synchronization. Read the 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>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Current used Baud Rate Prescaler value. The value's range is from 0 to 255.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="ab70138a7e54403355ec194f468f945fd"></a><!-- doxytag: member="xcan.h::XCan_GetBitTiming" ref="ab70138a7e54403355ec194f468f945fd" args="(XCan *InstancePtr, u8 *SyncJumpWidth, u8 *TimeSegment2, u8 *TimeSegment1)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void XCan_GetBitTiming </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>SyncJumpWidth</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u8 *&nbsp;</td>
<td class="paramname"> <em>TimeSegment2</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u8 *&nbsp;</td>
<td class="paramname"> <em>TimeSegment1</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 gets Bit time. Time segment 1, Time segment 2 and Synchronization Jump Width values are read in this function. According to device specification, the actual value of each of these fields is one more than the value read. Read the 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>SyncJumpWidth</em>&nbsp;</td><td>will store the Synchronization Jump Width value after this function returns. Its value ranges from 0 to 3. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>TimeSegment2</em>&nbsp;</td><td>will store the Time Segment 2 value after this function returns. Its value ranges from 0 to 7. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>TimeSegment1</em>&nbsp;</td><td>will store the Time Segment 1 value after this function returns. Its value ranges from 0 to 15.</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="a1a905b9f2f47e605267817c58edd1112"></a><!-- doxytag: member="xcan.h::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.h::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.h::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.h::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.h::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.h::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="ac53101769980d4aa036844100ac732af"></a><!-- doxytag: member="xcan.h::XCan_InterruptClear" ref="ac53101769980d4aa036844100ac732af" args="(XCan *InstancePtr, u32 Mask)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void XCan_InterruptClear </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 interrupt(s). Every bit set in Interrupt Status Register indicates that a specific type of interrupt is occurring, and this function clears one or more interrupts by writing a bit mask to Interrupt Clear Register.</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 the mask to clear. Bit positions of 1 will be cleared. Bit positions of 0 will not change the previous interrupt status. This mask is formed by OR'ing XCAN_IXR_* bits defined in <a class="el" href="xcan__l_8h.html">xcan_l.h</a>.</td></tr>
</table>
</dd>
</dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="a163cd737c7421ddbd0ff492883e32558"></a><!-- doxytag: member="xcan.h::XCan_InterruptDisable" ref="a163cd737c7421ddbd0ff492883e32558" args="(XCan *InstancePtr, u32 Mask)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void XCan_InterruptDisable </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 routine disables interrupt(s). Use the XCAN_IXR_* constants defined in <a class="el" href="xcan__l_8h.html">xcan_l.h</a> to create the bit-mask to disable interrupt(s).</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 the mask to disable. Bit positions of 1 will be disabled. Bit positions of 0 will keep the previous setting. This mask is formed by OR'ing XCAN_IXR_* bits defined in <a class="el" href="xcan__l_8h.html">xcan_l.h</a>.</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="a1abd3a018094fd4d586599d708c33e4f"></a><!-- doxytag: member="xcan.h::XCan_InterruptEnable" ref="a1abd3a018094fd4d586599d708c33e4f" args="(XCan *InstancePtr, u32 Mask)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void XCan_InterruptEnable </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 routine enables interrupt(s). Use the XCAN_IXR_* constants defined in <a class="el" href="xcan__l_8h.html">xcan_l.h</a> to create the bit-mask to enable interrupts.</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 the mask to enable. Bit positions of 1 will be enabled. Bit positions of 0 will keep the previous setting. This mask is formed by OR'ing XCAN_IXR_* bits defined in <a class="el" href="xcan__l_8h.html">xcan_l.h</a>.</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="a5670f843250e65969ce6ef36d0e06e24"></a><!-- doxytag: member="xcan.h::XCan_InterruptGetEnabled" ref="a5670f843250e65969ce6ef36d0e06e24" args="(XCan *InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">u32 XCan_InterruptGetEnabled </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 enabled interrupt(s). Use the XCAN_IXR_* 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>Enabled interrupt(s) in a 32-bit format.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="a26bb19c641bfce1cb3dac4f5c0b7f71d"></a><!-- doxytag: member="xcan.h::XCan_InterruptGetStatus" ref="a26bb19c641bfce1cb3dac4f5c0b7f71d" args="(XCan *InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">u32 XCan_InterruptGetStatus </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 interrupt status read from Interrupt Status Register. Use the XCAN_IXR_* 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 value stored in Interrupt Status Register.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="aafc4a0e025e8e3eb800778eba5a00c66"></a><!-- doxytag: member="xcan.h::XCan_IntrHandler" ref="aafc4a0e025e8e3eb800778eba5a00c66" args="(void *InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void XCan_IntrHandler </td>
<td>(</td>
<td class="paramtype">void *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This routine is the interrupt handler for the CAN driver.</p>
<p>This handler reads the interrupt status from the ISR, determines the source of the interrupts, calls according callbacks, and finally clears the interrupts.</p>
<p>Application beyond this driver is responsible for providing callbacks to handle interrupts and installing the callbacks using <a class="el" href="xcan_8h.html#a3a7838a033b61a842b06e3ee4b06a614">XCan_SetHandler()</a> during initialization phase. An example delivered with this driver demonstrates how this could be done.</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 that just interrupted.</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="a17e81d7c9c9f5e22d204a169873d9d5b"></a><!-- doxytag: member="xcan.h::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.h::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.h::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="aa18e848a6ffc670e024972ffc71b2ba8"></a><!-- doxytag: member="xcan.h::XCan_SelfTest" ref="aa18e848a6ffc670e024972ffc71b2ba8" args="(XCan *InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int XCan_SelfTest </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 runs a self-test on the CAN driver/device. The test resets the device, sets up the Loop Back mode, sends a standard frame, receives the frame, verifies the contents, and resets the device again.</p>
<p>Note that this is a destructive test in that resets of the device are performed. Refer to the device specification for the device status after the reset operation.</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>XST_SUCCESS if the self-test passed. i.e., the frame received via the internal loop back has the same contents as the sent frame.</li>
<li>XST_FAILURE Otherwise.</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd></dd></dl>
<p>If the CAN device does not work properly, this function may enter an infinite loop and will never return to the caller. <br/>
<br/>
If XST_FAILURE is returned, the device is not reset so that the caller could have a chance to check reason(s) causing the failure. </p>
</div>
</div>
<a class="anchor" id="ad4717011f46b8e9d5e15c0bfb04c33c8"></a><!-- doxytag: member="xcan.h::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.h::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="a75aabbb82d96151cadfd3c26a2a285e9"></a><!-- doxytag: member="xcan.h::XCan_SetBaudRatePrescaler" ref="a75aabbb82d96151cadfd3c26a2a285e9" args="(XCan *InstancePtr, u8 Prescaler)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int XCan_SetBaudRatePrescaler </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>Prescaler</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 sets Baud Rate Prescaler value. The system clock for the CAN controller is divided by (Prescaler + 1) to generate the quantum clock needed for sampling and synchronization. Read the device specification for details.</p>
<p>Baud Rate Prescaler could be set only after CAN device entered Configuration Mode. So please call <a class="el" href="xcan_8c.html#a994a0b0bd9c938e99de9d7ffceb10ef3">XCan_EnterMode()</a> to enter Configuration Mode before using this 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_can.html">XCan</a> instance to be worked on. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Prescaler</em>&nbsp;</td><td>is the value to set. Valid values are from 0 to 255.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
<li>XST_SUCCESS if the Baud Rate Prescaler value is set successfully.</li>
<li>XST_FAILURE if CAN device is not in Configuration Mode.</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="af60120410396727f6e9304ce9ba65980"></a><!-- doxytag: member="xcan.h::XCan_SetBitTiming" ref="af60120410396727f6e9304ce9ba65980" args="(XCan *InstancePtr, u8 SyncJumpWidth, u8 TimeSegment2, u8 TimeSegment1)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int XCan_SetBitTiming </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>SyncJumpWidth</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u8&nbsp;</td>
<td class="paramname"> <em>TimeSegment2</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u8&nbsp;</td>
<td class="paramname"> <em>TimeSegment1</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 sets Bit time. Time segment 1, Time segment 2 and Synchronization Jump Width are set in this function. Device specification requires the values passed into this function be one less than the actual values of these fields. Read the device specification for details.</p>
<p>Bit time could be set only after CAN device entered Configuration Mode. Please call <a class="el" href="xcan_8c.html#a994a0b0bd9c938e99de9d7ffceb10ef3">XCan_EnterMode()</a> to enter Configuration Mode before using this 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_can.html">XCan</a> instance to be worked on. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>SyncJumpWidth</em>&nbsp;</td><td>is the Synchronization Jump Width value to set. Valid values are from 0 to 3. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>TimeSegment2</em>&nbsp;</td><td>is the Time Segment 2 value to set. Valid values are from 0 to 7. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>TimeSegment1</em>&nbsp;</td><td>is the Time Segment 1 value to set. Valid values are from 0 to 15.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
<li>XST_SUCCESS if the Bit time is set successfully.</li>
<li>XST_FAILURE if CAN device is not in Configuration Mode.</li>
<li>XST_INVALID_PARAM if any value of SyncJumpWidth, TimeSegment2 and TimeSegment1 is invalid.</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="a3a7838a033b61a842b06e3ee4b06a614"></a><!-- doxytag: member="xcan.h::XCan_SetHandler" ref="a3a7838a033b61a842b06e3ee4b06a614" args="(XCan *InstancePtr, u32 HandlerType, void *CallBackFunc, void *CallBackRef)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int XCan_SetHandler </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>HandlerType</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&nbsp;</td>
<td class="paramname"> <em>CallBackFunc</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&nbsp;</td>
<td class="paramname"> <em>CallBackRef</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 installs an asynchronous callback function for the given HandlerType:</p>
<pre>
HandlerType Callback Function Type
----------------------- ---------------------------
XCAN_HANDLER_SEND XCan_SendRecvHandler
XCAN_HANDLER_RECV XCan_SendRecvHandler
XCAN_HANDLER_ERROR XCan_ErrorHandler
XCAN_HANDLER_EVENT XCan_EventHandler</pre><pre> HandlerType Invoked by this driver when:
----------------------- --------------------------------------------------
XCAN_HANDLER_SEND A frame transmitted by a call to
<a class="el" href="xcan_8c.html#ad4717011f46b8e9d5e15c0bfb04c33c8">XCan_Send()</a> has been sent successfully.</pre><pre> XCAN_HANDLER_RECV A frame has been received and is sitting in
the RX FIFO.</pre><pre> XCAN_HANDLER_ERROR An error interrupt is occurring.</pre><pre> XCAN_HANDLER_EVENT Any other kind of interrupt is occurring.
</pre><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>HandlerType</em>&nbsp;</td><td>specifies which handler is to be attached. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>CallBackFunc</em>&nbsp;</td><td>is the address of the callback function. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>CallBackRef</em>&nbsp;</td><td>is a user data item that will be passed to the callback function when it is invoked.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
<li>XST_SUCCESS when handler is installed.</li>
<li>XST_INVALID_PARAM when HandlerType is invalid.</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>Invoking this function for a handler that already has been installed replaces it with the new handler. </dd></dl>
</div>
</div>
<a class="anchor" id="a2b8e3ee4379e7a73c80a11d3877fb077"></a><!-- doxytag: member="xcan.h::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>
</div>
<p class="Copyright">
Copyright &copy; 1995-2014 Xilinx, Inc. All rights reserved.
</p>
</body>
</html>