📄 cpcore_h-source.html
字号:
<HTML><HEAD><TITLE>cpcore.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>cpcore.h</h1><a href="cpcore_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 : cpcore.h *</font>00005 <font class="comment">* Description : *</font>00006 <font class="comment">* Author : Uwe Koppe *</font>00007 <font class="comment">* e-mail : koppe@microcontrol.net *</font>00008 <font class="comment">* *</font>00009 <font class="comment">* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *</font>00010 <font class="comment">* *</font>00011 <font class="comment">* This program is free software; you can redistribute it and/or modify *</font>00012 <font class="comment">* it under the terms of the GNU General Public License as published by *</font>00013 <font class="comment">* the Free Software Foundation; either version 2 of the License, or *</font>00014 <font class="comment">* (at your option) any later version. *</font>00015 <font class="comment">* *</font>00016 <font class="comment">* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *</font>00017 <font class="comment">* *</font>00018 <font class="comment">* History *</font>00019 <font class="comment">* Vers. Date Comment Aut. *</font>00020 <font class="comment">* ----- ---------- --------------------------------------------- ---- *</font>00021 <font class="comment">* 0.1 11.02.1999 Initial version UK *</font>00022 <font class="comment">* 0.2 29.04.1999 Changed structures, new data type definitions UK *</font>00023 <font class="comment">* 0.3 04.09.1999 Adaption to version 0.3 of the CANpie Doc. UK *</font>00024 <font class="comment">* 0.4 18.01.2000 Adaption to Keil C compiler UK *</font>00025 <font class="comment">* 0.5 - no changes - *</font>00026 <font class="comment">* 0.6 15.06.2000 set to CANpie release 0.6 UK *</font>00027 <font class="comment">* 0.7 02.11.2000 new functions for buffer operations UK *</font>00028 <font class="comment">* 0.8 15.02.2001 set to CANpie release 0.8 UK *</font>00029 <font class="comment">* *</font>00030 <font class="comment">\*****************************************************************************/</font>00031 00032 00033 <font class="preprocessor">#ifndef _CANpie_Core_</font>00034 <font class="preprocessor"></font><font class="preprocessor">#define _CANpie_Core_</font>00035 <font class="preprocessor"></font>00036 <font class="preprocessor">#include "compiler.h"</font>00037 <font class="preprocessor">#include "<a class="code" href="cpconst_h.html">cpconst.h</a>"</font>00038 00039 00040 <font class="comment">/*-----------------------------------------------------------------------------</font>00041 <font class="comment">** Online documentation for Doxygen</font>00042 <font class="comment">*/</font>00043 00055 <font class="comment">/*------------------------------------------------------------------------</font>00056 <font class="comment">** External variables (defined in the cpcore.c file)</font>00057 <font class="comment">** for include purpose in other implementation files (e.g. cpuser.c)</font>00058 <font class="comment">**</font>00059 <font class="comment">*/</font>00060 00061 <font class="preprocessor">#ifdef __C51__</font>00062 <font class="preprocessor"></font><font class="keyword">extern</font> CpStruct_BitTimingValue code CpStruct_BitTimingTable[];00063 <font class="preprocessor">#else</font>00064 <font class="preprocessor"></font><font class="keyword">extern</font> <font class="keyword">const</font> CpStruct_BitTimingValue CpStruct_BitTimingTable[];00065 <font class="preprocessor">#endif</font>00066 <font class="preprocessor"></font>00067 <font class="keyword">extern</font> _U08 (* CpInt_ReceiveHandler[]) (<a class="code" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> *);00068 <font class="keyword">extern</font> _U08 (* CpInt_TransmitHandler[]) (<a class="code" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> *);00069 <font class="keyword">extern</font> _U08 (* CpInt_ErrorHandler[]) (_U08);00070 00071 <font class="keyword">extern</font> _U16 CpVar_InitFlag;00072 00073 00074 <font class="comment">/*-------------------------------------------------------------------------</font>00075 <font class="comment">** A driver with only one channel and small memory resources does not need</font>00076 <font class="comment">** the 'channel' parameter.</font>00077 <font class="comment">** The definition CP_SMALL_CODE is checked for the value '1' and the</font>00078 <font class="comment">** function prototypes are converted then. The function call in the</font>00079 <font class="comment">** application stays the same (with 'channel' parameter).</font>00080 <font class="comment">**</font>00081 <font class="comment">*/</font>00082 <font class="preprocessor">#if CP_SMALL_CODE == 1</font>00083 <font class="preprocessor"></font>00084 <font class="preprocessor">#define CpCoreAllocBuffer(CH, A, B) CpCoreAllocBuffer(A, B)</font>00085 <font class="preprocessor"></font><font class="preprocessor">#define CpCoreBaudrate(CH, A, B, C) CpCoreBaudrate(A, B, C)</font>00086 <font class="preprocessor"></font><font class="preprocessor">#define CpCoreBufferData(CH, A) CpCoreBufferData(A)</font>00087 <font class="preprocessor"></font><font class="preprocessor">#define CpCoreBufferDLC(CH, A, B) CpCoreBufferData(A, B)</font>00088 <font class="preprocessor"></font><font class="preprocessor">#define CpCoreBufferSend(CH, A) CpCoreBufferSend(A)</font>00089 <font class="preprocessor"></font><font class="preprocessor">#define CpCoreBufferTransmit(CH, A) CpCoreBufferTransmit(A)</font>00090 <font class="preprocessor"></font><font class="preprocessor">#define CpCoreCANMode(CH, A) CpCoreCANMode(A)</font>00091 <font class="preprocessor"></font><font class="preprocessor">#define CpCoreCANState(CH) CpCoreCANState()</font>00092 <font class="preprocessor"></font><font class="preprocessor">#define CpCoreDeAllocBuffer(CH, A) CpCoreDeAllocBuffer(A)</font>00093 <font class="preprocessor"></font><font class="preprocessor">#define CpCoreDeInitDriver(CH) CpCoreDeInitDriver()</font>00094 <font class="preprocessor"></font><font class="preprocessor">#define CpCoreFilterAll(CH, A) CpCoreFilterAll(A)</font>00095 <font class="preprocessor"></font><font class="preprocessor">#define CpCoreFilterMsg(CH, A, B) CpCoreFilterMsg(A, B)</font>00096 <font class="preprocessor"></font><font class="preprocessor">#define CpCoreHDI(CH, A) CpCoreHDI(A)</font>00097 <font class="preprocessor"></font><font class="preprocessor">#define CpCoreInitDriver(CH) CpCoreInitDriver()</font>00098 <font class="preprocessor"></font>00099 <font class="preprocessor">#define CpCoreMsgReceive(CH) CpCoreMsgReceive()</font>00100 <font class="preprocessor"></font><font class="preprocessor">#define CpCoreMsgTransmit(CH) CpCoreMsgTransmit()</font>00101 <font class="preprocessor"></font><font class="preprocessor">#define CpCoreRegRead(CH, A, B) CpCoreRegRead(A, B)</font>00102 <font class="preprocessor"></font><font class="preprocessor">#define CpCoreRegWrite(CH, A, B) CpCoreRegWrite(A, B)</font>00103 <font class="preprocessor"></font>00104 <font class="preprocessor">#endif</font>00105 <font class="preprocessor"></font>00106 00107 <font class="comment">/*-------------------------------------------------------------------------</font>00108 <font class="comment">** Function Prototypes</font>00109 <font class="comment">*/</font>00110 00111 00136 <font class="preprocessor">#if CP_FULL_CAN == 1</font>00137 <font class="preprocessor"></font>Cp_EXPORT _U08 Cp_PREFIX CpCoreAllocBuffer ( _U08 ubChannelV,00138 <a class="code" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> * msg,00139 _U08 direction);00140 <font class="preprocessor">#endif</font>00141 <font class="preprocessor"></font>00157 Cp_EXPORT _U08 Cp_PREFIX <a class="code" href="cpcore_h.html#a5">CpCoreBaudrate</a>(_U08 ubChannelV,00158 _U08 btr0, _U08 btr1,00159 _U08 sjw);00160 00161 00194 <font class="preprocessor">#if CP_FULL_CAN == 1</font>00195 <font class="preprocessor"></font>Cp_EXPORT _U08 * Cp_PREFIX CpCoreBufferData(_U08 ubChannelV, _U08 ubBufferV);00196 <font class="preprocessor">#endif</font>00197 <font class="preprocessor"></font>00198 00211 <font class="preprocessor">#if CP_FULL_CAN == 1</font>00212 <font class="preprocessor"></font>Cp_EXPORT _U08 Cp_PREFIX CpCoreBufferDLC( _U08 ubChannelV, _U08 ubBufferV,00213 _U08 ubDlcV);00214 <font class="preprocessor">#endif</font>00215 <font class="preprocessor"></font>00216 00231 <font class="preprocessor">#if CP_FULL_CAN == 1</font>00232 <font class="preprocessor"></font>Cp_EXPORT _U08 Cp_PREFIX CpCoreBufferSend(_U08 ubChannelV, _U08 ubBufferV);00233 <font class="preprocessor">#endif</font>00234 <font class="preprocessor"></font>00235 00252 <font class="preprocessor">#if CP_FULL_CAN == 1</font>00253 <font class="preprocessor"></font>Cp_EXPORT _U08 Cp_PREFIX CpCoreBufferTransmit(_U08 ubChannelV,00254 <a class="code" href="struct_CpStruct_CAN.html">CpStruct_CAN</a> * msg);00255 <font class="preprocessor">#endif</font>00256 <font class="preprocessor"></font>00257 00271 Cp_EXPORT _U08 Cp_PREFIX <a class="code" href="cpcore_h.html#a6">CpCoreCANMode</a>(_U08 ubChannelV, _U08 mode);00272 00273 00288 Cp_EXPORT _U08 Cp_PREFIX <a class="code" href="cpcore_h.html#a7">CpCoreCANState</a>(_U08 ubChannelV);00289 00290 00300 <font class="preprocessor">#if CP_FULL_CAN == 1</font>00301 <font class="preprocessor"></font>Cp_EXPORT _U08 Cp_PREFIX CpCoreDeAllocBuffer( _U08 ubChannelV,00302 _U08 msg_buffer);00303 <font class="preprocessor">#endif</font>00304 <font class="preprocessor"></font>00320 Cp_EXPORT _U08 Cp_PREFIX <a class="code" href="cpcore_h.html#a8">CpCoreDeInitDriver</a>(_U08 ubChannelV);00321 00322 00340 Cp_EXPORT _U08 Cp_PREFIX <a class="code" href="cpcore_h.html#a9">CpCoreFilterAll</a>(_U08 ubChannelV, _BIT enable);00341 00342 00364 Cp_EXPORT _U08 Cp_PREFIX <a class="code" href="cpcore_h.html#a10">CpCoreFilterMsg</a>( _U08 ubChannelV, _U16 id,00365 _BIT enable);00366 00367 00380 Cp_EXPORT _U08 Cp_PREFIX <a class="code" href="cpcore_h.html#a11">CpCoreHDI</a>(_U08 ubChannelV, <a class="code" href="struct_CpStruct_HDI.html">CpStruct_HDI</a>* hdi);00381 00382 00405 Cp_EXPORT _U08 Cp_PREFIX <a class="code" href="cpcore_h.html#a12">CpCoreInitDriver</a>(_U08 ubChannelV);00406 00407 00421 <font class="keywordtype">void</font> <a class="code" href="cpcore_h.html#a13">CpCoreIntHandler</a>(<font class="keywordtype">void</font>);00422 00423 00441 Cp_EXPORT _U08 Cp_PREFIX <a class="code" href="cpcore_h.html#a14">CpCoreMsgReceive</a>(_U08 ubChannelV);00442 00443 00460 Cp_EXPORT _U08 Cp_PREFIX <a class="code" href="cpcore_h.html#a15">CpCoreMsgTransmit</a>(_U08 ubChannelV);00461 00462 00484 Cp_EXPORT _U08 Cp_PREFIX <a class="code" href="cpcore_h.html#a16">CpCoreRegRead</a>( _U08 ubChannelV, _U16 regAdr,00485 _U08 * valuePtr);00486 00487 00508 Cp_EXPORT _U08 Cp_PREFIX <a class="code" href="cpcore_h.html#a17">CpCoreRegWrite</a>(_U08 ubChannelV, _U16 regAdr,00509 _U08 value);00510 00511 00512 00513 <font class="preprocessor">#endif </font><font class="comment">/* _CANpie_Core_ */</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 + -