📄 cpfifo_h.html
字号:
<HTML><HEAD><TITLE>cpfifo.h File Reference</TITLE><LINK HREF="micro.css" REL="stylesheet" TYPE="text/css"></HEAD><BODY BGCOLOR="#FFFFFF"><a name="PageTop"></a><!------ Document Header -------------------------------------------><table border="0" cellspacing="0" cellpadding="0"><tr><td valign="bottom"><img src="pictures/maphead.gif" vspace="0" border="0" height="20"></td></tr></table><table border="0" cellspacing="0" cellpadding="0"><tr><td valign="bottom"><a href="index.html"><img src="pictures/button_index.gif" vspace="0" border="0" height="25"></a></td><td valign="bottom"><a href="files.html"><img src="pictures/button_files.gif" vspace="0" border="0" height="25"></a></td><td valign="bottom"><a href="globals.html"><img src="pictures/button_funcs.gif" vspace="0" border="0" height="25"></a></td><td valign="bottom" width="80"> </td><td valign="bottom"><a href="annotated.html"><img src="pictures/button_structs.gif" vspace="0" border="0" height="25"></a></td><td valign="bottom"><a href="functions.html"><img src="pictures/button_members.gif" vspace="0" border="0" height="25"></a></td></tr></table><hr noshade width=680 size=1 align=left><!------ Document Start --------------------------------------------><table width=680><tr><td><!-- Generated by Doxygen 1.2.6 --><h1>cpfifo.h File Reference</h1>CANpie FIFO functions. <a href="#_details">More...</a><p><code>#include "<a class="el" href="cpconst_h-source.html">cpconst.h</a>"</code><br><p><a href="cpfifo_h-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0><tr><td colspan=2><br><h2>Functions</h2></td></tr><tr><td nowrap align=right valign=top>_U08 Cp_PREFIX </td><td valign=bottom><a class="el" href="cpfifo_h.html#a2">CpFifoSetup</a> (_U08 channel, _U08 buffer, _U16 size)</td></tr><tr><td> </td><td><font size=-1><em>Setup FIFO.</em> <a href="#a2">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>_U08 Cp_PREFIX </td><td valign=bottom><a class="el" href="cpfifo_h.html#a3">CpFifoRemove</a> (_U08 channel, _U08 buffer)</td></tr><tr><td> </td><td><font size=-1><em>Remove FIFO.</em> <a href="#a3">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>_U08 Cp_PREFIX </td><td valign=bottom><a class="el" href="cpfifo_h.html#a4">CpFifoClear</a> (_U08 channel, _U08 buffer)</td></tr><tr><td> </td><td><font size=-1><em>Clear FIFO contents.</em> <a href="#a4">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>_U08 Cp_PREFIX </td><td valign=bottom><a class="el" href="cpfifo_h.html#a5">CpFifoPush</a> (_U08 channel, _U08 buffer, <a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> *msgPtr)</td></tr><tr><td> </td><td><font size=-1><em>Push message into FIFO.</em> <a href="#a5">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>_U08 Cp_PREFIX </td><td valign=bottom><a class="el" href="cpfifo_h.html#a6">CpFifoPop</a> (_U08 channel, _U08 buffer, <a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> *msg)</td></tr><tr><td> </td><td><font size=-1><em>Pop message from FIFO.</em> <a href="#a6">More...</a><em></em></font><br><br></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>CANpie FIFO functions.<p> <p> The FIFO functions care for the handling of messages between the user interface (user functions) and the specific hardware implementation. The are currently two implementations for the FIFO: one with dynamic memory allocation (using malloc() and free() functions) and a second with static memory size. The latter is typically used for microcontroller implementations with low memory resources. Selection of the type is done by setting the definition CP_FIFO_TYPE in the file <a class="el" href="cpconfig_h.html">cpconfig.h</a> to the appropriate value. The size of the static FIFOs can be setup in the <a class="el" href="cpfifo_h.html">cpfifo.h</a> file via the definitions CP_FIFO_TRM_SIZE and CP_FIFO_RCV_SIZE.<p><hr><h2>Function Documentation</h2><a name="a4" doxytag="cpfifo.h::CpFifoClear"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> _U08 Cp_PREFIX CpFifoClear ( </b></td> <td valign="bottom"><b>_U08 <em>channel</em>, </b></td> </tr> <tr> <td></td> <td><b>_U08 <em>buffer</em> ) </b></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Clear FIFO contents.<p><dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>channel</em> </td><td>CAN channel of the hardware </td></tr><tr><td valign=top><em>buffer</em> </td><td>FIFO type (receive or transmit) <ul> <li>CP_FIFO_RCV: receive <li>CP_FIFO_TRM: transmit </ul><p></td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>Error code taken from the CpErr enumeration. If no error occured, the function will return CpErr_OK.<p></dl>This function clears the specified FIFO buffer. All messages inside the FIFO are erased. </td> </tr></table><a name="a6" doxytag="cpfifo.h::CpFifoPop"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> _U08 Cp_PREFIX CpFifoPop ( </b></td> <td valign="bottom"><b>_U08 <em>channel</em>, </b></td> </tr> <tr> <td></td> <td><b>_U08 <em>buffer</em>, </b></td> </tr> <tr> <td></td> <td><b><a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> * <em>msg</em> ) </b></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Pop message from FIFO.<p><dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>channel</em> </td><td>CAN channel of the hardware </td></tr><tr><td valign=top><em>buffer</em> </td><td>FIFO type (receive or transmit) <ul> <li>CP_FIFO_RCV: receive <li>CP_FIFO_TRM: transmit </ul> </td></tr><tr><td valign=top><em>msgPtr</em> </td><td>Pointer to a structure of type <a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a><p></td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>Error code taken from the CpErr enumeration. If no error occured, the function will return CpErr_OK.<p></dl>Pop a message from the FIFO buffer, given by the parameter 'buffer'. If the buffer is empty, the function will return 'CpErr_FIFO_EMPTY'. is not evaluated. </td> </tr></table><a name="a5" doxytag="cpfifo.h::CpFifoPush"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> _U08 Cp_PREFIX CpFifoPush ( </b></td> <td valign="bottom"><b>_U08 <em>channel</em>, </b></td> </tr> <tr> <td></td> <td><b>_U08 <em>buffer</em>, </b></td> </tr> <tr> <td></td> <td><b><a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> * <em>msgPtr</em> ) </b></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Push message into FIFO.<p><dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>channel</em> </td><td>CAN channel of the hardware </td></tr><tr><td valign=top><em>buffer</em> </td><td>FIFO type (receive or transmit) <ul> <li>CP_FIFO_RCV: receive <li>CP_FIFO_TRM: transmit </ul> </td></tr><tr><td valign=top><em>msgPtr</em> </td><td>Pointer to a structure of type <a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a><p></td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>Error code taken from the CpErr enumeration. If no error occured, the function will return CpErr_OK.<p></dl>Push a message into the FIFO buffer, given by the parameter 'buffer'. If the buffer is full, the function will return 'CpErr_FIFO_FULL'. </td> </tr></table><a name="a3" doxytag="cpfifo.h::CpFifoRemove"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> _U08 Cp_PREFIX CpFifoRemove ( </b></td> <td valign="bottom"><b>_U08 <em>channel</em>, </b></td> </tr> <tr> <td></td> <td><b>_U08 <em>buffer</em> ) </b></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Remove FIFO.<p><dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>channel</em> </td><td>CAN channel of the hardware </td></tr><tr><td valign=top><em>buffer</em> </td><td>FIFO type (receive or transmit) <ul> <li>CP_FIFO_RCV: receive <li>CP_FIFO_TRM: transmit </ul><p></td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>Error code taken from the CpErr enumeration. If no error occured, the function will return CpErr_OK.<p></dl>This function frees the reserved memory for the specified FIFO buffer. If a static FIFO is used (CP_FIFO_TYPE == 1) this function simply returns CpErr_OK. </td> </tr></table><a name="a2" doxytag="cpfifo.h::CpFifoSetup"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> _U08 Cp_PREFIX CpFifoSetup ( </b></td> <td valign="bottom"><b>_U08 <em>channel</em>, </b></td> </tr> <tr> <td></td> <td><b>_U08 <em>buffer</em>, </b></td> </tr> <tr> <td></td> <td><b>_U16 <em>size</em> ) </b></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Setup FIFO.<p><dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>channel</em> </td><td>CAN channel of the hardware </td></tr><tr><td valign=top><em>buffer</em> </td><td>FIFO type (receive or transmit) <ul> <li>CP_FIFO_RCV: receive <li>CP_FIFO_TRM: transmit </ul> </td></tr><tr><td valign=top><em>size</em> </td><td>size of the FIFO (number of messages)<p></td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>Error code taken from the CpErr enumeration. If no error occured, the function will return CpErr_OK.<p></dl>This function reserves memory for the specified FIFO buffer. If a static FIFO is used (CP_FIFO_TYPE == 1) the parameter 'size' is not evaluated. </td> </tr></table></td></tr></table><!------ Document footer -------------------------------------------><p><br><map name="FooterMap"><area shape=rect coords=" 1, 1, 100, 20" href="#PageTop"><area shape=rect coords="400, 1, 500, 20" href="mailto:koppe@microcontrol.net?Subject=CANpie"></map><table width="600" border="0" bgcolor="#FFFFFF" cellspacing="0"><tr><td><IMG src="pictures/mapfoot.gif" border="0" usemap="#FooterMap"></td></tr><!------ print modification date -----------------------------------><tr><td align="right"><h4>Last modified: 10 Jul 2001</h4></td></tr></table> </body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -