doc/doxygen/html/candriver_8h-source.html
author lbessard
Wed, 21 Nov 2007 16:30:26 +0100
changeset 317 f1c472b42327
parent 240 34654679f262
permissions -rw-r--r--
Bug on default COB ID value for PDO transmit and receive 5 and higher fixed
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
     1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
     2
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
     3
<title>CanFestival: include/hcs12/candriver.h Source File</title>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
     4
<link href="doxygen.css" rel="stylesheet" type="text/css">
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
     5
<link href="tabs.css" rel="stylesheet" type="text/css">
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
     6
</head><body>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
     7
<!-- Generated by Doxygen 1.5.1 -->
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
     8
<div class="tabs">
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
     9
  <ul>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    10
    <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    11
    <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    12
    <li id="current"><a href="files.html"><span>Files</span></a></li>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    13
    <li><a href="dirs.html"><span>Directories</span></a></li>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    14
  </ul></div>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    15
<div class="tabs">
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    16
  <ul>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    17
    <li><a href="files.html"><span>File&nbsp;List</span></a></li>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    18
    <li><a href="globals.html"><span>Globals</span></a></li>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    19
  </ul></div>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    20
<div class="nav">
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    21
<a class="el" href="dir_bb27f6e70a4a8ab6966321815f15a33d.html">include</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_d760eeaaeddcf24a708a1307f60f8f4e.html">hcs12</a></div>
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    22
<h1>candriver.h</h1><a href="candriver_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    23
<a name="l00002"></a>00002 <span class="comment">This file is part of CanFestival, a library implementing CanOpen Stack. </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    24
<a name="l00003"></a>00003 <span class="comment"></span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    25
<a name="l00004"></a>00004 <span class="comment">Copyright (C): Edouard TISSERANT and Francis DUPIN</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    26
<a name="l00005"></a>00005 <span class="comment"></span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    27
<a name="l00006"></a>00006 <span class="comment">See COPYING file for copyrights details.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    28
<a name="l00007"></a>00007 <span class="comment"></span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    29
<a name="l00008"></a>00008 <span class="comment">This library is free software; you can redistribute it and/or</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    30
<a name="l00009"></a>00009 <span class="comment">modify it under the terms of the GNU Lesser General Public</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    31
<a name="l00010"></a>00010 <span class="comment">License as published by the Free Software Foundation; either</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    32
<a name="l00011"></a>00011 <span class="comment">version 2.1 of the License, or (at your option) any later version.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    33
<a name="l00012"></a>00012 <span class="comment"></span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    34
<a name="l00013"></a>00013 <span class="comment">This library is distributed in the hope that it will be useful,</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    35
<a name="l00014"></a>00014 <span class="comment">but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    36
<a name="l00015"></a>00015 <span class="comment">MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    37
<a name="l00016"></a>00016 <span class="comment">Lesser General Public License for more details.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    38
<a name="l00017"></a>00017 <span class="comment"></span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    39
<a name="l00018"></a>00018 <span class="comment">You should have received a copy of the GNU Lesser General Public</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    40
<a name="l00019"></a>00019 <span class="comment">License along with this library; if not, write to the Free Software</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    41
<a name="l00020"></a>00020 <span class="comment">Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    42
<a name="l00021"></a>00021 <span class="comment">*/</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    43
<a name="l00022"></a>00022 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    44
<a name="l00023"></a>00023 <span class="preprocessor">#ifndef __CANDRIVER__</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    45
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define __CANDRIVER__</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    46
<a name="l00025"></a>00025 <span class="preprocessor"></span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    47
<a name="l00026"></a>00026 <span class="comment">//#include DEBUG_CAN</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    48
<a name="l00027"></a>00027 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    49
<a name="l00028"></a>00028 <span class="preprocessor">#include &lt;<a class="code" href="can_8h.html">can.h</a>&gt;</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    50
<a name="l00029"></a>00029 <span class="preprocessor">#include &lt;<a class="code" href="objdictdef_8h.html">objdictdef.h</a>&gt;</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    51
<a name="l00030"></a>00030 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    52
<a name="l00031"></a>00031 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    53
<a name="l00032"></a>00032 <span class="comment">/*</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    54
<a name="l00033"></a>00033 <span class="comment">The CAN message received are stored in a fifo stack</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    55
<a name="l00034"></a>00034 <span class="comment">We consider one stack for all the 5 can devices. It is a choice !</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    56
<a name="l00035"></a>00035 <span class="comment">*/</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    57
<a name="l00036"></a>00036 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    58
<a name="l00037"></a>00037 <span class="comment">/* Be free to change this value */</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    59
<a name="l00038"></a><a class="code" href="candriver_8h.html#12ae319363148d264184861475351e3c">00038</a> <span class="preprocessor">#define MAX_STACK_MSG_RCV 5</span>
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    60
<a name="l00039"></a>00039 <span class="preprocessor"></span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    61
<a name="l00040"></a>00040 <span class="comment">/* Number of incomings and outcomings CAN Line. The layer CanOpen must be</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    62
<a name="l00041"></a>00041 <span class="comment">used only for ONE line CAN. But you may used one or more CAN drivers, without</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    63
<a name="l00042"></a>00042 <span class="comment">a CanOpen layer.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    64
<a name="l00043"></a>00043 <span class="comment">Only 2 lines are implemented. If more lines are needed, copy void __attribute__((interrupt)) can0HdlRcv (void) to void __attribute__((interrupt)) canXHdlRcv (void) and make </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    65
<a name="l00044"></a>00044 <span class="comment">changes : [0] to [x], CAN0 to CANX, etc</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    66
<a name="l00045"></a>00045 <span class="comment">*/</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    67
<a name="l00046"></a><a class="code" href="candriver_8h.html#e815437e20b35852b381f41b5b3feca3">00046</a> <span class="preprocessor">#define NB_LINE_CAN 1</span>
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    68
<a name="l00047"></a>00047 <span class="preprocessor"></span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    69
<a name="l00048"></a>00048 <span class="comment">/* Whose hardware HCS12 CAN block is used for CanOpen ? Chose between CAN0, ..., CAN4</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    70
<a name="l00049"></a>00049 <span class="comment">If you use CANOPEN_LINE_NUMBER_USED = CANI, the value of NB_LINE_CAN must be</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    71
<a name="l00050"></a>00050 <span class="comment">more or equal to I + 1</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    72
<a name="l00051"></a>00051 <span class="comment">Value other than CAN0 not tested, but should work fine.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    73
<a name="l00052"></a>00052 <span class="comment"> */</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    74
<a name="l00053"></a><a class="code" href="candriver_8h.html#b790d6b6969e61da0bab8965d9b2a59e">00053</a> <span class="preprocessor">#define CANOPEN_LINE_NUMBER_USED CAN0</span>
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    75
<a name="l00054"></a>00054 <span class="preprocessor"></span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    76
<a name="l00055"></a>00055 <span class="comment">/* Stack of received messages </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    77
<a name="l00056"></a>00056 <span class="comment">MSG received on CAN0 module is stored in stackMsgRcv[0], etc</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    78
<a name="l00057"></a>00057 <span class="comment">*/</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    79
<a name="l00058"></a>00058 <span class="keyword">extern</span> <span class="keyword">volatile</span> <a class="code" href="structMessage.html">Message</a> <a class="code" href="candriver_8h.html#40054ae396fb4eedbac1ad9f9dd1a028">stackMsgRcv</a>[<a class="code" href="candriver_8h.html#e815437e20b35852b381f41b5b3feca3">NB_LINE_CAN</a>][<a class="code" href="candriver_8h.html#12ae319363148d264184861475351e3c">MAX_STACK_MSG_RCV</a>];
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    80
<a name="l00059"></a>00059 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    81
<a name="l00060"></a>00060 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    82
<a name="l00061"></a>00061 <span class="comment">/* Copy from the stack of the message to treat */</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    83
<a name="l00062"></a>00062 <span class="keyword">extern</span> <a class="code" href="structMessage.html">Message</a> <a class="code" href="candriver_8h.html#22740559e49d224a83022bf4e082b26f">msgRcv</a>;
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    84
<a name="l00063"></a>00063 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    85
<a name="l00064"></a>00064 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    86
<a name="l00065"></a>00065 <span class="comment">/* To move on the stack of messages </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    87
<a name="l00066"></a>00066 <span class="comment"> */</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    88
<a name="l00067"></a><a class="code" href="structt__pointerStack.html">00067</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    89
<a name="l00068"></a><a class="code" href="structt__pointerStack.html#b07f5d836a93a8aabc84ce62b55d8aeb">00068</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a> w ; <span class="comment">/* received */</span>
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    90
<a name="l00069"></a><a class="code" href="structt__pointerStack.html#a276e252993440068b1bc44faaa53fd7">00069</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a> r ; <span class="comment">/* To transmit */</span>
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    91
<a name="l00070"></a>00070 } <a class="code" href="structt__pointerStack.html">t_pointerStack</a>;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    92
<a name="l00071"></a>00071 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    93
<a name="l00072"></a>00072 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    94
<a name="l00073"></a>00073 <span class="comment">/* Pointer for write or read a message in/from the reception stack */</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    95
<a name="l00074"></a>00074 <span class="keyword">extern</span> <span class="keyword">volatile</span> <a class="code" href="structt__pointerStack.html">t_pointerStack</a> <a class="code" href="candriver_8h.html#ec01c7792152a9bc4620413f77df3c21">ptrMsgRcv</a>[<a class="code" href="candriver_8h.html#e815437e20b35852b381f41b5b3feca3">NB_LINE_CAN</a>];
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    96
<a name="l00075"></a>00075 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    97
<a name="l00076"></a>00076 <span class="comment">/* </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    98
<a name="l00077"></a>00077 <span class="comment">Parameters to define the  clock system for the CAN bus</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    99
<a name="l00078"></a>00078 <span class="comment">example : </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   100
<a name="l00079"></a>00079 <span class="comment">CAN_BUS_TIME clk = {</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   101
<a name="l00080"></a>00080 <span class="comment">      1,  // clksrc: Use the bus clock : 16 MHz, the freq. of the quartz's board        </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   102
<a name="l00081"></a>00081 <span class="comment">      0,  // brp :  chose btw 0 and 63 (6 bits).  freq time quantum = 16MHz / (brp + 1) </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   103
<a name="l00082"></a>00082 <span class="comment">      1,  // sjw : chose btw 0 and 3 (2 bits). Sync on (sjw + 1 ) time quantum          </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   104
<a name="l00083"></a>00083 <span class="comment">      1,  // samp : chose btw 0 and 3 (2 bits) (samp + 1 ) samples per bit              </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   105
<a name="l00084"></a>00084 <span class="comment">      4,  // tseg2 : chose btw 0 and 7 (3 bits) Segment 2 width = (tseg2 + 1)  tq       </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   106
<a name="l00085"></a>00085 <span class="comment">      9,  // tseg1 : chose btw 0 and 15 (4 bits) Segment 1 width = (tseg1 + 1)  tq      </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   107
<a name="l00086"></a>00086 <span class="comment"></span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   108
<a name="l00087"></a>00087 <span class="comment">      </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   109
<a name="l00088"></a>00088 <span class="comment">      With these values, </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   110
<a name="l00089"></a>00089 <span class="comment">      - The width of the bit time is 16 time quantum :</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   111
<a name="l00090"></a>00090 <span class="comment">          - 1 tq for the SYNC segment (could not be modified)</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   112
<a name="l00091"></a>00091 <span class="comment">          - 10 tq for the TIME 1 segment (tseg1 = 9)</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   113
<a name="l00092"></a>00092 <span class="comment">          - 5 tq for the TIME 2 segment (tseg2 = 4)</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   114
<a name="l00093"></a>00093 <span class="comment">      - Because the bus clock of the MSCAN is 16 MHZ, and the </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   115
<a name="l00094"></a>00094 <span class="comment">        freq of the time quantum is 16 MHZ (brp = 0), and  there are 16 tq in the bit time,</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   116
<a name="l00095"></a>00095 <span class="comment">        so the freq of the bit time is 1 MHz.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   117
<a name="l00096"></a>00096 <span class="comment">      </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   118
<a name="l00097"></a>00097 <span class="comment">  };</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   119
<a name="l00098"></a>00098 <span class="comment">*/</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   120
<a name="l00099"></a><a class="code" href="structcanBusTime.html">00099</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   121
<a name="l00100"></a><a class="code" href="structcanBusTime.html#97e1ad879dbd38f6726eacb704121930">00100</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  clksrc;     <span class="comment">/* use of internal clock  or clock bus        */</span>
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   122
<a name="l00101"></a><a class="code" href="structcanBusTime.html#f0662795b937b5c54451aa845a980c0d">00101</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  brp;        <span class="comment">/* define the bus speed                       */</span>
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   123
<a name="l00102"></a><a class="code" href="structcanBusTime.html#71915957851eb44a3dbdb5fb0cad45ff">00102</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  sjw;        <span class="comment">/* Number of time quantum for synchro - 1     */</span>
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   124
<a name="l00103"></a><a class="code" href="structcanBusTime.html#14a31c3c0d6d2ea48ce1c0d00db2724c">00103</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  samp;       <span class="comment">/* Number of sample per bit (1 or 3)          */</span>
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   125
<a name="l00104"></a><a class="code" href="structcanBusTime.html#1dfb7aa14ba56f5a73715f4d8c6befc9">00104</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  tseg2;      <span class="comment">/* Width of the time segment 2 (in tq) - 1    */</span>
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   126
<a name="l00105"></a><a class="code" href="structcanBusTime.html#6187a598266f497d7ecd897af3fd0139">00105</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  tseg1;      <span class="comment">/* Width of the time segment 1 (in tq) - 1    */</span>
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   127
<a name="l00106"></a>00106 } <a class="code" href="structcanBusTime.html">canBusTime</a>;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   128
<a name="l00107"></a>00107 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   129
<a name="l00108"></a>00108 <span class="comment">/* </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   130
<a name="l00109"></a>00109 <span class="comment">Parameters to init the filters for received messages</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   131
<a name="l00110"></a>00110 <span class="comment">*/</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   132
<a name="l00111"></a><a class="code" href="structcanBusFilterInit.html">00111</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   133
<a name="l00112"></a><a class="code" href="structcanBusFilterInit.html#5da0d810ad7e2e35a34737ba969caf39">00112</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  idam;        <span class="comment">/* Put 0x01 for 16 bits acceptance filter    */</span>
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   134
<a name="l00113"></a><a class="code" href="structcanBusFilterInit.html#f999163cff995179c6ff8d24e0278fac">00113</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  canidar0;
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   135
<a name="l00114"></a><a class="code" href="structcanBusFilterInit.html#02ae05657cd22560f8a41a491f57d204">00114</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  canidmr0;
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   136
<a name="l00115"></a><a class="code" href="structcanBusFilterInit.html#08dcbd19479f3a54e2a42a3d9ec9a255">00115</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  canidar1;
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   137
<a name="l00116"></a><a class="code" href="structcanBusFilterInit.html#ced1e6e7a19564d3ea5228bd61b6f235">00116</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  canidmr1; 
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   138
<a name="l00117"></a><a class="code" href="structcanBusFilterInit.html#c124ee6cf0d365b7b4a36b60a7527191">00117</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  canidar2;
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   139
<a name="l00118"></a><a class="code" href="structcanBusFilterInit.html#49dc105feb71df50a0af58069789f886">00118</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  canidmr2;
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   140
<a name="l00119"></a><a class="code" href="structcanBusFilterInit.html#c72887349184517379bb501c5f554c96">00119</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  canidar3;
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   141
<a name="l00120"></a><a class="code" href="structcanBusFilterInit.html#08039c51e6ced8e7f58de19092126158">00120</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  canidmr3;
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   142
<a name="l00121"></a><a class="code" href="structcanBusFilterInit.html#464b3b7f0e07f2ffc00becab1455a427">00121</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  canidar4;
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   143
<a name="l00122"></a><a class="code" href="structcanBusFilterInit.html#b9a81efcfccd87a948d62bd769b26b61">00122</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  canidmr4;
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   144
<a name="l00123"></a><a class="code" href="structcanBusFilterInit.html#1279a3436781a76dabb1258b53a83e6c">00123</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  canidar5;
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   145
<a name="l00124"></a><a class="code" href="structcanBusFilterInit.html#afce7265d09631e57c049f90437f5708">00124</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  canidmr5; 
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   146
<a name="l00125"></a><a class="code" href="structcanBusFilterInit.html#3bb15152e7d9411fa8af42e856901670">00125</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  canidar6;
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   147
<a name="l00126"></a><a class="code" href="structcanBusFilterInit.html#544b671460d71c1cdf601cc5c357d43c">00126</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  canidmr6;
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   148
<a name="l00127"></a><a class="code" href="structcanBusFilterInit.html#10efad1ba33abe4fbc25f36abc169364">00127</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  canidar7;
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   149
<a name="l00128"></a><a class="code" href="structcanBusFilterInit.html#56f25088d33f0cb1c0e305683c8235e1">00128</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  canidmr7;  
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   150
<a name="l00129"></a>00129 } <a class="code" href="structcanBusFilterInit.html">canBusFilterInit</a>;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   151
<a name="l00130"></a>00130 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   152
<a name="l00131"></a>00131 <span class="comment">/*</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   153
<a name="l00132"></a>00132 <span class="comment">Parameters to init MSCAN</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   154
<a name="l00133"></a>00133 <span class="comment">Example</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   155
<a name="l00134"></a>00134 <span class="comment">CAN_BUS_INIT bi = {</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   156
<a name="l00135"></a>00135 <span class="comment">    0,     no low power                  </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   157
<a name="l00136"></a>00136 <span class="comment">    0,     no time stamp                </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   158
<a name="l00137"></a>00137 <span class="comment">    1,     enable MSCAN                 </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   159
<a name="l00138"></a>00138 <span class="comment">    0,     clock source : oscillator    </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   160
<a name="l00139"></a>00139 <span class="comment">    0,     no loop back                 </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   161
<a name="l00140"></a>00140 <span class="comment">    0,     no listen only               </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   162
<a name="l00141"></a>00141 <span class="comment">    0,     no low pass filter for wk up </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   163
<a name="l00142"></a>00142 <span class="comment">    {</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   164
<a name="l00143"></a>00143 <span class="comment">      1,       Use the oscillator clock                         </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   165
<a name="l00144"></a>00144 <span class="comment">      0,       Quartz oscillator : freq time quantum =  freq oscillator clock / (0 + 1)</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   166
<a name="l00145"></a>00145 <span class="comment">      1,       Sync on (1 + 1) time quantum                            </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   167
<a name="l00146"></a>00146 <span class="comment">      1,       1 sample per bit                                  </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   168
<a name="l00147"></a>00147 <span class="comment">      4,       time segment 2 width : (4 + 1) tq                     </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   169
<a name="l00148"></a>00148 <span class="comment">      9,       time segment 1 width : (9 + 1) tq                     </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   170
<a name="l00149"></a>00149 <span class="comment">    }</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   171
<a name="l00150"></a>00150 <span class="comment">  };   </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   172
<a name="l00151"></a>00151 <span class="comment">*/</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   173
<a name="l00152"></a>00152 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   174
<a name="l00153"></a><a class="code" href="structcanBusInit.html">00153</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   175
<a name="l00154"></a><a class="code" href="structcanBusInit.html#e55fa49debf408530d0e02e046c78fc2">00154</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  cswai;      <span class="comment">/* Low power/normal in wait mode   (1/0)      */</span>
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   176
<a name="l00155"></a><a class="code" href="structcanBusInit.html#b2d867e2d4c69932e82294affc065529">00155</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  time;       <span class="comment">/* Timer for time-stamp enable/disable (1/0)  */</span>
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   177
<a name="l00156"></a><a class="code" href="structcanBusInit.html#94b6d65fade44b397c1e48e658e7bffe">00156</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  cane;       <span class="comment">/* Enable MSCAN (yes=1) Do it !               */</span>
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   178
<a name="l00157"></a><a class="code" href="structcanBusInit.html#a795e561857d0643cb7912ed92ab5268">00157</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  clksrc;     <span class="comment">/* clock source bus/oscillator (1/0)          */</span>
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   179
<a name="l00158"></a><a class="code" href="structcanBusInit.html#c8a539634dabd6c10519a59480cb250c">00158</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  loopb;      <span class="comment">/* loop back mode for test (yes=1/no=0)       */</span>
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   180
<a name="l00159"></a><a class="code" href="structcanBusInit.html#3576034b380091818fc88fb22aa408f2">00159</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  listen;     <span class="comment">/* MSCAN is listen only (yes=1/no=0 ie normal)*/</span>
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   181
<a name="l00160"></a><a class="code" href="structcanBusInit.html#acf29b4229abadb3f5ab7a6524b406e7">00160</a>   <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>  wupm;       <span class="comment">/* low pas filter for wake up (yes=1/no=0)    */</span>
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   182
<a name="l00161"></a>00161   <a class="code" href="structcanBusTime.html">canBusTime</a> 
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   183
<a name="l00162"></a><a class="code" href="structcanBusInit.html#3416d1e391b6ced43c74c1a28d473b7c">00162</a>         clk;        <span class="comment">/* Values for clock system init               */</span>
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   184
<a name="l00163"></a>00163   <a class="code" href="structcanBusFilterInit.html">canBusFilterInit</a>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   185
<a name="l00164"></a><a class="code" href="structcanBusInit.html#3311c0959bc93dedb5bd13fb653eab7c">00164</a>   fi;               <span class="comment">/* Values for filter acceptance msg init      */</span>
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   186
<a name="l00165"></a>00165   
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   187
<a name="l00166"></a>00166 } <a class="code" href="structcanBusInit.html">canBusInit</a>;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   188
<a name="l00167"></a>00167 
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   189
<a name="l00168"></a>00168 <span class="keyword">extern</span> <a class="code" href="structcanBusInit.html">canBusInit</a> <a class="code" href="candriver_8h.html#0324c271e4c71a8b96af194e6310a792">bi</a>;
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   190
<a name="l00169"></a>00169 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   191
<a name="l00170"></a>00170 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   192
<a name="l00171"></a>00171 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   193
<a name="l00172"></a>00172 <span class="comment">/*</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   194
<a name="l00173"></a>00173 <span class="comment">For the received messsage, add a Identificator to</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   195
<a name="l00174"></a>00174 <span class="comment">the list of ID to accept.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   196
<a name="l00175"></a>00175 <span class="comment">You can use several times this function to accept several messages.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   197
<a name="l00176"></a>00176 <span class="comment">It configures registers on 16 bits.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   198
<a name="l00177"></a>00177 <span class="comment">Automatically, it configure the filter to</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   199
<a name="l00178"></a>00178 <span class="comment">- not accepting the msg on 29 bits (ide=1 refused)</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   200
<a name="l00179"></a>00179 <span class="comment">- not filtering on rtr state (rtr = 1 and rtr = 0 are accepted)</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   201
<a name="l00180"></a>00180 <span class="comment">Algo :</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   202
<a name="l00181"></a>00181 <span class="comment">if CANIDARx = 0 then  CANIDARx = id . else do nothing</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   203
<a name="l00182"></a>00182 <span class="comment">CANIDMRx = CANIDMRx OR (CANIDARx XOR id )</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   204
<a name="l00183"></a>00183 <span class="comment">nFilter : 0 to 3</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   205
<a name="l00184"></a>00184 <span class="comment">Must be in init mode before.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   206
<a name="l00185"></a>00185 <span class="comment">*/</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   207
<a name="l00186"></a>00186 <span class="keywordtype">char</span> <a class="code" href="canOpenDriver_8c.html#9579ae456a8ee9cee1ae777a4a0ee3ac">canAddIdToFilter</a> (
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   208
<a name="l00187"></a>00187                        <a class="code" href="hcs12_2applicfg_8h.html#14fad477a4a001f547db2731eaaaa1dc">UNS16</a> adrCAN,
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   209
<a name="l00188"></a>00188                        <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a> nFilter,
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   210
<a name="l00189"></a>00189                        <a class="code" href="hcs12_2applicfg_8h.html#14fad477a4a001f547db2731eaaaa1dc">UNS16</a> <span class="keywordtype">id</span> <span class="comment">/* 11 bits, the 5 msb not used */</span>
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   211
<a name="l00190"></a>00190                        );
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   212
<a name="l00191"></a>00191 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   213
<a name="l00192"></a>00192 <span class="comment">/*</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   214
<a name="l00193"></a>00193 <span class="comment"> Use this function to change the CAN message acceptance filters and masks.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   215
<a name="l00194"></a>00194 <span class="comment"> */</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   216
<a name="l00195"></a>00195 <span class="keywordtype">char</span> <a class="code" href="canOpenDriver_8c.html#7fd72f38fd09b6e79a50ac32d8cc0629">canChangeFilter</a> (<a class="code" href="hcs12_2applicfg_8h.html#14fad477a4a001f547db2731eaaaa1dc">UNS16</a> adrCAN, <a class="code" href="structcanBusFilterInit.html">canBusFilterInit</a> fi);
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   217
<a name="l00196"></a>00196 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   218
<a name="l00197"></a>00197 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   219
<a name="l00198"></a>00198 <span class="comment">/*</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   220
<a name="l00199"></a>00199 <span class="comment">Enable one of the 5 MSCAN.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   221
<a name="l00200"></a>00200 <span class="comment">Must be done only one time after a reset of the CPU.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   222
<a name="l00201"></a>00201 <span class="comment">To do before any CAN initialisation</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   223
<a name="l00202"></a>00202 <span class="comment">*/</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   224
<a name="l00203"></a>00203 <span class="keywordtype">char</span> <a class="code" href="canOpenDriver_8c.html#bf55daf34be2503cf0414e15abf2c69c">canEnable</a> (
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   225
<a name="l00204"></a>00204                 <a class="code" href="hcs12_2applicfg_8h.html#14fad477a4a001f547db2731eaaaa1dc">UNS16</a> adrCAN <span class="comment">/* First address of MSCANx registers */</span>
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   226
<a name="l00205"></a>00205                 );
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   227
<a name="l00206"></a>00206 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   228
<a name="l00207"></a>00207 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   229
<a name="l00208"></a>00208 <span class="comment">/* </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   230
<a name="l00209"></a>00209 <span class="comment">Initialize one of the 5 mscan</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   231
<a name="l00210"></a>00210 <span class="comment">can be done multiple times in your code</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   232
<a name="l00211"></a>00211 <span class="comment">Return 0 : OK</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   233
<a name="l00212"></a>00212 <span class="comment">When it return from the function,</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   234
<a name="l00213"></a>00213 <span class="comment">mscan is on sleep mode with wake up disabled.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   235
<a name="l00214"></a>00214 <span class="comment">      is not on init mode</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   236
<a name="l00215"></a>00215 <span class="comment">*/</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   237
<a name="l00216"></a>00216 <span class="keywordtype">char</span> <a class="code" href="can__peak__win32_8c.html#cd636af61207be14f372fcbe0785f59d">canInit</a> (
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   238
<a name="l00217"></a>00217               <a class="code" href="hcs12_2applicfg_8h.html#14fad477a4a001f547db2731eaaaa1dc">UNS16</a> adrCAN,   <span class="comment">/* First address of MSCANx registers  */</span>
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   239
<a name="l00218"></a>00218               <a class="code" href="structcanBusInit.html">canBusInit</a> 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   240
<a name="l00219"></a>00219               bi       <span class="comment">/* All the parameters to init the bus */</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   241
<a name="l00220"></a>00220               );
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   242
<a name="l00221"></a>00221 <span class="comment">/*</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   243
<a name="l00222"></a>00222 <span class="comment">Initialize the parameters of the system clock for the MSCAN</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   244
<a name="l00223"></a>00223 <span class="comment">You must put the MSCAN in sleep mode before with canSleepMode()</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   245
<a name="l00224"></a>00224 <span class="comment">Return 0 : OK</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   246
<a name="l00225"></a>00225 <span class="comment">       1 : Not in sleep mode. Unable to init MSCAN </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   247
<a name="l00226"></a>00226 <span class="comment">*/</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   248
<a name="l00227"></a>00227 <span class="keywordtype">char</span> <a class="code" href="canOpenDriver_8c.html#83ad789afb5a949c85f8998b40d651c3">canInitClock</a> (
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   249
<a name="l00228"></a>00228                    <a class="code" href="hcs12_2applicfg_8h.html#14fad477a4a001f547db2731eaaaa1dc">UNS16</a> adrCAN, <span class="comment">/* First address of MSCANx registers */</span>
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   250
<a name="l00229"></a>00229                    <a class="code" href="structcanBusTime.html">canBusTime</a> clk);
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   251
<a name="l00230"></a>00230 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   252
<a name="l00231"></a>00231 <span class="comment">/* </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   253
<a name="l00232"></a>00232 <span class="comment">Initialize one filter for acceptance of received msg.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   254
<a name="l00233"></a>00233 <span class="comment">Filters MUST be configured on 16 bits </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   255
<a name="l00234"></a>00234 <span class="comment">(See doc Motorola mscan bloc guide fig 4.3)</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   256
<a name="l00235"></a>00235 <span class="comment">Must be in init mode before.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   257
<a name="l00236"></a>00236 <span class="comment">adrCAN  : adress of the first register of the mscan module</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   258
<a name="l00237"></a>00237 <span class="comment">nFilter : the filter : 0 to 3.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   259
<a name="l00238"></a>00238 <span class="comment">ar : Value to write in acceptance register</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   260
<a name="l00239"></a>00239 <span class="comment">     Beware ! hight byte and low byte inverted.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   261
<a name="l00240"></a>00240 <span class="comment">     for example if nFilter = 0, hight byte of ar -&gt; CANIDAR0</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   262
<a name="l00241"></a>00241 <span class="comment">                                 low   byte of ar -&gt; CANIDAR1</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   263
<a name="l00242"></a>00242 <span class="comment">mr : Value to write in mask register</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   264
<a name="l00243"></a>00243 <span class="comment">     Beware ! hight byte and low byte inverted.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   265
<a name="l00244"></a>00244 <span class="comment">     for example if nFilter = 2, hight byte of ar -&gt; CANIDMR4</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   266
<a name="l00245"></a>00245 <span class="comment">                                 low   byte of ar -&gt; CANIDMR5</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   267
<a name="l00246"></a>00246 <span class="comment">*/</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   268
<a name="l00247"></a>00247 <span class="keywordtype">char</span> <a class="code" href="canOpenDriver_8c.html#d5f0fc801fc795c7911fb7dc4f403428">canInit1Filter</a> (
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   269
<a name="l00248"></a>00248                      <a class="code" href="hcs12_2applicfg_8h.html#14fad477a4a001f547db2731eaaaa1dc">UNS16</a> adrCAN, 
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   270
<a name="l00249"></a>00249                      <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a> nFilter,
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   271
<a name="l00250"></a>00250                      <a class="code" href="hcs12_2applicfg_8h.html#14fad477a4a001f547db2731eaaaa1dc">UNS16</a> ar,
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   272
<a name="l00251"></a>00251                      <a class="code" href="hcs12_2applicfg_8h.html#14fad477a4a001f547db2731eaaaa1dc">UNS16</a> mr
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   273
<a name="l00252"></a>00252                      );
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   274
<a name="l00253"></a>00253 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   275
<a name="l00254"></a>00254 <span class="comment">/*</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   276
<a name="l00255"></a>00255 <span class="comment">Initialise the parameters for filtering the messages received.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   277
<a name="l00256"></a>00256 <span class="comment">You must put the MSCAN in init mode before with canInitMode()</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   278
<a name="l00257"></a>00257 <span class="comment">Return 0 : OK</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   279
<a name="l00258"></a>00258 <span class="comment">       1 : Not in init mode. Unable to init MSCAN </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   280
<a name="l00259"></a>00259 <span class="comment">*/</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   281
<a name="l00260"></a>00260 
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   282
<a name="l00261"></a>00261 <span class="keywordtype">char</span> <a class="code" href="canOpenDriver_8c.html#437cf0f7cee6930bc4d6f4743999e4f2">canInitFilter</a> (
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   283
<a name="l00262"></a>00262                     <a class="code" href="hcs12_2applicfg_8h.html#14fad477a4a001f547db2731eaaaa1dc">UNS16</a> adrCAN, <span class="comment">/* First address of MSCANx registers */</span>
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   284
<a name="l00263"></a>00263                     <a class="code" href="structcanBusFilterInit.html">canBusFilterInit</a> fi);
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   285
<a name="l00264"></a>00264 <span class="comment">/*</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   286
<a name="l00265"></a>00265 <span class="comment">Put one of the 5 mscan in Init mode</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   287
<a name="l00266"></a>00266 <span class="comment">Loop until init mode is reached.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   288
<a name="l00267"></a>00267 <span class="comment">*/</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   289
<a name="l00268"></a>00268 
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   290
<a name="l00269"></a>00269 <span class="keywordtype">char</span> <a class="code" href="canOpenDriver_8c.html#daff5eaa25245bff93a854283e2e0cb2">canInitMode</a> (
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   291
<a name="l00270"></a>00270                   <a class="code" href="hcs12_2applicfg_8h.html#14fad477a4a001f547db2731eaaaa1dc">UNS16</a> adrCAN <span class="comment">/* First address of MSCANx registers */</span>
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   292
<a name="l00271"></a>00271                   );    
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   293
<a name="l00272"></a>00272 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   294
<a name="l00273"></a>00273 <span class="comment">/*</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   295
<a name="l00274"></a>00274 <span class="comment">Leave the Init mode</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   296
<a name="l00275"></a>00275 <span class="comment">loop until init mode leaved.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   297
<a name="l00276"></a>00276 <span class="comment">*/</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   298
<a name="l00277"></a>00277 
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   299
<a name="l00278"></a>00278 <span class="keywordtype">char</span> <a class="code" href="canOpenDriver_8c.html#a619f965cc88e08dec28de4833bfe50a">canInitModeQ</a> (
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   300
<a name="l00279"></a>00279                    <a class="code" href="hcs12_2applicfg_8h.html#14fad477a4a001f547db2731eaaaa1dc">UNS16</a> adrCAN <span class="comment">/* First address of MSCANx registers */</span>
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   301
<a name="l00280"></a>00280                    );
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   302
<a name="l00281"></a>00281 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   303
<a name="l00282"></a>00282 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   304
<a name="l00283"></a>00283 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   305
<a name="l00284"></a>00284 <span class="comment">/*</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   306
<a name="l00285"></a>00285 <span class="comment">Transmit a msg on CAN "adrCan"</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   307
<a name="l00286"></a>00286 <span class="comment">Return : 0      No error</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   308
<a name="l00287"></a>00287 <span class="comment">         other  error : no buffer available to make the transmission</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   309
<a name="l00288"></a>00288 <span class="comment">*/</span>      
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   310
<a name="l00289"></a>00289 
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   311
<a name="l00290"></a>00290 <span class="keywordtype">char</span> <a class="code" href="canOpenDriver_8c.html#cd855997446329e6b6338fe8644edf11">canMsgTransmit</a> (
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   312
<a name="l00291"></a>00291                      <a class="code" href="hcs12_2applicfg_8h.html#14fad477a4a001f547db2731eaaaa1dc">UNS16</a> adrCAN,  <span class="comment">/* First address of MSCANx registers */</span>
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   313
<a name="l00292"></a>00292                      <a class="code" href="structMessage.html">Message</a> msg  <span class="comment">/* Message to transmit                */</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   314
<a name="l00293"></a>00293                      );
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   315
<a name="l00294"></a>00294 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   316
<a name="l00295"></a>00295 <span class="comment">/*</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   317
<a name="l00296"></a>00296 <span class="comment"> Set the interruptions. Must be call just after having left the init mode.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   318
<a name="l00297"></a>00297 <span class="comment"> */</span>          
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   319
<a name="l00298"></a>00298 <span class="keywordtype">char</span> <a class="code" href="canOpenDriver_8c.html#946843a5bc1823243b5120d57785f0ec">canSetInterrupt</a> (<a class="code" href="hcs12_2applicfg_8h.html#14fad477a4a001f547db2731eaaaa1dc">UNS16</a> adrCAN);                 
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   320
<a name="l00299"></a>00299 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   321
<a name="l00300"></a>00300 <span class="comment">/*</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   322
<a name="l00301"></a>00301 <span class="comment">Put one of the 5 mscan in sleep mode</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   323
<a name="l00302"></a>00302 <span class="comment">Beware! If some messages are to be sent,</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   324
<a name="l00303"></a>00303 <span class="comment">or if it is receiving, going into sleep mode</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   325
<a name="l00304"></a>00304 <span class="comment">may take time.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   326
<a name="l00305"></a>00305 <span class="comment">Wake up is disabled : stay in sleep mode even if</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   327
<a name="l00306"></a>00306 <span class="comment">bus traffic detected.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   328
<a name="l00307"></a>00307 <span class="comment">return 0 if 0K, other if error : mscan is on init mode.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   329
<a name="l00308"></a>00308 <span class="comment">Stay in this function until the sleep mode</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   330
<a name="l00309"></a>00309 <span class="comment">is reached.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   331
<a name="l00310"></a>00310 <span class="comment">*/</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   332
<a name="l00311"></a>00311 <span class="keywordtype">char</span> <a class="code" href="canOpenDriver_8c.html#ce25028cdf7de7a16b2762cb3846ddd4">canSleepMode</a> (
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   333
<a name="l00312"></a>00312                    <a class="code" href="hcs12_2applicfg_8h.html#14fad477a4a001f547db2731eaaaa1dc">UNS16</a> adrCAN <span class="comment">/* First address of MSCANx registers */</span>
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   334
<a name="l00313"></a>00313                    );   
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   335
<a name="l00314"></a>00314 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   336
<a name="l00315"></a>00315 <span class="comment">/*</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   337
<a name="l00316"></a>00316 <span class="comment">Leave the sleep mode</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   338
<a name="l00317"></a>00317 <span class="comment">loop until sleep mode leaved.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   339
<a name="l00318"></a>00318 <span class="comment">return 0 : OK</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   340
<a name="l00319"></a>00319 <span class="comment">return 1 : error : in init mode</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   341
<a name="l00320"></a>00320 <span class="comment">*/</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   342
<a name="l00321"></a>00321 <span class="keywordtype">char</span> <a class="code" href="canOpenDriver_8c.html#e147ca22aacafc3fa806f32f3f3577cb">canSleepModeQ</a> (
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   343
<a name="l00322"></a>00322                     <a class="code" href="hcs12_2applicfg_8h.html#14fad477a4a001f547db2731eaaaa1dc">UNS16</a> adrCAN <span class="comment">/* First address of MSCANx registers */</span>
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   344
<a name="l00323"></a>00323                     );  
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   345
<a name="l00324"></a>00324 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   346
<a name="l00325"></a>00325 <span class="comment">/*</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   347
<a name="l00326"></a>00326 <span class="comment">Put one of the 5 mscan in sleep mode</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   348
<a name="l00327"></a>00327 <span class="comment">MSCAN must not be in init mode.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   349
<a name="l00328"></a>00328 <span class="comment">wake up is enabled : wake up if traffic on CAN is detected</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   350
<a name="l00329"></a>00329 <span class="comment">Beware! If some messages are to be sent,</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   351
<a name="l00330"></a>00330 <span class="comment">or if it is receiving, going into sleep mode</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   352
<a name="l00331"></a>00331 <span class="comment">may take time.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   353
<a name="l00332"></a>00332 <span class="comment">Loop until sleep mode reached.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   354
<a name="l00333"></a>00333 <span class="comment">return 0 if 0K, other if error</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   355
<a name="l00334"></a>00334 <span class="comment">*/</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   356
<a name="l00335"></a>00335 <span class="keywordtype">char</span> <a class="code" href="canOpenDriver_8c.html#bb8b891e76257224f7c2e20d273c72a5">canSleepWupMode</a> (
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   357
<a name="l00336"></a>00336                       <a class="code" href="hcs12_2applicfg_8h.html#14fad477a4a001f547db2731eaaaa1dc">UNS16</a> adrCAN <span class="comment">/* First address of MSCANx registers */</span>
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   358
<a name="l00337"></a>00337                       );        
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   359
<a name="l00338"></a>00338 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   360
<a name="l00339"></a>00339 <span class="comment">/*</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   361
<a name="l00340"></a>00340 <span class="comment">Test if one of the 5 mscan is in init mode.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   362
<a name="l00341"></a>00341 <span class="comment">Return </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   363
<a name="l00342"></a>00342 <span class="comment">       0     -&gt; Not in init mode</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   364
<a name="l00343"></a>00343 <span class="comment">       other -&gt; In init mode</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   365
<a name="l00344"></a>00344 <span class="comment">*/</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   366
<a name="l00345"></a>00345 <span class="keywordtype">char</span> <a class="code" href="canOpenDriver_8c.html#101ff5d32d811e558e601083c84989fc">canTestInitMode</a> (
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   367
<a name="l00346"></a>00346                       <a class="code" href="hcs12_2applicfg_8h.html#14fad477a4a001f547db2731eaaaa1dc">UNS16</a> adrCAN <span class="comment">/* First address of MSCANx registers */</span>
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   368
<a name="l00347"></a>00347                       );   
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   369
<a name="l00348"></a>00348 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   370
<a name="l00349"></a>00349 <span class="comment">/*</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   371
<a name="l00350"></a>00350 <span class="comment">Test if one of the 5 mscan is in sleep mode.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   372
<a name="l00351"></a>00351 <span class="comment">Return </span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   373
<a name="l00352"></a>00352 <span class="comment">       0     -&gt; Not in sleep mode</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   374
<a name="l00353"></a>00353 <span class="comment">       other -&gt; In sleep mode</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   375
<a name="l00354"></a>00354 <span class="comment">*/</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   376
<a name="l00355"></a>00355 <span class="keywordtype">char</span> <a class="code" href="canOpenDriver_8c.html#008cc4a90d79b5ef1169d32a83947142">canTestSleepMode</a> (
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   377
<a name="l00356"></a>00356                        <a class="code" href="hcs12_2applicfg_8h.html#14fad477a4a001f547db2731eaaaa1dc">UNS16</a> adrCAN <span class="comment">/* First address of MSCANx registers */</span>
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   378
<a name="l00357"></a>00357                        );   
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   379
<a name="l00358"></a>00358 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   380
<a name="l00359"></a>00359 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   381
<a name="l00360"></a>00360 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   382
<a name="l00361"></a>00361 <span class="preprocessor">#endif </span><span class="comment">/*__CANDRIVER__*/</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   383
<a name="l00362"></a>00362 
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   384
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Jul 2 19:10:16 2007 for CanFestival by&nbsp;
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   385
<a href="http://www.doxygen.org/index.html">
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   386
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   387
</body>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   388
</html>