<p>Functions in this file are the minimum required functions for the <aclass="el"href="struct_x_can_ps.html">XCanPs</a> driver. See <aclass="el"href="xcanps_8h.html">xcanps.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 the 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_ps.html">XCanPs</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>FilterIndexes</em> </td><td>specifies which filter(s) to disable. Use any XCANPS_AFR_UAF*_MASK to disable one filter, and "Or" multiple XCANPS_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>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can_ps.html">XCanPs</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>FilterIndexes</em> </td><td>specifies which filter(s) to enable. Use any XCANPS_AFR_UAF*_MASK to enable one filter, and "Or" multiple XCANPS_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>This function reads the values of the Acceptance Filter Mask and ID Register for the specified Acceptance Filter. Use XCANPS_IDR_* defined in <aclass="el"href="xcanps__hw_8h.html">xcanps_hw.h</a> to interpret the values. Read the <aclass="el"href="xcanps_8h.html">xcanps.h</a> file 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_ps.html">XCanPs</a> instance. </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 XCANPS_FILTER_* value. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>MaskValue</em> </td><td>is a pointer to the data in which the Mask value read from the chosen Acceptance Filter Mask Register is returned. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>IdValue</em> </td><td>is a pointer to the data in which the ID value read from the chosen Acceptance Filter ID Register is returned.</td></tr>
<p>This function returns enabled acceptance filters. Use XCANPS_AFR_UAF*_MASK defined in <aclass="el"href="xcanps__hw_8h.html">xcanps_hw.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_ps.html">XCanPs</a> instance.</td></tr>
<p>This function sets values to the Acceptance Filter Mask Register (AFMR) and Acceptance Filter ID Register (AFIR) for the specified Acceptance Filter. Use XCANPS_IDR_* defined in <aclass="el"href="xcanps__hw_8h.html">xcanps_hw.h</a> to create the values to set the filter. Read the <aclass="el"href="xcanps_8h.html">xcanps.h</a> file 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="xcanps_8c.html#a1cffdc22b01e4b4d3aad5e556bf96d20">XCanPs_AcceptFilterDisable()</a>;</li>
<li>And the CAN device is ready to accept writes to AFMR and AFIR, i.e., <aclass="el"href="xcanps_8h.html#aecacd08d0192291be2907ddad81602c5">XCanPs_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_ps.html">XCanPs</a> instance. </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 XCANPS_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>This function clears Error Status bit(s) previously set in Error Status Register (ESR). Use the XCANPS_ESR_* constants defined in <aclass="el"href="xcanps__hw_8h.html">xcanps_hw.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 modified.</p>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can_ps.html">XCanPs</a> instance.</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 XCANPS_ESR_* values can 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_ps.html">XCanPs</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>OperationMode</em> </td><td>specify which operation mode to enter. Valid value is any of XCANPS_MODE_* defined in <aclass="el"href="xcanps_8h.html">xcanps.h</a>. Multiple modes can not be entered at the same time.</td></tr>
<p>This function does NOT ensure CAN device enters the specified operation mode before it returns the control to the caller. The caller is responsible for checking current operation mode using <aclass="el"href="xcanps_8c.html#a3644ad3aa2b02def735751ed45d207a4">XCanPs_GetMode()</a>. </p>
<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>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can_ps.html">XCanPs</a> instance.</td></tr>
<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>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can_ps.html">XCanPs</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>SyncJumpWidth</em> </td><td>will store the Synchronization Jump Width value after this function returns. Its value ranges from 0 to 3. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>TimeSegment2</em> </td><td>will store the Time Segment 2 value after this function returns. Its value ranges from 0 to 7. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>TimeSegment1</em> </td><td>will store the Time Segment 1 value after this function returns. Its value ranges from 0 to 15.</td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can_ps.html">XCanPs</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>RxErrorCount</em> </td><td>is a pointer to data in which the Receive Error counter value is returned. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>TxErrorCount</em> </td><td>is a pointer to data in which the Transmit Error counter value is returned.</td></tr>
<p>This function reads Error Status value from Error Status Register (ESR). Use the XCANPS_ESR_* constants defined in <aclass="el"href="xcanps__hw_8h.html">xcanps_hw.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_ps.html">XCanPs</a> instance.</td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can_ps.html">XCanPs</a> instance.</td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can_ps.html">XCanPs</a> instance.</td></tr>
<p>This function returns Status value from Status Register (SR). Use the XCANPS_SR_* constants defined in <aclass="el"href="xcanps__hw_8h.html">xcanps_hw.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_ps.html">XCanPs</a> instance.</td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can_ps.html">XCanPs</a> instance.</td></tr>
<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_ps.html">XCanPs</a> instance. </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_ps.html">XCanPs</a> instance.</td></tr>
<p>This function sends a CAN Frame. If the TX FIFO is not full then the given frame is written into the the TX FIFO otherwise, it returns an 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_ps.html">XCanPs</a> instance. </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_ps.html">XCanPs</a> instance. </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 interrupt handling, the caller should disable interrupt at processor level before invoking this function. </p>
<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 can be set only if the CAN device is in Configuration Mode. Call <aclass="el"href="xcanps_8c.html#a5a32b11e15d347ecae566778bb1c5e33">XCanPs_EnterMode()</a> to enter Configuration Mode before using this function.</p>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can_ps.html">XCanPs</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>Prescaler</em> </td><td>is the value to set. Valid values are from 0 to 255.</td></tr>
<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 can be set only if the CAN device is in Configuration Mode. Call <aclass="el"href="xcanps_8c.html#a5a32b11e15d347ecae566778bb1c5e33">XCanPs_EnterMode()</a> to enter Configuration Mode before using this function.</p>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can_ps.html">XCanPs</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>SyncJumpWidth</em> </td><td>is the Synchronization Jump Width value to set. Valid values are from 0 to 3. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>TimeSegment2</em> </td><td>is the Time Segment 2 value to set. Valid values are from 0 to 7. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>TimeSegment1</em> </td><td>is the Time Segment 1 value to set. Valid values are from 0 to 15.</td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can_ps.html">XCanPs</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>Threshold</em> </td><td>is the threshold to be set. The valid values are from 1 to 63.</td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_can_ps.html">XCanPs</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>Threshold</em> </td><td>is the threshold to be set. The valid values are from 1 to 63.</td></tr>