<tr><tdclass="memItemLeft"align="right"valign="top"><aclass="el"href="struct_x_can___config.html">XCan_Config</a> * </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="xcan_8c.html#ad6eac1dc169e07562c39d620f10af36a">XCan_GetConfig</a> (unsigned int InstanceIndex)</td></tr>
<p>The <aclass="el"href="struct_x_can.html">XCan</a> driver. Functions in this file are the minimum required functions for this driver. See <aclass="el"href="xcan_8h.html">xcan.h</a> for a detailed description of the driver.</p>
<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>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can.html">XCan</a> instance to be worked on. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>FilterIndexes</em> </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>
<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>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can.html">XCan</a> instance to be worked on. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>FilterIndexes</em> </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>
<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>
<p>This function reads the values of the Acceptance Filter Mask and ID Register for the specified Acceptance Filter. Use XCAN_IDR_* defined in <aclass="el"href="xcan__l_8h.html">xcan_l.h</a> to interpret the values. Read <aclass="el"href="xcan_8h.html">xcan.h</a> and device specification for details.</p>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can.html">XCan</a> instance to be worked on. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>FilterIndex</em> </td><td>defines which Acceptance Filter Mask Register to get Mask and ID from. Use any single XCAN_FILTER_* value. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>MaskValue</em> </td><td>will store the Mask value read from the chosen Acceptance Filter Mask Register after this function returns. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>IdValue</em> </td><td>will store the ID value read from the chosen Acceptance Filter ID Register after this function returns.</td></tr>
<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>
<p>This function returns enabled acceptance filters. Use XCAN_AFR_UAF*_MASK defined in <aclass="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>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can.html">XCan</a> instance to be worked on.</td></tr>
<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>
<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 <aclass="el"href="xcan__l_8h.html">xcan_l.h</a> to create the values to set the filter. Read <aclass="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 <aclass="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., <aclass="el"href="xcan_8h.html#adcfdfbba7de0499f02921ab6b5626c9b">XCan_IsAcceptFilterBusy()</a> returns FALSE.</li>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can.html">XCan</a> instance to be worked on. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>FilterIndex</em> </td><td>defines which Acceptance Filter Mask and ID Register to set. Use any single XCAN_AFR_UAF*_MASK value. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>MaskValue</em> </td><td>is the value to write to the chosen Acceptance Filter Mask Register. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>IdValue</em> </td><td>is the value to write to the chosen Acceptance Filter ID Register.</td></tr>
<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>
<p>This function clears Error Status bit(s) previously set in Error Status Register (ESR). Use the XCAN_ESR_* constants defined in <aclass="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>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can.html">XCan</a> instance to be worked on.</td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>Mask</em> </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>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can.html">XCan</a> instance to be worked on. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>OperationMode</em> </td><td>specify which operation mode to enter. Valid value is any of XCAN_MODE_* defined in <aclass="el"href="xcan_8h.html">xcan.h</a>. Please note no multiple modes could be entered at the same time.</td></tr>
<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 <aclass="el"href="xcan_8c.html#a6b437133a6a2f40f56cf3c80102f5b0d">XCan_GetMode()</a>. </p>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can.html">XCan</a> instance to be worked on. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>RxErrorCount</em> </td><td>will contain Receive Error Counter value after this function returns. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>TxErrorCount</em> </td><td>will contain Transmit Error Counter value after this function returns.</td></tr>
<p>This function reads Error Status value from Error Status Register (ESR). Use the XCAN_ESR_* constants defined in <aclass="el"href="xcan__l_8h.html">xcan_l.h</a> to interpret the returned value.</p>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can.html">XCan</a> instance to be worked on.</td></tr>
<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>
<dlclass="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>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can.html">XCan</a> instance to be worked on.</td></tr>
<p>This function returns Status value from Status Register (SR). Use the XCAN_SR_* constants defined in <aclass="el"href="xcan__l_8h.html">xcan_l.h</a> to interpret the returned value.</p>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can.html">XCan</a> instance to be worked on.</td></tr>
<p>This routine initializes a specific <aclass="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 <aclass="el"href="xcan_8c.html#a2b8e3ee4379e7a73c80a11d3877fb077">XCan_VmInitialize()</a>. See the description of <aclass="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 <aclass="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 <aclass="el"href="struct_x_can.html">XCan</a> structure</li>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can.html">XCan</a> instance to be worked on. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>DeviceId</em> </td><td>is the unique ID of the device controlled by this <aclass="el"href="struct_x_can.html">XCan</a> instance. Passing in a device ID associates the generic <aclass="el"href="struct_x_can.html">XCan</a> instance to a specific device, as chosen by the caller or application developer.</td></tr>
<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>
<dlclass="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>
<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>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can.html">XCan</a> instance to be worked on. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>FramePtr</em> </td><td>is a pointer to a 32-bit aligned buffer where the CAN frame to be written.</td></tr>
<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>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can.html">XCan</a> instance to be worked on.</td></tr>
<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>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can.html">XCan</a> instance to be worked on. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>FramePtr</em> </td><td>is a pointer to a 32-bit aligned buffer containing the CAN frame to be sent.</td></tr>
<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>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can.html">XCan</a> instance to be worked on. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>FramePtr</em> </td><td>is a pointer to a 32-bit aligned buffer containing the CAN High Priority frame to be sent.</td></tr>
<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>
<p>This routine initializes of a specific <aclass="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 <aclass="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 <aclass="el"href="struct_x_can.html">XCan</a> structure.</li>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can.html">XCan</a> instance to be worked on. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>DeviceId</em> </td><td>is the unique ID of the device controlled by this <aclass="el"href="struct_x_can.html">XCan</a> instance. Passing in a device ID associates the generic <aclass="el"href="struct_x_can.html">XCan</a> instance to a specific device, as chosen by the caller or application developer. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>VirtAddr</em> </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>