⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cpmsg_h.html

📁 Controller Area Network Programming Interface Environment Ver0.8。 CanPie版本0.8. CAN总线通讯编程接口源代码。
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<HTML><HEAD><TITLE>cpmsg.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">&nbsp;</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>cpmsg.h File Reference</h1>CANpie message support 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="cpmsg_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>Cp_EXPORT _U16 Cp_PREFIX&nbsp;</td><td valign=bottom><a class="el" href="cpmsg_h.html#a0">CpMsgGetStdId</a> (<a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> *msg)</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Get Standard Identifier.</em> <a href="#a0">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>Cp_EXPORT void Cp_PREFIX&nbsp;</td><td valign=bottom><a class="el" href="cpmsg_h.html#a1">CpMsgSetStdId</a> (<a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> *msg, _U16 id, _BIT rtr)</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Set Standard Identifier.</em> <a href="#a1">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>Cp_EXPORT _U32 Cp_PREFIX&nbsp;</td><td valign=bottom><a class="el" href="cpmsg_h.html#a2">CpMsgGetExtId</a> (<a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> *msg)</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Get Extended Identifier.</em> <a href="#a2">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>Cp_EXPORT void Cp_PREFIX&nbsp;</td><td valign=bottom><a class="el" href="cpmsg_h.html#a3">CpMsgSetExtId</a> (<a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> *msg, _U32 id, _BIT rtr)</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Set Extended Identifier.</em> <a href="#a3">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>Cp_EXPORT _U08 Cp_PREFIX&nbsp;</td><td valign=bottom><a class="el" href="cpmsg_h.html#a4">CpMsgGetDlc</a> (<a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> *msg)</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Get Data Length Code.</em> <a href="#a4">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>Cp_EXPORT void Cp_PREFIX&nbsp;</td><td valign=bottom><a class="el" href="cpmsg_h.html#a5">CpMsgSetDlc</a> (<a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> *msg, _U08 dlc)</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Set Data Length Code.</em> <a href="#a5">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>Cp_EXPORT _U08 Cp_PREFIX&nbsp;</td><td valign=bottom><a class="el" href="cpmsg_h.html#a6">CpMsgGetData</a> (<a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> *msg, _U08 byteNum)</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Get message data.</em> <a href="#a6">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>Cp_EXPORT void Cp_PREFIX&nbsp;</td><td valign=bottom><a class="el" href="cpmsg_h.html#a7">CpMsgSetData</a> (<a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> *msg, _U08 byteNum, _U08 byteVal)</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Set message data.</em> <a href="#a7">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>Cp_EXPORT void Cp_PREFIX&nbsp;</td><td valign=bottom><a class="el" href="cpmsg_h.html#a8">CpMsgClear</a> (<a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> *msg)</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Clear message structure.</em> <a href="#a8">More...</a><em></em></font><br><br></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>CANpie message support functions.<p><p><p> This file includes additional function for an easy access to the members of the CAN message structure (<a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a>). It is recommended to use these functions rather than accessing the structure elements directly. Another way (better performance) to access the structure is to use the macros defined in the '<a class="el" href="cpmacro_h.html">cpmacro.h</a>' file.<p><hr><h2>Function Documentation</h2><a name="a8" doxytag="cpmsg.h::CpMsgClear"></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> Cp_EXPORT void Cp_PREFIX CpMsgClear (          </b></td>          <td valign="bottom"><b><a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> * <em>msg</em>&nbsp;)          </b></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Clear message structure.<p><dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>msg</em>&nbsp;</td><td>Pointer to a structure of type <a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a><p></td></tr></table></dl>This function clears all members of a given CAN message structure.  It is intended for initialisation of a message.<p><b>Example</b> <div class="fragment"><pre> <a class="code" href="struct_CpStruct_CAN.html">CpStruct_CAN</a>   myMessage; <a class="code" href="cpmsg_h.html#a8">CpMsgClear</a>(&amp;myMessage);             <font class="comment">// clear the message</font> <a class="code" href="cpmsg_h.html#a1">CpMsgSetStdId</a>(&amp;myMessage, 100, 0);  <font class="comment">// identifier is 100 dec, no RTR</font> <a class="code" href="cpmsg_h.html#a5">CpMsgSetDlc</a>(&amp;myMessage, 2);         <font class="comment">// data length code is 2</font></pre></div>     </td>  </tr></table><a name="a6" doxytag="cpmsg.h::CpMsgGetData"></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> Cp_EXPORT _U08 Cp_PREFIX CpMsgGetData (          </b></td>          <td valign="bottom"><b><a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> * <em>msg</em>,           </b></td>        </tr>        <tr>          <td></td>          <td><b>_U08 <em>byteNum</em>&nbsp;)          </b></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Get message data.<p><dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>msg</em>&nbsp;</td><td>Pointer to a structure of type <a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> </td></tr><tr><td valign=top><em>byteNum</em>&nbsp;</td><td>zero based byte position </td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>data value of byte 'byteNum'<p></dl>This function retrieves the value of a data byte from a given  CAN message structure. The parameter 'byteNum' is zero based. That means the last byte from a message with DLC = 8 is  accessed with a byteNum value of 7.     </td>  </tr></table><a name="a4" doxytag="cpmsg.h::CpMsgGetDlc"></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> Cp_EXPORT _U08 Cp_PREFIX CpMsgGetDlc (          </b></td>          <td valign="bottom"><b><a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> * <em>msg</em>&nbsp;)          </b></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Get Data Length Code.<p><dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>msg</em>&nbsp;</td><td>Pointer to a structure of type <a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> </td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>Data Length Code<p></dl>This function retrieves the data length code (DLC) of a given  CAN message structure.     </td>  </tr></table><a name="a2" doxytag="cpmsg.h::CpMsgGetExtId"></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> Cp_EXPORT _U32 Cp_PREFIX CpMsgGetExtId (          </b></td>          <td valign="bottom"><b><a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> * <em>msg</em>&nbsp;)          </b></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Get Extended Identifier.<p><dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>msg</em>&nbsp;</td><td>Pointer to a structure of type <a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> </td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>Identifier value<p></dl>This function retrieves the identifier value of a given CAN message structure (29 bit identifier).     </td>  </tr></table><a name="a0" doxytag="cpmsg.h::CpMsgGetStdId"></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> Cp_EXPORT _U16 Cp_PREFIX CpMsgGetStdId (          </b></td>          <td valign="bottom"><b><a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> * <em>msg</em>&nbsp;)          </b></td>        </tr>      </table>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -