📄 cpmacro_h-source.html
字号:
<HTML><HEAD><TITLE>cpmacro.h Source File</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>cpmacro.h</h1><a href="cpmacro_h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">/*****************************************************************************\</font>00002 <font class="comment">* CANpie *</font>00003 <font class="comment">* *</font>00004 <font class="comment">* File : cpmacro.h *</font>00005 <font class="comment">* Description : This file supplies some support macros for access of the *</font>00006 <font class="comment">* "CpStruct_CAN" message structure. The macros are a faster *</font>00007 <font class="comment">* solution compared to functions. However, there is the lack *</font>00008 <font class="comment">* of error checking. Please be aware of this when using these *</font>00009 <font class="comment">* macros. *</font>00010 <font class="comment">* Author : Uwe Koppe *</font>00011 <font class="comment">* e-mail : koppe@microcontrol.net *</font>00012 <font class="comment">* *</font>00013 <font class="comment">* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *</font>00014 <font class="comment">* *</font>00015 <font class="comment">* This program is free software; you can redistribute it and/or modify *</font>00016 <font class="comment">* it under the terms of the GNU General Public License as published by *</font>00017 <font class="comment">* the Free Software Foundation; either version 2 of the License, or *</font>00018 <font class="comment">* (at your option) any later version. *</font>00019 <font class="comment">* *</font>00020 <font class="comment">* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *</font>00021 <font class="comment">* *</font>00022 <font class="comment">* History *</font>00023 <font class="comment">* Vers. Date Comment Aut. *</font>00024 <font class="comment">* ----- ---------- --------------------------------------------- ---- *</font>00025 <font class="comment">* 0.6 27.07.1999 Initial version UK *</font>00026 <font class="comment">* 0.7 09.02.2001 Fixed CpMacSetBufNum() UK *</font>00027 <font class="comment">* 0.8 - no changes - *</font>00028 <font class="comment">* *</font>00029 <font class="comment">\*****************************************************************************/</font>00030 00031 00032 <font class="preprocessor">#ifndef _CANpie_MacroSupport_</font>00033 <font class="preprocessor"></font><font class="preprocessor">#define _CANpie_MacroSupport_</font>00034 <font class="preprocessor"></font>00035 00036 <font class="preprocessor">#include "<a class="code" href="cpconst_h.html">cpconst.h</a>"</font>00037 00038 <font class="comment">/*-----------------------------------------------------------------------------</font>00039 <font class="comment">** Online documentation for Doxygen</font>00040 <font class="comment">*/</font>00041 <a name="l00091"></a><a class="code" href="cpmacro_h.html#a0">00091</a> <font class="preprocessor">#define CpMacGetBufNum(MSG_PTR) (_U08)(((MSG_PTR)->v_MsgFlags) >> 4)</font>00092 <font class="preprocessor"></font>00093 <a name="l00104"></a><a class="code" href="cpmacro_h.html#a1">00104</a> <font class="preprocessor">#define CpMacGetData(MSG_PTR, POS) ( (MSG_PTR)->v_MsgData[POS] )</font>00105 <font class="preprocessor"></font>00106 <a name="l00115"></a><a class="code" href="cpmacro_h.html#a2">00115</a> <font class="preprocessor">#define CpMacGetDlc(MSG_PTR) (_U08)(((MSG_PTR)->v_MsgFlags) & CP_MASK_DLC_BITS)</font>00116 <font class="preprocessor"></font>00117 <a name="l00127"></a><a class="code" href="cpmacro_h.html#a3">00127</a> <font class="preprocessor">#define CpMacGetExtId(MSG_PTR) ((MSG_PTR)->v_MsgId) & CP_MASK_EXT_FRAME</font>00128 <font class="preprocessor"></font>00129 <a name="l00140"></a><a class="code" href="cpmacro_h.html#a4">00140</a> <font class="preprocessor">#define CpMacGetStdId(MSG_PTR) (_U16)((MSG_PTR)->v_MsgId) & CP_MASK_STD_FRAME</font>00141 <font class="preprocessor"></font>00142 <a name="l00152"></a><a class="code" href="cpmacro_h.html#a5">00152</a> <font class="preprocessor">#define CpMacIsExtended(MSG_PTR) (_U08)(((MSG_PTR)->v_MsgId) >> 31)</font>00153 <font class="preprocessor"></font>00154 <a name="l00164"></a><a class="code" href="cpmacro_h.html#a6">00164</a> <font class="preprocessor">#define CpMacIsRemote(MSG_PTR) (_U08)(((MSG_PTR)->v_MsgId) >> 30)</font>00165 <font class="preprocessor"></font>00166 <a name="l00176"></a><a class="code" href="cpmacro_h.html#a7">00176</a> <font class="preprocessor">#define CpMacMsgClear(MSG_PTR) (MSG_PTR)->v_MsgId= 0;(MSG_PTR)->v_MsgFlags = 0</font>00177 <font class="preprocessor"></font>00178 <a name="l00189"></a><a class="code" href="cpmacro_h.html#a8">00189</a> <font class="preprocessor">#define CpMacSetBufNum(MSG_PTR, VAL) (MSG_PTR)->v_MsgFlags &= (~CP_MASK_BUF_BITS); (MSG_PTR)->v_MsgFlags |= (VAL << 4)</font>00190 <font class="preprocessor"></font>00191 <a name="l00204"></a><a class="code" href="cpmacro_h.html#a9">00204</a> <font class="preprocessor">#define CpMacSetData(MSG_PTR, POS, VAL) (MSG_PTR)->v_MsgData[POS] = VAL</font>00205 <font class="preprocessor"></font>00206 <a name="l00218"></a><a class="code" href="cpmacro_h.html#a10">00218</a> <font class="preprocessor">#define CpMacSetDlc(MSG_PTR, DLC) (MSG_PTR)->v_MsgFlags &= (~CP_MASK_DLC_BITS); (MSG_PTR)->v_MsgFlags |= DLC</font>00219 <font class="preprocessor"></font>00220 <a name="l00231"></a><a class="code" href="cpmacro_h.html#a11">00231</a> <font class="preprocessor">#define CpMacSetExtId(MSG_PTR, VAL) (MSG_PTR)->v_MsgId = VAL | CP_MASK_EXT_BIT</font>00232 <font class="preprocessor"></font>00233 <a name="l00241"></a><a class="code" href="cpmacro_h.html#a12">00241</a> <font class="preprocessor">#define CpMacSetRemote(MSG_PTR) (MSG_PTR)->v_MsgId |= CP_MASK_RTR_BIT</font>00242 <font class="preprocessor"></font>00243 <a name="l00254"></a><a class="code" href="cpmacro_h.html#a13">00254</a> <font class="preprocessor">#define CpMacSetStdId(MSG_PTR, VAL) (MSG_PTR)->v_MsgId = VAL</font>00255 <font class="preprocessor"></font>00256 00257 00258 <font class="preprocessor">#endif </font><font class="comment">/* _CANpie_MacroSupport_ */</font></pre></div></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 + -