📄 cpmacro_h.html
字号:
</table><a name="a6" doxytag="cpmacro.h::CpMacIsRemote"></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> #define CpMacIsRemote( </b></td> <td valign="bottom"><b>MSG_PTR ) (_U08)(((MSG_PTR)->v_MsgId) >> 30) </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Check for remote frame.<p><dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>MSG_PTR</em> </td><td>Pointer to a <a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> message<p></td></tr></table></dl>This macro checks if the Remote Transmission bit (RTR) is set. If the RTR bit is set, the macro will return 1, otherwise 0. </td> </tr></table><a name="a7" doxytag="cpmacro.h::CpMacMsgClear"></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> #define CpMacMsgClear( </b></td> <td valign="bottom"><b>MSG_PTR ) (MSG_PTR)->v_MsgId= 0;(MSG_PTR)->v_MsgFlags = 0 </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </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_PTR</em> </td><td>Pointer to a <a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> message </td></tr></table></dl><dl compact><dt><b>See also: </b><dd>The corresponding function <a class="el" href="cpmsg_h.html#a8">CpMsgClear</a>()<p></dl>This macro sets the identifier field and the flags field of a CAN message structure to 0. </td> </tr></table><a name="a8" doxytag="cpmacro.h::CpMacSetBufNum"></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> #define CpMacSetBufNum( </b></td> <td valign="bottom"><b>MSG_PTR, VAL ) (MSG_PTR)->v_MsgFlags &= (~CP_MASK_BUF_BITS); (MSG_PTR)->v_MsgFlags |= (VAL << 4) </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Set message buffer number.<p><dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>MSG_PTR</em> </td><td>Pointer to a <a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> message<p></td></tr></table></dl>A FullCAN controller has the feature of message buffers. The buffer number is coded in the field v_MsgFlags of the structure CpStruct_CAM. With this macro the number of the buffer (index starts at 1) can be set to a certain value. </td> </tr></table><a name="a9" doxytag="cpmacro.h::CpMacSetData"></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> #define CpMacSetData( </b></td> <td valign="bottom"><b>MSG_PTR, POS, VAL ) (MSG_PTR)->v_MsgData[POS] = VAL </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Set Data.<p><dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>MSG_PTR</em> </td><td>Pointer to a <a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> message </td></tr><tr><td valign=top><em>POS</em> </td><td>Zero based index of byte position </td></tr><tr><td valign=top><em>VAL</em> </td><td>Value of data byte in CAN message </td></tr></table></dl><dl compact><dt><b>See also: </b><dd>The corresponding function <a class="el" href="cpmsg_h.html#a7">CpMsgSetData</a>()<p></dl>This macro sets the data in a CAN message. The parameter POS must be within the range 0 .. 7, since there is no error checking. </td> </tr></table><a name="a10" doxytag="cpmacro.h::CpMacSetDlc"></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> #define CpMacSetDlc( </b></td> <td valign="bottom"><b>MSG_PTR, DLC ) (MSG_PTR)->v_MsgFlags &= (~CP_MASK_DLC_BITS); (MSG_PTR)->v_MsgFlags |= DLC </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Set Data Length Code.<p><dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>MSG_PTR</em> </td><td>Pointer to a <a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> message </td></tr><tr><td valign=top><em>DLC</em> </td><td>Data length code </td></tr></table></dl><dl compact><dt><b>See also: </b><dd>The corresponding function <a class="el" href="cpmsg_h.html#a5">CpMsgSetDlc</a>()<p></dl>This macro sets the data length code (DLC) of a CAN message. The parameter DLC must be within the range from 0..8. No error checking is provided. </td> </tr></table><a name="a11" doxytag="cpmacro.h::CpMacSetExtId"></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> #define CpMacSetExtId( </b></td> <td valign="bottom"><b>MSG_PTR, VAL ) (MSG_PTR)->v_MsgId = VAL | CP_MASK_EXT_BIT </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Set 29 Bit Identifier Value.<p><dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>MSG_PTR</em> </td><td>Pointer to a <a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> message </td></tr><tr><td valign=top><em>VAL</em> </td><td>Identifier value </td></tr></table></dl><dl compact><dt><b>See also: </b><dd>The corresponding function <a class="el" href="cpmsg_h.html#a3">CpMsgSetExtId</a>()<p></dl>This macro sets the identifer value for an extended frame (CAN 2.0B). </td> </tr></table><a name="a12" doxytag="cpmacro.h::CpMacSetRemote"></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> #define CpMacSetRemote( </b></td> <td valign="bottom"><b>MSG_PTR ) (MSG_PTR)->v_MsgId |= CP_MASK_RTR_BIT </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Set RTR bit.<p><dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>MSG_PTR</em> </td><td>Pointer to a <a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> message<p></td></tr></table></dl>This macro sets the Remote Transmission bit (RTR). </td> </tr></table><a name="a13" doxytag="cpmacro.h::CpMacSetStdId"></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> #define CpMacSetStdId( </b></td> <td valign="bottom"><b>MSG_PTR, VAL ) (MSG_PTR)->v_MsgId = VAL </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Set 11 Bit Identifier Value.<p><dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>MSG_PTR</em> </td><td>Pointer to a <a class="el" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> message </td></tr><tr><td valign=top><em>VAL</em> </td><td>Identifier value </td></tr></table></dl><dl compact><dt><b>See also: </b><dd>The corresponding function <a class="el" href="cpmsg_h.html#a3">CpMsgSetExtId</a>()<p></dl>This macro sets the identifer value for an standard frame (CAN 2.0A). </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 + -