# HG changeset patch # User etisserant # Date 1202803994 -3600 # Node ID 1c1e3599d66a9e81eb0e7c3a5a9d8b62d051316e # Parent 6efc85c5493ee1020e9dcb4cf3fab45e000516e5 Removed generated html doxygen doc from CVS, too many files. diff -r 6efc85c5493e -r 1c1e3599d66a doc/doxygen/html/.cvsignore --- a/doc/doxygen/html/.cvsignore Mon Feb 11 11:00:12 2008 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -*.md5 -*.map -*.dot diff -r 6efc85c5493e -r 1c1e3599d66a doc/doxygen/html/Master_8c-source.html --- a/doc/doxygen/html/Master_8c-source.html Mon Feb 11 11:00:12 2008 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,310 +0,0 @@ - -
-00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #include "Master.h" -00024 #include "Slave.h" -00025 #include "TestMasterSlave.h" -00026 -00027 /*****************************************************************************/ -00028 void TestMaster_heartbeatError(UNS8 heartbeatID) -00029 { -00030 eprintf("TestMaster_heartbeatError %d\n", heartbeatID); -00031 } -00032 -00033 /******************************************************** -00034 * ConfigureSlaveNode is responsible to -00035 * - setup master RPDO 1 to receive TPDO 1 from id 2 -00036 * - setup master RPDO 2 to receive TPDO 2 from id 2 -00037 ********************************************************/ -00038 void TestMaster_initialisation() -00039 { -00040 UNS32 PDO1_COBID = 0x0182; -00041 UNS32 PDO2_COBID = 0x0282; -00042 UNS8 size = sizeof(UNS32); -00043 -00044 eprintf("TestMaster_initialisation\n"); -00045 -00046 /***************************************** -00047 * Define RPDOs to match slave ID=2 TPDOs* -00048 *****************************************/ -00049 writeLocalDict( &TestMaster_Data, /*CO_Data* d*/ -00050 0x1400, /*UNS16 index*/ -00051 0x01, /*UNS8 subind*/ -00052 &PDO1_COBID, /*void * pSourceData,*/ -00053 &size, /* UNS8 * pExpectedSize*/ -00054 RW); /* UNS8 checkAccess */ -00055 -00056 writeLocalDict( &TestMaster_Data, /*CO_Data* d*/ -00057 0x1401, /*UNS16 index*/ -00058 0x01, /*UNS8 subind*/ -00059 &PDO2_COBID, /*void * pSourceData,*/ -00060 &size, /* UNS8 * pExpectedSize*/ -00061 RW); /* UNS8 checkAccess */ -00062 } -00063 -00064 // Step counts number of times ConfigureSlaveNode is called -00065 static init_step = 0; -00066 -00067 /*Froward declaration*/ -00068 static void ConfigureSlaveNode(CO_Data* d, UNS8 nodeId); -00069 -00070 -00071 static void CheckSDOAndContinue(CO_Data* d, UNS8 nodeId) -00072 { -00073 UNS32 abortCode; -00074 if(getWriteResultNetworkDict (d, nodeId, &abortCode) != SDO_FINISHED) -00075 eprintf("Master : Failed in initializing slave %2.2x, step %d, AbortCode :%4.4x \n", nodeId, init_step, abortCode); -00076 -00077 /* Finalise last SDO transfer with this node */ -00078 closeSDOtransfer(&TestMaster_Data, nodeId, SDO_CLIENT); -00079 -00080 ConfigureSlaveNode(d, nodeId); -00081 } -00082 -00083 /******************************************************** -00084 * ConfigureSlaveNode is responsible to -00085 * - setup slave TPDO 1 transmit time -00086 * - setup slave TPDO 2 transmit time -00087 * - switch to operational mode -00088 * - send NMT to slave -00089 ******************************************************** -00090 * This an example of : -00091 * Network Dictionary Access (SDO) with Callback -00092 * Slave node state change request (NMT) -00093 ******************************************************** -00094 * This is called first by TestMaster_preOperational -00095 * then it called again each time a SDO exchange is -00096 * finished. -00097 ********************************************************/ -00098 -00099 static void ConfigureSlaveNode(CO_Data* d, UNS8 nodeId) -00100 { -00101 /* Master configure heartbeat producer time at 1000 ms -00102 * for slave node-id 0x02 by DCF concise */ -00103 -00104 UNS8 Transmission_Type = 0x01; -00105 UNS32 abortCode; -00106 UNS8 res; -00107 eprintf("Master : ConfigureSlaveNode %2.2x\n", nodeId); -00108 -00109 switch(++init_step){ -00110 case 1: /*First step : setup Slave's TPDO 1 to be transmitted on SYNC*/ -00111 eprintf("Master : set slave %2.2x TPDO 1 transmit type\n", nodeId); -00112 res = writeNetworkDictCallBack (d, /*CO_Data* d*/ -00113 nodeId, /*UNS8 nodeId*/ -00114 0x1800, /*UNS16 index*/ -00115 0x02, /*UNS8 subindex*/ -00116 1, /*UNS8 count*/ -00117 0, /*UNS8 dataType*/ -00118 &Transmission_Type,/*void *data*/ -00119 CheckSDOAndContinue); /*SDOCallback_t Callback*/ -00120 break; -00121 -00122 case 2: /*Second step*/ -00123 eprintf("Master : set slave %2.2x TPDO 2 transmit type\n", nodeId); -00124 writeNetworkDictCallBack (d, /*CO_Data* d*/ -00125 nodeId, /*UNS8 nodeId*/ -00126 0x1801, /*UNS16 index*/ -00127 0x02, /*UNS16 index*/ -00128 1, /*UNS8 count*/ -00129 0, /*UNS8 dataType*/ -00130 &Transmission_Type,/*void *data*/ -00131 CheckSDOAndContinue); /*SDOCallback_t Callback*/ -00132 break; -00133 case 3: -00134 -00135 /****************************** START *******************************/ -00136 -00137 /* Put the master in operational mode */ -00138 setState(d, Operational); -00139 -00140 /* Ask slave node to go in operational mode */ -00141 masterSendNMTstateChange (d, nodeId, NMT_Start_Node); -00142 -00143 } -00144 } -00145 -00146 void TestMaster_preOperational() -00147 { -00148 -00149 eprintf("TestMaster_preOperational\n"); -00150 ConfigureSlaveNode(&TestMaster_Data, 0x02); -00151 -00152 } -00153 -00154 void TestMaster_operational() -00155 { -00156 eprintf("TestMaster_operational\n"); -00157 } -00158 -00159 void TestMaster_stopped() -00160 { -00161 eprintf("TestMaster_stopped\n"); -00162 } -00163 -00164 void TestMaster_post_sync() -00165 { -00166 eprintf("TestMaster_post_sync\n"); -00167 eprintf("Master: %d %d %d %d %d %d %d %d %d %x %x %d %d\n", -00168 MasterMap1, -00169 MasterMap2, -00170 MasterMap3, -00171 MasterMap4, -00172 MasterMap5, -00173 MasterMap6, -00174 MasterMap7, -00175 MasterMap8, -00176 MasterMap9, -00177 MasterMap10, -00178 MasterMap11, -00179 MasterMap12, -00180 MasterMap13); -00181 } -00182 -00183 char query_result = 0; -00184 char waiting_answer = 0; -00185 -00186 -00187 static void CheckSDO(CO_Data* d, UNS8 nodeId) -00188 { -00189 UNS32 abortCode; -00190 if(getWriteResultNetworkDict (d, nodeId, &abortCode) != SDO_FINISHED) -00191 eprintf("Master : Failed in changing Slave's transmit type AbortCode :%4.4x \n", abortCode); -00192 -00193 /* Finalise last SDO transfer with this node */ -00194 closeSDOtransfer(&TestMaster_Data, nodeId, SDO_CLIENT); -00195 } -00196 -00197 -00198 static int MasterSyncCount = 0; -00199 void TestMaster_post_TPDO() -00200 { -00201 eprintf("TestMaster_post_TPDO MasterSyncCount = %d \n", MasterSyncCount); -00202 // -00203 // { -00204 // char zero = 0; -00205 // if(MasterMap4 > 0x80){ -00206 // writeNetworkDict ( -00207 // &TestMaster_Data, -00208 // TestSlave_Data->bDeviceNodeId, -00209 // 0x2002, -00210 // 0x00, -00211 // 1, -00212 // 0, -00213 // &zero); -00214 // } -00215 // } -00216 -00217 #if 0 -00218 if(waiting_answer){ -00219 UNS32 abortCode; -00220 UNS8 size; -00221 switch(getReadResultNetworkDict ( -00222 &TestMaster_Data, -00223 0x02, -00224 &query_result, -00225 &size, -00226 &abortCode)) -00227 { -00228 case SDO_FINISHED: -00229 /* Do something with result here !!*/ -00230 eprintf("Got SDO answer (0x2002, 0x00), %d %d\n",query_result,size); -00231 case SDO_ABORTED_RCV: -00232 case SDO_ABORTED_INTERNAL: -00233 case SDO_RESET: -00234 waiting_answer = 0; -00235 closeSDOtransfer( -00236 &TestMaster_Data, -00237 0x02, -00238 SDO_CLIENT); -00239 break; -00240 case SDO_DOWNLOAD_IN_PROGRESS: -00241 case SDO_UPLOAD_IN_PROGRESS: -00242 break; -00243 } -00244 }else if(MasterSyncCount % 10 == 0){ -00245 readNetworkDict ( -00246 &TestMaster_Data, -00247 0x02, -00248 0x2002, -00249 0x00, -00250 0); -00251 waiting_answer = 1; -00252 } -00253 #endif -00254 if(MasterSyncCount % 17 == 0){ -00255 eprintf("Master : Ask RTR PDO (0x1402)\n"); -00256 sendPDOrequest(&TestMaster_Data, 0x1402 ); -00257 sendPDOrequest(&TestMaster_Data, 0x1403 ); -00258 } -00259 if(MasterSyncCount % 50 == 0){ -00260 eprintf("Master : Change slave's transmit type to 0xFF\n"); -00261 UNS8 transmitiontype = 0xFF; -00262 writeNetworkDictCallBack (&TestMaster_Data, /*CO_Data* d*/ -00263 2, /*UNS8 nodeId*/ -00264 0x1802, /*UNS16 index*/ -00265 0x02, /*UNS16 index*/ -00266 1, /*UNS8 count*/ -00267 0, /*UNS8 dataType*/ -00268 &transmitiontype,/*void *data*/ -00269 CheckSDO); /*SDOCallback_t Callback*/ -00270 } -00271 if(MasterSyncCount % 50 == 25){ -00272 eprintf("Master : Change slave's transmit type to 0x00\n"); -00273 UNS8 transmitiontype = 0x00; -00274 writeNetworkDictCallBack (&TestMaster_Data, /*CO_Data* d*/ -00275 2, /*UNS8 nodeId*/ -00276 0x1802, /*UNS16 index*/ -00277 0x02, /*UNS16 index*/ -00278 1, /*UNS8 count*/ -00279 0, /*UNS8 dataType*/ -00280 &transmitiontype,/*void *data*/ -00281 CheckSDO); /*SDOCallback_t Callback*/ -00282 } -00283 MasterSyncCount++; -00284 } -
#include "Master.h"
#include "Slave.h"
#include "TestMasterSlave.h"
-Include dependency graph for Master.c:
-Go to the source code of this file.
Functions | |
void | TestMaster_heartbeatError (UNS8 heartbeatID) |
void | TestMaster_initialisation () |
void | TestMaster_preOperational () |
void | TestMaster_operational () |
void | TestMaster_stopped () |
void | TestMaster_post_sync () |
void | TestMaster_post_TPDO () |
Variables | |
char | query_result = 0 |
char | waiting_answer = 0 |
void TestMaster_heartbeatError | -( | -UNS8 | -heartbeatID | -) | -- |
void TestMaster_initialisation | -( | -void | -- | ) | -- |
void TestMaster_operational | -( | -void | -- | ) | -- |
void TestMaster_post_sync | -( | -void | -- | ) | -- |
void TestMaster_post_TPDO | -( | -void | -- | ) | -- |
void TestMaster_preOperational | -( | -void | -- | ) | -- |
void TestMaster_stopped | -( | -void | -- | ) | -- |
-
char query_result = 0 | -
char waiting_answer = 0 | -
-
00001 #include "TestMaster.h" -00002 -00003 void TestMaster_heartbeatError(UNS8); -00004 -00005 UNS8 TestMaster_canSend(Message *); -00006 -00007 void TestMaster_initialisation(void); -00008 void TestMaster_preOperational(void); -00009 void TestMaster_operational(void); -00010 void TestMaster_stopped(void); -00011 -00012 void TestMaster_post_sync(void); -00013 void TestMaster_post_TPDO(void); -
#include "TestMaster.h"
-Include dependency graph for Master.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Functions | |
void | TestMaster_heartbeatError (UNS8) |
UNS8 | TestMaster_canSend (Message *) |
void | TestMaster_initialisation (void) |
void | TestMaster_preOperational (void) |
void | TestMaster_operational (void) |
void | TestMaster_stopped (void) |
void | TestMaster_post_sync (void) |
void | TestMaster_post_TPDO (void) |
UNS8 TestMaster_canSend | -( | -Message * | -- | ) | -- |
- -
void TestMaster_heartbeatError | -( | -UNS8 | -- | ) | -- |
void TestMaster_initialisation | -( | -void | -- | ) | -- |
- -
-Definition at line 38 of file Master.c. -
-References eprintf, RW, slavenodeid, TestMaster_Data, UNS32, UNS8, and writeLocalDict(). -
-Here is the call graph for this function:
void TestMaster_operational | -( | -void | -- | ) | -- |
void TestMaster_post_sync | -( | -void | -- | ) | -- |
- -
-Definition at line 164 of file Master.c. -
-References DI1, DI2, DI3, DI4, DI5, DI6, DI7, DI8, DO, eprintf, MasterMap1, MasterMap10, MasterMap11, MasterMap12, MasterMap13, MasterMap2, MasterMap3, MasterMap4, MasterMap5, MasterMap6, MasterMap7, MasterMap8, and MasterMap9. -
void TestMaster_post_TPDO | -( | -void | -- | ) | -- |
- -
-Definition at line 199 of file Master.c. -
-References closeSDOtransfer(), eprintf, getReadResultNetworkDict(), readNetworkDict(), SDO_ABORTED_INTERNAL, SDO_ABORTED_RCV, SDO_CLIENT, SDO_DOWNLOAD_IN_PROGRESS, SDO_FINISHED, SDO_RESET, SDO_UPLOAD_IN_PROGRESS, sendPDOrequest(), TestMaster_Data, UNS32, UNS8, and writeNetworkDictCallBack(). -
-Here is the call graph for this function:
void TestMaster_preOperational | -( | -void | -- | ) | -- |
- -
-Definition at line 146 of file Master.c. -
-References eprintf, slavenodeid, and TestMaster_Data. -
void TestMaster_stopped | -( | -void | -- | ) | -- |
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #include "Slave.h" -00024 #include "Master.h" -00025 #include "TestMasterSlave.h" -00026 -00027 /*****************************************************************************/ -00028 void TestSlave_heartbeatError(UNS8 heartbeatID) -00029 { -00030 eprintf("TestSlave_heartbeatError %d\n", heartbeatID); -00031 } -00032 -00033 void TestSlave_initialisation() -00034 { -00035 eprintf("TestSlave_initialisation\n"); -00036 } -00037 -00038 void TestSlave_preOperational() -00039 { -00040 eprintf("TestSlave_preOperational\n"); -00041 } -00042 -00043 void TestSlave_operational() -00044 { -00045 eprintf("TestSlave_operational\n"); -00046 } -00047 -00048 void TestSlave_stopped() -00049 { -00050 eprintf("TestSlave_stopped\n"); -00051 } -00052 -00053 void TestSlave_post_sync() -00054 { -00055 eprintf("TestSlave_post_sync\n"); -00056 -00057 SlaveMap1=1; -00058 SlaveMap2=1; -00059 SlaveMap3=0; -00060 SlaveMap4=0; -00061 SlaveMap5=1; -00062 SlaveMap6=0; -00063 SlaveMap7=1; -00064 SlaveMap8=0; -00065 SlaveMap9=16; -00066 SlaveMap10 = 0xff00ff00; -00067 SlaveMap11 = 0xabcd; -00068 SlaveMap12 += SlaveMap12 > 0x80 ? 0 : 1; -00069 eprintf("Slave: %d %d %d %d %d %d %d %d %d %x %x %d %d \n", -00070 SlaveMap1, -00071 SlaveMap2, -00072 SlaveMap3, -00073 SlaveMap4, -00074 SlaveMap5, -00075 SlaveMap6, -00076 SlaveMap7, -00077 SlaveMap8, -00078 SlaveMap9, -00079 SlaveMap10, -00080 SlaveMap11, -00081 SlaveMap12, -00082 SlaveMap13); -00083 } -00084 -00085 void TestSlave_post_TPDO() -00086 { -00087 SlaveMap13 += 1; -00088 eprintf("TestSlave_post_TPDO\n"); -00089 } -00090 -00091 void TestSlave_storeODSubIndex(UNS16 wIndex, UNS8 bSubindex) -00092 { -00093 /*TODO : -00094 * - call getODEntry for index and subindex, -00095 * - save content to file, database, flash, nvram, ... -00096 * -00097 * To ease flash organisation, index of variable to store -00098 * can be established by scanning d->objdict[d->ObjdictSize] -00099 * for variables to store. -00100 * -00101 * */ -00102 eprintf("TestSlave_storeODSubIndex : %4.4x %2.2x\n", wIndex, bSubindex); -00103 } -
#include "Slave.h"
#include "Master.h"
#include "TestMasterSlave.h"
-Include dependency graph for Slave.c:
-Go to the source code of this file.
Functions | |
void | TestSlave_heartbeatError (UNS8 heartbeatID) |
void | TestSlave_initialisation () |
void | TestSlave_preOperational () |
void | TestSlave_operational () |
void | TestSlave_stopped () |
void | TestSlave_post_sync () |
void | TestSlave_post_TPDO () |
void | TestSlave_storeODSubIndex (UNS16 wIndex, UNS8 bSubindex) |
void TestSlave_heartbeatError | -( | -UNS8 | -heartbeatID | -) | -- |
void TestSlave_initialisation | -( | -void | -- | ) | -- |
void TestSlave_operational | -( | -void | -- | ) | -- |
void TestSlave_post_sync | -( | -void | -- | ) | -- |
- -
-Definition at line 53 of file Slave.c. -
-References eprintf, SlaveMap1, SlaveMap10, SlaveMap11, SlaveMap12, SlaveMap13, SlaveMap2, SlaveMap3, SlaveMap4, SlaveMap5, SlaveMap6, SlaveMap7, SlaveMap8, and SlaveMap9. -
-Referenced by main(). -
void TestSlave_post_TPDO | -( | -void | -- | ) | -- |
- -
-Definition at line 85 of file Slave.c. -
-References eprintf, and SlaveMap13. -
-Referenced by main(). -
void TestSlave_preOperational | -( | -void | -- | ) | -- |
void TestSlave_stopped | -( | -void | -- | ) | -- |
void TestSlave_storeODSubIndex | -( | -UNS16 | -wIndex, | -|
- | - | UNS8 | -bSubindex | - |
- | ) | -- |
-
00001 #include "TestSlave.h" -00002 -00003 void TestSlave_heartbeatError(UNS8); -00004 -00005 UNS8 TestSlave_canSend(Message *); -00006 -00007 void TestSlave_initialisation(void); -00008 void TestSlave_preOperational(void); -00009 void TestSlave_operational(void); -00010 void TestSlave_stopped(void); -00011 -00012 void TestSlave_post_sync(void); -00013 void TestSlave_post_TPDO(void); -00014 void TestSlave_storeODSubIndex(UNS16 wIndex, UNS8 bSubindex); -
#include "TestSlave.h"
-Include dependency graph for Slave.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Functions | |
void | TestSlave_heartbeatError (UNS8) |
UNS8 | TestSlave_canSend (Message *) |
void | TestSlave_initialisation (void) |
void | TestSlave_preOperational (void) |
void | TestSlave_operational (void) |
void | TestSlave_stopped (void) |
void | TestSlave_post_sync (void) |
void | TestSlave_post_TPDO (void) |
void | TestSlave_storeODSubIndex (UNS16 wIndex, UNS8 bSubindex) |
UNS8 TestSlave_canSend | -( | -Message * | -- | ) | -- |
- -
void TestSlave_heartbeatError | -( | -UNS8 | -- | ) | -- |
void TestSlave_initialisation | -( | -void | -- | ) | -- |
void TestSlave_operational | -( | -void | -- | ) | -- |
void TestSlave_post_sync | -( | -void | -- | ) | -- |
- -
-Definition at line 53 of file Slave.c. -
-References eprintf, SlaveMap1, SlaveMap10, SlaveMap11, SlaveMap12, SlaveMap13, SlaveMap2, SlaveMap3, SlaveMap4, SlaveMap5, SlaveMap6, SlaveMap7, SlaveMap8, and SlaveMap9. -
-Referenced by main(). -
void TestSlave_post_TPDO | -( | -void | -- | ) | -- |
- -
-Definition at line 85 of file Slave.c. -
-References eprintf, and SlaveMap13. -
-Referenced by main(). -
void TestSlave_preOperational | -( | -void | -- | ) | -- |
void TestSlave_stopped | -( | -void | -- | ) | -- |
void TestSlave_storeODSubIndex | -( | -UNS16 | -wIndex, | -|
- | - | UNS8 | -bSubindex | - |
- | ) | -- |
-
00001 -00002 /* File generated by gen_cfile.py. Should not be modified. */ -00003 -00004 #include "TestMaster.h" -00005 -00006 /**************************************************************************/ -00007 /* Declaration of the mapped variables */ -00008 /**************************************************************************/ -00009 UNS8 DO = 0x0; /* Mapped at index 0x2000, subindex 0x00 */ -00010 UNS8 DI1 = 0x0; /* Mapped at index 0x200F, subindex 0x00 */ -00011 UNS8 DI2 = 0x0; /* Mapped at index 0x2010, subindex 0x00 */ -00012 UNS8 DI3 = 0x0; /* Mapped at index 0x2011, subindex 0x00 */ -00013 UNS8 DI4 = 0x0; /* Mapped at index 0x2012, subindex 0x00 */ -00014 UNS8 DI5 = 0x0; /* Mapped at index 0x2013, subindex 0x00 */ -00015 UNS8 DI6 = 0x0; /* Mapped at index 0x2014, subindex 0x00 */ -00016 UNS8 DI7 = 0x0; /* Mapped at index 0x2015, subindex 0x00 */ -00017 UNS8 DI8 = 0x0; /* Mapped at index 0x2016, subindex 0x00 */ -00018 -00019 /**************************************************************************/ -00020 /* Declaration of the value range types */ -00021 /**************************************************************************/ -00022 -00023 UNS32 TestMaster_valueRangeTest (UNS8 typeValue, void * value) -00024 { -00025 switch (typeValue) { -00026 } -00027 return 0; -00028 } -00029 -00030 /**************************************************************************/ -00031 /* The node id */ -00032 /**************************************************************************/ -00033 /* node_id default value.*/ -00034 UNS8 TestMaster_bDeviceNodeId = 0x01; -00035 -00036 /**************************************************************************/ -00037 /* Array of message processing information */ -00038 -00039 const UNS8 TestMaster_iam_a_slave = 0; -00040 -00041 TIMER_HANDLE TestMaster_heartBeatTimers[1] = {TIMER_NONE,}; -00042 -00043 /* -00044 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -00045 -00046 OBJECT DICTIONARY -00047 -00048 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -00049 */ -00050 -00051 /* index 0x1000 : Device Type. */ -00052 UNS32 TestMaster_obj1000 = 0x191; /* 401 */ -00053 subindex TestMaster_Index1000[] = -00054 { -00055 { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1000 } -00056 }; -00057 -00058 /* index 0x1001 : Error Register. */ -00059 UNS8 TestMaster_obj1001 = 0x0; /* 0 */ -00060 subindex TestMaster_Index1001[] = -00061 { -00062 { RO, uint8, sizeof (UNS8), (void*)&TestMaster_obj1001 } -00063 }; -00064 -00065 /* index 0x1005 : SYNC COB ID. */ -00066 UNS32 TestMaster_obj1005 = 0x40000080; /* 1073741952 */ -00067 ODCallback_t TestMaster_Index1005_callbacks[] = -00068 { -00069 NULL, -00070 }; -00071 subindex TestMaster_Index1005[] = -00072 { -00073 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1005 } -00074 }; -00075 -00076 /* index 0x1006 : Communication / Cycle Period. */ -00077 UNS32 TestMaster_obj1006 = 0xC350; /* 50000 */ -00078 ODCallback_t TestMaster_Index1006_callbacks[] = -00079 { -00080 NULL, -00081 }; -00082 subindex TestMaster_Index1006[] = -00083 { -00084 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1006 } -00085 }; -00086 -00087 /* index 0x1016 : Consumer Heartbeat Time. */ -00088 UNS8 TestMaster_highestSubIndex_obj1016 = 1; /* number of subindex - 1*/ -00089 UNS32 TestMaster_obj1016[] = -00090 { -00091 0x4005DC /* 4195804 */ -00092 }; -00093 subindex TestMaster_Index1016[] = -00094 { -00095 { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1016 }, -00096 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1016[0] } -00097 }; -00098 -00099 /* index 0x1017 : Producer Heartbeat Time */ -00100 UNS16 TestMaster_obj1017 = 0x0; /* 0 */ -00101 -00102 /* index 0x1018 : Identity. */ -00103 UNS8 TestMaster_highestSubIndex_obj1018 = 4; /* number of subindex - 1*/ -00104 UNS32 TestMaster_obj1018_Vendor_ID = 0x0; /* 0 */ -00105 UNS32 TestMaster_obj1018_Product_Code = 0x0; /* 0 */ -00106 UNS32 TestMaster_obj1018_Revision_Number = 0x0; /* 0 */ -00107 UNS32 TestMaster_obj1018_Serial_Number = 0x0; /* 0 */ -00108 subindex TestMaster_Index1018[] = -00109 { -00110 { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1018 }, -00111 { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1018_Vendor_ID }, -00112 { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1018_Product_Code }, -00113 { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1018_Revision_Number }, -00114 { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1018_Serial_Number } -00115 }; -00116 -00117 /* index 0x1280 : Client SDO 1 Parameter. */ -00118 UNS8 TestMaster_highestSubIndex_obj1280 = 3; /* number of subindex - 1*/ -00119 UNS32 TestMaster_obj1280_COB_ID_Client_to_Server_Transmit_SDO = 0x640; /* 1600 */ -00120 UNS32 TestMaster_obj1280_COB_ID_Server_to_Client_Receive_SDO = 0x5C0; /* 1472 */ -00121 INTEGER32 TestMaster_obj1280_Node_ID_of_the_SDO_Server = 0x40; /* 64 */ -00122 subindex TestMaster_Index1280[] = -00123 { -00124 { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1280 }, -00125 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1280_COB_ID_Client_to_Server_Transmit_SDO }, -00126 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1280_COB_ID_Server_to_Client_Receive_SDO }, -00127 { RW, int32, sizeof (INTEGER32), (void*)&TestMaster_obj1280_Node_ID_of_the_SDO_Server } -00128 }; -00129 -00130 /* index 0x1400 : Receive PDO 1 Parameter. */ -00131 UNS8 TestMaster_highestSubIndex_obj1400 = 5; /* number of subindex - 1*/ -00132 UNS32 TestMaster_obj1400_COB_ID_used_by_PDO = 0x1C0; /* 448 */ -00133 UNS8 TestMaster_obj1400_Transmission_Type = 0x1; /* 1 */ -00134 UNS16 TestMaster_obj1400_Inhibit_Time = 0x0; /* 0 */ -00135 UNS8 TestMaster_obj1400_Compatibility_Entry = 0x0; /* 0 */ -00136 UNS16 TestMaster_obj1400_Event_Timer = 0x0; /* 0 */ -00137 subindex TestMaster_Index1400[] = -00138 { -00139 { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1400 }, -00140 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1400_COB_ID_used_by_PDO }, -00141 { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1400_Transmission_Type }, -00142 { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1400_Inhibit_Time }, -00143 { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1400_Compatibility_Entry }, -00144 { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1400_Event_Timer } -00145 }; -00146 -00147 /* index 0x1600 : Receive PDO 1 Mapping. */ -00148 UNS8 TestMaster_highestSubIndex_obj1600 = 8; /* number of subindex - 1*/ -00149 UNS32 TestMaster_obj1600[] = -00150 { -00151 0x200F0001, /* 537853953 */ -00152 0x20100001, /* 537919489 */ -00153 0x20110001, /* 537985025 */ -00154 0x20120001, /* 538050561 */ -00155 0x20130001, /* 538116097 */ -00156 0x20140001, /* 538181633 */ -00157 0x20150001, /* 538247169 */ -00158 0x20160001 /* 538312705 */ -00159 }; -00160 subindex TestMaster_Index1600[] = -00161 { -00162 { RW, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1600 }, -00163 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[0] }, -00164 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[1] }, -00165 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[2] }, -00166 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[3] }, -00167 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[4] }, -00168 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[5] }, -00169 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[6] }, -00170 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[7] } -00171 }; -00172 -00173 /* index 0x1800 : Transmit PDO 1 Parameter. */ -00174 UNS8 TestMaster_highestSubIndex_obj1800 = 5; /* number of subindex - 1*/ -00175 UNS32 TestMaster_obj1800_COB_ID_used_by_PDO = 0x240; /* 576 */ -00176 UNS8 TestMaster_obj1800_Transmission_Type = 0x1; /* 1 */ -00177 UNS16 TestMaster_obj1800_Inhibit_Time = 0x0; /* 0 */ -00178 UNS8 TestMaster_obj1800_Compatibility_Entry = 0x0; /* 0 */ -00179 UNS16 TestMaster_obj1800_Event_Timer = 0x0; /* 0 */ -00180 subindex TestMaster_Index1800[] = -00181 { -00182 { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1800 }, -00183 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1800_COB_ID_used_by_PDO }, -00184 { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1800_Transmission_Type }, -00185 { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1800_Inhibit_Time }, -00186 { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1800_Compatibility_Entry }, -00187 { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1800_Event_Timer } -00188 }; -00189 -00190 /* index 0x1A00 : Transmit PDO 1 Mapping. */ -00191 UNS8 TestMaster_highestSubIndex_obj1A00 = 1; /* number of subindex - 1*/ -00192 UNS32 TestMaster_obj1A00[] = -00193 { -00194 0x20000008 /* 536870920 */ -00195 }; -00196 subindex TestMaster_Index1A00[] = -00197 { -00198 { RW, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1A00 }, -00199 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1A00[0] } -00200 }; -00201 -00202 /* index 0x2000 : Mapped variable DO */ -00203 subindex TestMaster_Index2000[] = -00204 { -00205 { RW, uint8, sizeof (UNS8), (void*)&DO } -00206 }; -00207 -00208 /* index 0x200F : Mapped variable DI1 */ -00209 subindex TestMaster_Index200F[] = -00210 { -00211 { RW, boolean, sizeof (UNS8), (void*)&DI1 } -00212 }; -00213 -00214 /* index 0x2010 : Mapped variable DI2 */ -00215 subindex TestMaster_Index2010[] = -00216 { -00217 { RW, boolean, sizeof (UNS8), (void*)&DI2 } -00218 }; -00219 -00220 /* index 0x2011 : Mapped variable DI3 */ -00221 subindex TestMaster_Index2011[] = -00222 { -00223 { RW, boolean, sizeof (UNS8), (void*)&DI3 } -00224 }; -00225 -00226 /* index 0x2012 : Mapped variable DI4 */ -00227 subindex TestMaster_Index2012[] = -00228 { -00229 { RW, boolean, sizeof (UNS8), (void*)&DI4 } -00230 }; -00231 -00232 /* index 0x2013 : Mapped variable DI5 */ -00233 subindex TestMaster_Index2013[] = -00234 { -00235 { RW, boolean, sizeof (UNS8), (void*)&DI5 } -00236 }; -00237 -00238 /* index 0x2014 : Mapped variable DI6 */ -00239 subindex TestMaster_Index2014[] = -00240 { -00241 { RW, boolean, sizeof (UNS8), (void*)&DI6 } -00242 }; -00243 -00244 /* index 0x2015 : Mapped variable DI7 */ -00245 subindex TestMaster_Index2015[] = -00246 { -00247 { RW, boolean, sizeof (UNS8), (void*)&DI7 } -00248 }; -00249 -00250 /* index 0x2016 : Mapped variable DI8 */ -00251 subindex TestMaster_Index2016[] = -00252 { -00253 { RW, boolean, sizeof (UNS8), (void*)&DI8 } -00254 }; -00255 -00256 const indextable TestMaster_objdict[] = -00257 { -00258 { (subindex*)TestMaster_Index1000,sizeof(TestMaster_Index1000)/sizeof(TestMaster_Index1000[0]), 0x1000}, -00259 { (subindex*)TestMaster_Index1001,sizeof(TestMaster_Index1001)/sizeof(TestMaster_Index1001[0]), 0x1001}, -00260 { (subindex*)TestMaster_Index1005,sizeof(TestMaster_Index1005)/sizeof(TestMaster_Index1005[0]), 0x1005}, -00261 { (subindex*)TestMaster_Index1006,sizeof(TestMaster_Index1006)/sizeof(TestMaster_Index1006[0]), 0x1006}, -00262 { (subindex*)TestMaster_Index1016,sizeof(TestMaster_Index1016)/sizeof(TestMaster_Index1016[0]), 0x1016}, -00263 { (subindex*)TestMaster_Index1018,sizeof(TestMaster_Index1018)/sizeof(TestMaster_Index1018[0]), 0x1018}, -00264 { (subindex*)TestMaster_Index1280,sizeof(TestMaster_Index1280)/sizeof(TestMaster_Index1280[0]), 0x1280}, -00265 { (subindex*)TestMaster_Index1400,sizeof(TestMaster_Index1400)/sizeof(TestMaster_Index1400[0]), 0x1400}, -00266 { (subindex*)TestMaster_Index1600,sizeof(TestMaster_Index1600)/sizeof(TestMaster_Index1600[0]), 0x1600}, -00267 { (subindex*)TestMaster_Index1800,sizeof(TestMaster_Index1800)/sizeof(TestMaster_Index1800[0]), 0x1800}, -00268 { (subindex*)TestMaster_Index1A00,sizeof(TestMaster_Index1A00)/sizeof(TestMaster_Index1A00[0]), 0x1A00}, -00269 { (subindex*)TestMaster_Index2000,sizeof(TestMaster_Index2000)/sizeof(TestMaster_Index2000[0]), 0x2000}, -00270 { (subindex*)TestMaster_Index200F,sizeof(TestMaster_Index200F)/sizeof(TestMaster_Index200F[0]), 0x200F}, -00271 { (subindex*)TestMaster_Index2010,sizeof(TestMaster_Index2010)/sizeof(TestMaster_Index2010[0]), 0x2010}, -00272 { (subindex*)TestMaster_Index2011,sizeof(TestMaster_Index2011)/sizeof(TestMaster_Index2011[0]), 0x2011}, -00273 { (subindex*)TestMaster_Index2012,sizeof(TestMaster_Index2012)/sizeof(TestMaster_Index2012[0]), 0x2012}, -00274 { (subindex*)TestMaster_Index2013,sizeof(TestMaster_Index2013)/sizeof(TestMaster_Index2013[0]), 0x2013}, -00275 { (subindex*)TestMaster_Index2014,sizeof(TestMaster_Index2014)/sizeof(TestMaster_Index2014[0]), 0x2014}, -00276 { (subindex*)TestMaster_Index2015,sizeof(TestMaster_Index2015)/sizeof(TestMaster_Index2015[0]), 0x2015}, -00277 { (subindex*)TestMaster_Index2016,sizeof(TestMaster_Index2016)/sizeof(TestMaster_Index2016[0]), 0x2016}, -00278 }; -00279 -00280 const indextable * TestMaster_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks) -00281 { -00282 int i; -00283 *callbacks = NULL; -00284 switch(wIndex){ -00285 case 0x1000: i = 0;break; -00286 case 0x1001: i = 1;break; -00287 case 0x1005: i = 2;*callbacks = TestMaster_Index1005_callbacks; break; -00288 case 0x1006: i = 3;*callbacks = TestMaster_Index1006_callbacks; break; -00289 case 0x1016: i = 4;break; -00290 case 0x1018: i = 5;break; -00291 case 0x1280: i = 6;break; -00292 case 0x1400: i = 7;break; -00293 case 0x1600: i = 8;break; -00294 case 0x1800: i = 9;break; -00295 case 0x1A00: i = 10;break; -00296 case 0x2000: i = 11;break; -00297 case 0x200F: i = 12;break; -00298 case 0x2010: i = 13;break; -00299 case 0x2011: i = 14;break; -00300 case 0x2012: i = 15;break; -00301 case 0x2013: i = 16;break; -00302 case 0x2014: i = 17;break; -00303 case 0x2015: i = 18;break; -00304 case 0x2016: i = 19;break; -00305 default: -00306 *errorCode = OD_NO_SUCH_OBJECT; -00307 return NULL; -00308 } -00309 *errorCode = OD_SUCCESSFUL; -00310 return &TestMaster_objdict[i]; -00311 } -00312 -00313 /* -00314 * To count at which received SYNC a PDO must be sent. -00315 * Even if no pdoTransmit are defined, at least one entry is computed -00316 * for compilations issues. -00317 */ -00318 s_PDO_status TestMaster_PDO_status[1] = {s_PDO_staus_Initializer}; -00319 -00320 quick_index TestMaster_firstIndex = { -00321 0, /* SDO_SVR */ -00322 6, /* SDO_CLT */ -00323 7, /* PDO_RCV */ -00324 8, /* PDO_RCV_MAP */ -00325 9, /* PDO_TRS */ -00326 10 /* PDO_TRS_MAP */ -00327 }; -00328 -00329 quick_index TestMaster_lastIndex = { -00330 0, /* SDO_SVR */ -00331 6, /* SDO_CLT */ -00332 7, /* PDO_RCV */ -00333 8, /* PDO_RCV_MAP */ -00334 9, /* PDO_TRS */ -00335 10 /* PDO_TRS_MAP */ -00336 }; -00337 -00338 UNS16 TestMaster_ObjdictSize = sizeof(TestMaster_objdict)/sizeof(TestMaster_objdict[0]); -00339 -00340 CO_Data TestMaster_Data = CANOPEN_NODE_DATA_INITIALIZER(TestMaster); -00341 -
#include "TestMaster.h"
-Include dependency graph for TestMaster.c:
-Go to the source code of this file.
const indextable* TestMaster_scanIndexOD | -( | -UNS16 | -wIndex, | -|
- | - | UNS32 * | -errorCode, | -|
- | - | ODCallback_t ** | -callbacks | - |
- | ) | -- |
- -
-Definition at line 280 of file TestMaster.c. -
-References OD_NO_SUCH_OBJECT, OD_SUCCESSFUL, TestMaster_Index1005_callbacks, TestMaster_Index1006_callbacks, and TestMaster_objdict. -
UNS32 TestMaster_valueRangeTest | -( | -UNS8 | -typeValue, | -|
- | - | void * | -value | - |
- | ) | -- |
- -
-Definition at line 23 of file TestMaster.c. -
-
UNS8 DI1 = 0x0 | -
UNS8 DI2 = 0x0 | -
UNS8 DI3 = 0x0 | -
UNS8 DI4 = 0x0 | -
UNS8 DI5 = 0x0 | -
UNS8 DI6 = 0x0 | -
UNS8 DI7 = 0x0 | -
UNS8 DI8 = 0x0 | -
UNS8 DO = 0x0 | -
UNS8 TestMaster_bDeviceNodeId = 0x01 | -
- -
-Definition at line 34 of file TestMaster.c. -
CO_Data TestMaster_Data = CANOPEN_NODE_DATA_INITIALIZER(TestMaster) | -
- -
-Definition at line 340 of file TestMaster.c. -
quick_index TestMaster_firstIndex | -
-Initial value:
{ - 0, - 6, - 7, - 8, - 9, - 10 -} -
-Definition at line 320 of file TestMaster.c. -
TIMER_HANDLE TestMaster_heartBeatTimers[1] = {TIMER_NONE,} | -
- -
-Definition at line 41 of file TestMaster.c. -
UNS8 TestMaster_highestSubIndex_obj1016 = 1 | -
- -
-Definition at line 88 of file TestMaster.c. -
UNS8 TestMaster_highestSubIndex_obj1018 = 4 | -
- -
-Definition at line 103 of file TestMaster.c. -
UNS8 TestMaster_highestSubIndex_obj1280 = 3 | -
- -
-Definition at line 118 of file TestMaster.c. -
UNS8 TestMaster_highestSubIndex_obj1400 = 5 | -
- -
-Definition at line 131 of file TestMaster.c. -
UNS8 TestMaster_highestSubIndex_obj1600 = 8 | -
- -
-Definition at line 148 of file TestMaster.c. -
UNS8 TestMaster_highestSubIndex_obj1800 = 5 | -
- -
-Definition at line 174 of file TestMaster.c. -
UNS8 TestMaster_highestSubIndex_obj1A00 = 1 | -
- -
-Definition at line 191 of file TestMaster.c. -
const UNS8 TestMaster_iam_a_slave = 0 | -
- -
-Definition at line 39 of file TestMaster.c. -
subindex TestMaster_Index1000[] | -
-Initial value:
- { - { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1000 } - } -
-Definition at line 53 of file TestMaster.c. -
subindex TestMaster_Index1001[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_obj1001 } - } -
-Definition at line 60 of file TestMaster.c. -
subindex TestMaster_Index1005[] | -
-Initial value:
- { - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1005 } - } -
-Definition at line 71 of file TestMaster.c. -
ODCallback_t TestMaster_Index1005_callbacks[] | -
subindex TestMaster_Index1006[] | -
-Initial value:
- { - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1006 } - } -
-Definition at line 82 of file TestMaster.c. -
ODCallback_t TestMaster_Index1006_callbacks[] | -
subindex TestMaster_Index1016[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1016 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1016[0] } - } -
-Definition at line 93 of file TestMaster.c. -
subindex TestMaster_Index1018[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1018 }, - { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1018_Vendor_ID }, - { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1018_Product_Code }, - { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1018_Revision_Number }, - { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1018_Serial_Number } - } -
-Definition at line 108 of file TestMaster.c. -
subindex TestMaster_Index1280[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1280 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1280_COB_ID_Client_to_Server_Transmit_SDO }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1280_COB_ID_Server_to_Client_Receive_SDO }, - { RW, int32, sizeof (INTEGER32), (void*)&TestMaster_obj1280_Node_ID_of_the_SDO_Server } - } -
-Definition at line 122 of file TestMaster.c. -
subindex TestMaster_Index1400[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1400 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1400_COB_ID_used_by_PDO }, - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1400_Transmission_Type }, - { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1400_Inhibit_Time }, - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1400_Compatibility_Entry }, - { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1400_Event_Timer } - } -
-Definition at line 137 of file TestMaster.c. -
subindex TestMaster_Index1600[] | -
-Initial value:
- { - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1600 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[0] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[1] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[2] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[3] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[4] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[5] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[6] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[7] } - } -
-Definition at line 160 of file TestMaster.c. -
subindex TestMaster_Index1800[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1800 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1800_COB_ID_used_by_PDO }, - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1800_Transmission_Type }, - { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1800_Inhibit_Time }, - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1800_Compatibility_Entry }, - { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1800_Event_Timer } - } -
-Definition at line 180 of file TestMaster.c. -
subindex TestMaster_Index1A00[] | -
-Initial value:
- { - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1A00 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1A00[0] } - } -
-Definition at line 196 of file TestMaster.c. -
subindex TestMaster_Index2000[] | -
subindex TestMaster_Index200F[] | -
subindex TestMaster_Index2010[] | -
subindex TestMaster_Index2011[] | -
subindex TestMaster_Index2012[] | -
subindex TestMaster_Index2013[] | -
subindex TestMaster_Index2014[] | -
subindex TestMaster_Index2015[] | -
subindex TestMaster_Index2016[] | -
quick_index TestMaster_lastIndex | -
-Initial value:
{ - 0, - 6, - 7, - 8, - 9, - 10 -} -
-Definition at line 329 of file TestMaster.c. -
UNS32 TestMaster_obj1000 = 0x191 | -
- -
-Definition at line 52 of file TestMaster.c. -
UNS8 TestMaster_obj1001 = 0x0 | -
- -
-Definition at line 59 of file TestMaster.c. -
UNS32 TestMaster_obj1005 = 0x40000080 | -
- -
-Definition at line 66 of file TestMaster.c. -
UNS32 TestMaster_obj1006 = 0xC350 | -
- -
-Definition at line 77 of file TestMaster.c. -
UNS32 TestMaster_obj1016[] | -
UNS16 TestMaster_obj1017 = 0x0 | -
- -
-Definition at line 100 of file TestMaster.c. -
UNS32 TestMaster_obj1018_Product_Code = 0x0 | -
- -
-Definition at line 105 of file TestMaster.c. -
UNS32 TestMaster_obj1018_Revision_Number = 0x0 | -
- -
-Definition at line 106 of file TestMaster.c. -
UNS32 TestMaster_obj1018_Serial_Number = 0x0 | -
- -
-Definition at line 107 of file TestMaster.c. -
UNS32 TestMaster_obj1018_Vendor_ID = 0x0 | -
- -
-Definition at line 104 of file TestMaster.c. -
UNS32 TestMaster_obj1280_COB_ID_Client_to_Server_Transmit_SDO = 0x640 | -
- -
-Definition at line 119 of file TestMaster.c. -
UNS32 TestMaster_obj1280_COB_ID_Server_to_Client_Receive_SDO = 0x5C0 | -
- -
-Definition at line 120 of file TestMaster.c. -
INTEGER32 TestMaster_obj1280_Node_ID_of_the_SDO_Server = 0x40 | -
- -
-Definition at line 121 of file TestMaster.c. -
UNS32 TestMaster_obj1400_COB_ID_used_by_PDO = 0x1C0 | -
- -
-Definition at line 132 of file TestMaster.c. -
UNS8 TestMaster_obj1400_Compatibility_Entry = 0x0 | -
- -
-Definition at line 135 of file TestMaster.c. -
UNS16 TestMaster_obj1400_Event_Timer = 0x0 | -
- -
-Definition at line 136 of file TestMaster.c. -
UNS16 TestMaster_obj1400_Inhibit_Time = 0x0 | -
- -
-Definition at line 134 of file TestMaster.c. -
UNS8 TestMaster_obj1400_Transmission_Type = 0x1 | -
- -
-Definition at line 133 of file TestMaster.c. -
UNS32 TestMaster_obj1600[] | -
-Initial value:
- { - 0x200F0001, - 0x20100001, - 0x20110001, - 0x20120001, - 0x20130001, - 0x20140001, - 0x20150001, - 0x20160001 - } -
-Definition at line 149 of file TestMaster.c. -
UNS32 TestMaster_obj1800_COB_ID_used_by_PDO = 0x240 | -
- -
-Definition at line 175 of file TestMaster.c. -
UNS8 TestMaster_obj1800_Compatibility_Entry = 0x0 | -
- -
-Definition at line 178 of file TestMaster.c. -
UNS16 TestMaster_obj1800_Event_Timer = 0x0 | -
- -
-Definition at line 179 of file TestMaster.c. -
UNS16 TestMaster_obj1800_Inhibit_Time = 0x0 | -
- -
-Definition at line 177 of file TestMaster.c. -
UNS8 TestMaster_obj1800_Transmission_Type = 0x1 | -
- -
-Definition at line 176 of file TestMaster.c. -
UNS32 TestMaster_obj1A00[] | -
const indextable TestMaster_objdict[] | -
-Initial value:
-{ - { (subindex*)TestMaster_Index1000,sizeof(TestMaster_Index1000)/sizeof(TestMaster_Index1000[0]), 0x1000}, - { (subindex*)TestMaster_Index1001,sizeof(TestMaster_Index1001)/sizeof(TestMaster_Index1001[0]), 0x1001}, - { (subindex*)TestMaster_Index1005,sizeof(TestMaster_Index1005)/sizeof(TestMaster_Index1005[0]), 0x1005}, - { (subindex*)TestMaster_Index1006,sizeof(TestMaster_Index1006)/sizeof(TestMaster_Index1006[0]), 0x1006}, - { (subindex*)TestMaster_Index1016,sizeof(TestMaster_Index1016)/sizeof(TestMaster_Index1016[0]), 0x1016}, - { (subindex*)TestMaster_Index1018,sizeof(TestMaster_Index1018)/sizeof(TestMaster_Index1018[0]), 0x1018}, - { (subindex*)TestMaster_Index1280,sizeof(TestMaster_Index1280)/sizeof(TestMaster_Index1280[0]), 0x1280}, - { (subindex*)TestMaster_Index1400,sizeof(TestMaster_Index1400)/sizeof(TestMaster_Index1400[0]), 0x1400}, - { (subindex*)TestMaster_Index1600,sizeof(TestMaster_Index1600)/sizeof(TestMaster_Index1600[0]), 0x1600}, - { (subindex*)TestMaster_Index1800,sizeof(TestMaster_Index1800)/sizeof(TestMaster_Index1800[0]), 0x1800}, - { (subindex*)TestMaster_Index1A00,sizeof(TestMaster_Index1A00)/sizeof(TestMaster_Index1A00[0]), 0x1A00}, - { (subindex*)TestMaster_Index2000,sizeof(TestMaster_Index2000)/sizeof(TestMaster_Index2000[0]), 0x2000}, - { (subindex*)TestMaster_Index200F,sizeof(TestMaster_Index200F)/sizeof(TestMaster_Index200F[0]), 0x200F}, - { (subindex*)TestMaster_Index2010,sizeof(TestMaster_Index2010)/sizeof(TestMaster_Index2010[0]), 0x2010}, - { (subindex*)TestMaster_Index2011,sizeof(TestMaster_Index2011)/sizeof(TestMaster_Index2011[0]), 0x2011}, - { (subindex*)TestMaster_Index2012,sizeof(TestMaster_Index2012)/sizeof(TestMaster_Index2012[0]), 0x2012}, - { (subindex*)TestMaster_Index2013,sizeof(TestMaster_Index2013)/sizeof(TestMaster_Index2013[0]), 0x2013}, - { (subindex*)TestMaster_Index2014,sizeof(TestMaster_Index2014)/sizeof(TestMaster_Index2014[0]), 0x2014}, - { (subindex*)TestMaster_Index2015,sizeof(TestMaster_Index2015)/sizeof(TestMaster_Index2015[0]), 0x2015}, - { (subindex*)TestMaster_Index2016,sizeof(TestMaster_Index2016)/sizeof(TestMaster_Index2016[0]), 0x2016}, -} -
-Definition at line 256 of file TestMaster.c. -
UNS16 TestMaster_ObjdictSize = sizeof(TestMaster_objdict)/sizeof(TestMaster_objdict[0]) | -
- -
-Definition at line 338 of file TestMaster.c. -
s_PDO_status TestMaster_PDO_status[1] = {s_PDO_staus_Initializer} | -
- -
-Definition at line 318 of file TestMaster.c. -
-
00001 -00002 /* File generated by gen_cfile.py. Should not be modified. */ -00003 -00004 #ifndef TESTMASTER_H -00005 #define TESTMASTER_H -00006 -00007 #include "data.h" -00008 -00009 /* Prototypes of function provided by object dictionnary */ -00010 UNS32 TestMaster_valueRangeTest (UNS8 typeValue, void * value); -00011 const indextable * TestMaster_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks); -00012 -00013 /* Master node data struct */ -00014 extern CO_Data TestMaster_Data; -00015 extern UNS8 DO; /* Mapped at index 0x2000, subindex 0x00*/ -00016 extern UNS8 DI1; /* Mapped at index 0x200F, subindex 0x00*/ -00017 extern UNS8 DI2; /* Mapped at index 0x2010, subindex 0x00*/ -00018 extern UNS8 DI3; /* Mapped at index 0x2011, subindex 0x00*/ -00019 extern UNS8 DI4; /* Mapped at index 0x2012, subindex 0x00*/ -00020 extern UNS8 DI5; /* Mapped at index 0x2013, subindex 0x00*/ -00021 extern UNS8 DI6; /* Mapped at index 0x2014, subindex 0x00*/ -00022 extern UNS8 DI7; /* Mapped at index 0x2015, subindex 0x00*/ -00023 extern UNS8 DI8; /* Mapped at index 0x2016, subindex 0x00*/ -00024 -00025 #endif // TESTMASTER_H -
#include "data.h"
-Include dependency graph for TestMaster.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Functions | |
UNS32 | TestMaster_valueRangeTest (UNS8 typeValue, void *value) |
const indextable * | TestMaster_scanIndexOD (UNS16 wIndex, UNS32 *errorCode, ODCallback_t **callbacks) |
Variables | |
CO_Data | TestMaster_Data |
UNS8 | DO |
UNS8 | DI1 |
UNS8 | DI2 |
UNS8 | DI3 |
UNS8 | DI4 |
UNS8 | DI5 |
UNS8 | DI6 |
UNS8 | DI7 |
UNS8 | DI8 |
const indextable* TestMaster_scanIndexOD | -( | -UNS16 | -wIndex, | -|
- | - | UNS32 * | -errorCode, | -|
- | - | ODCallback_t ** | -callbacks | - |
- | ) | -- |
- -
-Definition at line 425 of file TestMaster.c. -
-References OD_NO_SUCH_OBJECT, OD_SUCCESSFUL, TestMaster_Index1005_callbacks, TestMaster_Index1006_callbacks, and TestMaster_objdict. -
UNS32 TestMaster_valueRangeTest | -( | -UNS8 | -typeValue, | -|
- | - | void * | -value | - |
- | ) | -- |
- -
-Definition at line 27 of file TestMaster.c. -
-
UNS8 DI1 | -
UNS8 DI2 | -
UNS8 DI3 | -
UNS8 DI4 | -
UNS8 DI5 | -
UNS8 DI6 | -
UNS8 DI7 | -
UNS8 DI8 | -
UNS8 DO | -
CO_Data TestMaster_Data | -
- -
-Definition at line 496 of file TestMaster.c. -
-
00001 /* from http://www.pwilson.net/getopt.html */ -00002 -00003 /* Getopt for GNU. -00004 NOTE: getopt is now part of the C library, so if you don't know what -00005 "Keep this file name-space clean" means, talk to drepper@gnu.org -00006 before changing it! -00007 Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001 -00008 Free Software Foundation, Inc. -00009 This file is part of the GNU C Library. -00010 -00011 The GNU C Library is free software; you can redistribute it and/or -00012 modify it under the terms of the GNU Lesser General Public -00013 License as published by the Free Software Foundation; either -00014 version 2.1 of the License, or (at your option) any later version. -00015 -00016 The GNU C Library is distributed in the hope that it will be useful, -00017 but WITHOUT ANY WARRANTY; without even the implied warranty of -00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00019 Lesser General Public License for more details. -00020 -00021 You should have received a copy of the GNU Lesser General Public -00022 License along with the GNU C Library; if not, write to the Free -00023 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -00024 02111-1307 USA. */ -00025 -00026 /* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>. -00027 Ditto for AIX 3.2 and <stdlib.h>. */ -00028 #ifndef _NO_PROTO -00029 # define _NO_PROTO -00030 #endif -00031 -00032 #ifdef HAVE_CONFIG_H -00033 # include <config.h> -00034 #endif -00035 -00036 #if !defined __STDC__ || !__STDC__ -00037 /* This is a separate conditional since some stdc systems -00038 reject `defined (const)'. */ -00039 # ifndef const -00040 # define const -00041 # endif -00042 #endif -00043 -00044 #include <stdio.h> -00045 -00046 /* Comment out all this code if we are using the GNU C Library, and are not -00047 actually compiling the library itself. This code is part of the GNU C -00048 Library, but also included in many other GNU distributions. Compiling -00049 and linking in this code is a waste when using the GNU C library -00050 (especially if it is a shared library). Rather than having every GNU -00051 program understand `configure --with-gnu-libc' and omit the object files, -00052 it is simpler to just do this in the source for each such file. */ -00053 -00054 #define GETOPT_INTERFACE_VERSION 2 -00055 #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 -00056 # include <gnu-versions.h> -00057 # if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -00058 # define ELIDE_CODE -00059 # endif -00060 #endif -00061 -00062 #ifndef ELIDE_CODE -00063 -00064 -00065 /* This needs to come after some library #include -00066 to get __GNU_LIBRARY__ defined. */ -00067 #ifdef __GNU_LIBRARY__ -00068 /* Don't include stdlib.h for non-GNU C libraries because some of them -00069 contain conflicting prototypes for getopt. */ -00070 # include <stdlib.h> -00071 # include <unistd.h> -00072 #endif /* GNU C library. */ -00073 -00074 #ifdef VMS -00075 # include <unixlib.h> -00076 # if HAVE_STRING_H - 0 -00077 # include <string.h> -00078 # endif -00079 #endif -00080 -00081 #ifndef _ -00082 /* This is for other GNU distributions with internationalized messages. */ -00083 # if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC -00084 # include <libintl.h> -00085 # ifndef _ -00086 # define _(msgid) gettext (msgid) -00087 # endif -00088 # else -00089 # define _(msgid) (msgid) -00090 # endif -00091 # if defined _LIBC && defined USE_IN_LIBIO -00092 # include <wchar.h> -00093 # endif -00094 #endif -00095 -00096 /* This version of `getopt' appears to the caller like standard Unix `getopt' -00097 but it behaves differently for the user, since it allows the user -00098 to intersperse the options with the other arguments. -00099 -00100 As `getopt' works, it permutes the elements of ARGV so that, -00101 when it is done, all the options precede everything else. Thus -00102 all application programs are extended to handle flexible argument order. -00103 -00104 Setting the environment variable POSIXLY_CORRECT disables permutation. -00105 Then the behavior is completely standard. -00106 -00107 GNU application programs can use a third alternative mode in which -00108 they can distinguish the relative order of options and other arguments. */ -00109 -00110 #include "getopt.h" -00111 -00112 /* For communication from `getopt' to the caller. -00113 When `getopt' finds an option that takes an argument, -00114 the argument value is returned here. -00115 Also, when `ordering' is RETURN_IN_ORDER, -00116 each non-option ARGV-element is returned here. */ -00117 -00118 char *optarg; -00119 -00120 /* Index in ARGV of the next element to be scanned. -00121 This is used for communication to and from the caller -00122 and for communication between successive calls to `getopt'. -00123 -00124 On entry to `getopt', zero means this is the first call; initialize. -00125 -00126 When `getopt' returns -1, this is the index of the first of the -00127 non-option elements that the caller should itself scan. -00128 -00129 Otherwise, `optind' communicates from one call to the next -00130 how much of ARGV has been scanned so far. */ -00131 -00132 /* 1003.2 says this must be 1 before any call. */ -00133 int optind = 1; -00134 -00135 /* Formerly, initialization of getopt depended on optind==0, which -00136 causes problems with re-calling getopt as programs generally don't -00137 know that. */ -00138 -00139 int __getopt_initialized; -00140 -00141 /* The next char to be scanned in the option-element -00142 in which the last option character we returned was found. -00143 This allows us to pick up the scan where we left off. -00144 -00145 If this is zero, or a null string, it means resume the scan -00146 by advancing to the next ARGV-element. */ -00147 -00148 static char *nextchar; -00149 -00150 /* Callers store zero here to inhibit the error message -00151 for unrecognized options. */ -00152 -00153 int opterr = 1; -00154 -00155 /* Set to an option character which was unrecognized. -00156 This must be initialized on some systems to avoid linking in the -00157 system's own getopt implementation. */ -00158 -00159 int optopt = '?'; -00160 -00161 /* Describe how to deal with options that follow non-option ARGV-elements. -00162 -00163 If the caller did not specify anything, -00164 the default is REQUIRE_ORDER if the environment variable -00165 POSIXLY_CORRECT is defined, PERMUTE otherwise. -00166 -00167 REQUIRE_ORDER means don't recognize them as options; -00168 stop option processing when the first non-option is seen. -00169 This is what Unix does. -00170 This mode of operation is selected by either setting the environment -00171 variable POSIXLY_CORRECT, or using `+' as the first character -00172 of the list of option characters. -00173 -00174 PERMUTE is the default. We permute the contents of ARGV as we scan, -00175 so that eventually all the non-options are at the end. This allows options -00176 to be given in any order, even with programs that were not written to -00177 expect this. -00178 -00179 RETURN_IN_ORDER is an option available to programs that were written -00180 to expect options and other ARGV-elements in any order and that care about -00181 the ordering of the two. We describe each non-option ARGV-element -00182 as if it were the argument of an option with character code 1. -00183 Using `-' as the first character of the list of option characters -00184 selects this mode of operation. -00185 -00186 The special argument `--' forces an end of option-scanning regardless -00187 of the value of `ordering'. In the case of RETURN_IN_ORDER, only -00188 `--' can cause `getopt' to return -1 with `optind' != ARGC. */ -00189 -00190 static enum -00191 { -00192 REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER -00193 } ordering; -00194 -00195 /* Value of POSIXLY_CORRECT environment variable. */ -00196 static char *posixly_correct; -00197 -00198 #ifdef __GNU_LIBRARY__ -00199 /* We want to avoid inclusion of string.h with non-GNU libraries -00200 because there are many ways it can cause trouble. -00201 On some systems, it contains special magic macros that don't work -00202 in GCC. */ -00203 # include <string.h> -00204 # define my_index strchr -00205 #else -00206 -00207 # if HAVE_STRING_H || WIN32 /* Pete Wilson mod 7/28/02 */ -00208 # include <string.h> -00209 # else -00210 # include <strings.h> -00211 # endif -00212 -00213 /* Avoid depending on library functions or files -00214 whose names are inconsistent. */ -00215 -00216 #ifndef getenv -00217 extern char *getenv (); -00218 #endif -00219 -00220 static char * -00221 my_index (str, chr) -00222 const char *str; -00223 int chr; -00224 { -00225 while (*str) -00226 { -00227 if (*str == chr) -00228 return (char *) str; -00229 str++; -00230 } -00231 return 0; -00232 } -00233 -00234 /* If using GCC, we can safely declare strlen this way. -00235 If not using GCC, it is ok not to declare it. */ -00236 #ifdef __GNUC__ -00237 /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. -00238 That was relevant to code that was here before. */ -00239 # if (!defined __STDC__ || !__STDC__) && !defined strlen -00240 /* gcc with -traditional declares the built-in strlen to return int, -00241 and has done so at least since version 2.4.5. -- rms. */ -00242 extern int strlen (const char *); -00243 # endif /* not __STDC__ */ -00244 #endif /* __GNUC__ */ -00245 -00246 #endif /* not __GNU_LIBRARY__ */ -00247 -00248 /* Handle permutation of arguments. */ -00249 -00250 /* Describe the part of ARGV that contains non-options that have -00251 been skipped. `first_nonopt' is the index in ARGV of the first of them; -00252 `last_nonopt' is the index after the last of them. */ -00253 -00254 static int first_nonopt; -00255 static int last_nonopt; -00256 -00257 #ifdef _LIBC -00258 /* Stored original parameters. -00259 XXX This is no good solution. We should rather copy the args so -00260 that we can compare them later. But we must not use malloc(3). */ -00261 extern int __libc_argc; -00262 extern char **__libc_argv; -00263 -00264 /* Bash 2.0 gives us an environment variable containing flags -00265 indicating ARGV elements that should not be considered arguments. */ -00266 -00267 # ifdef USE_NONOPTION_FLAGS -00268 /* Defined in getopt_init.c */ -00269 extern char *__getopt_nonoption_flags; -00270 -00271 static int nonoption_flags_max_len; -00272 static int nonoption_flags_len; -00273 # endif -00274 -00275 # ifdef USE_NONOPTION_FLAGS -00276 # define SWAP_FLAGS(ch1, ch2) \ -00277 if (nonoption_flags_len > 0) \ -00278 { \ -00279 char __tmp = __getopt_nonoption_flags[ch1]; \ -00280 __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ -00281 __getopt_nonoption_flags[ch2] = __tmp; \ -00282 } -00283 # else -00284 # define SWAP_FLAGS(ch1, ch2) -00285 # endif -00286 #else /* !_LIBC */ -00287 # define SWAP_FLAGS(ch1, ch2) -00288 #endif /* _LIBC */ -00289 -00290 /* Exchange two adjacent subsequences of ARGV. -00291 One subsequence is elements [first_nonopt,last_nonopt) -00292 which contains all the non-options that have been skipped so far. -00293 The other is elements [last_nonopt,optind), which contains all -00294 the options processed since those non-options were skipped. -00295 -00296 `first_nonopt' and `last_nonopt' are relocated so that they describe -00297 the new indices of the non-options in ARGV after they are moved. */ -00298 -00299 #if defined __STDC__ && __STDC__ -00300 static void exchange (char **); -00301 #endif -00302 -00303 static void -00304 exchange (argv) -00305 char **argv; -00306 { -00307 int bottom = first_nonopt; -00308 int middle = last_nonopt; -00309 int top = optind; -00310 char *tem; -00311 -00312 /* Exchange the shorter segment with the far end of the longer segment. -00313 That puts the shorter segment into the right place. -00314 It leaves the longer segment in the right place overall, -00315 but it consists of two parts that need to be swapped next. */ -00316 -00317 #if defined _LIBC && defined USE_NONOPTION_FLAGS -00318 /* First make sure the handling of the `__getopt_nonoption_flags' -00319 string can work normally. Our top argument must be in the range -00320 of the string. */ -00321 if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) -00322 { -00323 /* We must extend the array. The user plays games with us and -00324 presents new arguments. */ -00325 char *new_str = malloc (top + 1); -00326 if (new_str == NULL) -00327 nonoption_flags_len = nonoption_flags_max_len = 0; -00328 else -00329 { -00330 memset (__mempcpy (new_str, __getopt_nonoption_flags, -00331 nonoption_flags_max_len), -00332 '\0', top + 1 - nonoption_flags_max_len); -00333 nonoption_flags_max_len = top + 1; -00334 __getopt_nonoption_flags = new_str; -00335 } -00336 } -00337 #endif -00338 -00339 while (top > middle && middle > bottom) -00340 { -00341 if (top - middle > middle - bottom) -00342 { -00343 /* Bottom segment is the short one. */ -00344 int len = middle - bottom; -00345 register int i; -00346 -00347 /* Swap it with the top part of the top segment. */ -00348 for (i = 0; i < len; i++) -00349 { -00350 tem = argv[bottom + i]; -00351 argv[bottom + i] = argv[top - (middle - bottom) + i]; -00352 argv[top - (middle - bottom) + i] = tem; -00353 SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); -00354 } -00355 /* Exclude the moved bottom segment from further swapping. */ -00356 top -= len; -00357 } -00358 else -00359 { -00360 /* Top segment is the short one. */ -00361 int len = top - middle; -00362 register int i; -00363 -00364 /* Swap it with the bottom part of the bottom segment. */ -00365 for (i = 0; i < len; i++) -00366 { -00367 tem = argv[bottom + i]; -00368 argv[bottom + i] = argv[middle + i]; -00369 argv[middle + i] = tem; -00370 SWAP_FLAGS (bottom + i, middle + i); -00371 } -00372 /* Exclude the moved top segment from further swapping. */ -00373 bottom += len; -00374 } -00375 } -00376 -00377 /* Update records for the slots the non-options now occupy. */ -00378 -00379 first_nonopt += (optind - last_nonopt); -00380 last_nonopt = optind; -00381 } -00382 -00383 /* Initialize the internal data when the first call is made. */ -00384 -00385 #if defined __STDC__ && __STDC__ -00386 static const char *_getopt_initialize (int, char *const *, const char *); -00387 #endif -00388 static const char * -00389 _getopt_initialize (argc, argv, optstring) -00390 int argc; -00391 char *const *argv; -00392 const char *optstring; -00393 { -00394 /* Start processing options with ARGV-element 1 (since ARGV-element 0 -00395 is the program name); the sequence of previously skipped -00396 non-option ARGV-elements is empty. */ -00397 -00398 first_nonopt = last_nonopt = optind; -00399 -00400 nextchar = NULL; -00401 -00402 posixly_correct = getenv ("POSIXLY_CORRECT"); -00403 -00404 /* Determine how to handle the ordering of options and nonoptions. */ -00405 -00406 if (optstring[0] == '-') -00407 { -00408 ordering = RETURN_IN_ORDER; -00409 ++optstring; -00410 } -00411 else if (optstring[0] == '+') -00412 { -00413 ordering = REQUIRE_ORDER; -00414 ++optstring; -00415 } -00416 else if (posixly_correct != NULL) -00417 ordering = REQUIRE_ORDER; -00418 else -00419 ordering = PERMUTE; -00420 -00421 #if defined _LIBC && defined USE_NONOPTION_FLAGS -00422 if (posixly_correct == NULL -00423 && argc == __libc_argc && argv == __libc_argv) -00424 { -00425 if (nonoption_flags_max_len == 0) -00426 { -00427 if (__getopt_nonoption_flags == NULL -00428 || __getopt_nonoption_flags[0] == '\0') -00429 nonoption_flags_max_len = -1; -00430 else -00431 { -00432 const char *orig_str = __getopt_nonoption_flags; -00433 int len = nonoption_flags_max_len = strlen (orig_str); -00434 if (nonoption_flags_max_len < argc) -00435 nonoption_flags_max_len = argc; -00436 __getopt_nonoption_flags = -00437 (char *) malloc (nonoption_flags_max_len); -00438 if (__getopt_nonoption_flags == NULL) -00439 nonoption_flags_max_len = -1; -00440 else -00441 memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), -00442 '\0', nonoption_flags_max_len - len); -00443 } -00444 } -00445 nonoption_flags_len = nonoption_flags_max_len; -00446 } -00447 else -00448 nonoption_flags_len = 0; -00449 #endif -00450 -00451 return optstring; -00452 } -00453 -00454 /* Scan elements of ARGV (whose length is ARGC) for option characters -00455 given in OPTSTRING. -00456 -00457 If an element of ARGV starts with '-', and is not exactly "-" or "--", -00458 then it is an option element. The characters of this element -00459 (aside from the initial '-') are option characters. If `getopt' -00460 is called repeatedly, it returns successively each of the option characters -00461 from each of the option elements. -00462 -00463 If `getopt' finds another option character, it returns that character, -00464 updating `optind' and `nextchar' so that the next call to `getopt' can -00465 resume the scan with the following option character or ARGV-element. -00466 -00467 If there are no more option characters, `getopt' returns -1. -00468 Then `optind' is the index in ARGV of the first ARGV-element -00469 that is not an option. (The ARGV-elements have been permuted -00470 so that those that are not options now come last.) -00471 -00472 OPTSTRING is a string containing the legitimate option characters. -00473 If an option character is seen that is not listed in OPTSTRING, -00474 return '?' after printing an error message. If you set `opterr' to -00475 zero, the error message is suppressed but we still return '?'. -00476 -00477 If a char in OPTSTRING is followed by a colon, that means it wants an arg, -00478 so the following text in the same ARGV-element, or the text of the following -00479 ARGV-element, is returned in `optarg'. Two colons mean an option that -00480 wants an optional arg; if there is text in the current ARGV-element, -00481 it is returned in `optarg', otherwise `optarg' is set to zero. -00482 -00483 If OPTSTRING starts with `-' or `+', it requests different methods of -00484 handling the non-option ARGV-elements. -00485 See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. -00486 -00487 Long-named options begin with `--' instead of `-'. -00488 Their names may be abbreviated as long as the abbreviation is unique -00489 or is an exact match for some defined option. If they have an -00490 argument, it follows the option name in the same ARGV-element, separated -00491 from the option name by a `=', or else the in next ARGV-element. -00492 When `getopt' finds a long-named option, it returns 0 if that option's -00493 `flag' field is nonzero, the value of the option's `val' field -00494 if the `flag' field is zero. -00495 -00496 The elements of ARGV aren't really const, because we permute them. -00497 But we pretend they're const in the prototype to be compatible -00498 with other systems. -00499 -00500 LONGOPTS is a vector of `struct option' terminated by an -00501 element containing a name which is zero. -00502 -00503 LONGIND returns the index in LONGOPT of the long-named option found. -00504 It is only valid when a long-named option has been found by the most -00505 recent call. -00506 -00507 If LONG_ONLY is nonzero, '-' as well as '--' can introduce -00508 long-named options. */ -00509 -00510 int -00511 _getopt_internal (argc, argv, optstring, longopts, longind, long_only) -00512 int argc; -00513 char *const *argv; -00514 const char *optstring; -00515 const struct option *longopts; -00516 int *longind; -00517 int long_only; -00518 { -00519 int print_errors = opterr; -00520 if (optstring[0] == ':') -00521 print_errors = 0; -00522 -00523 if (argc < 1) -00524 return -1; -00525 -00526 optarg = NULL; -00527 -00528 if (optind == 0 || !__getopt_initialized) -00529 { -00530 if (optind == 0) -00531 optind = 1; /* Don't scan ARGV[0], the program name. */ -00532 optstring = _getopt_initialize (argc, argv, optstring); -00533 __getopt_initialized = 1; -00534 } -00535 -00536 /* Test whether ARGV[optind] points to a non-option argument. -00537 Either it does not have option syntax, or there is an environment flag -00538 from the shell indicating it is not an option. The later information -00539 is only used when the used in the GNU libc. */ -00540 #if defined _LIBC && defined USE_NONOPTION_FLAGS -00541 # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ -00542 || (optind < nonoption_flags_len \ -00543 && __getopt_nonoption_flags[optind] == '1')) -00544 #else -00545 # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') -00546 #endif -00547 -00548 if (nextchar == NULL || *nextchar == '\0') -00549 { -00550 /* Advance to the next ARGV-element. */ -00551 -00552 /* Give FIRST_NONOPT and LAST_NONOPT rational values if OPTIND has been -00553 moved back by the user (who may also have changed the arguments). */ -00554 if (last_nonopt > optind) -00555 last_nonopt = optind; -00556 if (first_nonopt > optind) -00557 first_nonopt = optind; -00558 -00559 if (ordering == PERMUTE) -00560 { -00561 /* If we have just processed some options following some non-options, -00562 exchange them so that the options come first. */ -00563 -00564 if (first_nonopt != last_nonopt && last_nonopt != optind) -00565 exchange ((char **) argv); -00566 else if (last_nonopt != optind) -00567 first_nonopt = optind; -00568 -00569 /* Skip any additional non-options -00570 and extend the range of non-options previously skipped. */ -00571 -00572 while (optind < argc && NONOPTION_P) -00573 optind++; -00574 last_nonopt = optind; -00575 } -00576 -00577 /* The special ARGV-element `--' means premature end of options. -00578 Skip it like a null option, -00579 then exchange with previous non-options as if it were an option, -00580 then skip everything else like a non-option. */ -00581 -00582 if (optind != argc && !strcmp (argv[optind], "--")) -00583 { -00584 optind++; -00585 -00586 if (first_nonopt != last_nonopt && last_nonopt != optind) -00587 exchange ((char **) argv); -00588 else if (first_nonopt == last_nonopt) -00589 first_nonopt = optind; -00590 last_nonopt = argc; -00591 -00592 optind = argc; -00593 } -00594 -00595 /* If we have done all the ARGV-elements, stop the scan -00596 and back over any non-options that we skipped and permuted. */ -00597 -00598 if (optind == argc) -00599 { -00600 /* Set the next-arg-index to point at the non-options -00601 that we previously skipped, so the caller will digest them. */ -00602 if (first_nonopt != last_nonopt) -00603 optind = first_nonopt; -00604 return -1; -00605 } -00606 -00607 /* If we have come to a non-option and did not permute it, -00608 either stop the scan or describe it to the caller and pass it by. */ -00609 -00610 if (NONOPTION_P) -00611 { -00612 if (ordering == REQUIRE_ORDER) -00613 return -1; -00614 optarg = argv[optind++]; -00615 return 1; -00616 } -00617 -00618 /* We have found another option-ARGV-element. -00619 Skip the initial punctuation. */ -00620 -00621 nextchar = (argv[optind] + 1 -00622 + (longopts != NULL && argv[optind][1] == '-')); -00623 } -00624 -00625 /* Decode the current option-ARGV-element. */ -00626 -00627 /* Check whether the ARGV-element is a long option. -00628 -00629 If long_only and the ARGV-element has the form "-f", where f is -00630 a valid short option, don't consider it an abbreviated form of -00631 a long option that starts with f. Otherwise there would be no -00632 way to give the -f short option. -00633 -00634 On the other hand, if there's a long option "fubar" and -00635 the ARGV-element is "-fu", do consider that an abbreviation of -00636 the long option, just like "--fu", and not "-f" with arg "u". -00637 -00638 This distinction seems to be the most useful approach. */ -00639 -00640 if (longopts != NULL -00641 && (argv[optind][1] == '-' -00642 || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) -00643 { -00644 char *nameend; -00645 const struct option *p; -00646 const struct option *pfound = NULL; -00647 int exact = 0; -00648 int ambig = 0; -00649 int indfound = -1; -00650 int option_index; -00651 -00652 for (nameend = nextchar; *nameend && *nameend != '='; nameend++) -00653 /* Do nothing. */ ; -00654 -00655 /* Test all long options for either exact match -00656 or abbreviated matches. */ -00657 for (p = longopts, option_index = 0; p->name; p++, option_index++) -00658 if (!strncmp (p->name, nextchar, nameend - nextchar)) -00659 { -00660 if ((unsigned int) (nameend - nextchar) -00661 == (unsigned int) strlen (p->name)) -00662 { -00663 /* Exact match found. */ -00664 pfound = p; -00665 indfound = option_index; -00666 exact = 1; -00667 break; -00668 } -00669 else if (pfound == NULL) -00670 { -00671 /* First nonexact match found. */ -00672 pfound = p; -00673 indfound = option_index; -00674 } -00675 else if (long_only -00676 || pfound->has_arg != p->has_arg -00677 || pfound->flag != p->flag -00678 || pfound->val != p->val) -00679 /* Second or later nonexact match found. */ -00680 ambig = 1; -00681 } -00682 -00683 if (ambig && !exact) -00684 { -00685 if (print_errors) -00686 { -00687 #if defined _LIBC && defined USE_IN_LIBIO -00688 char *buf; -00689 -00690 __asprintf (&buf, _("%s: option `%s' is ambiguous\n"), -00691 argv[0], argv[optind]); -00692 -00693 if (_IO_fwide (stderr, 0) > 0) -00694 __fwprintf (stderr, L"%s", buf); -00695 else -00696 fputs (buf, stderr); -00697 -00698 free (buf); -00699 #else -00700 fprintf (stderr, _("%s: option `%s' is ambiguous\n"), -00701 argv[0], argv[optind]); -00702 #endif -00703 } -00704 nextchar += strlen (nextchar); -00705 optind++; -00706 optopt = 0; -00707 return '?'; -00708 } -00709 -00710 if (pfound != NULL) -00711 { -00712 option_index = indfound; -00713 optind++; -00714 if (*nameend) -00715 { -00716 /* Don't test has_arg with >, because some C compilers don't -00717 allow it to be used on enums. */ -00718 if (pfound->has_arg) -00719 optarg = nameend + 1; -00720 else -00721 { -00722 if (print_errors) -00723 { -00724 #if defined _LIBC && defined USE_IN_LIBIO -00725 char *buf; -00726 #endif -00727 -00728 if (argv[optind - 1][1] == '-') -00729 { -00730 /* --option */ -00731 #if defined _LIBC && defined USE_IN_LIBIO -00732 __asprintf (&buf, _("\ -00733 %s: option `--%s' doesn't allow an argument\n"), -00734 argv[0], pfound->name); -00735 #else -00736 fprintf (stderr, _("\ -00737 %s: option `--%s' doesn't allow an argument\n"), -00738 argv[0], pfound->name); -00739 #endif -00740 } -00741 else -00742 { -00743 /* +option or -option */ -00744 #if defined _LIBC && defined USE_IN_LIBIO -00745 __asprintf (&buf, _("\ -00746 %s: option `%c%s' doesn't allow an argument\n"), -00747 argv[0], argv[optind - 1][0], -00748 pfound->name); -00749 #else -00750 fprintf (stderr, _("\ -00751 %s: option `%c%s' doesn't allow an argument\n"), -00752 argv[0], argv[optind - 1][0], pfound->name); -00753 #endif -00754 } -00755 -00756 #if defined _LIBC && defined USE_IN_LIBIO -00757 if (_IO_fwide (stderr, 0) > 0) -00758 __fwprintf (stderr, L"%s", buf); -00759 else -00760 fputs (buf, stderr); -00761 -00762 free (buf); -00763 #endif -00764 } -00765 -00766 nextchar += strlen (nextchar); -00767 -00768 optopt = pfound->val; -00769 return '?'; -00770 } -00771 } -00772 else if (pfound->has_arg == 1) -00773 { -00774 if (optind < argc) -00775 optarg = argv[optind++]; -00776 else -00777 { -00778 if (print_errors) -00779 { -00780 #if defined _LIBC && defined USE_IN_LIBIO -00781 char *buf; -00782 -00783 __asprintf (&buf, -00784 _("%s: option `%s' requires an argument\n"), -00785 argv[0], argv[optind - 1]); -00786 -00787 if (_IO_fwide (stderr, 0) > 0) -00788 __fwprintf (stderr, L"%s", buf); -00789 else -00790 fputs (buf, stderr); -00791 -00792 free (buf); -00793 #else -00794 fprintf (stderr, -00795 _("%s: option `%s' requires an argument\n"), -00796 argv[0], argv[optind - 1]); -00797 #endif -00798 } -00799 nextchar += strlen (nextchar); -00800 optopt = pfound->val; -00801 return optstring[0] == ':' ? ':' : '?'; -00802 } -00803 } -00804 nextchar += strlen (nextchar); -00805 if (longind != NULL) -00806 *longind = option_index; -00807 if (pfound->flag) -00808 { -00809 *(pfound->flag) = pfound->val; -00810 return 0; -00811 } -00812 return pfound->val; -00813 } -00814 -00815 /* Can't find it as a long option. If this is not getopt_long_only, -00816 or the option starts with '--' or is not a valid short -00817 option, then it's an error. -00818 Otherwise interpret it as a short option. */ -00819 if (!long_only || argv[optind][1] == '-' -00820 || my_index (optstring, *nextchar) == NULL) -00821 { -00822 if (print_errors) -00823 { -00824 #if defined _LIBC && defined USE_IN_LIBIO -00825 char *buf; -00826 #endif -00827 -00828 if (argv[optind][1] == '-') -00829 { -00830 /* --option */ -00831 #if defined _LIBC && defined USE_IN_LIBIO -00832 __asprintf (&buf, _("%s: unrecognized option `--%s'\n"), -00833 argv[0], nextchar); -00834 #else -00835 fprintf (stderr, _("%s: unrecognized option `--%s'\n"), -00836 argv[0], nextchar); -00837 #endif -00838 } -00839 else -00840 { -00841 /* +option or -option */ -00842 #if defined _LIBC && defined USE_IN_LIBIO -00843 __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"), -00844 argv[0], argv[optind][0], nextchar); -00845 #else -00846 fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), -00847 argv[0], argv[optind][0], nextchar); -00848 #endif -00849 } -00850 -00851 #if defined _LIBC && defined USE_IN_LIBIO -00852 if (_IO_fwide (stderr, 0) > 0) -00853 __fwprintf (stderr, L"%s", buf); -00854 else -00855 fputs (buf, stderr); -00856 -00857 free (buf); -00858 #endif -00859 } -00860 nextchar = (char *) ""; -00861 optind++; -00862 optopt = 0; -00863 return '?'; -00864 } -00865 } -00866 -00867 /* Look at and handle the next short option-character. */ -00868 -00869 { -00870 char c = *nextchar++; -00871 char *temp = my_index (optstring, c); -00872 -00873 /* Increment `optind' when we start to process its last character. */ -00874 if (*nextchar == '\0') -00875 ++optind; -00876 -00877 if (temp == NULL || c == ':') -00878 { -00879 if (print_errors) -00880 { -00881 #if defined _LIBC && defined USE_IN_LIBIO -00882 char *buf; -00883 #endif -00884 -00885 if (posixly_correct) -00886 { -00887 /* 1003.2 specifies the format of this message. */ -00888 #if defined _LIBC && defined USE_IN_LIBIO -00889 __asprintf (&buf, _("%s: illegal option -- %c\n"), -00890 argv[0], c); -00891 #else -00892 fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); -00893 #endif -00894 } -00895 else -00896 { -00897 #if defined _LIBC && defined USE_IN_LIBIO -00898 __asprintf (&buf, _("%s: invalid option -- %c\n"), -00899 argv[0], c); -00900 #else -00901 fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); -00902 #endif -00903 } -00904 -00905 #if defined _LIBC && defined USE_IN_LIBIO -00906 if (_IO_fwide (stderr, 0) > 0) -00907 __fwprintf (stderr, L"%s", buf); -00908 else -00909 fputs (buf, stderr); -00910 -00911 free (buf); -00912 #endif -00913 } -00914 optopt = c; -00915 return '?'; -00916 } -00917 /* Convenience. Treat POSIX -W foo same as long option --foo */ -00918 if (temp[0] == 'W' && temp[1] == ';') -00919 { -00920 char *nameend; -00921 const struct option *p; -00922 const struct option *pfound = NULL; -00923 int exact = 0; -00924 int ambig = 0; -00925 int indfound = 0; -00926 int option_index; -00927 -00928 /* This is an option that requires an argument. */ -00929 if (*nextchar != '\0') -00930 { -00931 optarg = nextchar; -00932 /* If we end this ARGV-element by taking the rest as an arg, -00933 we must advance to the next element now. */ -00934 optind++; -00935 } -00936 else if (optind == argc) -00937 { -00938 if (print_errors) -00939 { -00940 /* 1003.2 specifies the format of this message. */ -00941 #if defined _LIBC && defined USE_IN_LIBIO -00942 char *buf; -00943 -00944 __asprintf (&buf, _("%s: option requires an argument -- %c\n"), -00945 argv[0], c); -00946 -00947 if (_IO_fwide (stderr, 0) > 0) -00948 __fwprintf (stderr, L"%s", buf); -00949 else -00950 fputs (buf, stderr); -00951 -00952 free (buf); -00953 #else -00954 fprintf (stderr, _("%s: option requires an argument -- %c\n"), -00955 argv[0], c); -00956 #endif -00957 } -00958 optopt = c; -00959 if (optstring[0] == ':') -00960 c = ':'; -00961 else -00962 c = '?'; -00963 return c; -00964 } -00965 else -00966 /* We already incremented `optind' once; -00967 increment it again when taking next ARGV-elt as argument. */ -00968 optarg = argv[optind++]; -00969 -00970 /* optarg is now the argument, see if it's in the -00971 table of longopts. */ -00972 -00973 for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) -00974 /* Do nothing. */ ; -00975 -00976 /* Test all long options for either exact match -00977 or abbreviated matches. */ -00978 for (p = longopts, option_index = 0; p->name; p++, option_index++) -00979 if (!strncmp (p->name, nextchar, nameend - nextchar)) -00980 { -00981 if ((unsigned int) (nameend - nextchar) == strlen (p->name)) -00982 { -00983 /* Exact match found. */ -00984 pfound = p; -00985 indfound = option_index; -00986 exact = 1; -00987 break; -00988 } -00989 else if (pfound == NULL) -00990 { -00991 /* First nonexact match found. */ -00992 pfound = p; -00993 indfound = option_index; -00994 } -00995 else -00996 /* Second or later nonexact match found. */ -00997 ambig = 1; -00998 } -00999 if (ambig && !exact) -01000 { -01001 if (print_errors) -01002 { -01003 #if defined _LIBC && defined USE_IN_LIBIO -01004 char *buf; -01005 -01006 __asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"), -01007 argv[0], argv[optind]); -01008 -01009 if (_IO_fwide (stderr, 0) > 0) -01010 __fwprintf (stderr, L"%s", buf); -01011 else -01012 fputs (buf, stderr); -01013 -01014 free (buf); -01015 #else -01016 fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), -01017 argv[0], argv[optind]); -01018 #endif -01019 } -01020 nextchar += strlen (nextchar); -01021 optind++; -01022 return '?'; -01023 } -01024 if (pfound != NULL) -01025 { -01026 option_index = indfound; -01027 if (*nameend) -01028 { -01029 /* Don't test has_arg with >, because some C compilers don't -01030 allow it to be used on enums. */ -01031 if (pfound->has_arg) -01032 optarg = nameend + 1; -01033 else -01034 { -01035 if (print_errors) -01036 { -01037 #if defined _LIBC && defined USE_IN_LIBIO -01038 char *buf; -01039 -01040 __asprintf (&buf, _("\ -01041 %s: option `-W %s' doesn't allow an argument\n"), -01042 argv[0], pfound->name); -01043 -01044 if (_IO_fwide (stderr, 0) > 0) -01045 __fwprintf (stderr, L"%s", buf); -01046 else -01047 fputs (buf, stderr); -01048 -01049 free (buf); -01050 #else -01051 fprintf (stderr, _("\ -01052 %s: option `-W %s' doesn't allow an argument\n"), -01053 argv[0], pfound->name); -01054 #endif -01055 } -01056 -01057 nextchar += strlen (nextchar); -01058 return '?'; -01059 } -01060 } -01061 else if (pfound->has_arg == 1) -01062 { -01063 if (optind < argc) -01064 optarg = argv[optind++]; -01065 else -01066 { -01067 if (print_errors) -01068 { -01069 #if defined _LIBC && defined USE_IN_LIBIO -01070 char *buf; -01071 -01072 __asprintf (&buf, _("\ -01073 %s: option `%s' requires an argument\n"), -01074 argv[0], argv[optind - 1]); -01075 -01076 if (_IO_fwide (stderr, 0) > 0) -01077 __fwprintf (stderr, L"%s", buf); -01078 else -01079 fputs (buf, stderr); -01080 -01081 free (buf); -01082 #else -01083 fprintf (stderr, -01084 _("%s: option `%s' requires an argument\n"), -01085 argv[0], argv[optind - 1]); -01086 #endif -01087 } -01088 nextchar += strlen (nextchar); -01089 return optstring[0] == ':' ? ':' : '?'; -01090 } -01091 } -01092 nextchar += strlen (nextchar); -01093 if (longind != NULL) -01094 *longind = option_index; -01095 if (pfound->flag) -01096 { -01097 *(pfound->flag) = pfound->val; -01098 return 0; -01099 } -01100 return pfound->val; -01101 } -01102 nextchar = NULL; -01103 return 'W'; /* Let the application handle it. */ -01104 } -01105 if (temp[1] == ':') -01106 { -01107 if (temp[2] == ':') -01108 { -01109 /* This is an option that accepts an argument optionally. */ -01110 if (*nextchar != '\0') -01111 { -01112 optarg = nextchar; -01113 optind++; -01114 } -01115 else -01116 optarg = NULL; -01117 nextchar = NULL; -01118 } -01119 else -01120 { -01121 /* This is an option that requires an argument. */ -01122 if (*nextchar != '\0') -01123 { -01124 optarg = nextchar; -01125 /* If we end this ARGV-element by taking the rest as an arg, -01126 we must advance to the next element now. */ -01127 optind++; -01128 } -01129 else if (optind == argc) -01130 { -01131 if (print_errors) -01132 { -01133 /* 1003.2 specifies the format of this message. */ -01134 #if defined _LIBC && defined USE_IN_LIBIO -01135 char *buf; -01136 -01137 __asprintf (&buf, -01138 _("%s: option requires an argument -- %c\n"), -01139 argv[0], c); -01140 -01141 if (_IO_fwide (stderr, 0) > 0) -01142 __fwprintf (stderr, L"%s", buf); -01143 else -01144 fputs (buf, stderr); -01145 -01146 free (buf); -01147 #else -01148 fprintf (stderr, -01149 _("%s: option requires an argument -- %c\n"), -01150 argv[0], c); -01151 #endif -01152 } -01153 optopt = c; -01154 if (optstring[0] == ':') -01155 c = ':'; -01156 else -01157 c = '?'; -01158 } -01159 else -01160 /* We already incremented `optind' once; -01161 increment it again when taking next ARGV-elt as argument. */ -01162 optarg = argv[optind++]; -01163 nextchar = NULL; -01164 } -01165 } -01166 return c; -01167 } -01168 } -01169 -01170 int -01171 getopt (argc, argv, optstring) -01172 int argc; -01173 char *const *argv; -01174 const char *optstring; -01175 { -01176 return _getopt_internal (argc, argv, optstring, -01177 (const struct option *) 0, -01178 (int *) 0, -01179 0); -01180 } -01181 -01182 #endif /* Not ELIDE_CODE. */ -01183 -01184 -01185 /* Compile with -DTEST to make an executable for use in testing -01186 the above definition of `getopt'. */ -01187 -01188 /* #define TEST */ /* Pete Wilson mod 7/28/02 */ -01189 #ifdef TEST -01190 -01191 #ifndef exit /* Pete Wilson mod 7/28/02 */ -01192 int exit(int); /* Pete Wilson mod 7/28/02 */ -01193 #endif /* Pete Wilson mod 7/28/02 */ -01194 -01195 int -01196 main (argc, argv) -01197 int argc; -01198 char **argv; -01199 { -01200 int c; -01201 int digit_optind = 0; -01202 -01203 while (1) -01204 { -01205 int this_option_optind = optind ? optind : 1; -01206 -01207 c = getopt (argc, argv, "abc:d:0123456789"); -01208 if (c == -1) -01209 break; -01210 -01211 switch (c) -01212 { -01213 case '0': -01214 case '1': -01215 case '2': -01216 case '3': -01217 case '4': -01218 case '5': -01219 case '6': -01220 case '7': -01221 case '8': -01222 case '9': -01223 if (digit_optind != 0 && digit_optind != this_option_optind) -01224 printf ("digits occur in two different argv-elements.\n"); -01225 digit_optind = this_option_optind; -01226 printf ("option %c\n", c); -01227 break; -01228 -01229 case 'a': -01230 printf ("option a\n"); -01231 break; -01232 -01233 case 'b': -01234 printf ("option b\n"); -01235 break; -01236 -01237 case 'c': -01238 printf ("option c with value `%s'\n", optarg); -01239 break; -01240 -01241 case '?': -01242 break; -01243 -01244 default: -01245 printf ("?? getopt returned character code 0%o ??\n", c); -01246 } -01247 } -01248 -01249 if (optind < argc) -01250 { -01251 printf ("non-option ARGV-elements: "); -01252 while (optind < argc) -01253 printf ("%s ", argv[optind++]); -01254 printf ("\n"); -01255 } -01256 -01257 exit (0); -01258 } -01259 -01260 #endif /* TEST */ -
#include <stdio.h>
#include "getopt.h"
#include <strings.h>
-Include dependency graph for getopt.c:
-Go to the source code of this file.
Defines | |
#define | GETOPT_INTERFACE_VERSION 2 |
#define | _(msgid) (msgid) |
#define | SWAP_FLAGS(ch1, ch2) |
#define | NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') |
Enumerations | |
enum | { REQUIRE_ORDER, -PERMUTE, -RETURN_IN_ORDER - } |
Functions | |
char * | getenv () |
int | _getopt_internal (int argc, char *const *argv, const char *optstring, const struct option *longopts, int *longind, int long_only) |
int | getopt (int argc, char *const *argv, const char *optstring) |
Variables | |
char * | optarg |
int | optind = 1 |
int | __getopt_initialized |
int | opterr = 1 |
int | optopt = '?' |
#define _ | -( | -msgid | -- | ) | -(msgid) | -
#define GETOPT_INTERFACE_VERSION 2 | -
#define SWAP_FLAGS | -( | -ch1, | |||
- | - | ch2 | -- | ) | -- |
-
anonymous enum | -
-
int _getopt_internal | -( | -int | -argc, | -|
- | - | char *const * | -argv, | -|
- | - | const char * | -optstring, | -|
- | - | const struct option * | -longopts, | -|
- | - | int * | -longind, | -|
- | - | int | -long_only | - |
- | ) | -- |
- -
-Definition at line 511 of file getopt.c. -
-References __getopt_initialized, option::name, NONOPTION_P, optarg, opterr, optind, PERMUTE, and REQUIRE_ORDER. -
char* getenv | -( | -- | ) | -- |
- -
int getopt | -( | -int | -argc, | -|
- | - | char *const * | -argv, | -|
- | - | const char * | -optstring | - |
- | ) | -- |
- -
-Definition at line 1171 of file getopt.c. -
-References _getopt_internal(). -
-Here is the call graph for this function:
-
int __getopt_initialized | -
-
00001 /* from http://www.pwilson.net/getopt.html */ -00002 -00003 /* getopt.h */ -00004 /* Declarations for getopt. -00005 Copyright (C) 1989-1994, 1996-1999, 2001 Free Software -00006 Foundation, Inc. This file is part of the GNU C Library. -00007 -00008 The GNU C Library is free software; you can redistribute -00009 it and/or modify it under the terms of the GNU Lesser -00010 General Public License as published by the Free Software -00011 Foundation; either version 2.1 of the License, or -00012 (at your option) any later version. -00013 -00014 The GNU C Library is distributed in the hope that it will -00015 be useful, but WITHOUT ANY WARRANTY; without even the -00016 implied warranty of MERCHANTABILITY or FITNESS FOR A -00017 PARTICULAR PURPOSE. See the GNU Lesser General Public -00018 License for more details. -00019 -00020 You should have received a copy of the GNU Lesser General -00021 Public License along with the GNU C Library; if not, write -00022 to the Free Software Foundation, Inc., 59 Temple Place, -00023 Suite 330, Boston, MA 02111-1307 USA. */ -00024 -00025 -00026 -00027 -00028 -00029 #ifndef _GETOPT_H -00030 -00031 #ifndef __need_getopt -00032 # define _GETOPT_H 1 -00033 #endif -00034 -00035 /* If __GNU_LIBRARY__ is not already defined, either we are being used -00036 standalone, or this is the first header included in the source file. -00037 If we are being used with glibc, we need to include <features.h>, but -00038 that does not exist if we are standalone. So: if __GNU_LIBRARY__ is -00039 not defined, include <ctype.h>, which will pull in <features.h> for us -00040 if it's from glibc. (Why ctype.h? It's guaranteed to exist and it -00041 doesn't flood the namespace with stuff the way some other headers do.) */ -00042 #if !defined __GNU_LIBRARY__ -00043 # include <ctype.h> -00044 #endif -00045 -00046 #ifdef __cplusplus -00047 extern "C" { -00048 #endif -00049 -00050 /* For communication from `getopt' to the caller. -00051 When `getopt' finds an option that takes an argument, -00052 the argument value is returned here. -00053 Also, when `ordering' is RETURN_IN_ORDER, -00054 each non-option ARGV-element is returned here. */ -00055 -00056 extern char *optarg; -00057 -00058 /* Index in ARGV of the next element to be scanned. -00059 This is used for communication to and from the caller -00060 and for communication between successive calls to `getopt'. -00061 -00062 On entry to `getopt', zero means this is the first call; initialize. -00063 -00064 When `getopt' returns -1, this is the index of the first of the -00065 non-option elements that the caller should itself scan. -00066 -00067 Otherwise, `optind' communicates from one call to the next -00068 how much of ARGV has been scanned so far. */ -00069 -00070 extern int optind; -00071 -00072 /* Callers store zero here to inhibit the error message `getopt' prints -00073 for unrecognized options. */ -00074 -00075 extern int opterr; -00076 -00077 /* Set to an option character which was unrecognized. */ -00078 -00079 extern int optopt; -00080 -00081 #ifndef __need_getopt -00082 /* Describe the long-named options requested by the application. -00083 The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector -00084 of `struct option' terminated by an element containing a name which is -00085 zero. -00086 -00087 The field `has_arg' is: -00088 no_argument (or 0) if the option does not take an argument, -00089 required_argument (or 1) if the option requires an argument, -00090 optional_argument (or 2) if the option takes an optional argument. -00091 -00092 If the field `flag' is not NULL, it points to a variable that is set -00093 to the value given in the field `val' when the option is found, but -00094 left unchanged if the option is not found. -00095 -00096 To have a long-named option do something other than set an `int' to -00097 a compiled-in constant, such as set a value from `optarg', set the -00098 option's `flag' field to zero and its `val' field to a nonzero -00099 value (the equivalent single-letter option character, if there is -00100 one). For long options that have a zero `flag' field, `getopt' -00101 returns the contents of the `val' field. */ -00102 -00103 struct option -00104 { -00105 # if (defined __STDC__ && __STDC__) || defined __cplusplus -00106 const char *name; -00107 # else -00108 char *name; -00109 # endif -00110 /* has_arg can't be an enum because some compilers complain about -00111 type mismatches in all the code that assumes it is an int. */ -00112 int has_arg; -00113 int *flag; -00114 int val; -00115 }; -00116 -00117 /* Names for the values of the `has_arg' field of `struct option'. */ -00118 -00119 # define no_argument 0 -00120 # define required_argument 1 -00121 # define optional_argument 2 -00122 #endif /* need getopt */ -00123 -00124 -00125 /* Get definitions and prototypes for functions to process the -00126 arguments in ARGV (ARGC of them, minus the program name) for -00127 options given in OPTS. -00128 -00129 Return the option character from OPTS just read. Return -1 when -00130 there are no more options. For unrecognized options, or options -00131 missing arguments, `optopt' is set to the option letter, and '?' is -00132 returned. -00133 -00134 The OPTS string is a list of characters which are recognized option -00135 letters, optionally followed by colons, specifying that that letter -00136 takes an argument, to be placed in `optarg'. -00137 -00138 If a letter in OPTS is followed by two colons, its argument is -00139 optional. This behavior is specific to the GNU `getopt'. -00140 -00141 The argument `--' causes premature termination of argument -00142 scanning, explicitly telling `getopt' that there are no more -00143 options. -00144 -00145 If OPTS begins with `--', then non-option arguments are treated as -00146 arguments to the option '\0'. This behavior is specific to the GNU -00147 `getopt'. */ -00148 -00149 #if (defined __STDC__ && __STDC__) || defined __cplusplus -00150 # ifdef __GNU_LIBRARY__ -00151 /* Many other libraries have conflicting prototypes for getopt, with -00152 differences in the consts, in stdlib.h. To avoid compilation -00153 errors, only prototype getopt for the GNU C library. */ -00154 extern int getopt (int ___argc, char *const *___argv, const char *__shortopts); -00155 # else /* not __GNU_LIBRARY__ */ -00156 extern int getopt (); -00157 # endif /* __GNU_LIBRARY__ */ -00158 -00159 # ifndef __need_getopt -00160 extern int getopt_long (int ___argc, char *const *___argv, -00161 const char *__shortopts, -00162 const struct option *__longopts, int *__longind); -00163 extern int getopt_long_only (int ___argc, char *const *___argv, -00164 const char *__shortopts, -00165 const struct option *__longopts, int *__longind); -00166 -00167 /* Internal only. Users should not call this directly. */ -00168 extern int _getopt_internal (int ___argc, char *const *___argv, -00169 const char *__shortopts, -00170 const struct option *__longopts, int *__longind, -00171 int __long_only); -00172 # endif -00173 #else /* not __STDC__ */ -00174 extern int getopt (); -00175 # ifndef __need_getopt -00176 extern int getopt_long (); -00177 extern int getopt_long_only (); -00178 -00179 extern int _getopt_internal (); -00180 # endif -00181 #endif /* __STDC__ */ -00182 -00183 #ifdef __cplusplus -00184 } -00185 #endif -00186 -00187 /* Make sure we later can get all the definitions and declarations. */ -00188 #undef __need_getopt -00189 -00190 #endif /* getopt.h */ -00191 -
#include <ctype.h>
-Include dependency graph for getopt.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Data Structures | |
struct | option |
Defines | |
#define | _GETOPT_H 1 |
#define | no_argument 0 |
#define | required_argument 1 |
#define | optional_argument 2 |
Functions | |
int | getopt () |
int | getopt_long () |
int | getopt_long_only () |
int | _getopt_internal () |
Variables | |
char * | optarg |
int | optind |
int | opterr |
int | optopt |
-
int _getopt_internal | -( | -- | ) | -- |
- -
int getopt | -( | -- | ) | -- |
- -
int getopt_long | -( | -- | ) | -- |
- -
int getopt_long_only | -( | -- | ) | -- |
- -
-
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #if defined(WIN32) && !defined(__CYGWIN__) -00024 #include <windows.h> -00025 #include "getopt.h" -00026 void pause(void) -00027 { -00028 system("PAUSE"); -00029 } -00030 #else -00031 #include <unistd.h> -00032 #include <stdio.h> -00033 #include <string.h> -00034 #include <stdlib.h> -00035 #include <signal.h> -00036 #endif -00037 -00038 #include "canfestival.h" -00039 #include "TestMasterMicroMod.h" -00040 #include "TestMaster.h" -00041 UNS8 slavenodeid; -00042 -00043 -00044 /*****************************************************************************/ -00045 void TestMaster_heartbeatError(UNS8 heartbeatID) -00046 { -00047 eprintf("TestMaster_heartbeatError %d\n", heartbeatID); -00048 } -00049 -00050 /******************************************************** -00051 * ConfigureSlaveNode is responsible to -00052 * - setup master RPDO 1 to receive TPDO 1 from id 0x40 -00053 * - setup master TPDO 1 to send RPDO 1 to id 0x40 -00054 ********************************************************/ -00055 void TestMaster_initialisation() -00056 { -00057 UNS32 PDO1_COBID = 0x0180 + slavenodeid; -00058 UNS32 PDO2_COBID = 0x0200 + slavenodeid; -00059 UNS8 size = sizeof(UNS32); -00060 -00061 eprintf("TestMaster_initialisation\n"); -00062 -00063 /***************************************** -00064 * Define RPDOs to match slave ID=0x40 TPDOs* -00065 *****************************************/ -00066 writeLocalDict( &TestMaster_Data, /*CO_Data* d*/ -00067 0x1400, /*UNS16 index*/ -00068 0x01, /*UNS8 subind*/ -00069 &PDO1_COBID, /*void * pSourceData,*/ -00070 &size, /* UNS8 * pExpectedSize*/ -00071 RW); /* UNS8 checkAccess */ -00072 -00073 -00074 /***************************************** -00075 * Define TPDOs to match slave ID=0x40 RPDOs* -00076 *****************************************/ -00077 writeLocalDict( &TestMaster_Data, /*CO_Data* d*/ -00078 0x1800, /*UNS16 index*/ -00079 0x01, /*UNS8 subind*/ -00080 &PDO2_COBID, /*void * pSourceData,*/ -00081 &size, /* UNS8 * pExpectedSize*/ -00082 RW); /* UNS8 checkAccess */ -00083 } -00084 -00085 static init_step = 0; -00086 -00087 /*Froward declaration*/ -00088 static void ConfigureSlaveNode(CO_Data* d, UNS8 nodeId); -00089 -00090 -00091 static void CheckSDOAndContinue(CO_Data* d, UNS8 nodeId) -00092 { -00093 UNS32 abortCode; -00094 -00095 if(getWriteResultNetworkDict (d, nodeId, &abortCode) != SDO_FINISHED) -00096 eprintf("Master : Failed in initializing slave %2.2x, step %d, AbortCode :%4.4x \n", nodeId, init_step, abortCode); -00097 -00098 /* Finalise last SDO transfer with this node */ -00099 closeSDOtransfer(&TestMaster_Data, nodeId, SDO_CLIENT); -00100 -00101 ConfigureSlaveNode(d, nodeId); -00102 } -00103 -00104 /******************************************************** -00105 * ConfigureSlaveNode is responsible to -00106 * - setup slave TPDO 1 transmit time -00107 * - setup slave TPDO 2 transmit time -00108 * - setup slave Heartbeat Producer time -00109 * - switch to operational mode -00110 * - send NMT to slave -00111 ******************************************************** -00112 * This an example of : -00113 * Network Dictionary Access (SDO) with Callback -00114 * Slave node state change request (NMT) -00115 ******************************************************** -00116 * This is called first by TestMaster_preOperational -00117 * then it called again each time a SDO exchange is -00118 * finished. -00119 ********************************************************/ -00120 static void ConfigureSlaveNode(CO_Data* d, UNS8 nodeId) -00121 { -00122 UNS8 res; -00123 eprintf("Master : ConfigureSlaveNode %2.2x\n", nodeId); -00124 switch(++init_step){ -00125 case 1: -00126 { /*disable Slave's TPDO 1 */ -00127 UNS32 TPDO_COBId = 0x80000180 + nodeId; -00128 -00129 eprintf("Master : disable slave %2.2x TPDO 1 \n", nodeId); -00130 res = writeNetworkDictCallBack (d, /*CO_Data* d*/ -00132 nodeId, /*UNS8 nodeId*/ -00133 0x1800, /*UNS16 index*/ -00134 0x01, /*UNS8 subindex*/ -00135 4, /*UNS8 count*/ -00136 0, /*UNS8 dataType*/ -00137 &TPDO_COBId,/*void *data*/ -00138 CheckSDOAndContinue); /*SDOCallback_t Callback*/ -00139 } -00140 break; -00141 -00142 case 2: -00143 { /*setup Slave's TPDO 1 to be transmitted on SYNC*/ -00144 UNS8 Transmission_Type = 0x01; -00145 -00146 eprintf("Master : set slave %2.2x TPDO 1 transmit type\n", nodeId); -00147 res = writeNetworkDictCallBack (d, /*CO_Data* d*/ -00149 nodeId, /*UNS8 nodeId*/ -00150 0x1800, /*UNS16 index*/ -00151 0x02, /*UNS8 subindex*/ -00152 1, /*UNS8 count*/ -00153 0, /*UNS8 dataType*/ -00154 &Transmission_Type,/*void *data*/ -00155 CheckSDOAndContinue); /*SDOCallback_t Callback*/ -00156 } -00157 break; -00158 -00159 case 3: -00160 { /*re-enable Slave's TPDO 1 */ -00161 UNS32 TPDO_COBId = 0x00000180 + nodeId; -00162 -00163 eprintf("Master : re-enable slave %2.2x TPDO 1\n", nodeId); -00164 res = writeNetworkDictCallBack (d, /*CO_Data* d*/ -00166 nodeId, /*UNS8 nodeId*/ -00167 0x1800, /*UNS16 index*/ -00168 0x01, /*UNS8 subindex*/ -00169 4, /*UNS8 count*/ -00170 0, /*UNS8 dataType*/ -00171 &TPDO_COBId,/*void *data*/ -00172 CheckSDOAndContinue); /*SDOCallback_t Callback*/ -00173 } -00174 break; -00175 -00176 case 4: -00177 { /*disable Slave's TPDO 2 */ -00178 UNS32 TPDO_COBId = 0x80000200 + nodeId; -00179 -00180 eprintf("Master : disable slave %2.2x RPDO 1\n", nodeId); -00181 res = writeNetworkDictCallBack (d, /*CO_Data* d*/ -00183 nodeId, /*UNS8 nodeId*/ -00184 0x1400, /*UNS16 index*/ -00185 0x01, /*UNS8 subindex*/ -00186 4, /*UNS8 count*/ -00187 0, /*UNS8 dataType*/ -00188 &TPDO_COBId,/*void *data*/ -00189 CheckSDOAndContinue); /*SDOCallback_t Callback*/ -00190 } -00191 break; -00192 -00193 -00194 case 5: -00195 { -00196 UNS8 Transmission_Type = 0x01; -00197 -00198 eprintf("Master : set slave %2.2x RPDO 1 receive type\n", nodeId); -00199 res = writeNetworkDictCallBack (d, /*CO_Data* d*/ -00201 nodeId, /*UNS8 nodeId*/ -00202 0x1400, /*UNS16 index*/ -00203 0x02, /*UNS8 subindex*/ -00204 1, /*UNS8 count*/ -00205 0, /*UNS8 dataType*/ -00206 &Transmission_Type,/*void *data*/ -00207 CheckSDOAndContinue); /*SDOCallback_t Callback*/ -00208 } -00209 break; -00210 -00211 case 6: -00212 { /*re-enable Slave's TPDO 1 */ -00213 UNS32 TPDO_COBId = 0x00000200 + nodeId; -00214 -00215 eprintf("Master : re-enable %2.2x RPDO 1\n", nodeId); -00216 res = writeNetworkDictCallBack (d, /*CO_Data* d*/ -00218 nodeId, /*UNS8 nodeId*/ -00219 0x1400, /*UNS16 index*/ -00220 0x01, /*UNS8 subindex*/ -00221 4, /*UNS8 count*/ -00222 0, /*UNS8 dataType*/ -00223 &TPDO_COBId,/*void *data*/ -00224 CheckSDOAndContinue); /*SDOCallback_t Callback*/ -00225 } -00226 break; -00227 -00228 case 7: -00229 { -00230 UNS16 Heartbeat_Producer_Time = 0x03E8; -00231 eprintf("Master : set slave %2.2x heartbeat producer time \n", nodeId); -00232 res = writeNetworkDictCallBack (d, /*CO_Data* d*/ -00234 nodeId, /*UNS8 nodeId*/ -00235 0x1017, /*UNS16 index*/ -00236 0x00, /*UNS8 subindex*/ -00237 2, /*UNS8 count*/ -00238 0, /*UNS8 dataType*/ -00239 &Heartbeat_Producer_Time,/*void *data*/ -00240 CheckSDOAndContinue); /*SDOCallback_t Callback*/ -00241 } -00242 break; -00243 -00244 case 8: -00245 { /*disable Slave's TPDO 2 */ -00246 UNS32 TPDO_COBId = 0x80000280 + nodeId; -00247 -00248 eprintf("Master : disable slave %2.2x TPDO 2 \n", nodeId); -00249 res = writeNetworkDictCallBack (d, /*CO_Data* d*/ -00251 nodeId, /*UNS8 nodeId*/ -00252 0x1801, /*UNS16 index*/ -00253 0x01, /*UNS8 subindex*/ -00254 4, /*UNS8 count*/ -00255 0, /*UNS8 dataType*/ -00256 &TPDO_COBId,/*void *data*/ -00257 CheckSDOAndContinue); /*SDOCallback_t Callback*/ -00258 } -00259 break; -00260 -00261 case 9: -00262 { /*disable Slave's TPDO 3 */ -00263 UNS32 TPDO_COBId = 0x80000380 + nodeId; -00264 -00265 eprintf("Master : disable slave %2.2x TPDO 3 \n", nodeId); -00266 res = writeNetworkDictCallBack (d, /*CO_Data* d*/ -00268 nodeId, /*UNS8 nodeId*/ -00269 0x1802, /*UNS16 index*/ -00270 0x01, /*UNS8 subindex*/ -00271 4, /*UNS8 count*/ -00272 0, /*UNS8 dataType*/ -00273 &TPDO_COBId,/*void *data*/ -00274 CheckSDOAndContinue); /*SDOCallback_t Callback*/ -00275 } -00276 break; -00277 -00278 case 10: -00279 { /*disable Slave's TPDO 2 */ -00280 UNS32 TPDO_COBId = 0x80000480 + nodeId; -00281 -00282 eprintf("Master : disable slave %2.2x TPDO 4 \n", nodeId); -00283 res = writeNetworkDictCallBack (d, /*CO_Data* d*/ -00285 nodeId, /*UNS8 nodeId*/ -00286 0x1803, /*UNS16 index*/ -00287 0x01, /*UNS8 subindex*/ -00288 4, /*UNS8 count*/ -00289 0, /*UNS8 dataType*/ -00290 &TPDO_COBId,/*void *data*/ -00291 CheckSDOAndContinue); /*SDOCallback_t Callback*/ -00292 } -00293 break; -00294 -00295 case 11: -00296 /* Put the master in operational mode */ -00297 setState(d, Operational); -00298 -00299 /* Ask slave node to go in operational mode */ -00300 masterSendNMTstateChange (d, nodeId, NMT_Start_Node); -00301 } -00302 -00303 } -00304 -00305 void TestMaster_preOperational() -00306 { -00307 -00308 eprintf("TestMaster_preOperational\n"); -00309 ConfigureSlaveNode(&TestMaster_Data, slavenodeid); -00310 -00311 } -00312 -00313 void TestMaster_operational() -00314 { -00315 eprintf("TestMaster_operational\n"); -00316 } -00317 -00318 void TestMaster_stopped() -00319 { -00320 eprintf("TestMaster_stopped\n"); -00321 } -00322 -00323 void TestMaster_post_sync() -00324 { -00325 DO++; -00326 eprintf("MicroMod Digital Out: %2.2x\n",DO); -00327 eprintf("MicroMod Digital In (by bit): DI1: %2.2x DI2: %2.2x DI3: %2.2x DI4: %2.2x DI5: %2.2x DI6: %2.2x DI7: %2.2x DI8: %2.2x\n",DI1,DI2,DI3,DI4,DI5,DI6,DI7,DI8); -00328 } -00329 -00330 void TestMaster_post_TPDO() -00331 { -00332 // eprintf("TestMaster_post_TPDO\n"); -00333 } -00334 -00335 //s_BOARD SlaveBoard = {"0", "500K"}; -00336 s_BOARD MasterBoard = {"32", "125K"}; -00337 -00338 #if !defined(WIN32) || defined(__CYGWIN__) -00339 void catch_signal(int sig) -00340 { -00341 signal(SIGTERM, catch_signal); -00342 signal(SIGINT, catch_signal); -00343 -00344 eprintf("Got Signal %d\n",sig); -00345 } -00346 #endif -00347 -00348 void help() -00349 { -00350 printf("**************************************************************\n"); -00351 printf("* TestMasterMicroMod *\n"); -00352 printf("* *\n"); -00353 printf("* A simple example for PC. *\n"); -00354 printf("* A CanOpen master that control a MicroMod module: *\n"); -00355 printf("* - setup module TPDO 1 transmit type *\n"); -00356 printf("* - setup module RPDO 1 transmit type *\n"); -00357 printf("* - setup module hearbeatbeat period *\n"); -00358 printf("* - disable others TPDOs *\n"); -00359 printf("* - set state to operational *\n"); -00360 printf("* - send periodic SYNC *\n"); -00361 printf("* - send periodic RPDO 1 to Micromod (digital output) *\n"); -00362 printf("* - listen Micromod's TPDO 1 (digital input) *\n"); -00363 printf("* - Mapping RPDO 1 bit per bit (digital input) *\n"); -00364 printf("* *\n"); -00365 printf("* Usage: *\n"); -00366 printf("* ./TestMasterMicroMod [OPTIONS] *\n"); -00367 printf("* *\n"); -00368 printf("* OPTIONS: *\n"); -00369 printf("* -l : Can library [\"libcanfestival_can_virtual.so\"] *\n"); -00370 printf("* *\n"); -00371 printf("* Slave: *\n"); -00372 printf("* -i : Slave Node id format [0x01 , 0x7F] *\n"); -00373 printf("* *\n"); -00374 printf("* Master: *\n"); -00375 printf("* -m : bus name [\"1\"] *\n"); -00376 printf("* -M : 1M,500K,250K,125K,100K,50K,20K,10K *\n"); -00377 printf("* *\n"); -00378 printf("**************************************************************\n"); -00379 } -00380 -00381 /*************************** INIT *****************************************/ -00382 void InitNodes(CO_Data* d, UNS32 id) -00383 { -00384 /****************************** INITIALISATION MASTER *******************************/ -00385 if(MasterBoard.baudrate){ -00386 /* Defining the node Id */ -00387 setNodeId(&TestMaster_Data, 0x01); -00388 -00389 /* init */ -00390 setState(&TestMaster_Data, Initialisation); -00391 } -00392 } -00393 -00394 /****************************************************************************/ -00395 /*************************** MAIN *****************************************/ -00396 /****************************************************************************/ -00397 int main(int argc,char **argv) -00398 { -00399 -00400 int c; -00401 extern char *optarg; -00402 char* LibraryPath="libcanfestival_can_virtual.so"; -00403 char *snodeid; -00404 while ((c = getopt(argc, argv, "-m:s:M:S:l:i:")) != EOF) -00405 { -00406 switch(c) -00407 { -00408 case 'm' : -00409 if (optarg[0] == 0) -00410 { -00411 help(); -00412 exit(1); -00413 } -00414 MasterBoard.busname = optarg; -00415 break; -00416 case 'M' : -00417 if (optarg[0] == 0) -00418 { -00419 help(); -00420 exit(1); -00421 } -00422 MasterBoard.baudrate = optarg; -00423 break; -00424 case 'l' : -00425 if (optarg[0] == 0) -00426 { -00427 help(); -00428 exit(1); -00429 } -00430 LibraryPath = optarg; -00431 break; -00432 case 'i' : -00433 if (optarg[0] == 0) -00434 { -00435 help(); -00436 exit(1); -00437 } -00438 snodeid = optarg; -00439 sscanf(snodeid,"%x",&slavenodeid); -00440 break; -00441 default: -00442 help(); -00443 exit(1); -00444 } -00445 } -00446 -00447 #if !defined(WIN32) || defined(__CYGWIN__) -00448 /* install signal handler for manual break */ -00449 signal(SIGTERM, catch_signal); -00450 signal(SIGINT, catch_signal); -00451 #endif -00452 -00453 #ifndef NOT_USE_DYNAMIC_LOADING -00454 LoadCanDriver(LibraryPath); -00455 #endif -00456 -00457 TestMaster_Data.heartbeatError = TestMaster_heartbeatError; -00458 TestMaster_Data.initialisation = TestMaster_initialisation; -00459 TestMaster_Data.preOperational = TestMaster_preOperational; -00460 TestMaster_Data.operational = TestMaster_operational; -00461 TestMaster_Data.stopped = TestMaster_stopped; -00462 TestMaster_Data.post_sync = TestMaster_post_sync; -00463 TestMaster_Data.post_TPDO = TestMaster_post_TPDO; -00464 -00465 if(!canOpen(&MasterBoard,&TestMaster_Data)){ -00466 eprintf("Cannot open Master Board\n"); -00467 goto fail_master; -00468 } -00469 -00470 // Start timer thread -00471 StartTimerLoop(&InitNodes); -00472 -00473 // wait Ctrl-C -00474 pause(); -00475 eprintf("Finishing.\n"); -00476 -00477 // Reset the slave node for next use (will stop emitting heartbeat) -00478 masterSendNMTstateChange (&TestMaster_Data, slavenodeid, NMT_Reset_Node); -00479 -00480 // Stop master -00481 setState(&TestMaster_Data, Stopped); -00482 -00483 // Stop timer thread -00484 StopTimerLoop(); -00485 -00486 fail_master: -00487 if(MasterBoard.baudrate) canClose(&TestMaster_Data); -00488 -00489 return 0; -00490 } -00491 -00492 -
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <signal.h>
#include "canfestival.h"
#include "TestMasterMicroMod.h"
#include "TestMaster.h"
-Include dependency graph for TestMasterMicroMod.c:
-Go to the source code of this file.
Functions | |
void | TestMaster_heartbeatError (UNS8 heartbeatID) |
void | TestMaster_initialisation () |
void | TestMaster_preOperational () |
void | TestMaster_operational () |
void | TestMaster_stopped () |
void | TestMaster_post_sync () |
void | TestMaster_post_TPDO () |
void | catch_signal (int sig) |
void | help () |
void | InitNodes (CO_Data *d, UNS32 id) |
int | main (int argc, char **argv) |
Variables | |
UNS8 | slavenodeid |
s_BOARD | MasterBoard = {"32", "125K"} |
void catch_signal | -( | -int | -sig | -) | -- |
- -
-Definition at line 339 of file TestMasterMicroMod.c. -
-References catch_signal(), and eprintf. -
-Here is the call graph for this function:
void help | -( | -- | ) | -- |
- -
-Definition at line 348 of file TestMasterMicroMod.c. -
void InitNodes | -( | -CO_Data * | -d, | -|
- | - | UNS32 | -id | - |
- | ) | -- |
- -
-Definition at line 382 of file TestMasterMicroMod.c. -
-References struct_s_BOARD::baudrate, Initialisation, MasterBoard, setNodeId(), setState(), and TestMaster_Data. -
-Here is the call graph for this function:
int main | -( | -int | -argc, | -|
- | - | char ** | -argv | - |
- | ) | -- |
- -
-Definition at line 397 of file TestMasterMicroMod.c. -
-References struct_s_BOARD::baudrate, struct_s_BOARD::busname, canClose(), canOpen(), catch_signal(), eprintf, getopt(), struct_CO_Data::heartbeatError, help(), struct_CO_Data::initialisation, InitNodes(), LoadCanDriver(), MasterBoard, masterSendNMTstateChange(), NMT_Reset_Node, struct_CO_Data::operational, optarg, struct_CO_Data::post_sync, struct_CO_Data::post_TPDO, struct_CO_Data::preOperational, setState(), slavenodeid, StartTimerLoop(), Stopped, struct_CO_Data::stopped, StopTimerLoop(), TestMaster_Data, TestMaster_heartbeatError(), TestMaster_initialisation(), TestMaster_operational(), TestMaster_post_sync(), TestMaster_post_TPDO(), TestMaster_preOperational(), and TestMaster_stopped(). -
-Here is the call graph for this function:
void TestMaster_heartbeatError | -( | -UNS8 | -heartbeatID | -) | -- |
void TestMaster_initialisation | -( | -void | -- | ) | -- |
- -
-Definition at line 55 of file TestMasterMicroMod.c. -
-References eprintf, RW, slavenodeid, TestMaster_Data, UNS32, UNS8, and writeLocalDict(). -
-Here is the call graph for this function:
void TestMaster_operational | -( | -void | -- | ) | -- |
void TestMaster_post_sync | -( | -void | -- | ) | -- |
- -
-Definition at line 323 of file TestMasterMicroMod.c. -
-References DI1, DI2, DI3, DI4, DI5, DI6, DI7, DI8, DO, eprintf, MasterMap1, MasterMap10, MasterMap11, MasterMap12, MasterMap13, MasterMap2, MasterMap3, MasterMap4, MasterMap5, MasterMap6, MasterMap7, MasterMap8, and MasterMap9. -
void TestMaster_post_TPDO | -( | -void | -- | ) | -- |
- -
-Definition at line 330 of file TestMasterMicroMod.c. -
-References closeSDOtransfer(), eprintf, getReadResultNetworkDict(), readNetworkDict(), SDO_ABORTED_INTERNAL, SDO_ABORTED_RCV, SDO_CLIENT, SDO_DOWNLOAD_IN_PROGRESS, SDO_FINISHED, SDO_RESET, SDO_UPLOAD_IN_PROGRESS, sendPDOrequest(), TestMaster_Data, UNS32, UNS8, and writeNetworkDictCallBack(). -
-Here is the call graph for this function:
void TestMaster_preOperational | -( | -void | -- | ) | -- |
- -
-Definition at line 305 of file TestMasterMicroMod.c. -
-References eprintf, slavenodeid, and TestMaster_Data. -
void TestMaster_stopped | -( | -void | -- | ) | -- |
-
s_BOARD MasterBoard = {"32", "125K"} | -
- -
-Definition at line 336 of file TestMasterMicroMod.c. -
UNS8 slavenodeid | -
- -
-Definition at line 41 of file TestMasterMicroMod.c. -
-Referenced by main(), TestMaster_initialisation(), and TestMaster_preOperational(). -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 #ifdef USE_XENO -00023 #define eprintf(...) -00024 #else -00025 #define eprintf(...) printf (__VA_ARGS__) -00026 #endif -00027 //void print_message(Message *m); -00028 -00029 /*UNS8 canSend(CAN_HANDLE fd0, Message *m);*/ -00030 -00031 #include "canfestival.h" -00032 -00033 /* -00034 #define CAN_FIFO_LENGTH 100 -00035 -00036 #define DECLARE_A_CAN_FIFO \ -00037 static Message FIFO[CAN_FIFO_LENGTH];\ -00038 static int FIFO_First = 0;\ -00039 static int FIFO_Last = 0;\ -00040 \ -00041 static void PutInFIFO(Message *m)\ -00042 {\ -00043 FIFO[FIFO_Last++] = *m;\ -00044 FIFO_Last %= CAN_FIFO_LENGTH;\ -00045 }\ -00046 \ -00047 static void GetFromFIFO(Message *m)\ -00048 {\ -00049 *m = FIFO[FIFO_First++];\ -00050 FIFO_First %= CAN_FIFO_LENGTH;\ -00051 }\ -00052 \ -00053 static void TransmitMessage(CO_Data* d, UNS32 id)\ -00054 {\ -00055 Message m;\ -00056 GetFromFIFO(&m);\ -00057 canDispatch(d, &m);\ -00058 } -00059 */ -
#include "canfestival.h"
-Include dependency graph for TestMasterMicroMod.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Defines | |
#define | eprintf(...) printf (__VA_ARGS__) |
#define eprintf | -( | -... | -- | ) | -printf (__VA_ARGS__) | -
- -
-Definition at line 25 of file TestMasterMicroMod.h. -
-
00001 -00002 /* File generated by gen_cfile.py. Should not be modified. */ -00003 -00004 #include "TestMaster.h" -00005 -00006 /**************************************************************************/ -00007 /* Declaration of the mapped variables */ -00008 /**************************************************************************/ -00009 UNS8 MasterMap1 = 0x0; /* Mapped at index 0x2000, subindex 0x00 */ -00010 UNS8 MasterMap2 = 0x0; /* Mapped at index 0x2001, subindex 0x00 */ -00011 UNS8 MasterMap3 = 0x0; /* Mapped at index 0x2002, subindex 0x00 */ -00012 UNS8 MasterMap4 = 0x0; /* Mapped at index 0x2003, subindex 0x00 */ -00013 UNS8 MasterMap5 = 0x0; /* Mapped at index 0x2004, subindex 0x00 */ -00014 UNS8 MasterMap6 = 0x0; /* Mapped at index 0x2005, subindex 0x00 */ -00015 UNS8 MasterMap7 = 0x0; /* Mapped at index 0x2006, subindex 0x00 */ -00016 UNS8 MasterMap8 = 0x0; /* Mapped at index 0x2007, subindex 0x00 */ -00017 UNS8 MasterMap9 = 0x0; /* Mapped at index 0x2008, subindex 0x00 */ -00018 UNS32 MasterMap10 = 0x0; /* Mapped at index 0x2009, subindex 0x00 */ -00019 UNS16 MasterMap11 = 0x0; /* Mapped at index 0x200A, subindex 0x00 */ -00020 INTEGER16 MasterMap12 = 0x0; /* Mapped at index 0x200B, subindex 0x00 */ -00021 INTEGER16 MasterMap13 = 0x0; /* Mapped at index 0x200C, subindex 0x00 */ -00022 -00023 /**************************************************************************/ -00024 /* Declaration of the value range types */ -00025 /**************************************************************************/ -00026 -00027 UNS32 TestMaster_valueRangeTest (UNS8 typeValue, void * value) -00028 { -00029 switch (typeValue) { -00030 } -00031 return 0; -00032 } -00033 -00034 /**************************************************************************/ -00035 /* The node id */ -00036 /**************************************************************************/ -00037 /* node_id default value.*/ -00038 UNS8 TestMaster_bDeviceNodeId = 0x00; -00039 -00040 /**************************************************************************/ -00041 /* Array of message processing information */ -00042 -00043 const UNS8 TestMaster_iam_a_slave = 0; -00044 -00045 TIMER_HANDLE TestMaster_heartBeatTimers[1] = {TIMER_NONE,}; -00046 -00047 /* -00048 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -00049 -00050 OBJECT DICTIONARY -00051 -00052 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -00053 */ -00054 -00055 /* index 0x1000 : Device Type. */ -00056 UNS32 TestMaster_obj1000 = 0x12D; /* 301 */ -00057 subindex TestMaster_Index1000[] = -00058 { -00059 { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1000 } -00060 }; -00061 -00062 /* index 0x1001 : Error Register. */ -00063 UNS8 TestMaster_obj1001 = 0x0; /* 0 */ -00064 subindex TestMaster_Index1001[] = -00065 { -00066 { RO, uint8, sizeof (UNS8), (void*)&TestMaster_obj1001 } -00067 }; -00068 -00069 /* index 0x1005 : SYNC COB ID. */ -00070 UNS32 TestMaster_obj1005 = 0x40000080; /* 1073741952 */ -00071 ODCallback_t TestMaster_Index1005_callbacks[] = -00072 { -00073 NULL, -00074 }; -00075 subindex TestMaster_Index1005[] = -00076 { -00077 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1005 } -00078 }; -00079 -00080 /* index 0x1006 : Communication / Cycle Period. */ -00081 UNS32 TestMaster_obj1006 = 0xC350; /* 50000 */ -00082 ODCallback_t TestMaster_Index1006_callbacks[] = -00083 { -00084 NULL, -00085 }; -00086 subindex TestMaster_Index1006[] = -00087 { -00088 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1006 } -00089 }; -00090 -00091 /* index 0x1010 : Store parameters. */ -00092 UNS8 TestMaster_highestSubIndex_obj1010 = 4; /* number of subindex - 1*/ -00093 UNS32 TestMaster_obj1010_Save_All_Parameters = 0x0; /* 0 */ -00094 UNS32 TestMaster_obj1010_Save_Communication_Parameters = 0x0; /* 0 */ -00095 UNS32 TestMaster_obj1010_Save_Application_Parameters = 0x0; /* 0 */ -00096 UNS32 TestMaster_obj1010_Save_Manufacturer_Parameters = 0x0; /* 0 */ -00097 subindex TestMaster_Index1010[] = -00098 { -00099 { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1010 }, -00100 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1010_Save_All_Parameters }, -00101 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1010_Save_Communication_Parameters }, -00102 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1010_Save_Application_Parameters }, -00103 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1010_Save_Manufacturer_Parameters } -00104 }; -00105 -00106 /* index 0x1011 : Restore Default Parameters. */ -00107 UNS8 TestMaster_highestSubIndex_obj1011 = 4; /* number of subindex - 1*/ -00108 UNS32 TestMaster_obj1011_Restore_All_Default_Parameters = 0x0; /* 0 */ -00109 UNS32 TestMaster_obj1011_Restore_Communication_Default_Parameters = 0x0; /* 0 */ -00110 UNS32 TestMaster_obj1011_Restore_Application_Default_Parameters = 0x0; /* 0 */ -00111 UNS32 TestMaster_obj1011_Restore_Manufacturer_Default_Parameters = 0x0; /* 0 */ -00112 subindex TestMaster_Index1011[] = -00113 { -00114 { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1011 }, -00115 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1011_Restore_All_Default_Parameters }, -00116 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1011_Restore_Communication_Default_Parameters }, -00117 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1011_Restore_Application_Default_Parameters }, -00118 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1011_Restore_Manufacturer_Default_Parameters } -00119 }; -00120 -00121 /* index 0x1016 : Consumer Heartbeat Time. */ -00122 UNS8 TestMaster_highestSubIndex_obj1016 = 1; /* number of subindex - 1*/ -00123 UNS32 TestMaster_obj1016[] = -00124 { -00125 0x205DC /* 132572 */ -00126 }; -00127 subindex TestMaster_Index1016[] = -00128 { -00129 { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1016 }, -00130 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1016[0] } -00131 }; -00132 -00133 /* index 0x1017 : Producer Heartbeat Time */ -00134 UNS16 TestMaster_obj1017 = 0x0; /* 0 */ -00135 -00136 /* index 0x1018 : Identity. */ -00137 UNS8 TestMaster_highestSubIndex_obj1018 = 4; /* number of subindex - 1*/ -00138 UNS32 TestMaster_obj1018_Vendor_ID = 0x0; /* 0 */ -00139 UNS32 TestMaster_obj1018_Product_Code = 0x0; /* 0 */ -00140 UNS32 TestMaster_obj1018_Revision_Number = 0x0; /* 0 */ -00141 UNS32 TestMaster_obj1018_Serial_Number = 0x0; /* 0 */ -00142 subindex TestMaster_Index1018[] = -00143 { -00144 { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1018 }, -00145 { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1018_Vendor_ID }, -00146 { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1018_Product_Code }, -00147 { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1018_Revision_Number }, -00148 { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1018_Serial_Number } -00149 }; -00150 -00151 /* index 0x1280 : Client SDO 1 Parameter. */ -00152 UNS8 TestMaster_highestSubIndex_obj1280 = 3; /* number of subindex - 1*/ -00153 UNS32 TestMaster_obj1280_COB_ID_Client_to_Server_Transmit_SDO = 0x602; /* 1538 */ -00154 UNS32 TestMaster_obj1280_COB_ID_Server_to_Client_Receive_SDO = 0x582; /* 1410 */ -00155 INTEGER32 TestMaster_obj1280_Node_ID_of_the_SDO_Server = 0x2; /* 2 */ -00156 subindex TestMaster_Index1280[] = -00157 { -00158 { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1280 }, -00159 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1280_COB_ID_Client_to_Server_Transmit_SDO }, -00160 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1280_COB_ID_Server_to_Client_Receive_SDO }, -00161 { RW, int32, sizeof (INTEGER32), (void*)&TestMaster_obj1280_Node_ID_of_the_SDO_Server } -00162 }; -00163 -00164 /* index 0x1400 : Receive PDO 1 Parameter. */ -00165 UNS8 TestMaster_highestSubIndex_obj1400 = 5; /* number of subindex - 1*/ -00166 UNS32 TestMaster_obj1400_COB_ID_used_by_PDO = 0x200; /* 512 */ -00167 UNS8 TestMaster_obj1400_Transmission_Type = 0x1; /* 1 */ -00168 UNS16 TestMaster_obj1400_Inhibit_Time = 0x0; /* 0 */ -00169 UNS8 TestMaster_obj1400_Compatibility_Entry = 0x0; /* 0 */ -00170 UNS16 TestMaster_obj1400_Event_Timer = 0x0; /* 0 */ -00171 subindex TestMaster_Index1400[] = -00172 { -00173 { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1400 }, -00174 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1400_COB_ID_used_by_PDO }, -00175 { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1400_Transmission_Type }, -00176 { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1400_Inhibit_Time }, -00177 { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1400_Compatibility_Entry }, -00178 { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1400_Event_Timer } -00179 }; -00180 -00181 /* index 0x1401 : Receive PDO 2 Parameter. */ -00182 UNS8 TestMaster_highestSubIndex_obj1401 = 5; /* number of subindex - 1*/ -00183 UNS32 TestMaster_obj1401_COB_ID_used_by_PDO = 0x300; /* 768 */ -00184 UNS8 TestMaster_obj1401_Transmission_Type = 0x0; /* 0 */ -00185 UNS16 TestMaster_obj1401_Inhibit_Time = 0x0; /* 0 */ -00186 UNS8 TestMaster_obj1401_Compatibility_Entry = 0x0; /* 0 */ -00187 UNS16 TestMaster_obj1401_Event_Timer = 0x0; /* 0 */ -00188 subindex TestMaster_Index1401[] = -00189 { -00190 { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1401 }, -00191 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1401_COB_ID_used_by_PDO }, -00192 { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1401_Transmission_Type }, -00193 { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1401_Inhibit_Time }, -00194 { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1401_Compatibility_Entry }, -00195 { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1401_Event_Timer } -00196 }; -00197 -00198 /* index 0x1402 : Receive PDO 3 Parameter. */ -00199 UNS8 TestMaster_highestSubIndex_obj1402 = 5; /* number of subindex - 1*/ -00200 UNS32 TestMaster_obj1402_COB_ID_used_by_PDO = 0x401; /* 1025 */ -00201 UNS8 TestMaster_obj1402_Transmission_Type = 0x0; /* 0 */ -00202 UNS16 TestMaster_obj1402_Inhibit_Time = 0x0; /* 0 */ -00203 UNS8 TestMaster_obj1402_Compatibility_Entry = 0x0; /* 0 */ -00204 UNS16 TestMaster_obj1402_Event_Timer = 0x0; /* 0 */ -00205 subindex TestMaster_Index1402[] = -00206 { -00207 { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1402 }, -00208 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1402_COB_ID_used_by_PDO }, -00209 { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1402_Transmission_Type }, -00210 { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1402_Inhibit_Time }, -00211 { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1402_Compatibility_Entry }, -00212 { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1402_Event_Timer } -00213 }; -00214 -00215 /* index 0x1403 : Receive PDO 4 Parameter. */ -00216 UNS8 TestMaster_highestSubIndex_obj1403 = 5; /* number of subindex - 1*/ -00217 UNS32 TestMaster_obj1403_COB_ID_used_by_PDO = 0x482; /* 1154 */ -00218 UNS8 TestMaster_obj1403_Transmission_Type = 0x0; /* 0 */ -00219 UNS16 TestMaster_obj1403_Inhibit_Time = 0x0; /* 0 */ -00220 UNS8 TestMaster_obj1403_Compatibility_Entry = 0x0; /* 0 */ -00221 UNS16 TestMaster_obj1403_Event_Timer = 0x0; /* 0 */ -00222 subindex TestMaster_Index1403[] = -00223 { -00224 { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1403 }, -00225 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1403_COB_ID_used_by_PDO }, -00226 { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1403_Transmission_Type }, -00227 { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1403_Inhibit_Time }, -00228 { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1403_Compatibility_Entry }, -00229 { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1403_Event_Timer } -00230 }; -00231 -00232 /* index 0x1600 : Receive PDO 1 Mapping. */ -00233 UNS8 TestMaster_highestSubIndex_obj1600 = 10; /* number of subindex - 1*/ -00234 UNS32 TestMaster_obj1600[] = -00235 { -00236 0x20000001, /* 536870913 */ -00237 0x20010001, /* 536936449 */ -00238 0x20020001, /* 537001985 */ -00239 0x20030001, /* 537067521 */ -00240 0x20040001, /* 537133057 */ -00241 0x20050001, /* 537198593 */ -00242 0x20060001, /* 537264129 */ -00243 0x20070001, /* 537329665 */ -00244 0x20080008, /* 537395208 */ -00245 0x20090020 /* 537460768 */ -00246 }; -00247 subindex TestMaster_Index1600[] = -00248 { -00249 { RW, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1600 }, -00250 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[0] }, -00251 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[1] }, -00252 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[2] }, -00253 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[3] }, -00254 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[4] }, -00255 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[5] }, -00256 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[6] }, -00257 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[7] }, -00258 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[8] }, -00259 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[9] } -00260 }; -00261 -00262 /* index 0x1601 : Receive PDO 2 Mapping. */ -00263 UNS8 TestMaster_highestSubIndex_obj1601 = 1; /* number of subindex - 1*/ -00264 UNS32 TestMaster_obj1601[] = -00265 { -00266 0x200A0010 /* 537526288 */ -00267 }; -00268 subindex TestMaster_Index1601[] = -00269 { -00270 { RW, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1601 }, -00271 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1601[0] } -00272 }; -00273 -00274 /* index 0x1602 : Receive PDO 3 Mapping. */ -00275 UNS8 TestMaster_highestSubIndex_obj1602 = 1; /* number of subindex - 1*/ -00276 UNS32 TestMaster_obj1602[] = -00277 { -00278 0x200B0010 /* 537591824 */ -00279 }; -00280 subindex TestMaster_Index1602[] = -00281 { -00282 { RW, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1602 }, -00283 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1602[0] } -00284 }; -00285 -00286 /* index 0x1603 : Receive PDO 4 Mapping. */ -00287 UNS8 TestMaster_highestSubIndex_obj1603 = 1; /* number of subindex - 1*/ -00288 UNS32 TestMaster_obj1603[] = -00289 { -00290 0x200C0010 /* 537657360 */ -00291 }; -00292 subindex TestMaster_Index1603[] = -00293 { -00294 { RW, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1603 }, -00295 { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1603[0] } -00296 }; -00297 -00298 /* index 0x1F22 : Concise DCF. */ -00299 UNS8 TestMaster_highestSubIndex_obj1F22 = 2; /* number of subindex - 1*/ -00300 UNS8* TestMaster_obj1F22[] = -00301 { -00302 "", -00303 "\x01\x00\x00\x00\x17\x10\x00\x02\x00\x00\x00\xe8\x03" -00304 }; -00305 subindex TestMaster_Index1F22[] = -00306 { -00307 { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1F22 }, -00308 { RW, domain, 0, (void*)&TestMaster_obj1F22[0] }, -00309 { RW, domain, 13, (void*)&TestMaster_obj1F22[1] } -00310 }; -00311 -00312 /* index 0x2000 : Mapped variable MasterMap1 */ -00313 subindex TestMaster_Index2000[] = -00314 { -00315 { RW, boolean, sizeof (UNS8), (void*)&MasterMap1 } -00316 }; -00317 -00318 /* index 0x2001 : Mapped variable MasterMap2 */ -00319 subindex TestMaster_Index2001[] = -00320 { -00321 { RW, boolean, sizeof (UNS8), (void*)&MasterMap2 } -00322 }; -00323 -00324 /* index 0x2002 : Mapped variable MasterMap3 */ -00325 subindex TestMaster_Index2002[] = -00326 { -00327 { RW, boolean, sizeof (UNS8), (void*)&MasterMap3 } -00328 }; -00329 -00330 /* index 0x2003 : Mapped variable MasterMap4 */ -00331 subindex TestMaster_Index2003[] = -00332 { -00333 { RW, boolean, sizeof (UNS8), (void*)&MasterMap4 } -00334 }; -00335 -00336 /* index 0x2004 : Mapped variable MasterMap5 */ -00337 subindex TestMaster_Index2004[] = -00338 { -00339 { RW, boolean, sizeof (UNS8), (void*)&MasterMap5 } -00340 }; -00341 -00342 /* index 0x2005 : Mapped variable MasterMap6 */ -00343 subindex TestMaster_Index2005[] = -00344 { -00345 { RW, boolean, sizeof (UNS8), (void*)&MasterMap6 } -00346 }; -00347 -00348 /* index 0x2006 : Mapped variable MasterMap7 */ -00349 subindex TestMaster_Index2006[] = -00350 { -00351 { RW, boolean, sizeof (UNS8), (void*)&MasterMap7 } -00352 }; -00353 -00354 /* index 0x2007 : Mapped variable MasterMap8 */ -00355 subindex TestMaster_Index2007[] = -00356 { -00357 { RW, boolean, sizeof (UNS8), (void*)&MasterMap8 } -00358 }; -00359 -00360 /* index 0x2008 : Mapped variable MasterMap9 */ -00361 subindex TestMaster_Index2008[] = -00362 { -00363 { RW, uint8, sizeof (UNS8), (void*)&MasterMap9 } -00364 }; -00365 -00366 /* index 0x2009 : Mapped variable MasterMap10 */ -00367 subindex TestMaster_Index2009[] = -00368 { -00369 { RW, uint32, sizeof (UNS32), (void*)&MasterMap10 } -00370 }; -00371 -00372 /* index 0x200A : Mapped variable MasterMap11 */ -00373 subindex TestMaster_Index200A[] = -00374 { -00375 { RW, uint16, sizeof (UNS16), (void*)&MasterMap11 } -00376 }; -00377 -00378 /* index 0x200B : Mapped variable MasterMap12 */ -00379 subindex TestMaster_Index200B[] = -00380 { -00381 { RW, int16, sizeof (INTEGER16), (void*)&MasterMap12 } -00382 }; -00383 -00384 /* index 0x200C : Mapped variable MasterMap13 */ -00385 subindex TestMaster_Index200C[] = -00386 { -00387 { RW, int16, sizeof (INTEGER16), (void*)&MasterMap13 } -00388 }; -00389 -00390 const indextable TestMaster_objdict[] = -00391 { -00392 { (subindex*)TestMaster_Index1000,sizeof(TestMaster_Index1000)/sizeof(TestMaster_Index1000[0]), 0x1000}, -00393 { (subindex*)TestMaster_Index1001,sizeof(TestMaster_Index1001)/sizeof(TestMaster_Index1001[0]), 0x1001}, -00394 { (subindex*)TestMaster_Index1005,sizeof(TestMaster_Index1005)/sizeof(TestMaster_Index1005[0]), 0x1005}, -00395 { (subindex*)TestMaster_Index1006,sizeof(TestMaster_Index1006)/sizeof(TestMaster_Index1006[0]), 0x1006}, -00396 { (subindex*)TestMaster_Index1010,sizeof(TestMaster_Index1010)/sizeof(TestMaster_Index1010[0]), 0x1010}, -00397 { (subindex*)TestMaster_Index1011,sizeof(TestMaster_Index1011)/sizeof(TestMaster_Index1011[0]), 0x1011}, -00398 { (subindex*)TestMaster_Index1016,sizeof(TestMaster_Index1016)/sizeof(TestMaster_Index1016[0]), 0x1016}, -00399 { (subindex*)TestMaster_Index1018,sizeof(TestMaster_Index1018)/sizeof(TestMaster_Index1018[0]), 0x1018}, -00400 { (subindex*)TestMaster_Index1280,sizeof(TestMaster_Index1280)/sizeof(TestMaster_Index1280[0]), 0x1280}, -00401 { (subindex*)TestMaster_Index1400,sizeof(TestMaster_Index1400)/sizeof(TestMaster_Index1400[0]), 0x1400}, -00402 { (subindex*)TestMaster_Index1401,sizeof(TestMaster_Index1401)/sizeof(TestMaster_Index1401[0]), 0x1401}, -00403 { (subindex*)TestMaster_Index1402,sizeof(TestMaster_Index1402)/sizeof(TestMaster_Index1402[0]), 0x1402}, -00404 { (subindex*)TestMaster_Index1403,sizeof(TestMaster_Index1403)/sizeof(TestMaster_Index1403[0]), 0x1403}, -00405 { (subindex*)TestMaster_Index1600,sizeof(TestMaster_Index1600)/sizeof(TestMaster_Index1600[0]), 0x1600}, -00406 { (subindex*)TestMaster_Index1601,sizeof(TestMaster_Index1601)/sizeof(TestMaster_Index1601[0]), 0x1601}, -00407 { (subindex*)TestMaster_Index1602,sizeof(TestMaster_Index1602)/sizeof(TestMaster_Index1602[0]), 0x1602}, -00408 { (subindex*)TestMaster_Index1603,sizeof(TestMaster_Index1603)/sizeof(TestMaster_Index1603[0]), 0x1603}, -00409 { (subindex*)TestMaster_Index1F22,sizeof(TestMaster_Index1F22)/sizeof(TestMaster_Index1F22[0]), 0x1F22}, -00410 { (subindex*)TestMaster_Index2000,sizeof(TestMaster_Index2000)/sizeof(TestMaster_Index2000[0]), 0x2000}, -00411 { (subindex*)TestMaster_Index2001,sizeof(TestMaster_Index2001)/sizeof(TestMaster_Index2001[0]), 0x2001}, -00412 { (subindex*)TestMaster_Index2002,sizeof(TestMaster_Index2002)/sizeof(TestMaster_Index2002[0]), 0x2002}, -00413 { (subindex*)TestMaster_Index2003,sizeof(TestMaster_Index2003)/sizeof(TestMaster_Index2003[0]), 0x2003}, -00414 { (subindex*)TestMaster_Index2004,sizeof(TestMaster_Index2004)/sizeof(TestMaster_Index2004[0]), 0x2004}, -00415 { (subindex*)TestMaster_Index2005,sizeof(TestMaster_Index2005)/sizeof(TestMaster_Index2005[0]), 0x2005}, -00416 { (subindex*)TestMaster_Index2006,sizeof(TestMaster_Index2006)/sizeof(TestMaster_Index2006[0]), 0x2006}, -00417 { (subindex*)TestMaster_Index2007,sizeof(TestMaster_Index2007)/sizeof(TestMaster_Index2007[0]), 0x2007}, -00418 { (subindex*)TestMaster_Index2008,sizeof(TestMaster_Index2008)/sizeof(TestMaster_Index2008[0]), 0x2008}, -00419 { (subindex*)TestMaster_Index2009,sizeof(TestMaster_Index2009)/sizeof(TestMaster_Index2009[0]), 0x2009}, -00420 { (subindex*)TestMaster_Index200A,sizeof(TestMaster_Index200A)/sizeof(TestMaster_Index200A[0]), 0x200A}, -00421 { (subindex*)TestMaster_Index200B,sizeof(TestMaster_Index200B)/sizeof(TestMaster_Index200B[0]), 0x200B}, -00422 { (subindex*)TestMaster_Index200C,sizeof(TestMaster_Index200C)/sizeof(TestMaster_Index200C[0]), 0x200C}, -00423 }; -00424 -00425 const indextable * TestMaster_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks) -00426 { -00427 int i; -00428 *callbacks = NULL; -00429 switch(wIndex){ -00430 case 0x1000: i = 0;break; -00431 case 0x1001: i = 1;break; -00432 case 0x1005: i = 2;*callbacks = TestMaster_Index1005_callbacks; break; -00433 case 0x1006: i = 3;*callbacks = TestMaster_Index1006_callbacks; break; -00434 case 0x1010: i = 4;break; -00435 case 0x1011: i = 5;break; -00436 case 0x1016: i = 6;break; -00437 case 0x1018: i = 7;break; -00438 case 0x1280: i = 8;break; -00439 case 0x1400: i = 9;break; -00440 case 0x1401: i = 10;break; -00441 case 0x1402: i = 11;break; -00442 case 0x1403: i = 12;break; -00443 case 0x1600: i = 13;break; -00444 case 0x1601: i = 14;break; -00445 case 0x1602: i = 15;break; -00446 case 0x1603: i = 16;break; -00447 case 0x1F22: i = 17;break; -00448 case 0x2000: i = 18;break; -00449 case 0x2001: i = 19;break; -00450 case 0x2002: i = 20;break; -00451 case 0x2003: i = 21;break; -00452 case 0x2004: i = 22;break; -00453 case 0x2005: i = 23;break; -00454 case 0x2006: i = 24;break; -00455 case 0x2007: i = 25;break; -00456 case 0x2008: i = 26;break; -00457 case 0x2009: i = 27;break; -00458 case 0x200A: i = 28;break; -00459 case 0x200B: i = 29;break; -00460 case 0x200C: i = 30;break; -00461 default: -00462 *errorCode = OD_NO_SUCH_OBJECT; -00463 return NULL; -00464 } -00465 *errorCode = OD_SUCCESSFUL; -00466 return &TestMaster_objdict[i]; -00467 } -00468 -00469 /* -00470 * To count at which received SYNC a PDO must be sent. -00471 * Even if no pdoTransmit are defined, at least one entry is computed -00472 * for compilations issues. -00473 */ -00474 s_PDO_status TestMaster_PDO_status[1] = {s_PDO_staus_Initializer}; -00475 -00476 quick_index TestMaster_firstIndex = { -00477 0, /* SDO_SVR */ -00478 8, /* SDO_CLT */ -00479 9, /* PDO_RCV */ -00480 13, /* PDO_RCV_MAP */ -00481 0, /* PDO_TRS */ -00482 0 /* PDO_TRS_MAP */ -00483 }; -00484 -00485 quick_index TestMaster_lastIndex = { -00486 0, /* SDO_SVR */ -00487 8, /* SDO_CLT */ -00488 12, /* PDO_RCV */ -00489 16, /* PDO_RCV_MAP */ -00490 0, /* PDO_TRS */ -00491 0 /* PDO_TRS_MAP */ -00492 }; -00493 -00494 UNS16 TestMaster_ObjdictSize = sizeof(TestMaster_objdict)/sizeof(TestMaster_objdict[0]); -00495 -00496 CO_Data TestMaster_Data = CANOPEN_NODE_DATA_INITIALIZER(TestMaster); -00497 -
#include "TestMaster.h"
-Include dependency graph for TestMaster.c:
-Go to the source code of this file.
const indextable* TestMaster_scanIndexOD | -( | -UNS16 | -wIndex, | -|
- | - | UNS32 * | -errorCode, | -|
- | - | ODCallback_t ** | -callbacks | - |
- | ) | -- |
- -
-Definition at line 425 of file TestMaster.c. -
UNS32 TestMaster_valueRangeTest | -( | -UNS8 | -typeValue, | -|
- | - | void * | -value | - |
- | ) | -- |
- -
-Definition at line 27 of file TestMaster.c. -
-
UNS8 MasterMap1 = 0x0 | -
UNS32 MasterMap10 = 0x0 | -
UNS16 MasterMap11 = 0x0 | -
INTEGER16 MasterMap12 = 0x0 | -
INTEGER16 MasterMap13 = 0x0 | -
UNS8 MasterMap2 = 0x0 | -
UNS8 MasterMap3 = 0x0 | -
UNS8 MasterMap4 = 0x0 | -
UNS8 MasterMap5 = 0x0 | -
UNS8 MasterMap6 = 0x0 | -
UNS8 MasterMap7 = 0x0 | -
UNS8 MasterMap8 = 0x0 | -
UNS8 MasterMap9 = 0x0 | -
UNS8 TestMaster_bDeviceNodeId = 0x00 | -
- -
-Definition at line 38 of file TestMaster.c. -
CO_Data TestMaster_Data = CANOPEN_NODE_DATA_INITIALIZER(TestMaster) | -
- -
-Definition at line 496 of file TestMaster.c. -
-Referenced by InitNodes(), main(), TestMaster_initialisation(), TestMaster_post_TPDO(), and TestMaster_preOperational(). -
quick_index TestMaster_firstIndex | -
-Initial value:
{ - 0, - 8, - 9, - 13, - 0, - 0 -} -
-Definition at line 476 of file TestMaster.c. -
TIMER_HANDLE TestMaster_heartBeatTimers[1] = {TIMER_NONE,} | -
- -
-Definition at line 45 of file TestMaster.c. -
UNS8 TestMaster_highestSubIndex_obj1010 = 4 | -
- -
-Definition at line 92 of file TestMaster.c. -
UNS8 TestMaster_highestSubIndex_obj1011 = 4 | -
- -
-Definition at line 107 of file TestMaster.c. -
UNS8 TestMaster_highestSubIndex_obj1016 = 1 | -
- -
-Definition at line 122 of file TestMaster.c. -
UNS8 TestMaster_highestSubIndex_obj1018 = 4 | -
- -
-Definition at line 137 of file TestMaster.c. -
UNS8 TestMaster_highestSubIndex_obj1280 = 3 | -
- -
-Definition at line 152 of file TestMaster.c. -
UNS8 TestMaster_highestSubIndex_obj1400 = 5 | -
- -
-Definition at line 165 of file TestMaster.c. -
UNS8 TestMaster_highestSubIndex_obj1401 = 5 | -
- -
-Definition at line 182 of file TestMaster.c. -
UNS8 TestMaster_highestSubIndex_obj1402 = 5 | -
- -
-Definition at line 199 of file TestMaster.c. -
UNS8 TestMaster_highestSubIndex_obj1403 = 5 | -
- -
-Definition at line 216 of file TestMaster.c. -
UNS8 TestMaster_highestSubIndex_obj1600 = 10 | -
- -
-Definition at line 233 of file TestMaster.c. -
UNS8 TestMaster_highestSubIndex_obj1601 = 1 | -
- -
-Definition at line 263 of file TestMaster.c. -
UNS8 TestMaster_highestSubIndex_obj1602 = 1 | -
- -
-Definition at line 275 of file TestMaster.c. -
UNS8 TestMaster_highestSubIndex_obj1603 = 1 | -
- -
-Definition at line 287 of file TestMaster.c. -
UNS8 TestMaster_highestSubIndex_obj1F22 = 2 | -
- -
-Definition at line 299 of file TestMaster.c. -
const UNS8 TestMaster_iam_a_slave = 0 | -
- -
-Definition at line 43 of file TestMaster.c. -
subindex TestMaster_Index1000[] | -
-Initial value:
- { - { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1000 } - } -
-Definition at line 57 of file TestMaster.c. -
subindex TestMaster_Index1001[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_obj1001 } - } -
-Definition at line 64 of file TestMaster.c. -
subindex TestMaster_Index1005[] | -
-Initial value:
- { - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1005 } - } -
-Definition at line 75 of file TestMaster.c. -
ODCallback_t TestMaster_Index1005_callbacks[] | -
-Initial value:
- { - NULL, - } -
-Definition at line 71 of file TestMaster.c. -
-Referenced by TestMaster_scanIndexOD(). -
subindex TestMaster_Index1006[] | -
-Initial value:
- { - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1006 } - } -
-Definition at line 86 of file TestMaster.c. -
ODCallback_t TestMaster_Index1006_callbacks[] | -
-Initial value:
- { - NULL, - } -
-Definition at line 82 of file TestMaster.c. -
-Referenced by TestMaster_scanIndexOD(). -
subindex TestMaster_Index1010[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1010 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1010_Save_All_Parameters }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1010_Save_Communication_Parameters }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1010_Save_Application_Parameters }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1010_Save_Manufacturer_Parameters } - } -
-Definition at line 97 of file TestMaster.c. -
subindex TestMaster_Index1011[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1011 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1011_Restore_All_Default_Parameters }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1011_Restore_Communication_Default_Parameters }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1011_Restore_Application_Default_Parameters }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1011_Restore_Manufacturer_Default_Parameters } - } -
-Definition at line 112 of file TestMaster.c. -
subindex TestMaster_Index1016[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1016 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1016[0] } - } -
-Definition at line 127 of file TestMaster.c. -
subindex TestMaster_Index1018[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1018 }, - { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1018_Vendor_ID }, - { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1018_Product_Code }, - { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1018_Revision_Number }, - { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1018_Serial_Number } - } -
-Definition at line 142 of file TestMaster.c. -
subindex TestMaster_Index1280[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1280 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1280_COB_ID_Client_to_Server_Transmit_SDO }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1280_COB_ID_Server_to_Client_Receive_SDO }, - { RW, int32, sizeof (INTEGER32), (void*)&TestMaster_obj1280_Node_ID_of_the_SDO_Server } - } -
-Definition at line 156 of file TestMaster.c. -
subindex TestMaster_Index1400[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1400 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1400_COB_ID_used_by_PDO }, - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1400_Transmission_Type }, - { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1400_Inhibit_Time }, - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1400_Compatibility_Entry }, - { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1400_Event_Timer } - } -
-Definition at line 171 of file TestMaster.c. -
subindex TestMaster_Index1401[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1401 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1401_COB_ID_used_by_PDO }, - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1401_Transmission_Type }, - { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1401_Inhibit_Time }, - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1401_Compatibility_Entry }, - { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1401_Event_Timer } - } -
-Definition at line 188 of file TestMaster.c. -
subindex TestMaster_Index1402[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1402 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1402_COB_ID_used_by_PDO }, - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1402_Transmission_Type }, - { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1402_Inhibit_Time }, - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1402_Compatibility_Entry }, - { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1402_Event_Timer } - } -
-Definition at line 205 of file TestMaster.c. -
subindex TestMaster_Index1403[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1403 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1403_COB_ID_used_by_PDO }, - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1403_Transmission_Type }, - { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1403_Inhibit_Time }, - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_obj1403_Compatibility_Entry }, - { RW, uint16, sizeof (UNS16), (void*)&TestMaster_obj1403_Event_Timer } - } -
-Definition at line 222 of file TestMaster.c. -
subindex TestMaster_Index1600[] | -
-Initial value:
- { - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1600 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[0] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[1] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[2] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[3] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[4] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[5] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[6] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[7] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[8] }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1600[9] } - } -
-Definition at line 247 of file TestMaster.c. -
subindex TestMaster_Index1601[] | -
-Initial value:
- { - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1601 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1601[0] } - } -
-Definition at line 268 of file TestMaster.c. -
subindex TestMaster_Index1602[] | -
-Initial value:
- { - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1602 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1602[0] } - } -
-Definition at line 280 of file TestMaster.c. -
subindex TestMaster_Index1603[] | -
-Initial value:
- { - { RW, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1603 }, - { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1603[0] } - } -
-Definition at line 292 of file TestMaster.c. -
subindex TestMaster_Index1F22[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1F22 }, - { RW, domain, 0, (void*)&TestMaster_obj1F22[0] }, - { RW, domain, 13, (void*)&TestMaster_obj1F22[1] } - } -
-Definition at line 305 of file TestMaster.c. -
subindex TestMaster_Index2000[] | -
-Initial value:
- { - { RW, boolean, sizeof (UNS8), (void*)&MasterMap1 } - } -
-Definition at line 313 of file TestMaster.c. -
subindex TestMaster_Index2001[] | -
-Initial value:
- { - { RW, boolean, sizeof (UNS8), (void*)&MasterMap2 } - } -
-Definition at line 319 of file TestMaster.c. -
subindex TestMaster_Index2002[] | -
-Initial value:
- { - { RW, boolean, sizeof (UNS8), (void*)&MasterMap3 } - } -
-Definition at line 325 of file TestMaster.c. -
subindex TestMaster_Index2003[] | -
-Initial value:
- { - { RW, boolean, sizeof (UNS8), (void*)&MasterMap4 } - } -
-Definition at line 331 of file TestMaster.c. -
subindex TestMaster_Index2004[] | -
-Initial value:
- { - { RW, boolean, sizeof (UNS8), (void*)&MasterMap5 } - } -
-Definition at line 337 of file TestMaster.c. -
subindex TestMaster_Index2005[] | -
-Initial value:
- { - { RW, boolean, sizeof (UNS8), (void*)&MasterMap6 } - } -
-Definition at line 343 of file TestMaster.c. -
subindex TestMaster_Index2006[] | -
-Initial value:
- { - { RW, boolean, sizeof (UNS8), (void*)&MasterMap7 } - } -
-Definition at line 349 of file TestMaster.c. -
subindex TestMaster_Index2007[] | -
-Initial value:
- { - { RW, boolean, sizeof (UNS8), (void*)&MasterMap8 } - } -
-Definition at line 355 of file TestMaster.c. -
subindex TestMaster_Index2008[] | -
-Initial value:
- { - { RW, uint8, sizeof (UNS8), (void*)&MasterMap9 } - } -
-Definition at line 361 of file TestMaster.c. -
subindex TestMaster_Index2009[] | -
-Initial value:
- { - { RW, uint32, sizeof (UNS32), (void*)&MasterMap10 } - } -
-Definition at line 367 of file TestMaster.c. -
subindex TestMaster_Index200A[] | -
-Initial value:
- { - { RW, uint16, sizeof (UNS16), (void*)&MasterMap11 } - } -
-Definition at line 373 of file TestMaster.c. -
subindex TestMaster_Index200B[] | -
-Initial value:
- { - { RW, int16, sizeof (INTEGER16), (void*)&MasterMap12 } - } -
-Definition at line 379 of file TestMaster.c. -
subindex TestMaster_Index200C[] | -
-Initial value:
- { - { RW, int16, sizeof (INTEGER16), (void*)&MasterMap13 } - } -
-Definition at line 385 of file TestMaster.c. -
quick_index TestMaster_lastIndex | -
-Initial value:
{ - 0, - 8, - 12, - 16, - 0, - 0 -} -
-Definition at line 485 of file TestMaster.c. -
UNS32 TestMaster_obj1000 = 0x12D | -
- -
-Definition at line 56 of file TestMaster.c. -
UNS8 TestMaster_obj1001 = 0x0 | -
- -
-Definition at line 63 of file TestMaster.c. -
UNS32 TestMaster_obj1005 = 0x40000080 | -
- -
-Definition at line 70 of file TestMaster.c. -
UNS32 TestMaster_obj1006 = 0xC350 | -
- -
-Definition at line 81 of file TestMaster.c. -
UNS32 TestMaster_obj1010_Save_All_Parameters = 0x0 | -
- -
-Definition at line 93 of file TestMaster.c. -
UNS32 TestMaster_obj1010_Save_Application_Parameters = 0x0 | -
- -
-Definition at line 95 of file TestMaster.c. -
UNS32 TestMaster_obj1010_Save_Communication_Parameters = 0x0 | -
- -
-Definition at line 94 of file TestMaster.c. -
UNS32 TestMaster_obj1010_Save_Manufacturer_Parameters = 0x0 | -
- -
-Definition at line 96 of file TestMaster.c. -
UNS32 TestMaster_obj1011_Restore_All_Default_Parameters = 0x0 | -
- -
-Definition at line 108 of file TestMaster.c. -
UNS32 TestMaster_obj1011_Restore_Application_Default_Parameters = 0x0 | -
- -
-Definition at line 110 of file TestMaster.c. -
UNS32 TestMaster_obj1011_Restore_Communication_Default_Parameters = 0x0 | -
- -
-Definition at line 109 of file TestMaster.c. -
UNS32 TestMaster_obj1011_Restore_Manufacturer_Default_Parameters = 0x0 | -
- -
-Definition at line 111 of file TestMaster.c. -
UNS32 TestMaster_obj1016[] | -
UNS16 TestMaster_obj1017 = 0x0 | -
- -
-Definition at line 134 of file TestMaster.c. -
UNS32 TestMaster_obj1018_Product_Code = 0x0 | -
- -
-Definition at line 139 of file TestMaster.c. -
UNS32 TestMaster_obj1018_Revision_Number = 0x0 | -
- -
-Definition at line 140 of file TestMaster.c. -
UNS32 TestMaster_obj1018_Serial_Number = 0x0 | -
- -
-Definition at line 141 of file TestMaster.c. -
UNS32 TestMaster_obj1018_Vendor_ID = 0x0 | -
- -
-Definition at line 138 of file TestMaster.c. -
UNS32 TestMaster_obj1280_COB_ID_Client_to_Server_Transmit_SDO = 0x602 | -
- -
-Definition at line 153 of file TestMaster.c. -
UNS32 TestMaster_obj1280_COB_ID_Server_to_Client_Receive_SDO = 0x582 | -
- -
-Definition at line 154 of file TestMaster.c. -
INTEGER32 TestMaster_obj1280_Node_ID_of_the_SDO_Server = 0x2 | -
- -
-Definition at line 155 of file TestMaster.c. -
UNS32 TestMaster_obj1400_COB_ID_used_by_PDO = 0x200 | -
- -
-Definition at line 166 of file TestMaster.c. -
UNS8 TestMaster_obj1400_Compatibility_Entry = 0x0 | -
- -
-Definition at line 169 of file TestMaster.c. -
UNS16 TestMaster_obj1400_Event_Timer = 0x0 | -
- -
-Definition at line 170 of file TestMaster.c. -
UNS16 TestMaster_obj1400_Inhibit_Time = 0x0 | -
- -
-Definition at line 168 of file TestMaster.c. -
UNS8 TestMaster_obj1400_Transmission_Type = 0x1 | -
- -
-Definition at line 167 of file TestMaster.c. -
UNS32 TestMaster_obj1401_COB_ID_used_by_PDO = 0x300 | -
- -
-Definition at line 183 of file TestMaster.c. -
UNS8 TestMaster_obj1401_Compatibility_Entry = 0x0 | -
- -
-Definition at line 186 of file TestMaster.c. -
UNS16 TestMaster_obj1401_Event_Timer = 0x0 | -
- -
-Definition at line 187 of file TestMaster.c. -
UNS16 TestMaster_obj1401_Inhibit_Time = 0x0 | -
- -
-Definition at line 185 of file TestMaster.c. -
UNS8 TestMaster_obj1401_Transmission_Type = 0x0 | -
- -
-Definition at line 184 of file TestMaster.c. -
UNS32 TestMaster_obj1402_COB_ID_used_by_PDO = 0x401 | -
- -
-Definition at line 200 of file TestMaster.c. -
UNS8 TestMaster_obj1402_Compatibility_Entry = 0x0 | -
- -
-Definition at line 203 of file TestMaster.c. -
UNS16 TestMaster_obj1402_Event_Timer = 0x0 | -
- -
-Definition at line 204 of file TestMaster.c. -
UNS16 TestMaster_obj1402_Inhibit_Time = 0x0 | -
- -
-Definition at line 202 of file TestMaster.c. -
UNS8 TestMaster_obj1402_Transmission_Type = 0x0 | -
- -
-Definition at line 201 of file TestMaster.c. -
UNS32 TestMaster_obj1403_COB_ID_used_by_PDO = 0x482 | -
- -
-Definition at line 217 of file TestMaster.c. -
UNS8 TestMaster_obj1403_Compatibility_Entry = 0x0 | -
- -
-Definition at line 220 of file TestMaster.c. -
UNS16 TestMaster_obj1403_Event_Timer = 0x0 | -
- -
-Definition at line 221 of file TestMaster.c. -
UNS16 TestMaster_obj1403_Inhibit_Time = 0x0 | -
- -
-Definition at line 219 of file TestMaster.c. -
UNS8 TestMaster_obj1403_Transmission_Type = 0x0 | -
- -
-Definition at line 218 of file TestMaster.c. -
UNS32 TestMaster_obj1600[] | -
-Initial value:
- { - 0x20000001, - 0x20010001, - 0x20020001, - 0x20030001, - 0x20040001, - 0x20050001, - 0x20060001, - 0x20070001, - 0x20080008, - 0x20090020 - } -
-Definition at line 234 of file TestMaster.c. -
UNS32 TestMaster_obj1601[] | -
UNS32 TestMaster_obj1602[] | -
UNS32 TestMaster_obj1603[] | -
UNS8* TestMaster_obj1F22[] | -
-Initial value:
- { - "", - "\x01\x00\x00\x00\x17\x10\x00\x02\x00\x00\x00\xe8\x03" - } -
-Definition at line 300 of file TestMaster.c. -
const indextable TestMaster_objdict[] | -
UNS16 TestMaster_ObjdictSize = sizeof(TestMaster_objdict)/sizeof(TestMaster_objdict[0]) | -
- -
-Definition at line 494 of file TestMaster.c. -
s_PDO_status TestMaster_PDO_status[1] = {s_PDO_staus_Initializer} | -
- -
-Definition at line 474 of file TestMaster.c. -
-
00001 -00002 /* File generated by gen_cfile.py. Should not be modified. */ -00003 -00004 #ifndef TESTMASTER_H -00005 #define TESTMASTER_H -00006 -00007 #include "data.h" -00008 -00009 /* Prototypes of function provided by object dictionnary */ -00010 UNS32 TestMaster_valueRangeTest (UNS8 typeValue, void * value); -00011 const indextable * TestMaster_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks); -00012 -00013 /* Master node data struct */ -00014 extern CO_Data TestMaster_Data; -00015 extern UNS8 MasterMap1; /* Mapped at index 0x2000, subindex 0x00*/ -00016 extern UNS8 MasterMap2; /* Mapped at index 0x2001, subindex 0x00*/ -00017 extern UNS8 MasterMap3; /* Mapped at index 0x2002, subindex 0x00*/ -00018 extern UNS8 MasterMap4; /* Mapped at index 0x2003, subindex 0x00*/ -00019 extern UNS8 MasterMap5; /* Mapped at index 0x2004, subindex 0x00*/ -00020 extern UNS8 MasterMap6; /* Mapped at index 0x2005, subindex 0x00*/ -00021 extern UNS8 MasterMap7; /* Mapped at index 0x2006, subindex 0x00*/ -00022 extern UNS8 MasterMap8; /* Mapped at index 0x2007, subindex 0x00*/ -00023 extern UNS8 MasterMap9; /* Mapped at index 0x2008, subindex 0x00*/ -00024 extern UNS32 MasterMap10; /* Mapped at index 0x2009, subindex 0x00*/ -00025 extern UNS16 MasterMap11; /* Mapped at index 0x200A, subindex 0x00*/ -00026 extern INTEGER16 MasterMap12; /* Mapped at index 0x200B, subindex 0x00*/ -00027 extern INTEGER16 MasterMap13; /* Mapped at index 0x200C, subindex 0x00*/ -00028 -00029 #endif // TESTMASTER_H -
#include "data.h"
-Include dependency graph for TestMaster.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Functions | |
UNS32 | TestMaster_valueRangeTest (UNS8 typeValue, void *value) |
const indextable * | TestMaster_scanIndexOD (UNS16 wIndex, UNS32 *errorCode, ODCallback_t **callbacks) |
Variables | |
CO_Data | TestMaster_Data |
UNS8 | MasterMap1 |
UNS8 | MasterMap2 |
UNS8 | MasterMap3 |
UNS8 | MasterMap4 |
UNS8 | MasterMap5 |
UNS8 | MasterMap6 |
UNS8 | MasterMap7 |
UNS8 | MasterMap8 |
UNS8 | MasterMap9 |
UNS32 | MasterMap10 |
UNS16 | MasterMap11 |
INTEGER16 | MasterMap12 |
INTEGER16 | MasterMap13 |
const indextable* TestMaster_scanIndexOD | -( | -UNS16 | -wIndex, | -|
- | - | UNS32 * | -errorCode, | -|
- | - | ODCallback_t ** | -callbacks | - |
- | ) | -- |
- -
-Definition at line 425 of file TestMaster.c. -
UNS32 TestMaster_valueRangeTest | -( | -UNS8 | -typeValue, | -|
- | - | void * | -value | - |
- | ) | -- |
- -
-Definition at line 27 of file TestMaster.c. -
-
UNS8 MasterMap1 | -
UNS32 MasterMap10 | -
UNS16 MasterMap11 | -
INTEGER16 MasterMap12 | -
INTEGER16 MasterMap13 | -
UNS8 MasterMap2 | -
UNS8 MasterMap3 | -
UNS8 MasterMap4 | -
UNS8 MasterMap5 | -
UNS8 MasterMap6 | -
UNS8 MasterMap7 | -
UNS8 MasterMap8 | -
UNS8 MasterMap9 | -
CO_Data TestMaster_Data | -
- -
-Definition at line 496 of file TestMaster.c. -
-
00001 /* from http://www.pwilson.net/getopt.html */ -00002 -00003 /* Getopt for GNU. -00004 NOTE: getopt is now part of the C library, so if you don't know what -00005 "Keep this file name-space clean" means, talk to drepper@gnu.org -00006 before changing it! -00007 Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001 -00008 Free Software Foundation, Inc. -00009 This file is part of the GNU C Library. -00010 -00011 The GNU C Library is free software; you can redistribute it and/or -00012 modify it under the terms of the GNU Lesser General Public -00013 License as published by the Free Software Foundation; either -00014 version 2.1 of the License, or (at your option) any later version. -00015 -00016 The GNU C Library is distributed in the hope that it will be useful, -00017 but WITHOUT ANY WARRANTY; without even the implied warranty of -00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00019 Lesser General Public License for more details. -00020 -00021 You should have received a copy of the GNU Lesser General Public -00022 License along with the GNU C Library; if not, write to the Free -00023 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -00024 02111-1307 USA. */ -00025 -00026 /* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>. -00027 Ditto for AIX 3.2 and <stdlib.h>. */ -00028 #ifndef _NO_PROTO -00029 # define _NO_PROTO -00030 #endif -00031 -00032 #ifdef HAVE_CONFIG_H -00033 # include <config.h> -00034 #endif -00035 -00036 #if !defined __STDC__ || !__STDC__ -00037 /* This is a separate conditional since some stdc systems -00038 reject `defined (const)'. */ -00039 # ifndef const -00040 # define const -00041 # endif -00042 #endif -00043 -00044 #include <stdio.h> -00045 -00046 /* Comment out all this code if we are using the GNU C Library, and are not -00047 actually compiling the library itself. This code is part of the GNU C -00048 Library, but also included in many other GNU distributions. Compiling -00049 and linking in this code is a waste when using the GNU C library -00050 (especially if it is a shared library). Rather than having every GNU -00051 program understand `configure --with-gnu-libc' and omit the object files, -00052 it is simpler to just do this in the source for each such file. */ -00053 -00054 #define GETOPT_INTERFACE_VERSION 2 -00055 #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 -00056 # include <gnu-versions.h> -00057 # if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -00058 # define ELIDE_CODE -00059 # endif -00060 #endif -00061 -00062 #ifndef ELIDE_CODE -00063 -00064 -00065 /* This needs to come after some library #include -00066 to get __GNU_LIBRARY__ defined. */ -00067 #ifdef __GNU_LIBRARY__ -00068 /* Don't include stdlib.h for non-GNU C libraries because some of them -00069 contain conflicting prototypes for getopt. */ -00070 # include <stdlib.h> -00071 # include <unistd.h> -00072 #endif /* GNU C library. */ -00073 -00074 #ifdef VMS -00075 # include <unixlib.h> -00076 # if HAVE_STRING_H - 0 -00077 # include <string.h> -00078 # endif -00079 #endif -00080 -00081 #ifndef _ -00082 /* This is for other GNU distributions with internationalized messages. */ -00083 # if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC -00084 # include <libintl.h> -00085 # ifndef _ -00086 # define _(msgid) gettext (msgid) -00087 # endif -00088 # else -00089 # define _(msgid) (msgid) -00090 # endif -00091 # if defined _LIBC && defined USE_IN_LIBIO -00092 # include <wchar.h> -00093 # endif -00094 #endif -00095 -00096 /* This version of `getopt' appears to the caller like standard Unix `getopt' -00097 but it behaves differently for the user, since it allows the user -00098 to intersperse the options with the other arguments. -00099 -00100 As `getopt' works, it permutes the elements of ARGV so that, -00101 when it is done, all the options precede everything else. Thus -00102 all application programs are extended to handle flexible argument order. -00103 -00104 Setting the environment variable POSIXLY_CORRECT disables permutation. -00105 Then the behavior is completely standard. -00106 -00107 GNU application programs can use a third alternative mode in which -00108 they can distinguish the relative order of options and other arguments. */ -00109 -00110 #include "getopt.h" -00111 -00112 /* For communication from `getopt' to the caller. -00113 When `getopt' finds an option that takes an argument, -00114 the argument value is returned here. -00115 Also, when `ordering' is RETURN_IN_ORDER, -00116 each non-option ARGV-element is returned here. */ -00117 -00118 char *optarg; -00119 -00120 /* Index in ARGV of the next element to be scanned. -00121 This is used for communication to and from the caller -00122 and for communication between successive calls to `getopt'. -00123 -00124 On entry to `getopt', zero means this is the first call; initialize. -00125 -00126 When `getopt' returns -1, this is the index of the first of the -00127 non-option elements that the caller should itself scan. -00128 -00129 Otherwise, `optind' communicates from one call to the next -00130 how much of ARGV has been scanned so far. */ -00131 -00132 /* 1003.2 says this must be 1 before any call. */ -00133 int optind = 1; -00134 -00135 /* Formerly, initialization of getopt depended on optind==0, which -00136 causes problems with re-calling getopt as programs generally don't -00137 know that. */ -00138 -00139 int __getopt_initialized; -00140 -00141 /* The next char to be scanned in the option-element -00142 in which the last option character we returned was found. -00143 This allows us to pick up the scan where we left off. -00144 -00145 If this is zero, or a null string, it means resume the scan -00146 by advancing to the next ARGV-element. */ -00147 -00148 static char *nextchar; -00149 -00150 /* Callers store zero here to inhibit the error message -00151 for unrecognized options. */ -00152 -00153 int opterr = 1; -00154 -00155 /* Set to an option character which was unrecognized. -00156 This must be initialized on some systems to avoid linking in the -00157 system's own getopt implementation. */ -00158 -00159 int optopt = '?'; -00160 -00161 /* Describe how to deal with options that follow non-option ARGV-elements. -00162 -00163 If the caller did not specify anything, -00164 the default is REQUIRE_ORDER if the environment variable -00165 POSIXLY_CORRECT is defined, PERMUTE otherwise. -00166 -00167 REQUIRE_ORDER means don't recognize them as options; -00168 stop option processing when the first non-option is seen. -00169 This is what Unix does. -00170 This mode of operation is selected by either setting the environment -00171 variable POSIXLY_CORRECT, or using `+' as the first character -00172 of the list of option characters. -00173 -00174 PERMUTE is the default. We permute the contents of ARGV as we scan, -00175 so that eventually all the non-options are at the end. This allows options -00176 to be given in any order, even with programs that were not written to -00177 expect this. -00178 -00179 RETURN_IN_ORDER is an option available to programs that were written -00180 to expect options and other ARGV-elements in any order and that care about -00181 the ordering of the two. We describe each non-option ARGV-element -00182 as if it were the argument of an option with character code 1. -00183 Using `-' as the first character of the list of option characters -00184 selects this mode of operation. -00185 -00186 The special argument `--' forces an end of option-scanning regardless -00187 of the value of `ordering'. In the case of RETURN_IN_ORDER, only -00188 `--' can cause `getopt' to return -1 with `optind' != ARGC. */ -00189 -00190 static enum -00191 { -00192 REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER -00193 } ordering; -00194 -00195 /* Value of POSIXLY_CORRECT environment variable. */ -00196 static char *posixly_correct; -00197 -00198 #ifdef __GNU_LIBRARY__ -00199 /* We want to avoid inclusion of string.h with non-GNU libraries -00200 because there are many ways it can cause trouble. -00201 On some systems, it contains special magic macros that don't work -00202 in GCC. */ -00203 # include <string.h> -00204 # define my_index strchr -00205 #else -00206 -00207 # if HAVE_STRING_H || WIN32 /* Pete Wilson mod 7/28/02 */ -00208 # include <string.h> -00209 # else -00210 # include <strings.h> -00211 # endif -00212 -00213 /* Avoid depending on library functions or files -00214 whose names are inconsistent. */ -00215 -00216 #ifndef getenv -00217 extern char *getenv (); -00218 #endif -00219 -00220 static char * -00221 my_index (str, chr) -00222 const char *str; -00223 int chr; -00224 { -00225 while (*str) -00226 { -00227 if (*str == chr) -00228 return (char *) str; -00229 str++; -00230 } -00231 return 0; -00232 } -00233 -00234 /* If using GCC, we can safely declare strlen this way. -00235 If not using GCC, it is ok not to declare it. */ -00236 #ifdef __GNUC__ -00237 /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. -00238 That was relevant to code that was here before. */ -00239 # if (!defined __STDC__ || !__STDC__) && !defined strlen -00240 /* gcc with -traditional declares the built-in strlen to return int, -00241 and has done so at least since version 2.4.5. -- rms. */ -00242 extern int strlen (const char *); -00243 # endif /* not __STDC__ */ -00244 #endif /* __GNUC__ */ -00245 -00246 #endif /* not __GNU_LIBRARY__ */ -00247 -00248 /* Handle permutation of arguments. */ -00249 -00250 /* Describe the part of ARGV that contains non-options that have -00251 been skipped. `first_nonopt' is the index in ARGV of the first of them; -00252 `last_nonopt' is the index after the last of them. */ -00253 -00254 static int first_nonopt; -00255 static int last_nonopt; -00256 -00257 #ifdef _LIBC -00258 /* Stored original parameters. -00259 XXX This is no good solution. We should rather copy the args so -00260 that we can compare them later. But we must not use malloc(3). */ -00261 extern int __libc_argc; -00262 extern char **__libc_argv; -00263 -00264 /* Bash 2.0 gives us an environment variable containing flags -00265 indicating ARGV elements that should not be considered arguments. */ -00266 -00267 # ifdef USE_NONOPTION_FLAGS -00268 /* Defined in getopt_init.c */ -00269 extern char *__getopt_nonoption_flags; -00270 -00271 static int nonoption_flags_max_len; -00272 static int nonoption_flags_len; -00273 # endif -00274 -00275 # ifdef USE_NONOPTION_FLAGS -00276 # define SWAP_FLAGS(ch1, ch2) \ -00277 if (nonoption_flags_len > 0) \ -00278 { \ -00279 char __tmp = __getopt_nonoption_flags[ch1]; \ -00280 __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ -00281 __getopt_nonoption_flags[ch2] = __tmp; \ -00282 } -00283 # else -00284 # define SWAP_FLAGS(ch1, ch2) -00285 # endif -00286 #else /* !_LIBC */ -00287 # define SWAP_FLAGS(ch1, ch2) -00288 #endif /* _LIBC */ -00289 -00290 /* Exchange two adjacent subsequences of ARGV. -00291 One subsequence is elements [first_nonopt,last_nonopt) -00292 which contains all the non-options that have been skipped so far. -00293 The other is elements [last_nonopt,optind), which contains all -00294 the options processed since those non-options were skipped. -00295 -00296 `first_nonopt' and `last_nonopt' are relocated so that they describe -00297 the new indices of the non-options in ARGV after they are moved. */ -00298 -00299 #if defined __STDC__ && __STDC__ -00300 static void exchange (char **); -00301 #endif -00302 -00303 static void -00304 exchange (argv) -00305 char **argv; -00306 { -00307 int bottom = first_nonopt; -00308 int middle = last_nonopt; -00309 int top = optind; -00310 char *tem; -00311 -00312 /* Exchange the shorter segment with the far end of the longer segment. -00313 That puts the shorter segment into the right place. -00314 It leaves the longer segment in the right place overall, -00315 but it consists of two parts that need to be swapped next. */ -00316 -00317 #if defined _LIBC && defined USE_NONOPTION_FLAGS -00318 /* First make sure the handling of the `__getopt_nonoption_flags' -00319 string can work normally. Our top argument must be in the range -00320 of the string. */ -00321 if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) -00322 { -00323 /* We must extend the array. The user plays games with us and -00324 presents new arguments. */ -00325 char *new_str = malloc (top + 1); -00326 if (new_str == NULL) -00327 nonoption_flags_len = nonoption_flags_max_len = 0; -00328 else -00329 { -00330 memset (__mempcpy (new_str, __getopt_nonoption_flags, -00331 nonoption_flags_max_len), -00332 '\0', top + 1 - nonoption_flags_max_len); -00333 nonoption_flags_max_len = top + 1; -00334 __getopt_nonoption_flags = new_str; -00335 } -00336 } -00337 #endif -00338 -00339 while (top > middle && middle > bottom) -00340 { -00341 if (top - middle > middle - bottom) -00342 { -00343 /* Bottom segment is the short one. */ -00344 int len = middle - bottom; -00345 register int i; -00346 -00347 /* Swap it with the top part of the top segment. */ -00348 for (i = 0; i < len; i++) -00349 { -00350 tem = argv[bottom + i]; -00351 argv[bottom + i] = argv[top - (middle - bottom) + i]; -00352 argv[top - (middle - bottom) + i] = tem; -00353 SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); -00354 } -00355 /* Exclude the moved bottom segment from further swapping. */ -00356 top -= len; -00357 } -00358 else -00359 { -00360 /* Top segment is the short one. */ -00361 int len = top - middle; -00362 register int i; -00363 -00364 /* Swap it with the bottom part of the bottom segment. */ -00365 for (i = 0; i < len; i++) -00366 { -00367 tem = argv[bottom + i]; -00368 argv[bottom + i] = argv[middle + i]; -00369 argv[middle + i] = tem; -00370 SWAP_FLAGS (bottom + i, middle + i); -00371 } -00372 /* Exclude the moved top segment from further swapping. */ -00373 bottom += len; -00374 } -00375 } -00376 -00377 /* Update records for the slots the non-options now occupy. */ -00378 -00379 first_nonopt += (optind - last_nonopt); -00380 last_nonopt = optind; -00381 } -00382 -00383 /* Initialize the internal data when the first call is made. */ -00384 -00385 #if defined __STDC__ && __STDC__ -00386 static const char *_getopt_initialize (int, char *const *, const char *); -00387 #endif -00388 static const char * -00389 _getopt_initialize (argc, argv, optstring) -00390 int argc; -00391 char *const *argv; -00392 const char *optstring; -00393 { -00394 /* Start processing options with ARGV-element 1 (since ARGV-element 0 -00395 is the program name); the sequence of previously skipped -00396 non-option ARGV-elements is empty. */ -00397 -00398 first_nonopt = last_nonopt = optind; -00399 -00400 nextchar = NULL; -00401 -00402 posixly_correct = getenv ("POSIXLY_CORRECT"); -00403 -00404 /* Determine how to handle the ordering of options and nonoptions. */ -00405 -00406 if (optstring[0] == '-') -00407 { -00408 ordering = RETURN_IN_ORDER; -00409 ++optstring; -00410 } -00411 else if (optstring[0] == '+') -00412 { -00413 ordering = REQUIRE_ORDER; -00414 ++optstring; -00415 } -00416 else if (posixly_correct != NULL) -00417 ordering = REQUIRE_ORDER; -00418 else -00419 ordering = PERMUTE; -00420 -00421 #if defined _LIBC && defined USE_NONOPTION_FLAGS -00422 if (posixly_correct == NULL -00423 && argc == __libc_argc && argv == __libc_argv) -00424 { -00425 if (nonoption_flags_max_len == 0) -00426 { -00427 if (__getopt_nonoption_flags == NULL -00428 || __getopt_nonoption_flags[0] == '\0') -00429 nonoption_flags_max_len = -1; -00430 else -00431 { -00432 const char *orig_str = __getopt_nonoption_flags; -00433 int len = nonoption_flags_max_len = strlen (orig_str); -00434 if (nonoption_flags_max_len < argc) -00435 nonoption_flags_max_len = argc; -00436 __getopt_nonoption_flags = -00437 (char *) malloc (nonoption_flags_max_len); -00438 if (__getopt_nonoption_flags == NULL) -00439 nonoption_flags_max_len = -1; -00440 else -00441 memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), -00442 '\0', nonoption_flags_max_len - len); -00443 } -00444 } -00445 nonoption_flags_len = nonoption_flags_max_len; -00446 } -00447 else -00448 nonoption_flags_len = 0; -00449 #endif -00450 -00451 return optstring; -00452 } -00453 -00454 /* Scan elements of ARGV (whose length is ARGC) for option characters -00455 given in OPTSTRING. -00456 -00457 If an element of ARGV starts with '-', and is not exactly "-" or "--", -00458 then it is an option element. The characters of this element -00459 (aside from the initial '-') are option characters. If `getopt' -00460 is called repeatedly, it returns successively each of the option characters -00461 from each of the option elements. -00462 -00463 If `getopt' finds another option character, it returns that character, -00464 updating `optind' and `nextchar' so that the next call to `getopt' can -00465 resume the scan with the following option character or ARGV-element. -00466 -00467 If there are no more option characters, `getopt' returns -1. -00468 Then `optind' is the index in ARGV of the first ARGV-element -00469 that is not an option. (The ARGV-elements have been permuted -00470 so that those that are not options now come last.) -00471 -00472 OPTSTRING is a string containing the legitimate option characters. -00473 If an option character is seen that is not listed in OPTSTRING, -00474 return '?' after printing an error message. If you set `opterr' to -00475 zero, the error message is suppressed but we still return '?'. -00476 -00477 If a char in OPTSTRING is followed by a colon, that means it wants an arg, -00478 so the following text in the same ARGV-element, or the text of the following -00479 ARGV-element, is returned in `optarg'. Two colons mean an option that -00480 wants an optional arg; if there is text in the current ARGV-element, -00481 it is returned in `optarg', otherwise `optarg' is set to zero. -00482 -00483 If OPTSTRING starts with `-' or `+', it requests different methods of -00484 handling the non-option ARGV-elements. -00485 See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. -00486 -00487 Long-named options begin with `--' instead of `-'. -00488 Their names may be abbreviated as long as the abbreviation is unique -00489 or is an exact match for some defined option. If they have an -00490 argument, it follows the option name in the same ARGV-element, separated -00491 from the option name by a `=', or else the in next ARGV-element. -00492 When `getopt' finds a long-named option, it returns 0 if that option's -00493 `flag' field is nonzero, the value of the option's `val' field -00494 if the `flag' field is zero. -00495 -00496 The elements of ARGV aren't really const, because we permute them. -00497 But we pretend they're const in the prototype to be compatible -00498 with other systems. -00499 -00500 LONGOPTS is a vector of `struct option' terminated by an -00501 element containing a name which is zero. -00502 -00503 LONGIND returns the index in LONGOPT of the long-named option found. -00504 It is only valid when a long-named option has been found by the most -00505 recent call. -00506 -00507 If LONG_ONLY is nonzero, '-' as well as '--' can introduce -00508 long-named options. */ -00509 -00510 int -00511 _getopt_internal (argc, argv, optstring, longopts, longind, long_only) -00512 int argc; -00513 char *const *argv; -00514 const char *optstring; -00515 const struct option *longopts; -00516 int *longind; -00517 int long_only; -00518 { -00519 int print_errors = opterr; -00520 if (optstring[0] == ':') -00521 print_errors = 0; -00522 -00523 if (argc < 1) -00524 return -1; -00525 -00526 optarg = NULL; -00527 -00528 if (optind == 0 || !__getopt_initialized) -00529 { -00530 if (optind == 0) -00531 optind = 1; /* Don't scan ARGV[0], the program name. */ -00532 optstring = _getopt_initialize (argc, argv, optstring); -00533 __getopt_initialized = 1; -00534 } -00535 -00536 /* Test whether ARGV[optind] points to a non-option argument. -00537 Either it does not have option syntax, or there is an environment flag -00538 from the shell indicating it is not an option. The later information -00539 is only used when the used in the GNU libc. */ -00540 #if defined _LIBC && defined USE_NONOPTION_FLAGS -00541 # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ -00542 || (optind < nonoption_flags_len \ -00543 && __getopt_nonoption_flags[optind] == '1')) -00544 #else -00545 # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') -00546 #endif -00547 -00548 if (nextchar == NULL || *nextchar == '\0') -00549 { -00550 /* Advance to the next ARGV-element. */ -00551 -00552 /* Give FIRST_NONOPT and LAST_NONOPT rational values if OPTIND has been -00553 moved back by the user (who may also have changed the arguments). */ -00554 if (last_nonopt > optind) -00555 last_nonopt = optind; -00556 if (first_nonopt > optind) -00557 first_nonopt = optind; -00558 -00559 if (ordering == PERMUTE) -00560 { -00561 /* If we have just processed some options following some non-options, -00562 exchange them so that the options come first. */ -00563 -00564 if (first_nonopt != last_nonopt && last_nonopt != optind) -00565 exchange ((char **) argv); -00566 else if (last_nonopt != optind) -00567 first_nonopt = optind; -00568 -00569 /* Skip any additional non-options -00570 and extend the range of non-options previously skipped. */ -00571 -00572 while (optind < argc && NONOPTION_P) -00573 optind++; -00574 last_nonopt = optind; -00575 } -00576 -00577 /* The special ARGV-element `--' means premature end of options. -00578 Skip it like a null option, -00579 then exchange with previous non-options as if it were an option, -00580 then skip everything else like a non-option. */ -00581 -00582 if (optind != argc && !strcmp (argv[optind], "--")) -00583 { -00584 optind++; -00585 -00586 if (first_nonopt != last_nonopt && last_nonopt != optind) -00587 exchange ((char **) argv); -00588 else if (first_nonopt == last_nonopt) -00589 first_nonopt = optind; -00590 last_nonopt = argc; -00591 -00592 optind = argc; -00593 } -00594 -00595 /* If we have done all the ARGV-elements, stop the scan -00596 and back over any non-options that we skipped and permuted. */ -00597 -00598 if (optind == argc) -00599 { -00600 /* Set the next-arg-index to point at the non-options -00601 that we previously skipped, so the caller will digest them. */ -00602 if (first_nonopt != last_nonopt) -00603 optind = first_nonopt; -00604 return -1; -00605 } -00606 -00607 /* If we have come to a non-option and did not permute it, -00608 either stop the scan or describe it to the caller and pass it by. */ -00609 -00610 if (NONOPTION_P) -00611 { -00612 if (ordering == REQUIRE_ORDER) -00613 return -1; -00614 optarg = argv[optind++]; -00615 return 1; -00616 } -00617 -00618 /* We have found another option-ARGV-element. -00619 Skip the initial punctuation. */ -00620 -00621 nextchar = (argv[optind] + 1 -00622 + (longopts != NULL && argv[optind][1] == '-')); -00623 } -00624 -00625 /* Decode the current option-ARGV-element. */ -00626 -00627 /* Check whether the ARGV-element is a long option. -00628 -00629 If long_only and the ARGV-element has the form "-f", where f is -00630 a valid short option, don't consider it an abbreviated form of -00631 a long option that starts with f. Otherwise there would be no -00632 way to give the -f short option. -00633 -00634 On the other hand, if there's a long option "fubar" and -00635 the ARGV-element is "-fu", do consider that an abbreviation of -00636 the long option, just like "--fu", and not "-f" with arg "u". -00637 -00638 This distinction seems to be the most useful approach. */ -00639 -00640 if (longopts != NULL -00641 && (argv[optind][1] == '-' -00642 || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) -00643 { -00644 char *nameend; -00645 const struct option *p; -00646 const struct option *pfound = NULL; -00647 int exact = 0; -00648 int ambig = 0; -00649 int indfound = -1; -00650 int option_index; -00651 -00652 for (nameend = nextchar; *nameend && *nameend != '='; nameend++) -00653 /* Do nothing. */ ; -00654 -00655 /* Test all long options for either exact match -00656 or abbreviated matches. */ -00657 for (p = longopts, option_index = 0; p->name; p++, option_index++) -00658 if (!strncmp (p->name, nextchar, nameend - nextchar)) -00659 { -00660 if ((unsigned int) (nameend - nextchar) -00661 == (unsigned int) strlen (p->name)) -00662 { -00663 /* Exact match found. */ -00664 pfound = p; -00665 indfound = option_index; -00666 exact = 1; -00667 break; -00668 } -00669 else if (pfound == NULL) -00670 { -00671 /* First nonexact match found. */ -00672 pfound = p; -00673 indfound = option_index; -00674 } -00675 else if (long_only -00676 || pfound->has_arg != p->has_arg -00677 || pfound->flag != p->flag -00678 || pfound->val != p->val) -00679 /* Second or later nonexact match found. */ -00680 ambig = 1; -00681 } -00682 -00683 if (ambig && !exact) -00684 { -00685 if (print_errors) -00686 { -00687 #if defined _LIBC && defined USE_IN_LIBIO -00688 char *buf; -00689 -00690 __asprintf (&buf, _("%s: option `%s' is ambiguous\n"), -00691 argv[0], argv[optind]); -00692 -00693 if (_IO_fwide (stderr, 0) > 0) -00694 __fwprintf (stderr, L"%s", buf); -00695 else -00696 fputs (buf, stderr); -00697 -00698 free (buf); -00699 #else -00700 fprintf (stderr, _("%s: option `%s' is ambiguous\n"), -00701 argv[0], argv[optind]); -00702 #endif -00703 } -00704 nextchar += strlen (nextchar); -00705 optind++; -00706 optopt = 0; -00707 return '?'; -00708 } -00709 -00710 if (pfound != NULL) -00711 { -00712 option_index = indfound; -00713 optind++; -00714 if (*nameend) -00715 { -00716 /* Don't test has_arg with >, because some C compilers don't -00717 allow it to be used on enums. */ -00718 if (pfound->has_arg) -00719 optarg = nameend + 1; -00720 else -00721 { -00722 if (print_errors) -00723 { -00724 #if defined _LIBC && defined USE_IN_LIBIO -00725 char *buf; -00726 #endif -00727 -00728 if (argv[optind - 1][1] == '-') -00729 { -00730 /* --option */ -00731 #if defined _LIBC && defined USE_IN_LIBIO -00732 __asprintf (&buf, _("\ -00733 %s: option `--%s' doesn't allow an argument\n"), -00734 argv[0], pfound->name); -00735 #else -00736 fprintf (stderr, _("\ -00737 %s: option `--%s' doesn't allow an argument\n"), -00738 argv[0], pfound->name); -00739 #endif -00740 } -00741 else -00742 { -00743 /* +option or -option */ -00744 #if defined _LIBC && defined USE_IN_LIBIO -00745 __asprintf (&buf, _("\ -00746 %s: option `%c%s' doesn't allow an argument\n"), -00747 argv[0], argv[optind - 1][0], -00748 pfound->name); -00749 #else -00750 fprintf (stderr, _("\ -00751 %s: option `%c%s' doesn't allow an argument\n"), -00752 argv[0], argv[optind - 1][0], pfound->name); -00753 #endif -00754 } -00755 -00756 #if defined _LIBC && defined USE_IN_LIBIO -00757 if (_IO_fwide (stderr, 0) > 0) -00758 __fwprintf (stderr, L"%s", buf); -00759 else -00760 fputs (buf, stderr); -00761 -00762 free (buf); -00763 #endif -00764 } -00765 -00766 nextchar += strlen (nextchar); -00767 -00768 optopt = pfound->val; -00769 return '?'; -00770 } -00771 } -00772 else if (pfound->has_arg == 1) -00773 { -00774 if (optind < argc) -00775 optarg = argv[optind++]; -00776 else -00777 { -00778 if (print_errors) -00779 { -00780 #if defined _LIBC && defined USE_IN_LIBIO -00781 char *buf; -00782 -00783 __asprintf (&buf, -00784 _("%s: option `%s' requires an argument\n"), -00785 argv[0], argv[optind - 1]); -00786 -00787 if (_IO_fwide (stderr, 0) > 0) -00788 __fwprintf (stderr, L"%s", buf); -00789 else -00790 fputs (buf, stderr); -00791 -00792 free (buf); -00793 #else -00794 fprintf (stderr, -00795 _("%s: option `%s' requires an argument\n"), -00796 argv[0], argv[optind - 1]); -00797 #endif -00798 } -00799 nextchar += strlen (nextchar); -00800 optopt = pfound->val; -00801 return optstring[0] == ':' ? ':' : '?'; -00802 } -00803 } -00804 nextchar += strlen (nextchar); -00805 if (longind != NULL) -00806 *longind = option_index; -00807 if (pfound->flag) -00808 { -00809 *(pfound->flag) = pfound->val; -00810 return 0; -00811 } -00812 return pfound->val; -00813 } -00814 -00815 /* Can't find it as a long option. If this is not getopt_long_only, -00816 or the option starts with '--' or is not a valid short -00817 option, then it's an error. -00818 Otherwise interpret it as a short option. */ -00819 if (!long_only || argv[optind][1] == '-' -00820 || my_index (optstring, *nextchar) == NULL) -00821 { -00822 if (print_errors) -00823 { -00824 #if defined _LIBC && defined USE_IN_LIBIO -00825 char *buf; -00826 #endif -00827 -00828 if (argv[optind][1] == '-') -00829 { -00830 /* --option */ -00831 #if defined _LIBC && defined USE_IN_LIBIO -00832 __asprintf (&buf, _("%s: unrecognized option `--%s'\n"), -00833 argv[0], nextchar); -00834 #else -00835 fprintf (stderr, _("%s: unrecognized option `--%s'\n"), -00836 argv[0], nextchar); -00837 #endif -00838 } -00839 else -00840 { -00841 /* +option or -option */ -00842 #if defined _LIBC && defined USE_IN_LIBIO -00843 __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"), -00844 argv[0], argv[optind][0], nextchar); -00845 #else -00846 fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), -00847 argv[0], argv[optind][0], nextchar); -00848 #endif -00849 } -00850 -00851 #if defined _LIBC && defined USE_IN_LIBIO -00852 if (_IO_fwide (stderr, 0) > 0) -00853 __fwprintf (stderr, L"%s", buf); -00854 else -00855 fputs (buf, stderr); -00856 -00857 free (buf); -00858 #endif -00859 } -00860 nextchar = (char *) ""; -00861 optind++; -00862 optopt = 0; -00863 return '?'; -00864 } -00865 } -00866 -00867 /* Look at and handle the next short option-character. */ -00868 -00869 { -00870 char c = *nextchar++; -00871 char *temp = my_index (optstring, c); -00872 -00873 /* Increment `optind' when we start to process its last character. */ -00874 if (*nextchar == '\0') -00875 ++optind; -00876 -00877 if (temp == NULL || c == ':') -00878 { -00879 if (print_errors) -00880 { -00881 #if defined _LIBC && defined USE_IN_LIBIO -00882 char *buf; -00883 #endif -00884 -00885 if (posixly_correct) -00886 { -00887 /* 1003.2 specifies the format of this message. */ -00888 #if defined _LIBC && defined USE_IN_LIBIO -00889 __asprintf (&buf, _("%s: illegal option -- %c\n"), -00890 argv[0], c); -00891 #else -00892 fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); -00893 #endif -00894 } -00895 else -00896 { -00897 #if defined _LIBC && defined USE_IN_LIBIO -00898 __asprintf (&buf, _("%s: invalid option -- %c\n"), -00899 argv[0], c); -00900 #else -00901 fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); -00902 #endif -00903 } -00904 -00905 #if defined _LIBC && defined USE_IN_LIBIO -00906 if (_IO_fwide (stderr, 0) > 0) -00907 __fwprintf (stderr, L"%s", buf); -00908 else -00909 fputs (buf, stderr); -00910 -00911 free (buf); -00912 #endif -00913 } -00914 optopt = c; -00915 return '?'; -00916 } -00917 /* Convenience. Treat POSIX -W foo same as long option --foo */ -00918 if (temp[0] == 'W' && temp[1] == ';') -00919 { -00920 char *nameend; -00921 const struct option *p; -00922 const struct option *pfound = NULL; -00923 int exact = 0; -00924 int ambig = 0; -00925 int indfound = 0; -00926 int option_index; -00927 -00928 /* This is an option that requires an argument. */ -00929 if (*nextchar != '\0') -00930 { -00931 optarg = nextchar; -00932 /* If we end this ARGV-element by taking the rest as an arg, -00933 we must advance to the next element now. */ -00934 optind++; -00935 } -00936 else if (optind == argc) -00937 { -00938 if (print_errors) -00939 { -00940 /* 1003.2 specifies the format of this message. */ -00941 #if defined _LIBC && defined USE_IN_LIBIO -00942 char *buf; -00943 -00944 __asprintf (&buf, _("%s: option requires an argument -- %c\n"), -00945 argv[0], c); -00946 -00947 if (_IO_fwide (stderr, 0) > 0) -00948 __fwprintf (stderr, L"%s", buf); -00949 else -00950 fputs (buf, stderr); -00951 -00952 free (buf); -00953 #else -00954 fprintf (stderr, _("%s: option requires an argument -- %c\n"), -00955 argv[0], c); -00956 #endif -00957 } -00958 optopt = c; -00959 if (optstring[0] == ':') -00960 c = ':'; -00961 else -00962 c = '?'; -00963 return c; -00964 } -00965 else -00966 /* We already incremented `optind' once; -00967 increment it again when taking next ARGV-elt as argument. */ -00968 optarg = argv[optind++]; -00969 -00970 /* optarg is now the argument, see if it's in the -00971 table of longopts. */ -00972 -00973 for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) -00974 /* Do nothing. */ ; -00975 -00976 /* Test all long options for either exact match -00977 or abbreviated matches. */ -00978 for (p = longopts, option_index = 0; p->name; p++, option_index++) -00979 if (!strncmp (p->name, nextchar, nameend - nextchar)) -00980 { -00981 if ((unsigned int) (nameend - nextchar) == strlen (p->name)) -00982 { -00983 /* Exact match found. */ -00984 pfound = p; -00985 indfound = option_index; -00986 exact = 1; -00987 break; -00988 } -00989 else if (pfound == NULL) -00990 { -00991 /* First nonexact match found. */ -00992 pfound = p; -00993 indfound = option_index; -00994 } -00995 else -00996 /* Second or later nonexact match found. */ -00997 ambig = 1; -00998 } -00999 if (ambig && !exact) -01000 { -01001 if (print_errors) -01002 { -01003 #if defined _LIBC && defined USE_IN_LIBIO -01004 char *buf; -01005 -01006 __asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"), -01007 argv[0], argv[optind]); -01008 -01009 if (_IO_fwide (stderr, 0) > 0) -01010 __fwprintf (stderr, L"%s", buf); -01011 else -01012 fputs (buf, stderr); -01013 -01014 free (buf); -01015 #else -01016 fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), -01017 argv[0], argv[optind]); -01018 #endif -01019 } -01020 nextchar += strlen (nextchar); -01021 optind++; -01022 return '?'; -01023 } -01024 if (pfound != NULL) -01025 { -01026 option_index = indfound; -01027 if (*nameend) -01028 { -01029 /* Don't test has_arg with >, because some C compilers don't -01030 allow it to be used on enums. */ -01031 if (pfound->has_arg) -01032 optarg = nameend + 1; -01033 else -01034 { -01035 if (print_errors) -01036 { -01037 #if defined _LIBC && defined USE_IN_LIBIO -01038 char *buf; -01039 -01040 __asprintf (&buf, _("\ -01041 %s: option `-W %s' doesn't allow an argument\n"), -01042 argv[0], pfound->name); -01043 -01044 if (_IO_fwide (stderr, 0) > 0) -01045 __fwprintf (stderr, L"%s", buf); -01046 else -01047 fputs (buf, stderr); -01048 -01049 free (buf); -01050 #else -01051 fprintf (stderr, _("\ -01052 %s: option `-W %s' doesn't allow an argument\n"), -01053 argv[0], pfound->name); -01054 #endif -01055 } -01056 -01057 nextchar += strlen (nextchar); -01058 return '?'; -01059 } -01060 } -01061 else if (pfound->has_arg == 1) -01062 { -01063 if (optind < argc) -01064 optarg = argv[optind++]; -01065 else -01066 { -01067 if (print_errors) -01068 { -01069 #if defined _LIBC && defined USE_IN_LIBIO -01070 char *buf; -01071 -01072 __asprintf (&buf, _("\ -01073 %s: option `%s' requires an argument\n"), -01074 argv[0], argv[optind - 1]); -01075 -01076 if (_IO_fwide (stderr, 0) > 0) -01077 __fwprintf (stderr, L"%s", buf); -01078 else -01079 fputs (buf, stderr); -01080 -01081 free (buf); -01082 #else -01083 fprintf (stderr, -01084 _("%s: option `%s' requires an argument\n"), -01085 argv[0], argv[optind - 1]); -01086 #endif -01087 } -01088 nextchar += strlen (nextchar); -01089 return optstring[0] == ':' ? ':' : '?'; -01090 } -01091 } -01092 nextchar += strlen (nextchar); -01093 if (longind != NULL) -01094 *longind = option_index; -01095 if (pfound->flag) -01096 { -01097 *(pfound->flag) = pfound->val; -01098 return 0; -01099 } -01100 return pfound->val; -01101 } -01102 nextchar = NULL; -01103 return 'W'; /* Let the application handle it. */ -01104 } -01105 if (temp[1] == ':') -01106 { -01107 if (temp[2] == ':') -01108 { -01109 /* This is an option that accepts an argument optionally. */ -01110 if (*nextchar != '\0') -01111 { -01112 optarg = nextchar; -01113 optind++; -01114 } -01115 else -01116 optarg = NULL; -01117 nextchar = NULL; -01118 } -01119 else -01120 { -01121 /* This is an option that requires an argument. */ -01122 if (*nextchar != '\0') -01123 { -01124 optarg = nextchar; -01125 /* If we end this ARGV-element by taking the rest as an arg, -01126 we must advance to the next element now. */ -01127 optind++; -01128 } -01129 else if (optind == argc) -01130 { -01131 if (print_errors) -01132 { -01133 /* 1003.2 specifies the format of this message. */ -01134 #if defined _LIBC && defined USE_IN_LIBIO -01135 char *buf; -01136 -01137 __asprintf (&buf, -01138 _("%s: option requires an argument -- %c\n"), -01139 argv[0], c); -01140 -01141 if (_IO_fwide (stderr, 0) > 0) -01142 __fwprintf (stderr, L"%s", buf); -01143 else -01144 fputs (buf, stderr); -01145 -01146 free (buf); -01147 #else -01148 fprintf (stderr, -01149 _("%s: option requires an argument -- %c\n"), -01150 argv[0], c); -01151 #endif -01152 } -01153 optopt = c; -01154 if (optstring[0] == ':') -01155 c = ':'; -01156 else -01157 c = '?'; -01158 } -01159 else -01160 /* We already incremented `optind' once; -01161 increment it again when taking next ARGV-elt as argument. */ -01162 optarg = argv[optind++]; -01163 nextchar = NULL; -01164 } -01165 } -01166 return c; -01167 } -01168 } -01169 -01170 int -01171 getopt (argc, argv, optstring) -01172 int argc; -01173 char *const *argv; -01174 const char *optstring; -01175 { -01176 return _getopt_internal (argc, argv, optstring, -01177 (const struct option *) 0, -01178 (int *) 0, -01179 0); -01180 } -01181 -01182 #endif /* Not ELIDE_CODE. */ -01183 -01184 -01185 /* Compile with -DTEST to make an executable for use in testing -01186 the above definition of `getopt'. */ -01187 -01188 /* #define TEST */ /* Pete Wilson mod 7/28/02 */ -01189 #ifdef TEST -01190 -01191 #ifndef exit /* Pete Wilson mod 7/28/02 */ -01192 int exit(int); /* Pete Wilson mod 7/28/02 */ -01193 #endif /* Pete Wilson mod 7/28/02 */ -01194 -01195 int -01196 main (argc, argv) -01197 int argc; -01198 char **argv; -01199 { -01200 int c; -01201 int digit_optind = 0; -01202 -01203 while (1) -01204 { -01205 int this_option_optind = optind ? optind : 1; -01206 -01207 c = getopt (argc, argv, "abc:d:0123456789"); -01208 if (c == -1) -01209 break; -01210 -01211 switch (c) -01212 { -01213 case '0': -01214 case '1': -01215 case '2': -01216 case '3': -01217 case '4': -01218 case '5': -01219 case '6': -01220 case '7': -01221 case '8': -01222 case '9': -01223 if (digit_optind != 0 && digit_optind != this_option_optind) -01224 printf ("digits occur in two different argv-elements.\n"); -01225 digit_optind = this_option_optind; -01226 printf ("option %c\n", c); -01227 break; -01228 -01229 case 'a': -01230 printf ("option a\n"); -01231 break; -01232 -01233 case 'b': -01234 printf ("option b\n"); -01235 break; -01236 -01237 case 'c': -01238 printf ("option c with value `%s'\n", optarg); -01239 break; -01240 -01241 case '?': -01242 break; -01243 -01244 default: -01245 printf ("?? getopt returned character code 0%o ??\n", c); -01246 } -01247 } -01248 -01249 if (optind < argc) -01250 { -01251 printf ("non-option ARGV-elements: "); -01252 while (optind < argc) -01253 printf ("%s ", argv[optind++]); -01254 printf ("\n"); -01255 } -01256 -01257 exit (0); -01258 } -01259 -01260 #endif /* TEST */ -
#include <stdio.h>
#include "getopt.h"
#include <strings.h>
-Include dependency graph for getopt.c:
-Go to the source code of this file.
Defines | |
#define | GETOPT_INTERFACE_VERSION 2 |
#define | _(msgid) (msgid) |
#define | SWAP_FLAGS(ch1, ch2) |
#define | NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') |
Enumerations | |
enum | { REQUIRE_ORDER, -PERMUTE, -RETURN_IN_ORDER - } |
Functions | |
char * | getenv () |
int | _getopt_internal (int argc, char *const *argv, const char *optstring, const struct option *longopts, int *longind, int long_only) |
int | getopt (int argc, char *const *argv, const char *optstring) |
Variables | |
char * | optarg |
int | optind = 1 |
int | __getopt_initialized |
int | opterr = 1 |
int | optopt = '?' |
#define _ | -( | -msgid | -- | ) | -(msgid) | -
#define GETOPT_INTERFACE_VERSION 2 | -
- -
-Referenced by _getopt_internal(). -
#define SWAP_FLAGS | -( | -ch1, | |||
- | - | ch2 | -- | ) | -- |
-
anonymous enum | -
-
int _getopt_internal | -( | -int | -argc, | -|
- | - | char *const * | -argv, | -|
- | - | const char * | -optstring, | -|
- | - | const struct option * | -longopts, | -|
- | - | int * | -longind, | -|
- | - | int | -long_only | - |
- | ) | -- |
- -
-Definition at line 511 of file getopt.c. -
-References __getopt_initialized, option::name, NONOPTION_P, optarg, opterr, optind, PERMUTE, and REQUIRE_ORDER. -
-Referenced by getopt(). -
char* getenv | -( | -- | ) | -- |
- -
int getopt | -( | -int | -argc, | -|
- | - | char *const * | -argv, | -|
- | - | const char * | -optstring | - |
- | ) | -- |
- -
-Definition at line 1171 of file getopt.c. -
-References _getopt_internal(). -
-Referenced by main(). -
-Here is the call graph for this function:
-
int __getopt_initialized | -
char* optarg | -
- -
-Definition at line 118 of file getopt.c. -
-Referenced by _getopt_internal(), and main(). -
int opterr = 1 | -
int optind = 1 | -
-
00001 /* from http://www.pwilson.net/getopt.html */ -00002 -00003 /* getopt.h */ -00004 /* Declarations for getopt. -00005 Copyright (C) 1989-1994, 1996-1999, 2001 Free Software -00006 Foundation, Inc. This file is part of the GNU C Library. -00007 -00008 The GNU C Library is free software; you can redistribute -00009 it and/or modify it under the terms of the GNU Lesser -00010 General Public License as published by the Free Software -00011 Foundation; either version 2.1 of the License, or -00012 (at your option) any later version. -00013 -00014 The GNU C Library is distributed in the hope that it will -00015 be useful, but WITHOUT ANY WARRANTY; without even the -00016 implied warranty of MERCHANTABILITY or FITNESS FOR A -00017 PARTICULAR PURPOSE. See the GNU Lesser General Public -00018 License for more details. -00019 -00020 You should have received a copy of the GNU Lesser General -00021 Public License along with the GNU C Library; if not, write -00022 to the Free Software Foundation, Inc., 59 Temple Place, -00023 Suite 330, Boston, MA 02111-1307 USA. */ -00024 -00025 -00026 -00027 -00028 -00029 #ifndef _GETOPT_H -00030 -00031 #ifndef __need_getopt -00032 # define _GETOPT_H 1 -00033 #endif -00034 -00035 /* If __GNU_LIBRARY__ is not already defined, either we are being used -00036 standalone, or this is the first header included in the source file. -00037 If we are being used with glibc, we need to include <features.h>, but -00038 that does not exist if we are standalone. So: if __GNU_LIBRARY__ is -00039 not defined, include <ctype.h>, which will pull in <features.h> for us -00040 if it's from glibc. (Why ctype.h? It's guaranteed to exist and it -00041 doesn't flood the namespace with stuff the way some other headers do.) */ -00042 #if !defined __GNU_LIBRARY__ -00043 # include <ctype.h> -00044 #endif -00045 -00046 #ifdef __cplusplus -00047 extern "C" { -00048 #endif -00049 -00050 /* For communication from `getopt' to the caller. -00051 When `getopt' finds an option that takes an argument, -00052 the argument value is returned here. -00053 Also, when `ordering' is RETURN_IN_ORDER, -00054 each non-option ARGV-element is returned here. */ -00055 -00056 extern char *optarg; -00057 -00058 /* Index in ARGV of the next element to be scanned. -00059 This is used for communication to and from the caller -00060 and for communication between successive calls to `getopt'. -00061 -00062 On entry to `getopt', zero means this is the first call; initialize. -00063 -00064 When `getopt' returns -1, this is the index of the first of the -00065 non-option elements that the caller should itself scan. -00066 -00067 Otherwise, `optind' communicates from one call to the next -00068 how much of ARGV has been scanned so far. */ -00069 -00070 extern int optind; -00071 -00072 /* Callers store zero here to inhibit the error message `getopt' prints -00073 for unrecognized options. */ -00074 -00075 extern int opterr; -00076 -00077 /* Set to an option character which was unrecognized. */ -00078 -00079 extern int optopt; -00080 -00081 #ifndef __need_getopt -00082 /* Describe the long-named options requested by the application. -00083 The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector -00084 of `struct option' terminated by an element containing a name which is -00085 zero. -00086 -00087 The field `has_arg' is: -00088 no_argument (or 0) if the option does not take an argument, -00089 required_argument (or 1) if the option requires an argument, -00090 optional_argument (or 2) if the option takes an optional argument. -00091 -00092 If the field `flag' is not NULL, it points to a variable that is set -00093 to the value given in the field `val' when the option is found, but -00094 left unchanged if the option is not found. -00095 -00096 To have a long-named option do something other than set an `int' to -00097 a compiled-in constant, such as set a value from `optarg', set the -00098 option's `flag' field to zero and its `val' field to a nonzero -00099 value (the equivalent single-letter option character, if there is -00100 one). For long options that have a zero `flag' field, `getopt' -00101 returns the contents of the `val' field. */ -00102 -00103 struct option -00104 { -00105 # if (defined __STDC__ && __STDC__) || defined __cplusplus -00106 const char *name; -00107 # else -00108 char *name; -00109 # endif -00110 /* has_arg can't be an enum because some compilers complain about -00111 type mismatches in all the code that assumes it is an int. */ -00112 int has_arg; -00113 int *flag; -00114 int val; -00115 }; -00116 -00117 /* Names for the values of the `has_arg' field of `struct option'. */ -00118 -00119 # define no_argument 0 -00120 # define required_argument 1 -00121 # define optional_argument 2 -00122 #endif /* need getopt */ -00123 -00124 -00125 /* Get definitions and prototypes for functions to process the -00126 arguments in ARGV (ARGC of them, minus the program name) for -00127 options given in OPTS. -00128 -00129 Return the option character from OPTS just read. Return -1 when -00130 there are no more options. For unrecognized options, or options -00131 missing arguments, `optopt' is set to the option letter, and '?' is -00132 returned. -00133 -00134 The OPTS string is a list of characters which are recognized option -00135 letters, optionally followed by colons, specifying that that letter -00136 takes an argument, to be placed in `optarg'. -00137 -00138 If a letter in OPTS is followed by two colons, its argument is -00139 optional. This behavior is specific to the GNU `getopt'. -00140 -00141 The argument `--' causes premature termination of argument -00142 scanning, explicitly telling `getopt' that there are no more -00143 options. -00144 -00145 If OPTS begins with `--', then non-option arguments are treated as -00146 arguments to the option '\0'. This behavior is specific to the GNU -00147 `getopt'. */ -00148 -00149 #if (defined __STDC__ && __STDC__) || defined __cplusplus -00150 # ifdef __GNU_LIBRARY__ -00151 /* Many other libraries have conflicting prototypes for getopt, with -00152 differences in the consts, in stdlib.h. To avoid compilation -00153 errors, only prototype getopt for the GNU C library. */ -00154 extern int getopt (int ___argc, char *const *___argv, const char *__shortopts); -00155 # else /* not __GNU_LIBRARY__ */ -00156 extern int getopt (); -00157 # endif /* __GNU_LIBRARY__ */ -00158 -00159 # ifndef __need_getopt -00160 extern int getopt_long (int ___argc, char *const *___argv, -00161 const char *__shortopts, -00162 const struct option *__longopts, int *__longind); -00163 extern int getopt_long_only (int ___argc, char *const *___argv, -00164 const char *__shortopts, -00165 const struct option *__longopts, int *__longind); -00166 -00167 /* Internal only. Users should not call this directly. */ -00168 extern int _getopt_internal (int ___argc, char *const *___argv, -00169 const char *__shortopts, -00170 const struct option *__longopts, int *__longind, -00171 int __long_only); -00172 # endif -00173 #else /* not __STDC__ */ -00174 extern int getopt (); -00175 # ifndef __need_getopt -00176 extern int getopt_long (); -00177 extern int getopt_long_only (); -00178 -00179 extern int _getopt_internal (); -00180 # endif -00181 #endif /* __STDC__ */ -00182 -00183 #ifdef __cplusplus -00184 } -00185 #endif -00186 -00187 /* Make sure we later can get all the definitions and declarations. */ -00188 #undef __need_getopt -00189 -00190 #endif /* getopt.h */ -00191 -
#include <ctype.h>
-Include dependency graph for getopt.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Data Structures | |
struct | option |
Defines | |
#define | _GETOPT_H 1 |
#define | no_argument 0 |
#define | required_argument 1 |
#define | optional_argument 2 |
Functions | |
int | getopt () |
int | getopt_long () |
int | getopt_long_only () |
int | _getopt_internal () |
Variables | |
char * | optarg |
int | optind |
int | opterr |
int | optopt |
-
int _getopt_internal | -( | -- | ) | -- |
- -
int getopt | -( | -- | ) | -- |
- -
int getopt_long | -( | -- | ) | -- |
- -
int getopt_long_only | -( | -- | ) | -- |
- -
-
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #if defined(WIN32) && !defined(__CYGWIN__) -00024 #include <windows.h> -00025 #include "getopt.h" -00026 void pause(void) -00027 { -00028 system("PAUSE"); -00029 } -00030 #else -00031 #include <stdio.h> -00032 #include <string.h> -00033 #include <unistd.h> -00034 #include <stdlib.h> -00035 #include <signal.h> -00036 #endif -00037 -00038 #include "canfestival.h" -00039 //#include <can_driver.h> -00040 //#include <timers_driver.h> -00041 -00042 #include "Master.h" -00043 #include "Slave.h" -00044 #include "TestMasterSlave.h" -00045 -00046 UNS32 OnMasterMap1Update(CO_Data* d, const indextable * unsused_indextable, UNS8 unsused_bSubindex) -00047 { -00048 eprintf("OnSlaveMap1Update:%d\n", SlaveMap1); -00049 return 0; -00050 } -00051 -00052 s_BOARD SlaveBoard = {"0", "125K"}; -00053 s_BOARD MasterBoard = {"1", "125K"}; -00054 -00055 #if !defined(WIN32) || defined(__CYGWIN__) -00056 void catch_signal(int sig) -00057 { -00058 signal(SIGTERM, catch_signal); -00059 signal(SIGINT, catch_signal); -00060 eprintf("Got Signal %d\n",sig); -00061 } -00062 #endif -00063 -00064 void help() -00065 { -00066 printf("**************************************************************\n"); -00067 printf("* TestMasterSlave *\n"); -00068 printf("* *\n"); -00069 printf("* A simple example for PC. It does implement 2 CanOpen *\n"); -00070 printf("* nodes in the same process. A master and a slave. Both *\n"); -00071 printf("* communicate together, exchanging periodically NMT, SYNC, *\n"); -00072 printf("* SDO and PDO. Master configure heartbeat producer time *\n"); -00073 printf("* at 1000 ms for slave node-id 0x02 by concise DCF. *\n"); -00074 printf("* *\n"); -00075 printf("* Usage: *\n"); -00076 printf("* ./TestMasterSlave [OPTIONS] *\n"); -00077 printf("* *\n"); -00078 printf("* OPTIONS: *\n"); -00079 printf("* -l : Can library [\"libcanfestival_can_virtual.so\"] *\n"); -00080 printf("* *\n"); -00081 printf("* Slave: *\n"); -00082 printf("* -s : bus name [\"0\"] *\n"); -00083 printf("* -S : 1M,500K,250K,125K,100K,50K,20K,10K,none(disable) *\n"); -00084 printf("* *\n"); -00085 printf("* Master: *\n"); -00086 printf("* -m : bus name [\"1\"] *\n"); -00087 printf("* -M : 1M,500K,250K,125K,100K,50K,20K,10K,none(disable) *\n"); -00088 printf("* *\n"); -00089 printf("**************************************************************\n"); -00090 } -00091 -00092 /*************************** INIT *****************************************/ -00093 void InitNodes(CO_Data* d, UNS32 id) -00094 { -00095 /****************************** INITIALISATION SLAVE *******************************/ -00096 if(strcmp(SlaveBoard.baudrate, "none")) { -00097 /* Defining the node Id */ -00098 setNodeId(&TestSlave_Data, 0x02); -00099 /* init */ -00100 setState(&TestSlave_Data, Initialisation); -00101 } -00102 -00103 /****************************** INITIALISATION MASTER *******************************/ -00104 if(strcmp(MasterBoard.baudrate, "none")){ -00105 RegisterSetODentryCallBack(&TestMaster_Data, 0x2000, 0, &OnMasterMap1Update); -00106 -00107 /* Defining the node Id */ -00108 setNodeId(&TestMaster_Data, 0x01); -00109 -00110 /* init */ -00111 setState(&TestMaster_Data, Initialisation); -00112 -00113 } -00114 } -00115 -00116 /****************************************************************************/ -00117 /*************************** MAIN *****************************************/ -00118 /****************************************************************************/ -00119 int main(int argc,char **argv) -00120 { -00121 -00122 int c; -00123 extern char *optarg; -00124 char* LibraryPath="libcanfestival_can_virtual.so"; -00125 -00126 while ((c = getopt(argc, argv, "-m:s:M:S:l:")) != EOF) -00127 { -00128 switch(c) -00129 { -00130 case 's' : -00131 if (optarg[0] == 0) -00132 { -00133 help(); -00134 exit(1); -00135 } -00136 SlaveBoard.busname = optarg; -00137 break; -00138 case 'm' : -00139 if (optarg[0] == 0) -00140 { -00141 help(); -00142 exit(1); -00143 } -00144 MasterBoard.busname = optarg; -00145 break; -00146 case 'S' : -00147 if (optarg[0] == 0) -00148 { -00149 help(); -00150 exit(1); -00151 } -00152 SlaveBoard.baudrate = optarg; -00153 break; -00154 case 'M' : -00155 if (optarg[0] == 0) -00156 { -00157 help(); -00158 exit(1); -00159 } -00160 MasterBoard.baudrate = optarg; -00161 break; -00162 case 'l' : -00163 if (optarg[0] == 0) -00164 { -00165 help(); -00166 exit(1); -00167 } -00168 LibraryPath = optarg; -00169 break; -00170 default: -00171 help(); -00172 exit(1); -00173 } -00174 } -00175 -00176 #if !defined(WIN32) || defined(__CYGWIN__) -00177 /* install signal handler for manual break */ -00178 signal(SIGTERM, catch_signal); -00179 signal(SIGINT, catch_signal); -00180 #endif -00181 -00182 #ifndef NOT_USE_DYNAMIC_LOADING -00183 LoadCanDriver(LibraryPath); -00184 #endif -00185 // Open CAN devices -00186 -00187 if(strcmp(SlaveBoard.baudrate, "none")){ -00188 -00189 TestSlave_Data.heartbeatError = TestSlave_heartbeatError; -00190 TestSlave_Data.initialisation = TestSlave_initialisation; -00191 TestSlave_Data.preOperational = TestSlave_preOperational; -00192 TestSlave_Data.operational = TestSlave_operational; -00193 TestSlave_Data.stopped = TestSlave_stopped; -00194 TestSlave_Data.post_sync = TestSlave_post_sync; -00195 TestSlave_Data.post_TPDO = TestSlave_post_TPDO; -00196 TestSlave_Data.storeODSubIndex = TestSlave_storeODSubIndex; -00197 -00198 if(!canOpen(&SlaveBoard,&TestSlave_Data)){ -00199 eprintf("Cannot open Slave Board (%s,%s)\n",SlaveBoard.busname, SlaveBoard.baudrate); -00200 goto fail_slave; -00201 } -00202 } -00203 if(strcmp(MasterBoard.baudrate, "none")){ -00204 -00205 TestMaster_Data.heartbeatError = TestMaster_heartbeatError; -00206 TestMaster_Data.initialisation = TestMaster_initialisation; -00207 TestMaster_Data.preOperational = TestMaster_preOperational; -00208 TestMaster_Data.operational = TestMaster_operational; -00209 TestMaster_Data.stopped = TestMaster_stopped; -00210 TestMaster_Data.post_sync = TestMaster_post_sync; -00211 TestMaster_Data.post_TPDO = TestMaster_post_TPDO; -00212 -00213 if(!canOpen(&MasterBoard,&TestMaster_Data)){ -00214 eprintf("Cannot open Master Board (%s,%s)\n",MasterBoard.busname, MasterBoard.baudrate); -00215 goto fail_master; -00216 } -00217 } -00218 -00219 // Start timer thread -00220 StartTimerLoop(&InitNodes); -00221 -00222 // wait Ctrl-C -00223 -00224 pause(); -00225 eprintf("Finishing.\n"); -00226 -00227 masterSendNMTstateChange (&TestMaster_Data, 0x02, NMT_Reset_Node); -00228 eprintf("reset\n"); -00229 // Stop master -00230 setState(&TestMaster_Data, Stopped); -00231 -00232 // Stop timer thread -00233 StopTimerLoop(); -00234 -00235 // Close CAN devices (and can threads) -00236 if(strcmp(SlaveBoard.baudrate, "none")) canClose(&TestSlave_Data); -00237 fail_master: -00238 if(strcmp(MasterBoard.baudrate, "none")) canClose(&TestMaster_Data); -00239 fail_slave: -00240 return 0; -00241 } -
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
#include "canfestival.h"
#include "Master.h"
#include "Slave.h"
#include "TestMasterSlave.h"
-Include dependency graph for TestMasterSlave.c:
-Go to the source code of this file.
Functions | |
UNS32 | OnMasterMap1Update (CO_Data *d, const indextable *unsused_indextable, UNS8 unsused_bSubindex) |
void | catch_signal (int sig) |
void | help () |
void | InitNodes (CO_Data *d, UNS32 id) |
int | main (int argc, char **argv) |
Variables | |
s_BOARD | SlaveBoard = {"0", "125K"} |
s_BOARD | MasterBoard = {"1", "125K"} |
void catch_signal | -( | -int | -sig | -) | -- |
- -
-Definition at line 56 of file TestMasterSlave.c. -
-References eprintf. -
-Referenced by catch_signal(), and main(). -
void help | -( | -- | ) | -- |
void InitNodes | -( | -CO_Data * | -d, | -|
- | - | UNS32 | -id | - |
- | ) | -- |
- -
-Definition at line 93 of file TestMasterSlave.c. -
-References struct_s_BOARD::baudrate, Initialisation, MasterBoard, OnMasterMap1Update(), RegisterSetODentryCallBack(), setNodeId(), setState(), SlaveBoard, TestMaster_Data, and TestSlave_Data. -
-Referenced by main(). -
-Here is the call graph for this function:
int main | -( | -int | -argc, | -|
- | - | char ** | -argv | - |
- | ) | -- |
- -
-Definition at line 119 of file TestMasterSlave.c. -
-References struct_s_BOARD::baudrate, struct_s_BOARD::busname, canClose(), canOpen(), catch_signal(), eprintf, getopt(), struct_CO_Data::heartbeatError, help(), struct_CO_Data::initialisation, InitNodes(), LoadCanDriver(), MasterBoard, masterSendNMTstateChange(), NMT_Reset_Node, struct_CO_Data::operational, optarg, struct_CO_Data::post_sync, struct_CO_Data::post_TPDO, struct_CO_Data::preOperational, setState(), SlaveBoard, StartTimerLoop(), Stopped, struct_CO_Data::stopped, StopTimerLoop(), struct_CO_Data::storeODSubIndex, TestMaster_Data, TestMaster_heartbeatError(), TestMaster_initialisation(), TestMaster_operational(), TestMaster_post_sync(), TestMaster_post_TPDO(), TestMaster_preOperational(), TestMaster_stopped(), TestSlave_Data, TestSlave_heartbeatError(), TestSlave_initialisation(), TestSlave_operational(), TestSlave_post_sync(), TestSlave_post_TPDO(), TestSlave_preOperational(), TestSlave_stopped(), and TestSlave_storeODSubIndex(). -
-Here is the call graph for this function:
UNS32 OnMasterMap1Update | -( | -CO_Data * | -d, | -|
- | - | const indextable * | -unsused_indextable, | -|
- | - | UNS8 | -unsused_bSubindex | - |
- | ) | -- |
- -
-Definition at line 46 of file TestMasterSlave.c. -
-References eprintf, and SlaveMap1. -
-Referenced by InitNodes(). -
-
s_BOARD MasterBoard = {"1", "125K"} | -
- -
-Definition at line 53 of file TestMasterSlave.c. -
-Referenced by InitNodes(), and main(). -
s_BOARD SlaveBoard = {"0", "125K"} | -
- -
-Definition at line 52 of file TestMasterSlave.c. -
-Referenced by InitNodes(), and main(). -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 #ifdef USE_XENO -00023 //#define eprintf(...) if(0){} -00024 #define eprintf(...) -00025 #else -00026 #define eprintf(...) printf (__VA_ARGS__) -00027 #endif -00028 void print_message(Message *m); -00029 -00030 /*UNS8 canSend(CAN_HANDLE fd0, Message *m);*/ -00031 -00032 #include "canfestival.h" -00033 -00034 /* -00035 #define CAN_FIFO_LENGTH 100 -00036 -00037 #define DECLARE_A_CAN_FIFO \ -00038 static Message FIFO[CAN_FIFO_LENGTH];\ -00039 static int FIFO_First = 0;\ -00040 static int FIFO_Last = 0;\ -00041 \ -00042 static void PutInFIFO(Message *m)\ -00043 {\ -00044 FIFO[FIFO_Last++] = *m;\ -00045 FIFO_Last %= CAN_FIFO_LENGTH;\ -00046 }\ -00047 \ -00048 static void GetFromFIFO(Message *m)\ -00049 {\ -00050 *m = FIFO[FIFO_First++];\ -00051 FIFO_First %= CAN_FIFO_LENGTH;\ -00052 }\ -00053 \ -00054 static void TransmitMessage(CO_Data* d, UNS32 id)\ -00055 {\ -00056 Message m;\ -00057 GetFromFIFO(&m);\ -00058 canDispatch(d, &m);\ -00059 } -00060 */ -
#include "canfestival.h"
-Include dependency graph for TestMasterSlave.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Defines | |
#define | eprintf(...) printf (__VA_ARGS__) |
Functions | |
void | print_message (Message *m) |
#define eprintf | -( | -... | -- | ) | -printf (__VA_ARGS__) | -
- -
-Definition at line 26 of file TestMasterSlave.h. -
-Referenced by catch_signal(), main(), OnMasterMap1Update(), TestMaster_heartbeatError(), TestMaster_initialisation(), TestMaster_operational(), TestMaster_post_sync(), TestMaster_post_TPDO(), TestMaster_preOperational(), TestMaster_stopped(), TestSlave_heartbeatError(), TestSlave_initialisation(), TestSlave_operational(), TestSlave_post_sync(), TestSlave_post_TPDO(), TestSlave_preOperational(), TestSlave_stopped(), and TestSlave_storeODSubIndex(). -
-
void print_message | -( | -Message * | -m | -) | -- |
- -
-Definition at line 53 of file can_virtual.c. -
-References Message::cob_id, Message::data, Message::len, MyCase, NMT, NODE_GUARD, PDO1rx, PDO1tx, PDO2rx, PDO2tx, PDO3rx, PDO3tx, PDO4rx, PDO4tx, Message::rtr, SDOrx, SDOtx, SYNC, TIME_STAMP, and SHORT_CAN::w. -
-Referenced by canSend_driver(). -
-
00001 -00002 /* File generated by gen_cfile.py. Should not be modified. */ -00003 -00004 #include "TestSlave.h" -00005 -00006 /**************************************************************************/ -00007 /* Declaration of the mapped variables */ -00008 /**************************************************************************/ -00009 UNS8 SlaveMap1 = 0x0; /* Mapped at index 0x2000, subindex 0x00 */ -00010 UNS8 SlaveMap2 = 0x0; /* Mapped at index 0x2001, subindex 0x00 */ -00011 UNS8 SlaveMap3 = 0x0; /* Mapped at index 0x2002, subindex 0x00 */ -00012 UNS8 SlaveMap4 = 0x0; /* Mapped at index 0x2003, subindex 0x00 */ -00013 UNS8 SlaveMap5 = 0x0; /* Mapped at index 0x2004, subindex 0x00 */ -00014 UNS8 SlaveMap6 = 0x0; /* Mapped at index 0x2005, subindex 0x00 */ -00015 UNS8 SlaveMap7 = 0x0; /* Mapped at index 0x2006, subindex 0x00 */ -00016 UNS8 SlaveMap8 = 0x0; /* Mapped at index 0x2007, subindex 0x00 */ -00017 UNS8 SlaveMap9 = 0x0; /* Mapped at index 0x2008, subindex 0x00 */ -00018 UNS32 SlaveMap10 = 0x0; /* Mapped at index 0x2009, subindex 0x00 */ -00019 UNS16 SlaveMap11 = 0x0; /* Mapped at index 0x200A, subindex 0x00 */ -00020 INTEGER16 SlaveMap12 = 0x0; /* Mapped at index 0x200B, subindex 0x00 */ -00021 INTEGER16 SlaveMap13 = 0x4D2; /* Mapped at index 0x200C, subindex 0x00 */ -00022 -00023 /**************************************************************************/ -00024 /* Declaration of the value range types */ -00025 /**************************************************************************/ -00026 -00027 UNS32 TestSlave_valueRangeTest (UNS8 typeValue, void * value) -00028 { -00029 switch (typeValue) { -00030 } -00031 return 0; -00032 } -00033 -00034 /**************************************************************************/ -00035 /* The node id */ -00036 /**************************************************************************/ -00037 /* node_id default value.*/ -00038 UNS8 TestSlave_bDeviceNodeId = 0x02; -00039 -00040 /**************************************************************************/ -00041 /* Array of message processing information */ -00042 -00043 const UNS8 TestSlave_iam_a_slave = 1; -00044 -00045 TIMER_HANDLE TestSlave_heartBeatTimers[1]; -00046 -00047 /* -00048 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -00049 -00050 OBJECT DICTIONARY -00051 -00052 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -00053 */ -00054 -00055 /* index 0x1000 : Device Type. */ -00056 UNS32 TestSlave_obj1000 = 0x12D; /* 301 */ -00057 subindex TestSlave_Index1000[] = -00058 { -00059 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1000 } -00060 }; -00061 -00062 /* index 0x1001 : Error Register. */ -00063 UNS8 TestSlave_obj1001 = 0x0; /* 0 */ -00064 subindex TestSlave_Index1001[] = -00065 { -00066 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_obj1001 } -00067 }; -00068 -00069 /* index 0x1005 : SYNC COB ID. */ -00070 UNS32 TestSlave_obj1005 = 0x80; /* 128 */ -00071 ODCallback_t TestSlave_Index1005_callbacks[] = -00072 { -00073 NULL, -00074 }; -00075 subindex TestSlave_Index1005[] = -00076 { -00077 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1005 } -00078 }; -00079 -00080 /* index 0x1006 : Communication / Cycle Period. */ -00081 UNS32 TestSlave_obj1006 = 0x0; /* 0 */ -00082 ODCallback_t TestSlave_Index1006_callbacks[] = -00083 { -00084 NULL, -00085 }; -00086 subindex TestSlave_Index1006[] = -00087 { -00088 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1006 } -00089 }; -00090 -00091 /* index 0x1010 : Store parameters. */ -00092 UNS8 TestSlave_highestSubIndex_obj1010 = 4; /* number of subindex - 1*/ -00093 UNS32 TestSlave_obj1010_Save_All_Parameters = 0x0; /* 0 */ -00094 UNS32 TestSlave_obj1010_Save_Communication_Parameters = 0x0; /* 0 */ -00095 UNS32 TestSlave_obj1010_Save_Application_Parameters = 0x0; /* 0 */ -00096 UNS32 TestSlave_obj1010_Save_Manufacturer_Parameters = 0x0; /* 0 */ -00097 ODCallback_t TestSlave_Index1010_callbacks[] = -00098 { -00099 NULL, -00100 NULL, -00101 NULL, -00102 NULL, -00103 NULL, -00104 }; -00105 subindex TestSlave_Index1010[] = -00106 { -00107 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1010 }, -00108 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_All_Parameters }, -00109 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_Communication_Parameters }, -00110 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_Application_Parameters }, -00111 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_Manufacturer_Parameters } -00112 }; -00113 -00114 /* index 0x1011 : Restore Default Parameters. */ -00115 UNS8 TestSlave_highestSubIndex_obj1011 = 4; /* number of subindex - 1*/ -00116 UNS32 TestSlave_obj1011_Restore_All_Default_Parameters = 0x0; /* 0 */ -00117 UNS32 TestSlave_obj1011_Restore_Communication_Default_Parameters = 0x0; /* 0 */ -00118 UNS32 TestSlave_obj1011_Restore_Application_Default_Parameters = 0x0; /* 0 */ -00119 UNS32 TestSlave_obj1011_Restore_Manufacturer_Default_Parameters = 0x0; /* 0 */ -00120 ODCallback_t TestSlave_Index1011_callbacks[] = -00121 { -00122 NULL, -00123 NULL, -00124 NULL, -00125 NULL, -00126 NULL, -00127 }; -00128 subindex TestSlave_Index1011[] = -00129 { -00130 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1011 }, -00131 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_All_Default_Parameters }, -00132 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_Communication_Default_Parameters }, -00133 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_Application_Default_Parameters }, -00134 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_Manufacturer_Default_Parameters } -00135 }; -00136 -00137 /* index 0x1016 : Consumer Heartbeat Time */ -00138 UNS8 TestSlave_highestSubIndex_obj1016 = 0; -00139 UNS32 TestSlave_obj1016[]={0}; -00140 -00141 /* index 0x1017 : Producer Heartbeat Time. */ -00142 UNS16 TestSlave_obj1017 = 0x0; /* 0 */ -00143 ODCallback_t TestSlave_Index1017_callbacks[] = -00144 { -00145 NULL, -00146 }; -00147 subindex TestSlave_Index1017[] = -00148 { -00149 { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1017 } -00150 }; -00151 -00152 /* index 0x1018 : Identity. */ -00153 UNS8 TestSlave_highestSubIndex_obj1018 = 4; /* number of subindex - 1*/ -00154 UNS32 TestSlave_obj1018_Vendor_ID = 0x0; /* 0 */ -00155 UNS32 TestSlave_obj1018_Product_Code = 0x0; /* 0 */ -00156 UNS32 TestSlave_obj1018_Revision_Number = 0x0; /* 0 */ -00157 UNS32 TestSlave_obj1018_Serial_Number = 0x0; /* 0 */ -00158 subindex TestSlave_Index1018[] = -00159 { -00160 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1018 }, -00161 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Vendor_ID }, -00162 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Product_Code }, -00163 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Revision_Number }, -00164 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Serial_Number } -00165 }; -00166 -00167 /* index 0x1200 : Server SDO Parameter. */ -00168 UNS8 TestSlave_highestSubIndex_obj1200 = 2; /* number of subindex - 1*/ -00169 UNS32 TestSlave_obj1200_COB_ID_Client_to_Server_Receive_SDO = 0x601; /* 1537 */ -00170 UNS32 TestSlave_obj1200_COB_ID_Server_to_Client_Transmit_SDO = 0x581; /* 1409 */ -00171 subindex TestSlave_Index1200[] = -00172 { -00173 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1200 }, -00174 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1200_COB_ID_Client_to_Server_Receive_SDO }, -00175 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1200_COB_ID_Server_to_Client_Transmit_SDO } -00176 }; -00177 -00178 /* index 0x1800 : Transmit PDO 1 Parameter. */ -00179 UNS8 TestSlave_highestSubIndex_obj1800 = 5; /* number of subindex - 1*/ -00180 UNS32 TestSlave_obj1800_COB_ID_used_by_PDO = 0x182; /* 386 */ -00181 UNS8 TestSlave_obj1800_Transmission_Type = 0x0; /* 0 */ -00182 UNS16 TestSlave_obj1800_Inhibit_Time = 0x0; /* 0 */ -00183 UNS8 TestSlave_obj1800_Compatibility_Entry = 0x0; /* 0 */ -00184 UNS16 TestSlave_obj1800_Event_Timer = 0x0; /* 0 */ -00185 ODCallback_t TestSlave_Index1800_callbacks[] = -00186 { -00187 NULL, -00188 NULL, -00189 NULL, -00190 NULL, -00191 NULL, -00192 NULL, -00193 }; -00194 subindex TestSlave_Index1800[] = -00195 { -00196 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1800 }, -00197 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1800_COB_ID_used_by_PDO }, -00198 { RW|TO_BE_SAVE, uint8, sizeof (UNS8), (void*)&TestSlave_obj1800_Transmission_Type }, -00199 { RW|TO_BE_SAVE, uint16, sizeof (UNS16), (void*)&TestSlave_obj1800_Inhibit_Time }, -00200 { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1800_Compatibility_Entry }, -00201 { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1800_Event_Timer } -00202 }; -00203 -00204 /* index 0x1801 : Transmit PDO 2 Parameter. */ -00205 UNS8 TestSlave_highestSubIndex_obj1801 = 5; /* number of subindex - 1*/ -00206 UNS32 TestSlave_obj1801_COB_ID_used_by_PDO = 0x282; /* 642 */ -00207 UNS8 TestSlave_obj1801_Transmission_Type = 0x0; /* 0 */ -00208 UNS16 TestSlave_obj1801_Inhibit_Time = 0x0; /* 0 */ -00209 UNS8 TestSlave_obj1801_Compatibility_Entry = 0x0; /* 0 */ -00210 UNS16 TestSlave_obj1801_Event_Timer = 0x0; /* 0 */ -00211 ODCallback_t TestSlave_Index1801_callbacks[] = -00212 { -00213 NULL, -00214 NULL, -00215 NULL, -00216 NULL, -00217 NULL, -00218 NULL, -00219 }; -00220 subindex TestSlave_Index1801[] = -00221 { -00222 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1801 }, -00223 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1801_COB_ID_used_by_PDO }, -00224 { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1801_Transmission_Type }, -00225 { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1801_Inhibit_Time }, -00226 { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1801_Compatibility_Entry }, -00227 { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1801_Event_Timer } -00228 }; -00229 -00230 /* index 0x1802 : Transmit PDO 3 Parameter. */ -00231 UNS8 TestSlave_highestSubIndex_obj1802 = 5; /* number of subindex - 1*/ -00232 UNS32 TestSlave_obj1802_COB_ID_used_by_PDO = 0x382; /* 898 */ -00233 UNS8 TestSlave_obj1802_Transmission_Type = 0xFF; /* 255 */ -00234 UNS16 TestSlave_obj1802_Inhibit_Time = 0x1388; /* 5000 */ -00235 UNS8 TestSlave_obj1802_Compatibility_Entry = 0x0; /* 0 */ -00236 UNS16 TestSlave_obj1802_Event_Timer = 0x3E8; /* 1000 */ -00237 ODCallback_t TestSlave_Index1802_callbacks[] = -00238 { -00239 NULL, -00240 NULL, -00241 NULL, -00242 NULL, -00243 NULL, -00244 NULL, -00245 }; -00246 subindex TestSlave_Index1802[] = -00247 { -00248 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1802 }, -00249 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1802_COB_ID_used_by_PDO }, -00250 { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1802_Transmission_Type }, -00251 { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1802_Inhibit_Time }, -00252 { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1802_Compatibility_Entry }, -00253 { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1802_Event_Timer } -00254 }; -00255 -00256 /* index 0x1803 : Transmit PDO 4 Parameter. */ -00257 UNS8 TestSlave_highestSubIndex_obj1803 = 5; /* number of subindex - 1*/ -00258 UNS32 TestSlave_obj1803_COB_ID_used_by_PDO = 0x482; /* 1154 */ -00259 UNS8 TestSlave_obj1803_Transmission_Type = 0xFC; /* 252 */ -00260 UNS16 TestSlave_obj1803_Inhibit_Time = 0x0; /* 0 */ -00261 UNS8 TestSlave_obj1803_Compatibility_Entry = 0x0; /* 0 */ -00262 UNS16 TestSlave_obj1803_Event_Timer = 0x0; /* 0 */ -00263 ODCallback_t TestSlave_Index1803_callbacks[] = -00264 { -00265 NULL, -00266 NULL, -00267 NULL, -00268 NULL, -00269 NULL, -00270 NULL, -00271 }; -00272 subindex TestSlave_Index1803[] = -00273 { -00274 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1803 }, -00275 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1803_COB_ID_used_by_PDO }, -00276 { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1803_Transmission_Type }, -00277 { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1803_Inhibit_Time }, -00278 { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1803_Compatibility_Entry }, -00279 { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1803_Event_Timer } -00280 }; -00281 -00282 /* index 0x1804 : Transmit PDO 5 Parameter. */ -00283 UNS8 TestSlave_highestSubIndex_obj1804 = 5; /* number of subindex - 1*/ -00284 UNS32 TestSlave_obj1804_COB_ID_used_by_PDO = 0x401; /* 1025 */ -00285 UNS8 TestSlave_obj1804_Transmission_Type = 0xFD; /* 253 */ -00286 UNS16 TestSlave_obj1804_Inhibit_Time = 0x0; /* 0 */ -00287 UNS8 TestSlave_obj1804_Compatibility_Entry = 0x0; /* 0 */ -00288 UNS16 TestSlave_obj1804_Event_Timer = 0x0; /* 0 */ -00289 ODCallback_t TestSlave_Index1804_callbacks[] = -00290 { -00291 NULL, -00292 NULL, -00293 NULL, -00294 NULL, -00295 NULL, -00296 NULL, -00297 }; -00298 subindex TestSlave_Index1804[] = -00299 { -00300 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1804 }, -00301 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1804_COB_ID_used_by_PDO }, -00302 { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1804_Transmission_Type }, -00303 { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1804_Inhibit_Time }, -00304 { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1804_Compatibility_Entry }, -00305 { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1804_Event_Timer } -00306 }; -00307 -00308 /* index 0x1A00 : Transmit PDO 1 Mapping. */ -00309 UNS8 TestSlave_highestSubIndex_obj1A00 = 10; /* number of subindex - 1*/ -00310 UNS32 TestSlave_obj1A00[] = -00311 { -00312 0x20000001, /* 536870913 */ -00313 0x20010001, /* 536936449 */ -00314 0x20020001, /* 537001985 */ -00315 0x20030001, /* 537067521 */ -00316 0x20040001, /* 537133057 */ -00317 0x20050001, /* 537198593 */ -00318 0x20060001, /* 537264129 */ -00319 0x20070001, /* 537329665 */ -00320 0x20080008, /* 537395208 */ -00321 0x20090020 /* 537460768 */ -00322 }; -00323 subindex TestSlave_Index1A00[] = -00324 { -00325 { RW, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1A00 }, -00326 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[0] }, -00327 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[1] }, -00328 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[2] }, -00329 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[3] }, -00330 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[4] }, -00331 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[5] }, -00332 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[6] }, -00333 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[7] }, -00334 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[8] }, -00335 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[9] } -00336 }; -00337 -00338 /* index 0x1A01 : Transmit PDO 2 Mapping. */ -00339 UNS8 TestSlave_highestSubIndex_obj1A01 = 1; /* number of subindex - 1*/ -00340 UNS32 TestSlave_obj1A01[] = -00341 { -00342 0x200A0010 /* 537526288 */ -00343 }; -00344 subindex TestSlave_Index1A01[] = -00345 { -00346 { RW, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1A01 }, -00347 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A01[0] } -00348 }; -00349 -00350 /* index 0x1A02 : Transmit PDO 3 Mapping. */ -00351 UNS8 TestSlave_highestSubIndex_obj1A02 = 1; /* number of subindex - 1*/ -00352 UNS32 TestSlave_obj1A02[] = -00353 { -00354 0x200B0010 /* 537591824 */ -00355 }; -00356 subindex TestSlave_Index1A02[] = -00357 { -00358 { RW, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1A02 }, -00359 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A02[0] } -00360 }; -00361 -00362 /* index 0x1A03 : Transmit PDO 4 Mapping. */ -00363 UNS8 TestSlave_highestSubIndex_obj1A03 = 1; /* number of subindex - 1*/ -00364 UNS32 TestSlave_obj1A03[] = -00365 { -00366 0x200C0010 /* 537657360 */ -00367 }; -00368 subindex TestSlave_Index1A03[] = -00369 { -00370 { RW, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1A03 }, -00371 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A03[0] } -00372 }; -00373 -00374 /* index 0x1A04 : Transmit PDO 5 Mapping. */ -00375 UNS8 TestSlave_highestSubIndex_obj1A04 = 1; /* number of subindex - 1*/ -00376 UNS32 TestSlave_obj1A04[] = -00377 { -00378 0x200C0010 /* 537657360 */ -00379 }; -00380 subindex TestSlave_Index1A04[] = -00381 { -00382 { RW, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1A04 }, -00383 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A04[0] } -00384 }; -00385 -00386 /* index 0x2000 : Mapped variable SlaveMap1 */ -00387 subindex TestSlave_Index2000[] = -00388 { -00389 { RW, boolean, sizeof (UNS8), (void*)&SlaveMap1 } -00390 }; -00391 -00392 /* index 0x2001 : Mapped variable SlaveMap2 */ -00393 subindex TestSlave_Index2001[] = -00394 { -00395 { RW, boolean, sizeof (UNS8), (void*)&SlaveMap2 } -00396 }; -00397 -00398 /* index 0x2002 : Mapped variable SlaveMap3 */ -00399 subindex TestSlave_Index2002[] = -00400 { -00401 { RW, boolean, sizeof (UNS8), (void*)&SlaveMap3 } -00402 }; -00403 -00404 /* index 0x2003 : Mapped variable SlaveMap4 */ -00405 subindex TestSlave_Index2003[] = -00406 { -00407 { RW, boolean, sizeof (UNS8), (void*)&SlaveMap4 } -00408 }; -00409 -00410 /* index 0x2004 : Mapped variable SlaveMap5 */ -00411 subindex TestSlave_Index2004[] = -00412 { -00413 { RW, boolean, sizeof (UNS8), (void*)&SlaveMap5 } -00414 }; -00415 -00416 /* index 0x2005 : Mapped variable SlaveMap6 */ -00417 subindex TestSlave_Index2005[] = -00418 { -00419 { RW, boolean, sizeof (UNS8), (void*)&SlaveMap6 } -00420 }; -00421 -00422 /* index 0x2006 : Mapped variable SlaveMap7 */ -00423 subindex TestSlave_Index2006[] = -00424 { -00425 { RW, boolean, sizeof (UNS8), (void*)&SlaveMap7 } -00426 }; -00427 -00428 /* index 0x2007 : Mapped variable SlaveMap8 */ -00429 subindex TestSlave_Index2007[] = -00430 { -00431 { RW, boolean, sizeof (UNS8), (void*)&SlaveMap8 } -00432 }; -00433 -00434 /* index 0x2008 : Mapped variable SlaveMap9 */ -00435 subindex TestSlave_Index2008[] = -00436 { -00437 { RW, uint8, sizeof (UNS8), (void*)&SlaveMap9 } -00438 }; -00439 -00440 /* index 0x2009 : Mapped variable SlaveMap10 */ -00441 subindex TestSlave_Index2009[] = -00442 { -00443 { RW, uint32, sizeof (UNS32), (void*)&SlaveMap10 } -00444 }; -00445 -00446 /* index 0x200A : Mapped variable SlaveMap11 */ -00447 subindex TestSlave_Index200A[] = -00448 { -00449 { RW, uint16, sizeof (UNS16), (void*)&SlaveMap11 } -00450 }; -00451 -00452 /* index 0x200B : Mapped variable SlaveMap12 */ -00453 subindex TestSlave_Index200B[] = -00454 { -00455 { RW, int16, sizeof (INTEGER16), (void*)&SlaveMap12 } -00456 }; -00457 -00458 /* index 0x200C : Mapped variable SlaveMap13 */ -00459 subindex TestSlave_Index200C[] = -00460 { -00461 { RW, int16, sizeof (INTEGER16), (void*)&SlaveMap13 } -00462 }; -00463 -00464 const indextable TestSlave_objdict[] = -00465 { -00466 { (subindex*)TestSlave_Index1000,sizeof(TestSlave_Index1000)/sizeof(TestSlave_Index1000[0]), 0x1000}, -00467 { (subindex*)TestSlave_Index1001,sizeof(TestSlave_Index1001)/sizeof(TestSlave_Index1001[0]), 0x1001}, -00468 { (subindex*)TestSlave_Index1005,sizeof(TestSlave_Index1005)/sizeof(TestSlave_Index1005[0]), 0x1005}, -00469 { (subindex*)TestSlave_Index1006,sizeof(TestSlave_Index1006)/sizeof(TestSlave_Index1006[0]), 0x1006}, -00470 { (subindex*)TestSlave_Index1010,sizeof(TestSlave_Index1010)/sizeof(TestSlave_Index1010[0]), 0x1010}, -00471 { (subindex*)TestSlave_Index1011,sizeof(TestSlave_Index1011)/sizeof(TestSlave_Index1011[0]), 0x1011}, -00472 { (subindex*)TestSlave_Index1017,sizeof(TestSlave_Index1017)/sizeof(TestSlave_Index1017[0]), 0x1017}, -00473 { (subindex*)TestSlave_Index1018,sizeof(TestSlave_Index1018)/sizeof(TestSlave_Index1018[0]), 0x1018}, -00474 { (subindex*)TestSlave_Index1200,sizeof(TestSlave_Index1200)/sizeof(TestSlave_Index1200[0]), 0x1200}, -00475 { (subindex*)TestSlave_Index1800,sizeof(TestSlave_Index1800)/sizeof(TestSlave_Index1800[0]), 0x1800}, -00476 { (subindex*)TestSlave_Index1801,sizeof(TestSlave_Index1801)/sizeof(TestSlave_Index1801[0]), 0x1801}, -00477 { (subindex*)TestSlave_Index1802,sizeof(TestSlave_Index1802)/sizeof(TestSlave_Index1802[0]), 0x1802}, -00478 { (subindex*)TestSlave_Index1803,sizeof(TestSlave_Index1803)/sizeof(TestSlave_Index1803[0]), 0x1803}, -00479 { (subindex*)TestSlave_Index1804,sizeof(TestSlave_Index1804)/sizeof(TestSlave_Index1804[0]), 0x1804}, -00480 { (subindex*)TestSlave_Index1A00,sizeof(TestSlave_Index1A00)/sizeof(TestSlave_Index1A00[0]), 0x1A00}, -00481 { (subindex*)TestSlave_Index1A01,sizeof(TestSlave_Index1A01)/sizeof(TestSlave_Index1A01[0]), 0x1A01}, -00482 { (subindex*)TestSlave_Index1A02,sizeof(TestSlave_Index1A02)/sizeof(TestSlave_Index1A02[0]), 0x1A02}, -00483 { (subindex*)TestSlave_Index1A03,sizeof(TestSlave_Index1A03)/sizeof(TestSlave_Index1A03[0]), 0x1A03}, -00484 { (subindex*)TestSlave_Index1A04,sizeof(TestSlave_Index1A04)/sizeof(TestSlave_Index1A04[0]), 0x1A04}, -00485 { (subindex*)TestSlave_Index2000,sizeof(TestSlave_Index2000)/sizeof(TestSlave_Index2000[0]), 0x2000}, -00486 { (subindex*)TestSlave_Index2001,sizeof(TestSlave_Index2001)/sizeof(TestSlave_Index2001[0]), 0x2001}, -00487 { (subindex*)TestSlave_Index2002,sizeof(TestSlave_Index2002)/sizeof(TestSlave_Index2002[0]), 0x2002}, -00488 { (subindex*)TestSlave_Index2003,sizeof(TestSlave_Index2003)/sizeof(TestSlave_Index2003[0]), 0x2003}, -00489 { (subindex*)TestSlave_Index2004,sizeof(TestSlave_Index2004)/sizeof(TestSlave_Index2004[0]), 0x2004}, -00490 { (subindex*)TestSlave_Index2005,sizeof(TestSlave_Index2005)/sizeof(TestSlave_Index2005[0]), 0x2005}, -00491 { (subindex*)TestSlave_Index2006,sizeof(TestSlave_Index2006)/sizeof(TestSlave_Index2006[0]), 0x2006}, -00492 { (subindex*)TestSlave_Index2007,sizeof(TestSlave_Index2007)/sizeof(TestSlave_Index2007[0]), 0x2007}, -00493 { (subindex*)TestSlave_Index2008,sizeof(TestSlave_Index2008)/sizeof(TestSlave_Index2008[0]), 0x2008}, -00494 { (subindex*)TestSlave_Index2009,sizeof(TestSlave_Index2009)/sizeof(TestSlave_Index2009[0]), 0x2009}, -00495 { (subindex*)TestSlave_Index200A,sizeof(TestSlave_Index200A)/sizeof(TestSlave_Index200A[0]), 0x200A}, -00496 { (subindex*)TestSlave_Index200B,sizeof(TestSlave_Index200B)/sizeof(TestSlave_Index200B[0]), 0x200B}, -00497 { (subindex*)TestSlave_Index200C,sizeof(TestSlave_Index200C)/sizeof(TestSlave_Index200C[0]), 0x200C}, -00498 }; -00499 -00500 const indextable * TestSlave_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks) -00501 { -00502 int i; -00503 *callbacks = NULL; -00504 switch(wIndex){ -00505 case 0x1000: i = 0;break; -00506 case 0x1001: i = 1;break; -00507 case 0x1005: i = 2;*callbacks = TestSlave_Index1005_callbacks; break; -00508 case 0x1006: i = 3;*callbacks = TestSlave_Index1006_callbacks; break; -00509 case 0x1010: i = 4;*callbacks = TestSlave_Index1010_callbacks; break; -00510 case 0x1011: i = 5;*callbacks = TestSlave_Index1011_callbacks; break; -00511 case 0x1017: i = 6;*callbacks = TestSlave_Index1017_callbacks; break; -00512 case 0x1018: i = 7;break; -00513 case 0x1200: i = 8;break; -00514 case 0x1800: i = 9;*callbacks = TestSlave_Index1800_callbacks; break; -00515 case 0x1801: i = 10;*callbacks = TestSlave_Index1801_callbacks; break; -00516 case 0x1802: i = 11;*callbacks = TestSlave_Index1802_callbacks; break; -00517 case 0x1803: i = 12;*callbacks = TestSlave_Index1803_callbacks; break; -00518 case 0x1804: i = 13;*callbacks = TestSlave_Index1804_callbacks; break; -00519 case 0x1A00: i = 14;break; -00520 case 0x1A01: i = 15;break; -00521 case 0x1A02: i = 16;break; -00522 case 0x1A03: i = 17;break; -00523 case 0x1A04: i = 18;break; -00524 case 0x2000: i = 19;break; -00525 case 0x2001: i = 20;break; -00526 case 0x2002: i = 21;break; -00527 case 0x2003: i = 22;break; -00528 case 0x2004: i = 23;break; -00529 case 0x2005: i = 24;break; -00530 case 0x2006: i = 25;break; -00531 case 0x2007: i = 26;break; -00532 case 0x2008: i = 27;break; -00533 case 0x2009: i = 28;break; -00534 case 0x200A: i = 29;break; -00535 case 0x200B: i = 30;break; -00536 case 0x200C: i = 31;break; -00537 default: -00538 *errorCode = OD_NO_SUCH_OBJECT; -00539 return NULL; -00540 } -00541 *errorCode = OD_SUCCESSFUL; -00542 return &TestSlave_objdict[i]; -00543 } -00544 -00545 /* -00546 * To count at which received SYNC a PDO must be sent. -00547 * Even if no pdoTransmit are defined, at least one entry is computed -00548 * for compilations issues. -00549 */ -00550 s_PDO_status TestSlave_PDO_status[5] = {s_PDO_staus_Initializer,s_PDO_staus_Initializer,s_PDO_staus_Initializer,s_PDO_staus_Initializer,s_PDO_staus_Initializer}; -00551 -00552 quick_index TestSlave_firstIndex = { -00553 8, /* SDO_SVR */ -00554 0, /* SDO_CLT */ -00555 0, /* PDO_RCV */ -00556 0, /* PDO_RCV_MAP */ -00557 9, /* PDO_TRS */ -00558 14 /* PDO_TRS_MAP */ -00559 }; -00560 -00561 quick_index TestSlave_lastIndex = { -00562 8, /* SDO_SVR */ -00563 0, /* SDO_CLT */ -00564 0, /* PDO_RCV */ -00565 0, /* PDO_RCV_MAP */ -00566 13, /* PDO_TRS */ -00567 18 /* PDO_TRS_MAP */ -00568 }; -00569 -00570 UNS16 TestSlave_ObjdictSize = sizeof(TestSlave_objdict)/sizeof(TestSlave_objdict[0]); -00571 -00572 CO_Data TestSlave_Data = CANOPEN_NODE_DATA_INITIALIZER(TestSlave); -00573 -
#include "TestSlave.h"
-Include dependency graph for TestSlave.c:
-Go to the source code of this file.
const indextable* TestSlave_scanIndexOD | -( | -UNS16 | -wIndex, | -|
- | - | UNS32 * | -errorCode, | -|
- | - | ODCallback_t ** | -callbacks | - |
- | ) | -- |
- -
-Definition at line 500 of file TestSlave.c. -
-References OD_NO_SUCH_OBJECT, OD_SUCCESSFUL, TestSlave_Index1005_callbacks, TestSlave_Index1006_callbacks, TestSlave_Index1010_callbacks, TestSlave_Index1011_callbacks, TestSlave_Index1017_callbacks, TestSlave_Index1800_callbacks, TestSlave_Index1801_callbacks, TestSlave_Index1802_callbacks, TestSlave_Index1803_callbacks, TestSlave_Index1804_callbacks, and TestSlave_objdict. -
UNS32 TestSlave_valueRangeTest | -( | -UNS8 | -typeValue, | -|
- | - | void * | -value | - |
- | ) | -- |
- -
-Definition at line 27 of file TestSlave.c. -
-
UNS8 SlaveMap1 = 0x0 | -
- -
-Definition at line 9 of file TestSlave.c. -
-Referenced by OnMasterMap1Update(), and TestSlave_post_sync(). -
UNS32 SlaveMap10 = 0x0 | -
UNS16 SlaveMap11 = 0x0 | -
INTEGER16 SlaveMap12 = 0x0 | -
INTEGER16 SlaveMap13 = 0x4D2 | -
- -
-Definition at line 21 of file TestSlave.c. -
-Referenced by TestSlave_post_sync(), and TestSlave_post_TPDO(). -
UNS8 SlaveMap2 = 0x0 | -
UNS8 SlaveMap3 = 0x0 | -
UNS8 SlaveMap4 = 0x0 | -
UNS8 SlaveMap5 = 0x0 | -
UNS8 SlaveMap6 = 0x0 | -
UNS8 SlaveMap7 = 0x0 | -
UNS8 SlaveMap8 = 0x0 | -
UNS8 SlaveMap9 = 0x0 | -
UNS8 TestSlave_bDeviceNodeId = 0x02 | -
- -
-Definition at line 38 of file TestSlave.c. -
CO_Data TestSlave_Data = CANOPEN_NODE_DATA_INITIALIZER(TestSlave) | -
quick_index TestSlave_firstIndex | -
-Initial value:
{ - 8, - 0, - 0, - 0, - 9, - 14 -} -
-Definition at line 552 of file TestSlave.c. -
TIMER_HANDLE TestSlave_heartBeatTimers[1] | -
- -
-Definition at line 45 of file TestSlave.c. -
UNS8 TestSlave_highestSubIndex_obj1010 = 4 | -
- -
-Definition at line 92 of file TestSlave.c. -
UNS8 TestSlave_highestSubIndex_obj1011 = 4 | -
- -
-Definition at line 115 of file TestSlave.c. -
UNS8 TestSlave_highestSubIndex_obj1016 = 0 | -
- -
-Definition at line 138 of file TestSlave.c. -
UNS8 TestSlave_highestSubIndex_obj1018 = 4 | -
- -
-Definition at line 153 of file TestSlave.c. -
UNS8 TestSlave_highestSubIndex_obj1200 = 2 | -
- -
-Definition at line 168 of file TestSlave.c. -
UNS8 TestSlave_highestSubIndex_obj1800 = 5 | -
- -
-Definition at line 179 of file TestSlave.c. -
UNS8 TestSlave_highestSubIndex_obj1801 = 5 | -
- -
-Definition at line 205 of file TestSlave.c. -
UNS8 TestSlave_highestSubIndex_obj1802 = 5 | -
- -
-Definition at line 231 of file TestSlave.c. -
UNS8 TestSlave_highestSubIndex_obj1803 = 5 | -
- -
-Definition at line 257 of file TestSlave.c. -
UNS8 TestSlave_highestSubIndex_obj1804 = 5 | -
- -
-Definition at line 283 of file TestSlave.c. -
UNS8 TestSlave_highestSubIndex_obj1A00 = 10 | -
- -
-Definition at line 309 of file TestSlave.c. -
UNS8 TestSlave_highestSubIndex_obj1A01 = 1 | -
- -
-Definition at line 339 of file TestSlave.c. -
UNS8 TestSlave_highestSubIndex_obj1A02 = 1 | -
- -
-Definition at line 351 of file TestSlave.c. -
UNS8 TestSlave_highestSubIndex_obj1A03 = 1 | -
- -
-Definition at line 363 of file TestSlave.c. -
UNS8 TestSlave_highestSubIndex_obj1A04 = 1 | -
- -
-Definition at line 375 of file TestSlave.c. -
const UNS8 TestSlave_iam_a_slave = 1 | -
- -
-Definition at line 43 of file TestSlave.c. -
subindex TestSlave_Index1000[] | -
-Initial value:
- { - { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1000 } - } -
-Definition at line 57 of file TestSlave.c. -
subindex TestSlave_Index1001[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestSlave_obj1001 } - } -
-Definition at line 64 of file TestSlave.c. -
subindex TestSlave_Index1005[] | -
-Initial value:
- { - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1005 } - } -
-Definition at line 75 of file TestSlave.c. -
ODCallback_t TestSlave_Index1005_callbacks[] | -
-Initial value:
- { - NULL, - } -
-Definition at line 71 of file TestSlave.c. -
-Referenced by TestSlave_scanIndexOD(). -
subindex TestSlave_Index1006[] | -
-Initial value:
- { - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1006 } - } -
-Definition at line 86 of file TestSlave.c. -
ODCallback_t TestSlave_Index1006_callbacks[] | -
-Initial value:
- { - NULL, - } -
-Definition at line 82 of file TestSlave.c. -
-Referenced by TestSlave_scanIndexOD(). -
subindex TestSlave_Index1010[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1010 }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_All_Parameters }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_Communication_Parameters }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_Application_Parameters }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_Manufacturer_Parameters } - } -
-Definition at line 105 of file TestSlave.c. -
ODCallback_t TestSlave_Index1010_callbacks[] | -
-Initial value:
- { - NULL, - NULL, - NULL, - NULL, - NULL, - } -
-Definition at line 97 of file TestSlave.c. -
-Referenced by TestSlave_scanIndexOD(). -
subindex TestSlave_Index1011[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1011 }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_All_Default_Parameters }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_Communication_Default_Parameters }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_Application_Default_Parameters }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_Manufacturer_Default_Parameters } - } -
-Definition at line 128 of file TestSlave.c. -
ODCallback_t TestSlave_Index1011_callbacks[] | -
-Initial value:
- { - NULL, - NULL, - NULL, - NULL, - NULL, - } -
-Definition at line 120 of file TestSlave.c. -
-Referenced by TestSlave_scanIndexOD(). -
subindex TestSlave_Index1017[] | -
-Initial value:
- { - { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1017 } - } -
-Definition at line 147 of file TestSlave.c. -
ODCallback_t TestSlave_Index1017_callbacks[] | -
-Initial value:
- { - NULL, - } -
-Definition at line 143 of file TestSlave.c. -
-Referenced by TestSlave_scanIndexOD(). -
subindex TestSlave_Index1018[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1018 }, - { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Vendor_ID }, - { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Product_Code }, - { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Revision_Number }, - { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Serial_Number } - } -
-Definition at line 158 of file TestSlave.c. -
subindex TestSlave_Index1200[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1200 }, - { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1200_COB_ID_Client_to_Server_Receive_SDO }, - { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1200_COB_ID_Server_to_Client_Transmit_SDO } - } -
-Definition at line 171 of file TestSlave.c. -
subindex TestSlave_Index1800[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1800 }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1800_COB_ID_used_by_PDO }, - { RW|TO_BE_SAVE, uint8, sizeof (UNS8), (void*)&TestSlave_obj1800_Transmission_Type }, - { RW|TO_BE_SAVE, uint16, sizeof (UNS16), (void*)&TestSlave_obj1800_Inhibit_Time }, - { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1800_Compatibility_Entry }, - { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1800_Event_Timer } - } -
-Definition at line 194 of file TestSlave.c. -
ODCallback_t TestSlave_Index1800_callbacks[] | -
-Initial value:
- { - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - } -
-Definition at line 185 of file TestSlave.c. -
-Referenced by TestSlave_scanIndexOD(). -
subindex TestSlave_Index1801[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1801 }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1801_COB_ID_used_by_PDO }, - { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1801_Transmission_Type }, - { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1801_Inhibit_Time }, - { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1801_Compatibility_Entry }, - { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1801_Event_Timer } - } -
-Definition at line 220 of file TestSlave.c. -
ODCallback_t TestSlave_Index1801_callbacks[] | -
-Initial value:
- { - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - } -
-Definition at line 211 of file TestSlave.c. -
-Referenced by TestSlave_scanIndexOD(). -
subindex TestSlave_Index1802[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1802 }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1802_COB_ID_used_by_PDO }, - { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1802_Transmission_Type }, - { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1802_Inhibit_Time }, - { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1802_Compatibility_Entry }, - { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1802_Event_Timer } - } -
-Definition at line 246 of file TestSlave.c. -
ODCallback_t TestSlave_Index1802_callbacks[] | -
-Initial value:
- { - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - } -
-Definition at line 237 of file TestSlave.c. -
-Referenced by TestSlave_scanIndexOD(). -
subindex TestSlave_Index1803[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1803 }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1803_COB_ID_used_by_PDO }, - { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1803_Transmission_Type }, - { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1803_Inhibit_Time }, - { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1803_Compatibility_Entry }, - { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1803_Event_Timer } - } -
-Definition at line 272 of file TestSlave.c. -
ODCallback_t TestSlave_Index1803_callbacks[] | -
-Initial value:
- { - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - } -
-Definition at line 263 of file TestSlave.c. -
-Referenced by TestSlave_scanIndexOD(). -
subindex TestSlave_Index1804[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1804 }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1804_COB_ID_used_by_PDO }, - { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1804_Transmission_Type }, - { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1804_Inhibit_Time }, - { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1804_Compatibility_Entry }, - { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1804_Event_Timer } - } -
-Definition at line 298 of file TestSlave.c. -
ODCallback_t TestSlave_Index1804_callbacks[] | -
-Initial value:
- { - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - } -
-Definition at line 289 of file TestSlave.c. -
-Referenced by TestSlave_scanIndexOD(). -
subindex TestSlave_Index1A00[] | -
-Initial value:
- { - { RW, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1A00 }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[0] }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[1] }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[2] }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[3] }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[4] }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[5] }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[6] }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[7] }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[8] }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[9] } - } -
-Definition at line 323 of file TestSlave.c. -
subindex TestSlave_Index1A01[] | -
-Initial value:
- { - { RW, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1A01 }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A01[0] } - } -
-Definition at line 344 of file TestSlave.c. -
subindex TestSlave_Index1A02[] | -
-Initial value:
- { - { RW, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1A02 }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A02[0] } - } -
-Definition at line 356 of file TestSlave.c. -
subindex TestSlave_Index1A03[] | -
-Initial value:
- { - { RW, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1A03 }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A03[0] } - } -
-Definition at line 368 of file TestSlave.c. -
subindex TestSlave_Index1A04[] | -
-Initial value:
- { - { RW, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1A04 }, - { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A04[0] } - } -
-Definition at line 380 of file TestSlave.c. -
subindex TestSlave_Index2000[] | -
subindex TestSlave_Index2001[] | -
subindex TestSlave_Index2002[] | -
subindex TestSlave_Index2003[] | -
subindex TestSlave_Index2004[] | -
subindex TestSlave_Index2005[] | -
subindex TestSlave_Index2006[] | -
subindex TestSlave_Index2007[] | -
subindex TestSlave_Index2008[] | -
subindex TestSlave_Index2009[] | -
-Initial value:
- { - { RW, uint32, sizeof (UNS32), (void*)&SlaveMap10 } - } -
-Definition at line 441 of file TestSlave.c. -
subindex TestSlave_Index200A[] | -
-Initial value:
- { - { RW, uint16, sizeof (UNS16), (void*)&SlaveMap11 } - } -
-Definition at line 447 of file TestSlave.c. -
subindex TestSlave_Index200B[] | -
-Initial value:
- { - { RW, int16, sizeof (INTEGER16), (void*)&SlaveMap12 } - } -
-Definition at line 453 of file TestSlave.c. -
subindex TestSlave_Index200C[] | -
-Initial value:
- { - { RW, int16, sizeof (INTEGER16), (void*)&SlaveMap13 } - } -
-Definition at line 459 of file TestSlave.c. -
quick_index TestSlave_lastIndex | -
-Initial value:
{ - 8, - 0, - 0, - 0, - 13, - 18 -} -
-Definition at line 561 of file TestSlave.c. -
UNS32 TestSlave_obj1000 = 0x12D | -
- -
-Definition at line 56 of file TestSlave.c. -
UNS8 TestSlave_obj1001 = 0x0 | -
- -
-Definition at line 63 of file TestSlave.c. -
UNS32 TestSlave_obj1005 = 0x80 | -
- -
-Definition at line 70 of file TestSlave.c. -
UNS32 TestSlave_obj1006 = 0x0 | -
- -
-Definition at line 81 of file TestSlave.c. -
UNS32 TestSlave_obj1010_Save_All_Parameters = 0x0 | -
- -
-Definition at line 93 of file TestSlave.c. -
UNS32 TestSlave_obj1010_Save_Application_Parameters = 0x0 | -
- -
-Definition at line 95 of file TestSlave.c. -
UNS32 TestSlave_obj1010_Save_Communication_Parameters = 0x0 | -
- -
-Definition at line 94 of file TestSlave.c. -
UNS32 TestSlave_obj1010_Save_Manufacturer_Parameters = 0x0 | -
- -
-Definition at line 96 of file TestSlave.c. -
UNS32 TestSlave_obj1011_Restore_All_Default_Parameters = 0x0 | -
- -
-Definition at line 116 of file TestSlave.c. -
UNS32 TestSlave_obj1011_Restore_Application_Default_Parameters = 0x0 | -
- -
-Definition at line 118 of file TestSlave.c. -
UNS32 TestSlave_obj1011_Restore_Communication_Default_Parameters = 0x0 | -
- -
-Definition at line 117 of file TestSlave.c. -
UNS32 TestSlave_obj1011_Restore_Manufacturer_Default_Parameters = 0x0 | -
- -
-Definition at line 119 of file TestSlave.c. -
UNS32 TestSlave_obj1016[] = {0} | -
- -
-Definition at line 139 of file TestSlave.c. -
UNS16 TestSlave_obj1017 = 0x0 | -
- -
-Definition at line 142 of file TestSlave.c. -
UNS32 TestSlave_obj1018_Product_Code = 0x0 | -
- -
-Definition at line 155 of file TestSlave.c. -
UNS32 TestSlave_obj1018_Revision_Number = 0x0 | -
- -
-Definition at line 156 of file TestSlave.c. -
UNS32 TestSlave_obj1018_Serial_Number = 0x0 | -
- -
-Definition at line 157 of file TestSlave.c. -
UNS32 TestSlave_obj1018_Vendor_ID = 0x0 | -
- -
-Definition at line 154 of file TestSlave.c. -
UNS32 TestSlave_obj1200_COB_ID_Client_to_Server_Receive_SDO = 0x601 | -
- -
-Definition at line 169 of file TestSlave.c. -
UNS32 TestSlave_obj1200_COB_ID_Server_to_Client_Transmit_SDO = 0x581 | -
- -
-Definition at line 170 of file TestSlave.c. -
UNS32 TestSlave_obj1800_COB_ID_used_by_PDO = 0x182 | -
- -
-Definition at line 180 of file TestSlave.c. -
UNS8 TestSlave_obj1800_Compatibility_Entry = 0x0 | -
- -
-Definition at line 183 of file TestSlave.c. -
UNS16 TestSlave_obj1800_Event_Timer = 0x0 | -
- -
-Definition at line 184 of file TestSlave.c. -
UNS16 TestSlave_obj1800_Inhibit_Time = 0x0 | -
- -
-Definition at line 182 of file TestSlave.c. -
UNS8 TestSlave_obj1800_Transmission_Type = 0x0 | -
- -
-Definition at line 181 of file TestSlave.c. -
UNS32 TestSlave_obj1801_COB_ID_used_by_PDO = 0x282 | -
- -
-Definition at line 206 of file TestSlave.c. -
UNS8 TestSlave_obj1801_Compatibility_Entry = 0x0 | -
- -
-Definition at line 209 of file TestSlave.c. -
UNS16 TestSlave_obj1801_Event_Timer = 0x0 | -
- -
-Definition at line 210 of file TestSlave.c. -
UNS16 TestSlave_obj1801_Inhibit_Time = 0x0 | -
- -
-Definition at line 208 of file TestSlave.c. -
UNS8 TestSlave_obj1801_Transmission_Type = 0x0 | -
- -
-Definition at line 207 of file TestSlave.c. -
UNS32 TestSlave_obj1802_COB_ID_used_by_PDO = 0x382 | -
- -
-Definition at line 232 of file TestSlave.c. -
UNS8 TestSlave_obj1802_Compatibility_Entry = 0x0 | -
- -
-Definition at line 235 of file TestSlave.c. -
UNS16 TestSlave_obj1802_Event_Timer = 0x3E8 | -
- -
-Definition at line 236 of file TestSlave.c. -
UNS16 TestSlave_obj1802_Inhibit_Time = 0x1388 | -
- -
-Definition at line 234 of file TestSlave.c. -
UNS8 TestSlave_obj1802_Transmission_Type = 0xFF | -
- -
-Definition at line 233 of file TestSlave.c. -
UNS32 TestSlave_obj1803_COB_ID_used_by_PDO = 0x482 | -
- -
-Definition at line 258 of file TestSlave.c. -
UNS8 TestSlave_obj1803_Compatibility_Entry = 0x0 | -
- -
-Definition at line 261 of file TestSlave.c. -
UNS16 TestSlave_obj1803_Event_Timer = 0x0 | -
- -
-Definition at line 262 of file TestSlave.c. -
UNS16 TestSlave_obj1803_Inhibit_Time = 0x0 | -
- -
-Definition at line 260 of file TestSlave.c. -
UNS8 TestSlave_obj1803_Transmission_Type = 0xFC | -
- -
-Definition at line 259 of file TestSlave.c. -
UNS32 TestSlave_obj1804_COB_ID_used_by_PDO = 0x401 | -
- -
-Definition at line 284 of file TestSlave.c. -
UNS8 TestSlave_obj1804_Compatibility_Entry = 0x0 | -
- -
-Definition at line 287 of file TestSlave.c. -
UNS16 TestSlave_obj1804_Event_Timer = 0x0 | -
- -
-Definition at line 288 of file TestSlave.c. -
UNS16 TestSlave_obj1804_Inhibit_Time = 0x0 | -
- -
-Definition at line 286 of file TestSlave.c. -
UNS8 TestSlave_obj1804_Transmission_Type = 0xFD | -
- -
-Definition at line 285 of file TestSlave.c. -
UNS32 TestSlave_obj1A00[] | -
-Initial value:
- { - 0x20000001, - 0x20010001, - 0x20020001, - 0x20030001, - 0x20040001, - 0x20050001, - 0x20060001, - 0x20070001, - 0x20080008, - 0x20090020 - } -
-Definition at line 310 of file TestSlave.c. -
UNS32 TestSlave_obj1A01[] | -
UNS32 TestSlave_obj1A02[] | -
UNS32 TestSlave_obj1A03[] | -
UNS32 TestSlave_obj1A04[] | -
const indextable TestSlave_objdict[] | -
UNS16 TestSlave_ObjdictSize = sizeof(TestSlave_objdict)/sizeof(TestSlave_objdict[0]) | -
- -
-Definition at line 570 of file TestSlave.c. -
s_PDO_status TestSlave_PDO_status[5] = {s_PDO_staus_Initializer,s_PDO_staus_Initializer,s_PDO_staus_Initializer,s_PDO_staus_Initializer,s_PDO_staus_Initializer} | -
- -
-Definition at line 550 of file TestSlave.c. -
-
00001 -00002 /* File generated by gen_cfile.py. Should not be modified. */ -00003 -00004 #ifndef TESTSLAVE_H -00005 #define TESTSLAVE_H -00006 -00007 #include "data.h" -00008 -00009 /* Prototypes of function provided by object dictionnary */ -00010 UNS32 TestSlave_valueRangeTest (UNS8 typeValue, void * value); -00011 const indextable * TestSlave_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks); -00012 -00013 /* Master node data struct */ -00014 extern CO_Data TestSlave_Data; -00015 extern ODCallback_t Store_parameters_callbacks[]; /* Callbacks of index0x1010 */ -00016 extern ODCallback_t Restore_Default_Parameters_callbacks[]; /* Callbacks of index0x1011 */ -00017 extern ODCallback_t Transmit_PDO_1_Parameter_callbacks[]; /* Callbacks of index0x1800 */ -00018 extern ODCallback_t Transmit_PDO_2_Parameter_callbacks[]; /* Callbacks of index0x1801 */ -00019 extern ODCallback_t Transmit_PDO_3_Parameter_callbacks[]; /* Callbacks of index0x1802 */ -00020 extern ODCallback_t Transmit_PDO_4_Parameter_callbacks[]; /* Callbacks of index0x1803 */ -00021 extern ODCallback_t Transmit_PDO_5_Parameter_callbacks[]; /* Callbacks of index0x1804 */ -00022 extern UNS8 SlaveMap1; /* Mapped at index 0x2000, subindex 0x00*/ -00023 extern UNS8 SlaveMap2; /* Mapped at index 0x2001, subindex 0x00*/ -00024 extern UNS8 SlaveMap3; /* Mapped at index 0x2002, subindex 0x00*/ -00025 extern UNS8 SlaveMap4; /* Mapped at index 0x2003, subindex 0x00*/ -00026 extern UNS8 SlaveMap5; /* Mapped at index 0x2004, subindex 0x00*/ -00027 extern UNS8 SlaveMap6; /* Mapped at index 0x2005, subindex 0x00*/ -00028 extern UNS8 SlaveMap7; /* Mapped at index 0x2006, subindex 0x00*/ -00029 extern UNS8 SlaveMap8; /* Mapped at index 0x2007, subindex 0x00*/ -00030 extern UNS8 SlaveMap9; /* Mapped at index 0x2008, subindex 0x00*/ -00031 extern UNS32 SlaveMap10; /* Mapped at index 0x2009, subindex 0x00*/ -00032 extern UNS16 SlaveMap11; /* Mapped at index 0x200A, subindex 0x00*/ -00033 extern INTEGER16 SlaveMap12; /* Mapped at index 0x200B, subindex 0x00*/ -00034 extern INTEGER16 SlaveMap13; /* Mapped at index 0x200C, subindex 0x00*/ -00035 -00036 #endif // TESTSLAVE_H -
#include "data.h"
-Include dependency graph for TestSlave.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Functions | |
UNS32 | TestSlave_valueRangeTest (UNS8 typeValue, void *value) |
const indextable * | TestSlave_scanIndexOD (UNS16 wIndex, UNS32 *errorCode, ODCallback_t **callbacks) |
Variables | |
CO_Data | TestSlave_Data |
ODCallback_t | Store_parameters_callbacks [] |
ODCallback_t | Restore_Default_Parameters_callbacks [] |
ODCallback_t | Transmit_PDO_1_Parameter_callbacks [] |
ODCallback_t | Transmit_PDO_2_Parameter_callbacks [] |
ODCallback_t | Transmit_PDO_3_Parameter_callbacks [] |
ODCallback_t | Transmit_PDO_4_Parameter_callbacks [] |
ODCallback_t | Transmit_PDO_5_Parameter_callbacks [] |
UNS8 | SlaveMap1 |
UNS8 | SlaveMap2 |
UNS8 | SlaveMap3 |
UNS8 | SlaveMap4 |
UNS8 | SlaveMap5 |
UNS8 | SlaveMap6 |
UNS8 | SlaveMap7 |
UNS8 | SlaveMap8 |
UNS8 | SlaveMap9 |
UNS32 | SlaveMap10 |
UNS16 | SlaveMap11 |
INTEGER16 | SlaveMap12 |
INTEGER16 | SlaveMap13 |
const indextable* TestSlave_scanIndexOD | -( | -UNS16 | -wIndex, | -|
- | - | UNS32 * | -errorCode, | -|
- | - | ODCallback_t ** | -callbacks | - |
- | ) | -- |
- -
-Definition at line 500 of file TestSlave.c. -
-References OD_NO_SUCH_OBJECT, OD_SUCCESSFUL, TestSlave_Index1005_callbacks, TestSlave_Index1006_callbacks, TestSlave_Index1010_callbacks, TestSlave_Index1011_callbacks, TestSlave_Index1017_callbacks, TestSlave_Index1800_callbacks, TestSlave_Index1801_callbacks, TestSlave_Index1802_callbacks, TestSlave_Index1803_callbacks, TestSlave_Index1804_callbacks, and TestSlave_objdict. -
UNS32 TestSlave_valueRangeTest | -( | -UNS8 | -typeValue, | -|
- | - | void * | -value | - |
- | ) | -- |
- -
-Definition at line 27 of file TestSlave.c. -
-
ODCallback_t Restore_Default_Parameters_callbacks[] | -
- -
UNS8 SlaveMap1 | -
- -
-Definition at line 9 of file TestSlave.c. -
-Referenced by OnMasterMap1Update(), and TestSlave_post_sync(). -
UNS32 SlaveMap10 | -
UNS16 SlaveMap11 | -
INTEGER16 SlaveMap12 | -
INTEGER16 SlaveMap13 | -
- -
-Definition at line 21 of file TestSlave.c. -
-Referenced by TestSlave_post_sync(), and TestSlave_post_TPDO(). -
UNS8 SlaveMap2 | -
UNS8 SlaveMap3 | -
UNS8 SlaveMap4 | -
UNS8 SlaveMap5 | -
UNS8 SlaveMap6 | -
UNS8 SlaveMap7 | -
UNS8 SlaveMap8 | -
UNS8 SlaveMap9 | -
ODCallback_t Store_parameters_callbacks[] | -
- -
CO_Data TestSlave_Data | -
ODCallback_t Transmit_PDO_1_Parameter_callbacks[] | -
- -
ODCallback_t Transmit_PDO_2_Parameter_callbacks[] | -
- -
ODCallback_t Transmit_PDO_3_Parameter_callbacks[] | -
- -
ODCallback_t Transmit_PDO_4_Parameter_callbacks[] | -
- -
ODCallback_t Transmit_PDO_5_Parameter_callbacks[] | -
- -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 // Uncomment if you don't need console informations. -00024 #define DEBUG_WAR_CONSOLE_ON -00025 #define DEBUG_ERR_CONSOLE_ON -00026 -00027 #include <stddef.h> /* for NULL */ -00028 -00029 #include <asm-m68hc12/portsaccess.h> -00030 #include <asm-m68hc12/ports_def.h> -00031 #include <asm-m68hc12/ports.h> -00032 #include <interrupt.h> -00033 -00034 #include "../include/data.h" -00035 #include <applicfg.h> -00036 -00037 -00038 -00039 #include "../include/hcs12/candriver.h" -00040 #include "../include/hcs12/canOpenDriver.h" -00041 #include "../include/def.h" -00042 #include "../include/can.h" -00043 #include "../include/objdictdef.h" -00044 #include "../include/objacces.h" -00045 #include "../include/sdo.h" -00046 #include "../include/pdo.h" -00047 #include "../include/timer.h" -00048 #include "../include/lifegrd.h" -00049 #include "../include/sync.h" -00050 -00051 #include "../include/nmtSlave.h" -00052 -00053 // File created by the GUI -00054 #include "objdict.h" -00055 -00056 -00057 -00058 -00059 -00060 // HCS12 configuration -00061 // ----------------------------------------------------- -00062 -00063 enum E_CanBaudrate -00064 { -00065 CAN_BAUDRATE_250K, -00066 CAN_BAUDRATE_500K, -00067 CAN_BAUDRATE_1M, -00068 }; -00069 -00070 -00071 const canBusTime CAN_Baudrates[] = -00072 { -00073 { -00074 1, /* clksrc: Use the bus clock : 16 MHz, the freq. of the quartz's board */ -00075 3, /* brp : chose btw 0 and 63 (6 bits). freq time quantum = 16MHz / (brp + 1) */ -00076 0, /* sjw : chose btw 0 and 3 (2 bits). Sync on (sjw + 1 ) time quantum */ -00077 0, /* samp : chose btw 0 and 3 (2 bits) (samp + 1 ) samples per bit */ -00078 1, /* tseg2 : chose btw 0 and 7 (3 bits) Segment 2 width = (tseg2 + 1) tq */ -00079 12, /* tseg1 : chose btw 0 and 15 (4 bits) Segment 1 width = (tseg1 + 1) tq */ -00080 -00081 /* -00082 With these values, -00083 - The width of the bit time is 16 time quantum : -00084 - 1 tq for the SYNC segment (could not be modified) -00085 - 13 tq for the TIME 1 segment (tseg1 = 12) -00086 - 2 tq for the TIME 2 segment (tseg2 = 1) -00087 - Because the bus clock of the MSCAN is 16 MHZ, and the -00088 freq of the time quantum is 4 MHZ (brp = 3+1), and there are 16 tq in the bit time, -00089 so the freq of the bit time is 250 kHz. -00090 */ -00091 }, -00092 -00093 { -00094 1, /* clksrc: Use the bus clock : 16 MHz, the freq. of the quartz's board */ -00095 1, /* brp : chose btw 0 and 63 (6 bits). freq time quantum = 16MHz / (brp + 1) */ -00096 0, /* sjw : chose btw 0 and 3 (2 bits). Sync on (sjw + 1 ) time quantum */ -00097 0, /* samp : chose btw 0 and 3 (2 bits) (samp + 1 ) samples per bit */ -00098 1, /* tseg2 : chose btw 0 and 7 (3 bits) Segment 2 width = (tseg2 + 1) tq */ -00099 12, /* tseg1 : chose btw 0 and 15 (4 bits) Segment 1 width = (tseg1 + 1) tq */ -00100 -00101 /* -00102 With these values, -00103 - The width of the bit time is 16 time quantum : -00104 - 1 tq for the SYNC segment (could not be modified) -00105 - 13 tq for the TIME 1 segment (tseg1 = 12) -00106 - 2 tq for the TIME 2 segment (tseg2 = 1) -00107 - Because the bus clock of the MSCAN is 16 MHZ, and the -00108 freq of the time quantum is 8 MHZ (brp = 1+1), and there are 16 tq in the bit time, -00109 so the freq of the bit time is 500 kHz. -00110 */ -00111 }, -00112 -00113 { -00114 1, /* clksrc: Use the bus clock : 16 MHz, the freq. of the quartz's board */ -00115 1, /* brp : chose btw 0 and 63 (6 bits). freq time quantum = 16MHz / (brp + 1) */ -00116 0, /* sjw : chose btw 0 and 3 (2 bits). Sync on (sjw + 1 ) time quantum */ -00117 0, /* samp : chose btw 0 and 3 (2 bits) (samp +MSG_WAR(0x3F33, "Je suis le noeud ", getNodeId()); 1 ) samples per bit */ -00118 1, /* tseg2 : chose btw 0 and 7 (3 bits) Segment 2 width = (tseg2 + 1) tq */ -00119 4, /* tseg1 : chose btw 0 and 15 (4 bits) Segment 1 width = (tseg1 + 1) tq */ -00120 -00121 /* -00122 With these values, -00123 - The width of the bit time is 16 time quantum : -00124 - 1 tq for the SYNC segment (could not be modified) -00125 - 5 tq for the TIME 1 segment (tseg1 = 4) -00126 - 2 tq for the TIME 2 segment (tseg2 = 1) -00127 - Because the bus clock of the MSCAN is 16 MHZ, and the -00128 freq of the time quantum is 8 MHZ (brp = 1+1), and there are 8 tq in the bit time, -00129 so the freq of the bit time is 1 MHz. -00130 */ -00131 } -00132 }; -00133 -00134 -00135 -00136 -00137 /**************************prototypes*****************************************/ -00138 -00139 //Init can bus and Canopen -00140 void initCanopencapteur (void); -00141 // Init the sensor -00142 void initSensor(void); -00143 void initPortB(void); -00144 void initPortH(void); -00145 -00146 -00147 //------------------------------------------------------------------------------ -00148 //Initialisation of the port B for the leds. -00149 void initPortB(void) -00150 { -00151 // Port B is output -00152 IO_PORTS_8(DDRB)= 0XFF; -00153 // RAZ -00154 IO_PORTS_8(PORTB) = 0xFF; -00155 } -00156 -00157 //------------------------------------------------------------------------------ -00158 // Init of port H to choose the CAN rate by switch, and the nodeId -00159 void initPortH(void) -00160 { -00161 // Port H is input -00162 IO_PORTS_8(DDRH)= 0X00; -00163 // Enable pull device -00164 IO_PORTS_8(PERH) = 0XFF; -00165 // Choose the pull-up device -00166 IO_PORTS_8(PPSH) = 0X00; -00167 } -00168 -00169 //------------------------------------------------------------------------------ -00170 void initSensor(void) -00171 { -00172 UNS8 baudrate = 0; -00173 UNS8 nodeId = 0; -00174 // Init led control -00175 initPortB(); -00176 IO_PORTS_8(PORTB) &= ~ 0x01; //One led ON -00177 initPortH(); -00178 -00179 /* Defining the node Id */ -00180 // Uncomment to have a fixed nodeId -00181 //setNodeId(&gene_SYNC_Data, 0x03); -00182 -00183 // Comment below to have a fixed nodeId -00184 nodeId = ~(IO_PORTS_8(PTH)) & 0x3F; -00185 if (nodeId == 0) { -00186 MSG_WAR(0x3F33, "Using default nodeId : ", getNodeId(&gene_SYNC_Data)); -00187 } -00188 else -00189 setNodeId(&gene_SYNC_Data, nodeId); -00190 -00191 MSG_WAR(0x3F33, "My nodeId is : ", getNodeId(&gene_SYNC_Data)); -00192 -00193 canBusInit bi0 = { -00194 0, /* no low power */ -00195 0, /* no time stamp */ -00196 1, /* enable MSCAN */ -00197 0, /* clock source : oscillator (In fact, it is not used) */ -00198 0, /* no loop back */ -00199 0, /* no listen only */ -00200 0, /* no low pass filter for wk up */ -00201 CAN_Baudrates[CAN_BAUDRATE_250K], -00202 { -00203 0x00, /* Filter on 16 bits. See Motorola Block Guide V02.14 fig 4-3 */ -00204 0x00, 0xFF, /* filter 0 hight accept all msg */ -00205 0x00, 0xFF, /* filter 0 low accept all msg */ -00206 0x00, 0xFF, /* filter 1 hight filter all of msg */ -00207 0x00, 0xFF, /* filter 1 low filter all of msg */ -00208 0x00, 0xFF, /* filter 2 hight filter most of msg */ -00209 0x00, 0xFF, /* filter 2 low filter most of msg */ -00210 0x00, 0xFF, /* filter 3 hight filter most of msg */ -00211 0x00, 0xFF, /* filter 3 low filter most of msg */ -00212 } -00213 }; -00214 -00215 //Init the HCS12 microcontroler for CanOpen -00216 initHCS12(); -00217 -00218 // Chose the CAN rate (On our board, whe have switch for all purpose) -00219 // 7 8 -00220 // ON ON => 1000 kpbs -00221 // OFF ON => 500 kpbs -00222 // ON OFF => 250 kpbs -00223 -00224 baudrate = ~(IO_PORTS_8(PTH)) & 0xC0; -00225 -00226 // Uncomment to have a fixed baudrate of 250 kbps -00227 //baudrate = 1; -00228 -00229 switch (baudrate) { -00230 case 0x40: -00231 bi0.clk = CAN_Baudrates[CAN_BAUDRATE_250K]; -00232 MSG_WAR(0x3F30, "CAN 250 kbps ", 0); -00233 break; -00234 case 0x80: -00235 bi0.clk = CAN_Baudrates[CAN_BAUDRATE_500K]; -00236 MSG_WAR(0x3F31, "CAN 500 kbps ", 0); -00237 break; -00238 case 0xC0: -00239 bi0.clk = CAN_Baudrates[CAN_BAUDRATE_1M]; -00240 MSG_WAR(0x3F31, "CAN 1000 kbps ", 0); -00241 break; -00242 default: -00243 bi0.clk = CAN_Baudrates[CAN_BAUDRATE_250K]; -00244 MSG_WAR(0x2F32, "CAN BAUD RATE NOT DEFINED => 250 kbps ", 0); -00245 } -00246 -00247 -00248 -00249 MSG_WAR(0x3F33, "SYNC signal generator ", 0); -00250 -00251 canInit(CANOPEN_LINE_NUMBER_USED, bi0); //initialize filters... -00252 initTimer(); // Init hcs12 timer used by CanFestival. (see timerhw.c) -00253 unlock(); // Allow interruptions -00254 } -00255 -00256 -00257 -00258 -00259 -00260 -00261 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -00262 // FUNCTIONS WHICH ARE PART OF CANFESTIVAL and *must* be implemented here. -00263 -00264 //------------------------------------------------------------------------------ -00265 void gene_SYNC_heartbeatError( UNS8 heartbeatID ) -00266 { -00267 -00268 MSG_ERR(0x1F00, "HeartBeat not received from node : ", heartbeatID); -00269 } -00270 -00271 //------------------------------------------------------------------------------ -00272 void gene_SYNC_initialisation() -00273 { -00274 MSG_WAR (0x3F00, "Entering in INIT ", 0); -00275 initSensor(); -00276 -00277 IO_PORTS_8(PORTB) &= ~ 0x01; // led 0 : ON -00278 IO_PORTS_8(PORTB) |= 0x0E; // leds 1, 2, 3 : OFF -00279 -00280 } -00281 -00282 -00283 //------------------------------------------------------------------------------ -00284 void gene_SYNC_preOperational() -00285 { -00286 MSG_WAR (0x3F01, "Entering in PRE-OPERATIONAL ", 0); -00287 IO_PORTS_8(PORTB) &= ~ 0x03; // leds 0, 1 : ON -00288 IO_PORTS_8(PORTB) |= 0x0C; // leds 2, 3 : OFF -00289 /* default values for the msg CAN filters */ -00290 /* Accept all */ -00291 { -00292 canBusFilterInit filterConfiguration = -00293 { -00294 0x01, /* Filter on 16 bits. See Motorola Block Guide V02.14 */ -00295 /*canidarx, canidmrx */ -00296 0x00, 0xFF, /* filter 0 */ -00297 0x00, 0xFF, /* filter 0 */ -00298 0x00, 0xFF, /* filter 1 */ -00299 0x00, 0xFF, /* filter 1 */ -00300 0x00, 0xFF, /* filter 2 */ -00301 0x00, 0xFF, /* filter 2 */ -00302 0x00, 0xFF, /* filter 3 */ -00303 0x00, 0xFF, /* filter 3 */ -00304 }; -00305 canChangeFilter(CANOPEN_LINE_NUMBER_USED, filterConfiguration); -00306 } -00307 // Reset the automatic change by SDO -00308 applyDownloadedFilters = 0; -00309 -00310 } -00311 -00312 -00313 //------------------------------------------------------------------------------ -00314 void gene_SYNC_operational() -00315 { -00316 MSG_WAR (0x3F02, "Entering in OPERATIONAL ", 0); -00317 IO_PORTS_8(PORTB) &= ~ 0x07; // leds 0, 1, 2 : ON -00318 IO_PORTS_8(PORTB) |= 0x08; // leds 3 : OFF -00319 -00320 // Filtering the CAN received msgs. -00321 // 2 ways -00322 // First :applying an automatic filter -00323 // Second : The values of the filtering registers are mapped in the object dictionary, -00324 // So that a filtering configuration can be downloaded by SDO in pre-operational mode -00325 -00326 if (applyDownloadedFilters == 0) {// No downloaded configuration to apply -00327 UNS16 accept1 = 0x0000; // Accept NMT -00328 UNS16 mask1 = 0x0FFF; // Mask NMT -00329 UNS16 accept2 = 0xE000; // Accept NMT error control (heartbeat, nodeguard) -00330 UNS16 mask2 = 0x0FFF; // Mask NMT error control (heartbeat, nodeguard) -00331 -00332 canBusFilterInit filterConfiguration = -00333 {// filters 3 and 4 not used, so configured like filter 1. -00334 0x01, /* Filter on 16 bits. See Motorola Block Guide V02.14 */ -00335 /*canidarx, canidmrx */ -00336 (UNS8)(accept1 >> 8), (UNS8)(mask1 >> 8), /* filter 1 id10...3*/ -00337 (UNS8)accept1 , (UNS8)mask1, /* filter 1 id2 ... */ -00338 (UNS8)(accept2 >> 8), (UNS8)(mask2 >> 8), /* filter 2 id10...3*/ -00339 (UNS8)accept2 , (UNS8)mask2, /* filter 2 id2 ... */ -00340 (UNS8)(accept1 >> 8), (UNS8)(mask1 >> 8), /* filter 3 id10...3*/ -00341 (UNS8)accept1 , (UNS8)mask1, /* filter 3 id2 ... */ -00342 (UNS8)(accept1 >> 8), (UNS8)(mask1 >> 8), /* filter 4 id10...3*/ -00343 (UNS8)accept1 , (UNS8)mask1 /* filter 4 id2 ... */ -00344 }; -00345 canChangeFilter(CANOPEN_LINE_NUMBER_USED, filterConfiguration); -00346 MSG_WAR (0x3F03, "Internal CAN Rcv filter applied ", 0); -00347 } -00348 else { // Apply filters downnloaded -00349 canBusFilterInit filterConfiguration = -00350 {// filters 3 and 4 not used, so configured like filter 1. -00351 0x01, /* Filter on 16 bits. See Motorola Block Guide V02.14 */ -00352 /*canidarx, canidmrx */ -00353 (UNS8)( acceptanceFilter1>> 8), (UNS8)(mask1 >> 8), /* filter 1 id10...3*/ -00354 (UNS8)acceptanceFilter1 , (UNS8)mask1, /* filter 1 id2 ... */ -00355 (UNS8)(acceptanceFilter2 >> 8), (UNS8)(mask2 >> 8), /* filter 2 id10...3*/ -00356 (UNS8)acceptanceFilter2 , (UNS8)mask2, /* filter 2 id2 ... */ -00357 (UNS8)(acceptanceFilter3 >> 8), (UNS8)(mask3 >> 8), /* filter 3 id10...3*/ -00358 (UNS8)acceptanceFilter3 , (UNS8)mask3, /* filter 3 id2 ... */ -00359 (UNS8)(acceptanceFilter4 >> 8), (UNS8)(mask4 >> 8), /* filter 4 id10...3*/ -00360 (UNS8)acceptanceFilter4 , (UNS8)mask4 /* filter 4 id2 ... */ -00361 }; -00362 canChangeFilter(CANOPEN_LINE_NUMBER_USED, filterConfiguration); -00363 MSG_WAR (0x3F04, "Downloaded CAN Rcv filter applied ", 0); -00364 } -00365 } -00366 -00367 //------------------------------------------------------------------------------ -00368 void gene_SYNC_stopped() -00369 { -00370 MSG_WAR (0x3F02, "Entering in STOPPED ", 0); -00371 IO_PORTS_8(PORTB) |= 0x0E; // leds 1, 2, 3, 4 : OFF -00372 } -00373 -00374 // End functions which are part of Canfestival -00375 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -00376 -00377 -00378 /******************************************************************************/ -00379 /********************************* MAIN ***************************************/ -00380 /******************************************************************************/ -00381 -00382 -00383 UNS8 main (void) -00384 { -00385 -00386 MSG_WAR(0x3F34, "Entering in the main ", 0); -00387 //----------------------------- INITIALISATION -------------------------------- -00388 gene_SYNC_Data.heartbeatError = gene_SYNC_heartbeatError; -00389 gene_SYNC_Data.initialisation = gene_SYNC_initialisation; -00390 gene_SYNC_Data.preOperational = gene_SYNC_preOperational; -00391 gene_SYNC_Data.preOperational = gene_SYNC_operational; -00392 gene_SYNC_Data.stopped = gene_SYNC_stopped; -00393 -00394 -00395 /* Put the node in Initialisation mode */ -00396 MSG_WAR(0x3F35, "Will entering in INIT ", 0); -00397 setState(&gene_SYNC_Data, Initialisation); -00398 -00399 //----------------------------- START ----------------------------------------- -00400 /* Put the node in pre-operational mode */ -00401 //MSG_WAR(0x3F36, "va passer en pre-op", 0); -00402 //setState(&gene_SYNC_Data, Pre_operational); -00403 -00404 // Loop of receiving messages -00405 while (1) { -00406 Message m; -00407 if (f_can_receive(0, &m)) { -00408 //MSG_WAR(0x3F36, "Msg received", m.cob_id.w); -00409 lock(); // Not to have interruptions by timer, which can corrupt the data -00410 canDispatch(&gene_SYNC_Data, &m); -00411 unlock(); -00412 } -00413 } -00414 -00415 return (0); -00416 } -00417 -00418 -00419 -
#include <stddef.h>
#include <asm-m68hc12/portsaccess.h>
#include <asm-m68hc12/ports_def.h>
#include <asm-m68hc12/ports.h>
#include <interrupt.h>
#include "../include/data.h"
#include <applicfg.h>
#include "../include/hcs12/candriver.h"
#include "../include/hcs12/canOpenDriver.h"
#include "../include/def.h"
#include "../include/can.h"
#include "../include/objdictdef.h"
#include "../include/objacces.h"
#include "../include/sdo.h"
#include "../include/pdo.h"
#include "../include/timer.h"
#include "../include/lifegrd.h"
#include "../include/sync.h"
#include "../include/nmtSlave.h"
#include "objdict.h"
-Include dependency graph for appli.c:
-Go to the source code of this file.
Defines | |
#define | DEBUG_WAR_CONSOLE_ON |
#define | DEBUG_ERR_CONSOLE_ON |
Enumerations | |
enum | E_CanBaudrate { CAN_BAUDRATE_250K, -CAN_BAUDRATE_500K, -CAN_BAUDRATE_1M - } |
Functions | |
void | initCanopencapteur (void) |
void | initSensor (void) |
void | initPortB (void) |
void | initPortH (void) |
void | gene_SYNC_heartbeatError (UNS8 heartbeatID) |
void | gene_SYNC_initialisation () |
void | gene_SYNC_preOperational () |
void | gene_SYNC_operational () |
void | gene_SYNC_stopped () |
UNS8 | main (void) |
Variables | |
const canBusTime | CAN_Baudrates [] |
-
enum E_CanBaudrate | -
-
void gene_SYNC_heartbeatError | -( | -UNS8 | -heartbeatID | -) | -- |
void gene_SYNC_initialisation | -( | -void | -- | ) | -- |
- -
-Definition at line 272 of file appli.c. -
-References initSensor(), IO_PORTS_8, MSG_WAR, and PORTB. -
-Referenced by main(). -
-Here is the call graph for this function:
void gene_SYNC_operational | -( | -void | -- | ) | -- |
- -
-Definition at line 314 of file appli.c. -
-References acceptanceFilter1, acceptanceFilter2, acceptanceFilter3, acceptanceFilter4, applyDownloadedFilters, canChangeFilter(), CANOPEN_LINE_NUMBER_USED, IO_PORTS_8, mask1, mask2, mask3, mask4, MSG_WAR, PORTB, UNS16, and UNS8. -
-Referenced by main(). -
-Here is the call graph for this function:
void gene_SYNC_preOperational | -( | -void | -- | ) | -- |
- -
-Definition at line 284 of file appli.c. -
-References applyDownloadedFilters, canChangeFilter(), CANOPEN_LINE_NUMBER_USED, IO_PORTS_8, MSG_WAR, and PORTB. -
-Referenced by main(). -
-Here is the call graph for this function:
void gene_SYNC_stopped | -( | -void | -- | ) | -- |
void initCanopencapteur | -( | -void | -- | ) | -- |
- -
void initPortB | -( | -void | -- | ) | -- |
- -
-Definition at line 149 of file appli.c. -
-References DDRB, IO_PORTS_8, and PORTB. -
-Referenced by initSensor(). -
void initPortH | -( | -void | -- | ) | -- |
- -
-Definition at line 159 of file appli.c. -
-References DDRH, IO_PORTS_8, PERH, and PPSH. -
-Referenced by initSensor(). -
void initSensor | -( | -void | -- | ) | -- |
- -
-Definition at line 170 of file appli.c. -
-References CAN_BAUDRATE_1M, CAN_BAUDRATE_250K, CAN_BAUDRATE_500K, CAN_Baudrates, canInit(), CANOPEN_LINE_NUMBER_USED, canBusInit::clk, gene_SYNC_Data, getNodeId(), initHCS12(), initPortB(), initPortH(), initTimer(), IO_PORTS_8, MSG_WAR, PORTB, PTH, setNodeId(), unlock(), and UNS8. -
-Referenced by gene_SYNC_initialisation(). -
-Here is the call graph for this function:
UNS8 main | -( | -void | -- | ) | -- |
- -
-Definition at line 383 of file appli.c. -
-References canDispatch(), f_can_receive(), gene_SYNC_Data, gene_SYNC_heartbeatError(), gene_SYNC_initialisation(), gene_SYNC_operational(), gene_SYNC_preOperational(), gene_SYNC_stopped(), struct_CO_Data::heartbeatError, Initialisation, struct_CO_Data::initialisation, lock(), MSG_WAR, struct_CO_Data::preOperational, setState(), struct_CO_Data::stopped, and unlock(). -
-Here is the call graph for this function:
-
const canBusTime CAN_Baudrates[] | -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #define DEBUG_WAR_CONSOLE_ON -00024 #define DEBUG_ERR_CONSOLE_ON -00025 -00026 #include <stddef.h> /* for NULL */ -00027 -00028 #include "../include/hcs12/asm-m68hc12/portsaccess.h" -00029 #include "../include/hcs12/asm-m68hc12/ports_def.h" -00030 #include "../include/hcs12/asm-m68hc12/ports.h" -00031 #include "../include/data.h" -00032 #include "../include/hcs12/applicfg.h" -00033 #include "../include/hcs12/candriver.h" -00034 #include "../include/hcs12/interrupt.h" -00035 #include "../include/hcs12/canOpenDriver.h" -00036 #include "../include/can.h" -00037 #include "../include/objdictdef.h" -00038 #include "../include/timer.h" -00039 -00040 -00041 -00042 -00043 -00044 -00045 volatile static Message stackMsgRcv[NB_LINE_CAN][MAX_STACK_MSG_RCV]; -00046 volatile static t_pointerStack ptrMsgRcv[NB_LINE_CAN]; -00047 -00048 volatile static TIMEVAL last_time_set = TIMEVAL_MAX; -00049 static UNS8 timer_is_set = 0; -00050 -00051 /* Prototypes */ -00052 UNS8 f_can_receive(UNS8 notused, Message *m); -00053 UNS8 canSend(UNS8 notused, Message *m); -00054 void __attribute__((interrupt)) timer4Hdl (void); -00055 -00056 #define max(a,b) a>b?a:b -00057 -00058 /******************************************************************************/ -00059 void setTimer(TIMEVAL value) -00060 { -00061 IO_PORTS_16(TC4H) += value; -00062 timer_is_set = 1; -00063 } -00064 -00065 /******************************************************************************/ -00066 TIMEVAL getElapsedTime() -00067 { -00068 return (IO_PORTS_16(TC4H) > last_time_set ? IO_PORTS_16(TC4H) - last_time_set : last_time_set - IO_PORTS_16(TC4H)); -00069 } -00070 -00071 -00072 /******************************************************************************/ -00073 void resetTimer(void) -00074 { -00075 -00076 } -00077 -00078 /******************************************************************************/ -00079 void initTimer(void) -00080 { -00081 lock(); // Inhibition of interruptions -00082 -00083 // Configure the timer channel 4 -00084 IO_PORTS_8(TIOS) |= 0x10; // Canal 4 in output -00085 IO_PORTS_8(TCTL1) &= ~(0x01 + 0x02); // Canal 4 unconnected to pin output -00086 IO_PORTS_8(TIE) |= 0x10; // allow interruption channel 4 -00087 IO_PORTS_8(TSCR2) |= 0X05; // Pre-scaler = 32 -00088 // If this value is changed, change must be done also -00089 // in void __attribute__((interrupt)) timer4Hdl (void) -00090 -00091 IO_PORTS_8(TSCR1) |= 0x80; // Start timer -00092 unlock(); // Allow interruptions -00093 } -00094 -00095 /******************************************************************************/ -00096 void __attribute__((interrupt)) timer4Hdl (void) -00097 { -00098 lock(); -00099 last_time_set = IO_PORTS_16(TC4H); -00100 IO_PORTS_8(TFLG1) = 0x10; // RAZ flag interruption timer channel 4 -00101 // Compute the next event : When the timer reach the value of TC4, an interrupt is -00102 // started -00103 //IO_PORTS_16(TC4H) += 250; // To have an interruption every 1 ms -00104 //timerInterrupt(0); -00105 //MSG_WAR(0xFFFF, "timer4 IT", 0); -00106 { -00107 //MSG_WAR(0xFFFF, "t4 ", IO_PORTS_16(TCNTH) - IO_PORTS_16(TC4H)); -00108 } -00109 TimeDispatch(); -00110 unlock(); -00111 } -00112 -00113 -00114 /******************************************************************************/ -00115 void initSCI_0(void) -00116 { -00117 IO_PORTS_16(SCI0 + SCIBDH) = -00118 ((1000000 / SERIAL_SCI0_BAUD_RATE) * BUS_CLOCK) >> 4 ; -00119 IO_PORTS_8(SCI0 + SCICR1) = 0; // format 8N1 -00120 IO_PORTS_8(SCI0 + SCICR2) = 0x08; // Transmit enable only -00121 } -00122 -00123 /******************************************************************************/ -00124 void initSCI_1(void) -00125 { -00126 IO_PORTS_16(SCI1 + SCIBDH) = -00127 ((1000000 / SERIAL_SCI1_BAUD_RATE) * BUS_CLOCK) >> 4 ; -00128 IO_PORTS_8(SCI1 + SCICR1) = 0; // format 8N1 -00129 IO_PORTS_8(SCI1 + SCICR2) = 0x08; // Transmit enable only -00130 } -00131 -00132 -00133 /******************************************************************************/ -00134 char * -00135 hex_convert (char *buf, unsigned long value, char lastCar) -00136 { -00137 //Thanks to Stéphane Carrez for this function -00138 char num[32]; -00139 int pos; -00140 -00141 *buf++ = '0'; -00142 *buf++ = 'x'; -00143 -00144 pos = 0; -00145 while (value != 0) { -00146 char c = value & 0x0F; -00147 num[pos++] = "0123456789ABCDEF"[(unsigned) c]; -00148 value = (value >> 4) & (0x0fffffffL); -00149 } -00150 if (pos == 0) -00151 num[pos++] = '0'; -00152 -00153 while (--pos >= 0) -00154 *buf++ = num[pos]; -00155 -00156 *buf++ = lastCar; -00157 *buf = 0; -00158 return buf; -00159 } -00160 -00161 /******************************************************************************/ -00162 void printSCI_str(char sci, const char * str) -00163 { -00164 char i = 0; -00165 -00166 while ((*(str + i) != 0) && (i < 0xFF)) { -00167 if (*(str + i) == '\n') -00168 { -00169 while ((IO_PORTS_8(sci + SCISR1) & 0X80) == 0); // wait if buffer not empty -00170 IO_PORTS_8(sci + SCIDRL) = 13; // return to start of line -00171 } -00172 while ((IO_PORTS_8(sci + SCISR1) & 0X80) == 0); // wait if buffer not empty -00173 IO_PORTS_8(sci + SCIDRL) = *(str + i++); -00174 } -00175 -00176 } -00177 -00178 /******************************************************************************/ -00179 void printSCI_nbr(char sci, unsigned long nbr, char lastCar) -00180 { -00181 char strNbr[12]; -00182 hex_convert(strNbr, nbr, lastCar); -00183 printSCI_str(sci, strNbr); -00184 } -00185 -00186 /******************************************************************************/ -00187 // PLL 24 MHZ if quartz on board is 16 MHZ -00188 void initPLL(void) -00189 { -00190 IO_PORTS_8(CLKSEL) &= ~0x80; // unselect the PLL -00191 IO_PORTS_8(PLLCTL) |= 0X60; // PLL ON and bandwidth auto -00192 IO_PORTS_8(SYNR) = 0x02; -00193 IO_PORTS_8(REFDV) = 0x01; -00194 while ((IO_PORTS_8(CRGFLG) & 0x08) == 0); -00195 IO_PORTS_8(CLKSEL) |= 0x80; -00196 } -00197 -00198 /******************************************************************************/ -00199 void initHCS12(void) -00200 { -00201 -00202 # ifdef USE_PLL -00203 MSG_WAR(0x3620, "Use the PLL ", 0); -00204 initPLL(); -00205 # endif -00206 -00207 } -00208 -00209 /***************************************************************************/ -00210 char canAddIdToFilter(UNS16 adrCAN, UNS8 nFilter, UNS16 id) -00211 { -00212 UNS8 fiMsb; -00213 UNS8 fiLsb; -00214 UNS8 idMsb = (UNS8) (id >> 3); -00215 UNS8 idLsb = (UNS8) (id << 5); -00216 -00217 if (! canTestInitMode(adrCAN)) { -00218 /* Error because not init mode */ -00219 MSG_WAR(0X2600, "Not in init mode ", 0); -00220 return 1; -00221 } -00222 switch (nFilter) { -00223 case 0: -00224 nFilter = CANIDAR0; /* First bank */ -00225 break; -00226 case 1: -00227 nFilter = CANIDAR2; /* First bank */ -00228 break; -00229 case 2: -00230 nFilter = CANIDAR4; /* Second bank */ -00231 break; -00232 case 3: -00233 nFilter = CANIDAR6; /* Second bank */ -00234 } -00235 if (! IO_PORTS_16(adrCAN + nFilter)) { -00236 /* if CANIDARx = 0 */ -00237 IO_PORTS_8(adrCAN + nFilter) = idMsb; -00238 IO_PORTS_8(adrCAN + nFilter + 1) = idLsb; -00239 } -00240 fiMsb = IO_PORTS_8(adrCAN + nFilter) ^ idMsb; -00241 fiLsb = IO_PORTS_8(adrCAN + nFilter + 1) ^ idLsb; -00242 /* address of CANIDMRx */ -00243 IO_PORTS_8(adrCAN + nFilter + 4) = IO_PORTS_8(adrCAN + nFilter + 4) | fiMsb; -00244 IO_PORTS_8(adrCAN + nFilter + 5) = IO_PORTS_8(adrCAN + nFilter + 5) | fiLsb; -00245 IO_PORTS_8(adrCAN + nFilter + 5) |= 0x10; /* Not filtering on rtr value */ -00246 return 0; -00247 } -00248 -00249 /***************************************************************************/ -00250 char canChangeFilter(UNS16 adrCAN, canBusFilterInit fi) -00251 { -00252 /* If not in init mode, go to sleep before going in init mode*/ -00253 if (! canTestInitMode(adrCAN)) { -00254 canSleepMode(adrCAN); -00255 canInitMode(adrCAN); -00256 } -00257 //update the filters configuration -00258 canInitFilter(adrCAN, fi); -00259 canInitModeQ(adrCAN); -00260 canSleepModeQ(adrCAN); -00261 canSetInterrupt(adrCAN); -00262 return 0; -00263 } -00264 -00265 /***************************************************************************/ -00266 char canEnable(UNS16 adrCAN) -00267 { -00268 /* Register CANCTL1 -00269 bit 7 : 1 MSCAN enabled -00270 Other bits : default reset values -00271 */ -00272 IO_PORTS_8(adrCAN + CANCTL1) = 0X80; -00273 return 0; -00274 } -00275 -00276 /***************************************************************************/ -00277 char canInit(UNS16 adrCAN, canBusInit bi) -00278 { -00279 /* If not in init mode, go to sleep before going in init mode*/ -00280 if (! canTestInitMode(adrCAN)) { -00281 canSleepMode(adrCAN); -00282 canInitMode(adrCAN); -00283 } -00284 -00285 canEnable(adrCAN); /* Does nothing if already enable */ -00286 /* The most secure way to go in init mode : put before MSCAN in sleep mode */ -00287 //canSleepMode(adrCAN); -00288 /* Put MSCAN in Init mode */ -00289 //canInitMode(adrCAN); -00290 canInitClock(adrCAN, bi.clk); -00291 /* Init CANCTL1 register. Must be in init mode */ -00292 IO_PORTS_8(adrCAN + CANCTL1) &=0xC4;// 0xCB; /* Clr the bits that may be modified */ -00293 IO_PORTS_8(adrCAN + CANCTL1) = (bi.cane << 7) | (bi.loopb << 5 ) | -00294 (bi.listen << 4) | (bi.wupm << 2); -00295 /* Initialize the filters for received msgs */ -00296 /* We should decide to accept all the msgs */ -00297 canInitFilter(adrCAN, bi.fi); -00298 /* Before to modify CANCTL0, we must leave the init mode */ -00299 canInitModeQ(adrCAN); -00300 /* Init CANCTL0 register. MSCAN must not be in init mode */ -00301 /* Do not change the value of wupe (should be 0) and slprq (should be 1) */ -00302 /* Do not change the value of initrq (should be 0) */ -00303 /* rxfrm is cleared, mupe also (should be before)*/ -00304 IO_PORTS_8(adrCAN + CANCTL0) &= 0x53; /* Clr the bits that may be modified */ -00305 IO_PORTS_8(adrCAN + CANCTL0) = (bi.cswai << 5) | (bi.time << 3); -00306 canSetInterrupt(adrCAN); -00307 canInitModeQ(adrCAN); /* Leave the init mode */ -00308 canSleepModeQ(adrCAN); /* Leave the sleep mode */ -00309 return 0; -00310 } -00311 -00312 /***************************************************************************/ -00313 char canInitClock(UNS16 adrCAN, canBusTime clk) -00314 { -00315 if (! canTestInitMode(adrCAN)) { -00316 /* Not in Init mode */ -00317 MSG_WAR(0X2601, "not in init mode ", 0); -00318 return 1; -00319 } -00320 /* Set or reset CLKSRC (register CANCTL1). Does not change the other bits*/ -00321 clk.clksrc = clk.clksrc << 6; -00322 IO_PORTS_8(adrCAN + CANCTL1) &= 0xBF; -00323 IO_PORTS_8(adrCAN + CANCTL1) |= clk.clksrc; -00324 /* Build the CANBTR0 register */ -00325 IO_PORTS_8(adrCAN + CANBTR0) = 0x00; /* Clear before changes */ -00326 IO_PORTS_8(adrCAN + CANBTR0) = (clk.sjw << 6) | (clk.brp); -00327 /* Build the CANBTR1 register */ -00328 IO_PORTS_8(adrCAN + CANBTR1) = 0x00; /* Clear before changes */ -00329 IO_PORTS_8(adrCAN + CANBTR1) = (clk.samp << 7) | (clk.tseg2 << 4) | -00330 (clk.tseg1); -00331 return 0; -00332 } -00333 -00334 /***************************************************************************/ -00335 char canInit1Filter(UNS16 adrCAN, UNS8 nFilter, UNS16 ar, UNS16 mr) -00336 { -00337 if (! canTestInitMode(adrCAN)) { -00338 /* Error because not init mode */ -00339 MSG_WAR(0X2602, "not in init mode ", 0); -00340 return 1; -00341 } -00342 switch (nFilter) { -00343 case 0: -00344 nFilter = CANIDAR0; /* First bank */ -00345 break; -00346 case 1: -00347 nFilter = CANIDAR2; /* First bank */ -00348 break; -00349 case 2: -00350 nFilter = CANIDAR4; /* Second bank */ -00351 break; -00352 case 3: -00353 nFilter = CANIDAR6; /* Second bank */ -00354 } -00355 /* address of CANIDARx */ -00356 IO_PORTS_8(adrCAN + nFilter) = (UNS8) (ar >> 8); -00357 IO_PORTS_8(adrCAN + nFilter + 1) = (UNS8) (ar); -00358 IO_PORTS_8(adrCAN + nFilter + 4) = (UNS8) (mr >> 8); -00359 IO_PORTS_8(adrCAN + nFilter + 5) = (UNS8) (mr); -00360 return 0; -00361 } -00362 -00363 /***************************************************************************/ -00364 char canInitFilter(UNS16 adrCAN, canBusFilterInit fi) -00365 { -00366 if (! canTestInitMode(adrCAN)) { -00367 /* Error because not init mode */ -00368 MSG_WAR(0X2603, "not in init mode ", 0); -00369 return 1; -00370 } -00371 IO_PORTS_8(adrCAN + CANIDAC) = fi.idam << 4; -00372 IO_PORTS_8(adrCAN + CANIDAR0) = fi.canidar0; -00373 IO_PORTS_8(adrCAN + CANIDMR0) = fi.canidmr0; -00374 IO_PORTS_8(adrCAN + CANIDAR1) = fi.canidar1; -00375 IO_PORTS_8(adrCAN + CANIDMR1) = fi.canidmr1; -00376 IO_PORTS_8(adrCAN + CANIDAR2) = fi.canidar2; -00377 IO_PORTS_8(adrCAN + CANIDMR2) = fi.canidmr2; -00378 IO_PORTS_8(adrCAN + CANIDAR3) = fi.canidar3; -00379 IO_PORTS_8(adrCAN + CANIDMR3) = fi.canidmr3; -00380 IO_PORTS_8(adrCAN + CANIDAR4) = fi.canidar4; -00381 IO_PORTS_8(adrCAN + CANIDMR4) = fi.canidmr4; -00382 IO_PORTS_8(adrCAN + CANIDAR5) = fi.canidar5; -00383 IO_PORTS_8(adrCAN + CANIDMR5) = fi.canidmr5; -00384 IO_PORTS_8(adrCAN + CANIDAR6) = fi.canidar6; -00385 IO_PORTS_8(adrCAN + CANIDMR6) = fi.canidmr6; -00386 IO_PORTS_8(adrCAN + CANIDAR7) = fi.canidar7; -00387 IO_PORTS_8(adrCAN + CANIDMR7) = fi.canidmr7; -00388 return 0; -00389 } -00390 -00391 /***************************************************************************/ -00392 char canInitMode(UNS16 adrCAN) -00393 { -00394 IO_PORTS_8(adrCAN + CANCTL0) |= 0x01; /* Set the bit INITRQ */ -00395 while (! canTestInitMode(adrCAN)) { -00396 } -00397 return 0; -00398 } -00399 -00400 /***************************************************************************/ -00401 char canInitModeQ(UNS16 adrCAN) -00402 { -00403 IO_PORTS_8(adrCAN + CANCTL0) &= 0xFE; /* Clear the bit INITRQ */ -00404 while (canTestInitMode(adrCAN)) { -00405 } -00406 return 0; -00407 } -00408 -00409 /***************************************************************************/ -00410 char canMsgTransmit(UNS16 adrCAN, Message msg) -00411 { -00412 /* Remind : only CAN A msg implemented. ie id on 11 bits, not 29 */ -00413 UNS8 cantflg; -00414 UNS8 i; -00415 /* Looking for a free buffer */ -00416 cantflg = IO_PORTS_8(adrCAN + CANTFLG); -00417 if ( cantflg == 0) { /* all the TXEx are set */ -00418 MSG_WAR(0X2604, "No buffer free. Msg to transmit is losted ", 0); -00419 return 1; /* No buffer free */ -00420 } -00421 else{ -00422 /* Selecting a buffer */ -00423 IO_PORTS_8(adrCAN + CANTBSEL) = cantflg; -00424 /* We put ide = 0 because id is on 11 bits only */ -00425 IO_PORTS_8(adrCAN + CANTRSID) = (UNS8)(msg.cob_id.w >> 3); -00426 IO_PORTS_8(adrCAN + CANTRSID + 1) = (UNS8)((msg.cob_id.w << 5)| -00427 (msg.rtr << 4)); -00428 -00429 IO_PORTS_8(adrCAN + CANTRSLEN) = msg.len & 0X0F; -00430 /* For the priority, we put the highter bits of the cob_id */ -00431 IO_PORTS_8(adrCAN + CANTRSPRI) = IO_PORTS_8(adrCAN + CANTRSID); -00432 for (i = 0 ; i < msg.len ; i++) { -00433 IO_PORTS_8(adrCAN + CANTRSDTA + i) = msg.data[i]; -00434 } -00435 /* Transmitting the message */ -00436 cantflg = IO_PORTS_8(adrCAN + CANTBSEL);/* to know which buf is selected */ -00437 IO_PORTS_8(adrCAN + CANTBSEL) = 0x00; -00438 IO_PORTS_8(adrCAN + CANTFLG) = cantflg; /* Ready to transmit ! */ -00439 -00440 } -00441 return 0; -00442 } -00443 -00444 /***************************************************************************/ -00445 char canSetInterrupt(UNS16 adrCAN) -00446 { -00447 IO_PORTS_8(adrCAN + CANRIER) = 0X01; /* Allow interruptions on receive */ -00448 IO_PORTS_8(adrCAN + CANTIER) = 0X00; /* disallow interruptions on transmit */ -00449 return 0; -00450 } -00451 /***************************************************************************/ -00452 char canSleepMode(UNS16 adrCAN) -00453 { -00454 IO_PORTS_8(adrCAN + CANCTL0) &= 0xFB; /* clr the bit WUPE to avoid a wake-up*/ -00455 IO_PORTS_8(adrCAN + CANCTL0) |= 0x02; /* Set the bit SLPRQ. go to Sleep !*/ -00456 -00457 // IO_PORTS_8(adrCAN + CANCTL1) |= 0x04; -00458 // IO_PORTS_8(adrCAN + CANCTL0) |= 0x02; /* Set the bit SLPRQ */ -00459 while ( ! canTestSleepMode(adrCAN)) { -00460 } -00461 -00462 return 0; -00463 } -00464 -00465 /***************************************************************************/ -00466 char canSleepModeQ(UNS16 adrCAN) -00467 { -00468 if (canTestInitMode(adrCAN)) { -00469 /* Error because in init mode */ -00470 MSG_WAR(0X2606, "not in init mode ", 0); -00471 return 1; -00472 } -00473 IO_PORTS_8(adrCAN + CANCTL0) &= 0xFD; /* clr the bit SLPRQ */ -00474 while ( canTestSleepMode(adrCAN)) { -00475 } -00476 return 0; -00477 } -00478 -00479 /***************************************************************************/ -00480 char canSleepWupMode(UNS16 adrCAN) -00481 { -00482 if (canTestInitMode(adrCAN)) { -00483 MSG_WAR(0X2607, "not in init mode ", 0); -00484 return 1; -00485 } -00486 IO_PORTS_8(adrCAN + CANCTL0) |= 0x06; /* Set the bits WUPE & SLPRQ */ -00487 while ( ! canTestSleepMode(adrCAN)) { -00488 } -00489 return 0; -00490 } -00491 -00492 /***************************************************************************/ -00493 char canTestInitMode(UNS16 adrCAN) -00494 { -00495 return IO_PORTS_8(adrCAN + CANCTL1) & 0x01; /* Test the bit INITAK */ -00496 } -00497 -00498 /***************************************************************************/ -00499 char canTestSleepMode(UNS16 adrCAN) -00500 { -00501 return IO_PORTS_8(adrCAN + CANCTL1) & 0x02; /* Test the bit SLPAK */ -00502 } -00503 -00504 /***************************************************************************/ -00505 UNS8 canSend(UNS8 notused, Message *m) -00506 { -00507 canMsgTransmit(CANOPEN_LINE_NUMBER_USED, *m); -00508 return 0; -00509 } -00510 -00511 -00512 /**************************************************************************/ -00513 UNS8 f_can_receive(UNS8 notused, Message *msgRcv) -00514 { -00515 UNS8 i, j; -00516 -00517 switch (CANOPEN_LINE_NUMBER_USED) { -00518 case CAN0 : j = 0; break; -00519 case CAN1 : j = 1; break; -00520 case CAN2 : j = 2; break; -00521 case CAN3 : j = 3; break; -00522 case CAN4 : j = 4; break; -00523 } -00524 -00525 /* See if a message is pending in the stack */ -00526 if (ptrMsgRcv[j].r == ptrMsgRcv[j].w) -00527 return 0x0; // No new message -00528 -00529 /* Increment the reading pointer of the stack */ -00530 if (ptrMsgRcv[j].r == (MAX_STACK_MSG_RCV - 1)) -00531 ptrMsgRcv[j].r = 0; -00532 else -00533 ptrMsgRcv[j].r ++; -00534 -00535 /* Store the message from the stack*/ -00536 msgRcv->cob_id.w = stackMsgRcv[j][ptrMsgRcv[j].r].cob_id.w; -00537 msgRcv->len = stackMsgRcv[j][ptrMsgRcv[j].r].len; -00538 msgRcv->rtr = stackMsgRcv[j][ptrMsgRcv[j].r].rtr; -00539 for (i = 0 ; i < stackMsgRcv[j][ptrMsgRcv[j].r].len ; i++) -00540 msgRcv->data[i] = stackMsgRcv[j][ptrMsgRcv[j].r].data[i]; -00541 return 0xFF; -00542 } -00543 -00544 -00545 /****************************************************************************** -00546 ******************************* CAN INTERRUPT *******************************/ -00547 -00548 void __attribute__((interrupt)) can0HdlTra (void) -00549 { -00550 -00551 } -00552 -00553 void __attribute__((interrupt)) can0HdlRcv (void) -00554 { -00555 UNS8 i; -00556 lock(); -00557 IO_PORTS_8(PORTB) &= ~ 0x40; // led 6 port B : ON -00558 UNS8 NewPtrW; -00559 /* We are obliged to save the message while the interruption is pending */ -00560 /* Increment the writing stack pointer before writing the msg */ -00561 if (ptrMsgRcv[0].w == (MAX_STACK_MSG_RCV - 1)) -00562 NewPtrW = 0; -00563 else -00564 NewPtrW = ptrMsgRcv[0].w + 1; -00565 -00566 if (NewPtrW == ptrMsgRcv[0].r) { -00567 /* The stack is full. The last msg received before this one is lost */ -00568 MSG_WAR(0X1620, "Stack for received msg is full", 0); -00569 //IO_PORTS_8(PORTB) &= ~0x40; // led 6 : ON (for debogue) -00570 } -00571 else -00572 ptrMsgRcv[0].w = NewPtrW; -00573 -00574 /* Store the message */ -00575 stackMsgRcv[0][ptrMsgRcv[0].w].cob_id.w = IO_PORTS_16(CAN0 + CANRCVID) >> 5; -00576 stackMsgRcv[0][ptrMsgRcv[0].w].len = IO_PORTS_8(CAN0 + CANRCVLEN) & 0x0F; -00577 stackMsgRcv[0][ptrMsgRcv[0].w].rtr = (IO_PORTS_8(CAN0 + CANRCVID + 1) >> 4) & 0x01; -00578 for (i = 0 ; i < stackMsgRcv[0][ptrMsgRcv[0].w].len ; i++) -00579 stackMsgRcv[0][ptrMsgRcv[0].w].data[i] = IO_PORTS_8(CAN0 + CANRCVDTA + i); -00580 -00581 // The message is stored , so -00582 // we can now release the receive foreground buffer -00583 // and acknowledge the interruption -00584 IO_PORTS_8(CAN0 + CANRFLG) |= 0x01; -00585 // Not very usefull -00586 IO_PORTS_8(CAN0 + CANCTL0) |= 0x80; -00587 IO_PORTS_8(PORTB) |= 0x40; // led 6 port B : OFF -00588 unlock(); -00589 } -00590 -00591 void __attribute__((interrupt)) can0HdlWup (void) -00592 { -00593 -00594 } -00595 -00596 void __attribute__((interrupt)) can0HdlErr (void) -00597 { -00598 -00599 } -00600 -00601 void __attribute__((interrupt)) can1HdlTra (void) -00602 { -00603 -00604 } -00605 -00606 void __attribute__((interrupt)) can1HdlRcv (void) -00607 { -00608 UNS8 i; -00609 lock(); -00610 UNS8 NewPtrW; -00611 /* We are obliged to save the message while the interruption is pending */ -00612 /* Increment the writing stack pointer before writing the msg */ -00613 if (ptrMsgRcv[1].w == (MAX_STACK_MSG_RCV - 1)) -00614 NewPtrW = 0; -00615 else -00616 NewPtrW = ptrMsgRcv[1].w + 1; -00617 -00618 if (NewPtrW == ptrMsgRcv[1].r) { -00619 /* The stack is full. The last msg received before this one is lost */ -00620 MSG_WAR(0X2620, "Stack for received msg is full", 0); -00621 } -00622 else -00623 ptrMsgRcv[1].w = NewPtrW; -00624 -00625 /* Store the message */ -00626 stackMsgRcv[1][ptrMsgRcv[1].w].cob_id.w = IO_PORTS_16(CAN1 + CANRCVID) >> 5; -00627 stackMsgRcv[1][ptrMsgRcv[1].w].len = IO_PORTS_8(CAN1 + CANRCVLEN) & 0x0F; -00628 stackMsgRcv[0][ptrMsgRcv[0].w].rtr = (IO_PORTS_8(CAN1 + CANRCVID + 1) >> 4) & 0x01; -00629 for (i = 0 ; i < stackMsgRcv[1][ptrMsgRcv[1].w].len ; i++) -00630 stackMsgRcv[1][ptrMsgRcv[1].w].data[i] = IO_PORTS_8(CAN1 + CANRCVDTA + i); -00631 -00632 // The message is stored , so -00633 // we can now release the receive foreground buffer -00634 // and acknowledge the interruption -00635 IO_PORTS_8(CAN1 + CANRFLG) |= 0x01; -00636 // Not very usefull -00637 IO_PORTS_8(CAN1 + CANCTL0) |= 0x80; -00638 unlock(); -00639 } -00640 -00641 void __attribute__((interrupt)) can1HdlWup (void) -00642 { -00643 -00644 } -00645 -00646 void __attribute__((interrupt)) can1HdlErr (void) -00647 { -00648 -00649 } -00650 -00651 void __attribute__((interrupt)) can2HdlTra (void) -00652 { -00653 -00654 } -00655 -00656 void __attribute__((interrupt)) can2HdlRcv (void) -00657 { -00658 -00659 } -00660 -00661 void __attribute__((interrupt)) can2HdlWup (void) -00662 { -00663 -00664 } -00665 -00666 void __attribute__((interrupt)) can2HdlErr (void) -00667 { -00668 -00669 } -00670 -00671 void __attribute__((interrupt)) can3HdlTra (void) -00672 { -00673 -00674 } -00675 -00676 void __attribute__((interrupt)) can3HdlRcv (void) -00677 { -00678 -00679 } -00680 -00681 void __attribute__((interrupt)) can3HdlWup (void) -00682 { -00683 -00684 } -00685 -00686 void __attribute__((interrupt)) can3HdlErr (void) -00687 { -00688 -00689 } -00690 -00691 void __attribute__((interrupt)) can4HdlTra (void) -00692 { -00693 -00694 } -00695 -00696 void __attribute__((interrupt)) can4HdlRcv (void) -00697 { -00698 -00699 } -00700 -00701 void __attribute__((interrupt)) can4HdlWup (void) -00702 { -00703 -00704 } -00705 -00706 void __attribute__((interrupt)) can4HdlErr (void) -00707 { -00708 -00709 } -00710 -00711 -00712 -
#include <stddef.h>
#include "../include/hcs12/asm-m68hc12/portsaccess.h"
#include "../include/hcs12/asm-m68hc12/ports_def.h"
#include "../include/hcs12/asm-m68hc12/ports.h"
#include "../include/data.h"
#include "../include/hcs12/applicfg.h"
#include "../include/hcs12/candriver.h"
#include "../include/hcs12/interrupt.h"
#include "../include/hcs12/canOpenDriver.h"
#include "../include/can.h"
#include "../include/objdictdef.h"
#include "../include/timer.h"
-Include dependency graph for canOpenDriver.c:
-Go to the source code of this file.
Defines | |
#define | DEBUG_WAR_CONSOLE_ON |
#define | DEBUG_ERR_CONSOLE_ON |
#define | max(a, b) a>b?a:b |
Functions | |
UNS8 | f_can_receive (UNS8 notused, Message *m) |
UNS8 | canSend (UNS8 notused, Message *m) |
void | __attribute__ ((interrupt)) |
TIMEVAL | getElapsedTime () |
void | resetTimer (void) |
void | initTimer (void) |
void | initSCI_0 (void) |
Initialisation of the serial port 0. | |
void | initSCI_1 (void) |
Initialisation of the serial port 1. | |
char * | hex_convert (char *buf, unsigned long value, char lastCar) |
void | printSCI_str (char sci, const char *str) |
void | printSCI_nbr (char sci, unsigned long nbr, char lastCar) |
void | initPLL (void) |
void | initHCS12 (void) |
Put here all the code to init the HCS12. | |
char | canAddIdToFilter (UNS16 adrCAN, UNS8 nFilter, UNS16 id) |
char | canChangeFilter (UNS16 adrCAN, canBusFilterInit fi) |
char | canEnable (UNS16 adrCAN) |
char | canInit (UNS16 adrCAN, canBusInit bi) |
char | canInitClock (UNS16 adrCAN, canBusTime clk) |
char | canInit1Filter (UNS16 adrCAN, UNS8 nFilter, UNS16 ar, UNS16 mr) |
char | canInitFilter (UNS16 adrCAN, canBusFilterInit fi) |
char | canInitMode (UNS16 adrCAN) |
char | canInitModeQ (UNS16 adrCAN) |
char | canMsgTransmit (UNS16 adrCAN, Message msg) |
char | canSetInterrupt (UNS16 adrCAN) |
char | canSleepMode (UNS16 adrCAN) |
char | canSleepModeQ (UNS16 adrCAN) |
char | canSleepWupMode (UNS16 adrCAN) |
char | canTestInitMode (UNS16 adrCAN) |
char | canTestSleepMode (UNS16 adrCAN) |
#define DEBUG_ERR_CONSOLE_ON | -
- -
-Definition at line 24 of file canOpenDriver.c. -
#define DEBUG_WAR_CONSOLE_ON | -
- -
-Definition at line 23 of file canOpenDriver.c. -
#define max | -( | -a, | |||
- | - | b | -- | ) | -a>b?a:b | -
- -
-
void __attribute__ | -( | -(interrupt) | -- | ) | -- |
-Message transmitted on MSCAN 0 -
-Definition at line 54 of file canOpenDriver.c. -
-References IO_PORTS_16, and TC4H. -
char canAddIdToFilter | -( | -UNS16 | -adrCAN, | -|
- | - | UNS8 | -nFilter, | -|
- | - | UNS16 | -id | - |
- | ) | -- |
- -
-Definition at line 210 of file canOpenDriver.c. -
-References CANIDAR0, CANIDAR2, CANIDAR4, CANIDAR6, canTestInitMode(), IO_PORTS_16, IO_PORTS_8, MSG_WAR, and UNS8. -
-Here is the call graph for this function:
char canChangeFilter | -( | -UNS16 | -adrCAN, | -|
- | - | canBusFilterInit | -fi | - |
- | ) | -- |
- -
-Definition at line 250 of file canOpenDriver.c. -
-References canInitFilter(), canInitMode(), canInitModeQ(), canSetInterrupt(), canSleepMode(), canSleepModeQ(), and canTestInitMode(). -
-Referenced by gene_SYNC_operational(), and gene_SYNC_preOperational(). -
-Here is the call graph for this function:
char canEnable | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 266 of file canOpenDriver.c. -
-References CANCTL1, and IO_PORTS_8. -
-Referenced by canInit(). -
char canInit | -( | -UNS16 | -adrCAN, | -|
- | - | canBusInit | -bi | - |
- | ) | -- |
- -
-Definition at line 277 of file canOpenDriver.c. -
-References CANCTL0, CANCTL1, canBusInit::cane, canEnable(), canInitClock(), canInitFilter(), canInitMode(), canInitModeQ(), canSetInterrupt(), canSleepMode(), canSleepModeQ(), canTestInitMode(), canBusInit::clk, canBusInit::cswai, canBusInit::fi, IO_PORTS_8, canBusInit::listen, canBusInit::loopb, canBusInit::time, and canBusInit::wupm. -
-Here is the call graph for this function:
char canInit1Filter | -( | -UNS16 | -adrCAN, | -|
- | - | UNS8 | -nFilter, | -|
- | - | UNS16 | -ar, | -|
- | - | UNS16 | -mr | - |
- | ) | -- |
- -
-Definition at line 335 of file canOpenDriver.c. -
-References CANIDAR0, CANIDAR2, CANIDAR4, CANIDAR6, canTestInitMode(), IO_PORTS_8, MSG_WAR, and UNS8. -
-Here is the call graph for this function:
char canInitClock | -( | -UNS16 | -adrCAN, | -|
- | - | canBusTime | -clk | - |
- | ) | -- |
- -
-Definition at line 313 of file canOpenDriver.c. -
-References canBusTime::brp, CANBTR0, CANBTR1, CANCTL1, canTestInitMode(), canBusTime::clksrc, IO_PORTS_8, MSG_WAR, canBusTime::samp, canBusTime::sjw, canBusTime::tseg1, and canBusTime::tseg2. -
-Referenced by canInit(). -
-Here is the call graph for this function:
char canInitFilter | -( | -UNS16 | -adrCAN, | -|
- | - | canBusFilterInit | -fi | - |
- | ) | -- |
- -
-Definition at line 364 of file canOpenDriver.c. -
-References CANIDAC, CANIDAR0, canBusFilterInit::canidar0, CANIDAR1, canBusFilterInit::canidar1, CANIDAR2, canBusFilterInit::canidar2, CANIDAR3, canBusFilterInit::canidar3, CANIDAR4, canBusFilterInit::canidar4, CANIDAR5, canBusFilterInit::canidar5, CANIDAR6, canBusFilterInit::canidar6, CANIDAR7, canBusFilterInit::canidar7, CANIDMR0, canBusFilterInit::canidmr0, CANIDMR1, canBusFilterInit::canidmr1, CANIDMR2, canBusFilterInit::canidmr2, CANIDMR3, canBusFilterInit::canidmr3, CANIDMR4, canBusFilterInit::canidmr4, CANIDMR5, canBusFilterInit::canidmr5, CANIDMR6, canBusFilterInit::canidmr6, CANIDMR7, canBusFilterInit::canidmr7, canTestInitMode(), canBusFilterInit::idam, IO_PORTS_8, and MSG_WAR. -
-Referenced by canChangeFilter(), and canInit(). -
-Here is the call graph for this function:
char canInitMode | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 392 of file canOpenDriver.c. -
-References CANCTL0, canTestInitMode(), and IO_PORTS_8. -
-Referenced by canChangeFilter(), and canInit(). -
-Here is the call graph for this function:
char canInitModeQ | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 401 of file canOpenDriver.c. -
-References CANCTL0, canTestInitMode(), and IO_PORTS_8. -
-Referenced by canChangeFilter(), and canInit(). -
-Here is the call graph for this function:
char canMsgTransmit | -( | -UNS16 | -adrCAN, | -|
- | - | Message | -msg | - |
- | ) | -- |
- -
-Definition at line 410 of file canOpenDriver.c. -
-References CANTBSEL, CANTFLG, CANTRSDTA, CANTRSID, CANTRSLEN, CANTRSPRI, Message::cob_id, Message::data, IO_PORTS_8, Message::len, MSG_WAR, Message::rtr, UNS8, and SHORT_CAN::w. -
-Referenced by canSend(). -
UNS8 canSend | -( | -UNS8 | -notused, | -|
- | - | Message * | -m | - |
- | ) | -- |
- -
-Definition at line 505 of file canOpenDriver.c. -
-References canMsgTransmit(), and CANOPEN_LINE_NUMBER_USED. -
-Referenced by _sendPDOevent(), canSend(), LoadCanDriver(), masterSendNMTnodeguard(), masterSendNMTstateChange(), proceedNODE_GUARD(), proceedPDO(), ProducerHearbeatAlarm(), sendPDOrequest(), sendSDO(), sendSYNC(), and slaveSendBootUp(). -
-Here is the call graph for this function:
char canSetInterrupt | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 445 of file canOpenDriver.c. -
-References CANRIER, CANTIER, and IO_PORTS_8. -
-Referenced by canChangeFilter(), and canInit(). -
char canSleepMode | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 452 of file canOpenDriver.c. -
-References CANCTL0, canTestSleepMode(), and IO_PORTS_8. -
-Referenced by canChangeFilter(), and canInit(). -
-Here is the call graph for this function:
char canSleepModeQ | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 466 of file canOpenDriver.c. -
-References CANCTL0, canTestInitMode(), canTestSleepMode(), IO_PORTS_8, and MSG_WAR. -
-Referenced by canChangeFilter(), and canInit(). -
-Here is the call graph for this function:
char canSleepWupMode | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 480 of file canOpenDriver.c. -
-References CANCTL0, canTestInitMode(), canTestSleepMode(), IO_PORTS_8, and MSG_WAR. -
-Here is the call graph for this function:
char canTestInitMode | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 493 of file canOpenDriver.c. -
-References CANCTL1, and IO_PORTS_8. -
-Referenced by canAddIdToFilter(), canChangeFilter(), canInit(), canInit1Filter(), canInitClock(), canInitFilter(), canInitMode(), canInitModeQ(), canSleepModeQ(), and canSleepWupMode(). -
char canTestSleepMode | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 499 of file canOpenDriver.c. -
-References CANCTL1, and IO_PORTS_8. -
-Referenced by canSleepMode(), canSleepModeQ(), and canSleepWupMode(). -
UNS8 f_can_receive | -( | -UNS8 | -notused, | -|
- | - | Message * | -m | - |
- | ) | -- |
- -
-Definition at line 513 of file canOpenDriver.c. -
-References CAN0, CAN1, CAN2, CAN3, CAN4, CANOPEN_LINE_NUMBER_USED, Message::cob_id, Message::data, Message::len, MAX_STACK_MSG_RCV, t_pointerStack::r, Message::rtr, UNS8, and SHORT_CAN::w. -
-Referenced by main(). -
TIMEVAL getElapsedTime | -( | -void | -- | ) | -- |
- -
-Definition at line 66 of file canOpenDriver.c. -
-Referenced by StartTimerLoop(), and TimeDispatch(). -
char* hex_convert | -( | -char * | -buf, | -|
- | - | unsigned long | -value, | -|
- | - | char | -lastCar | - |
- | ) | -- |
-Convert an integer to a string in hexadecimal format If you do not wants to use a lastCar, put lastCar = '' (end of string) ex : value = 0XABCDEF and lastCar = '
-' buf[0] = '0' buf[1] = 'X' buf[2] = 'A' .... buf[7] = 'F' buf[8] = '
-' buf[9] = ''
-
-Definition at line 135 of file canOpenDriver.c. -
-Referenced by printSCI_nbr(). -
void initHCS12 | -( | -void | -- | ) | -- |
-Put here all the code to init the HCS12. -
- -
-Definition at line 199 of file canOpenDriver.c. -
-References initPLL(), and MSG_WAR. -
-Referenced by initSensor(). -
-Here is the call graph for this function:
void initPLL | -( | -void | -- | ) | -- |
-to start using the PLL. Bus clock becomes 24 MHz if the quartz on the board is at 16 MHz -
-Definition at line 188 of file canOpenDriver.c. -
-References CLKSEL, CRGFLG, IO_PORTS_8, PLLCTL, REFDV, and SYNR. -
-Referenced by initHCS12(). -
void initSCI_0 | -( | -void | -- | ) | -- |
-Initialisation of the serial port 0. -
- -
-Definition at line 115 of file canOpenDriver.c. -
-References BUS_CLOCK, IO_PORTS_16, IO_PORTS_8, SCI0, SCIBDH, SCICR1, SCICR2, and SERIAL_SCI0_BAUD_RATE. -
void initSCI_1 | -( | -void | -- | ) | -- |
-Initialisation of the serial port 1. -
- -
-Definition at line 124 of file canOpenDriver.c. -
-References BUS_CLOCK, IO_PORTS_16, IO_PORTS_8, SCI1, SCIBDH, SCICR1, SCICR2, and SERIAL_SCI1_BAUD_RATE. -
void initTimer | -( | -void | -- | ) | -- |
- -
-Definition at line 79 of file canOpenDriver.c. -
-Referenced by initSensor(), and StartTimerLoop(). -
void printSCI_nbr | -( | -char | -sci, | -|
- | - | unsigned long | -nbr, | -|
- | - | char | -lastCar | - |
- | ) | -- |
-Print the number in hexadecimal to the serial port sci (sci takes the values SCI0 or SCI1) -
-Definition at line 179 of file canOpenDriver.c. -
-References hex_convert(), and printSCI_str(). -
-Here is the call graph for this function:
void printSCI_str | -( | -char | -sci, | -|
- | - | const char * | -str | - |
- | ) | -- |
-Print the string to the serial port sci (sci takes the values SCI0 or SCI1) -
-Definition at line 162 of file canOpenDriver.c. -
-References IO_PORTS_8, SCIDRL, and SCISR1. -
-Referenced by printSCI_nbr(). -
void resetTimer | -( | -void | -- | ) | -- |
- -
-Definition at line 73 of file canOpenDriver.c. -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 -00024 #ifndef __CANOPENDRIVER__ -00025 #define __CANOPENDRIVER__ -00026 -00027 -00028 -00029 // --------- to be called by user app --------- -00030 -00031 void initTimer(void); -00032 void resetTimer(void); -00033 void TimerLoop(void); -00034 -00041 UNS8 f_can_receive(UNS8 notused, Message *m); -00042 -00043 #endif -
-Go to the source code of this file.
Functions | |
void | initTimer (void) |
void | resetTimer (void) |
void | TimerLoop (void) |
UNS8 | f_can_receive (UNS8 notused, Message *m) |
UNS8 f_can_receive | -( | -UNS8 | -notused, | -|
- | - | Message * | -m | - |
- | ) | -- |
-Returns 0 if no message received, 0xFF if the receiving stack is not empty. May be call in polling. You can also call canDispatch(...) in void __attribute__((interrupt)) can0HdlRcv (void) (see include/hcs12/canOpenDriver.c) -
void initTimer | -( | -void | -- | ) | -- |
- -
-Definition at line 79 of file canOpenDriver.c. -
-References IO_PORTS_8, last_sig, lock(), TCTL1, TIE, timer, timer_notify(), TIOS, TSCR1, TSCR2, and unlock(). -
-Here is the call graph for this function:
void resetTimer | -( | -void | -- | ) | -- |
- -
-Definition at line 73 of file canOpenDriver.c. -
void TimerLoop | -( | -void | -- | ) | -- |
- -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #ifndef __can_h__ -00024 #define __can_h__ -00025 -00026 #include "applicfg.h" -00028 /* -00029 union SHORT_CAN { -00030 struct { UNS8 b0,b1; } b; -00031 UNS32 w; -00032 }; -00033 */ -00034 -00035 typedef struct { -00036 UNS32 w; /* 32 bits */ -00037 } SHORT_CAN; -00038 -00039 -00041 typedef struct { -00042 SHORT_CAN cob_id; /* l'ID du mesg */ -00043 UNS8 rtr; /* remote transmission request. 0 if not rtr, -00044 1 for a rtr message */ -00045 UNS8 len; /* message length (0 to 8) */ -00046 UNS8 data[8]; /* data */ -00047 } Message; -00048 -00049 #define Message_Initializer {0,0,0,{0,0,0,0,0,0,0,0}} -00050 -00051 typedef UNS8 (*canSend_t)(Message *); -00052 -00053 #endif /* __can_h__ */ -
#include "applicfg.h"
-Include dependency graph for can.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Data Structures | |
struct | SHORT_CAN |
struct | Message |
Defines | |
#define | Message_Initializer {0,0,0,{0,0,0,0,0,0,0,0}} |
Typedefs | |
typedef UNS8(*) | canSend_t (Message *) |
#define Message_Initializer {0,0,0,{0,0,0,0,0,0,0,0}} | -
-
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #ifndef __can_driver_h__ -00024 #define __can_driver_h__ -00025 -00026 struct struct_s_BOARD; -00027 -00028 typedef struct struct_s_BOARD s_BOARD; -00029 -00030 #include "applicfg.h" -00031 #include "can.h" -00032 -00033 struct struct_s_BOARD { -00034 char * busname; -00035 char * baudrate; -00036 }; -00037 -00038 #ifndef DLL_CALL -00039 #define DLL_CALL(funcname) funcname##_driver -00040 #endif -00041 -00042 #ifndef FCT_PTR_INIT -00043 #define FCT_PTR_INIT -00044 #endif -00045 -00046 -00047 UNS8 DLL_CALL(canReceive)(CAN_HANDLE, Message *)FCT_PTR_INIT; -00048 UNS8 DLL_CALL(canSend)(CAN_HANDLE, Message *)FCT_PTR_INIT; -00049 CAN_HANDLE DLL_CALL(canOpen)(s_BOARD *)FCT_PTR_INIT; -00050 int DLL_CALL(canClose)(CAN_HANDLE)FCT_PTR_INIT; -00051 -00052 #endif -
#include "applicfg.h"
#include "can.h"
-Include dependency graph for can_driver.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Data Structures | |
struct | struct_s_BOARD |
Defines | |
#define | DLL_CALL(funcname) funcname##_driver |
Typedefs | |
typedef struct_s_BOARD | s_BOARD |
Functions | |
UNS8 DLL_CALL() | canReceive (CAN_HANDLE, Message *) FCT_PTR_INIT |
UNS8 DLL_CALL() | canSend (CAN_HANDLE, Message *) FCT_PTR_INIT |
CAN_HANDLE DLL_CALL() | canOpen (s_BOARD *) FCT_PTR_INIT |
int DLL_CALL() | canClose (CAN_HANDLE) FCT_PTR_INIT |
#define DLL_CALL | -( | -funcname | -- | ) | -funcname##_driver | -
- -
-Definition at line 39 of file can_driver.h. -
-
typedef struct struct_s_BOARD s_BOARD | -
- -
-Definition at line 28 of file can_driver.h. -
-
int DLL_CALL() canClose | -( | -CAN_HANDLE | -- | ) | -- |
- -
CAN_HANDLE DLL_CALL() canOpen | -( | -s_BOARD * | -- | ) | -- |
- -
UNS8 DLL_CALL() canReceive | -( | -CAN_HANDLE | -, | -|
- | - | Message * | -- | |
- | ) | -- |
- -
-Definition at line 124 of file drivers_win32.cpp. -
-References driver_data::inst, driver_procs::m_canReceive, and s_driver_procs. -
-Referenced by canReceiveLoop(), and LoadCanDriver(). -
UNS8 DLL_CALL() canSend | -( | -CAN_HANDLE | -, | -|
- | - | Message * | -- | |
- | ) | -- |
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #include <stdio.h> -00024 #include <string.h> -00025 #include <errno.h> -00026 #include <fcntl.h> -00027 -00028 #include "canmsg.h" -00029 #include "lincan.h" -00030 -00031 #include "can_driver.h" -00032 -00033 /*********functions which permit to communicate with the board****************/ -00034 UNS8 canReceive_driver(CAN_HANDLE fd0, Message *m) -00035 { -00036 int res; -00037 struct canmsg_t canmsg; -00038 -00039 canmsg.flags = 0; /* Ensure standard receive, not required for LinCAN>=0.3.1 */ -00040 -00041 do{ -00042 res = read(fd0,&canmsg,sizeof(canmsg_t)); -00043 if((res<0)&&(errno == -EAGAIN)) res = 0; -00044 }while(res==0); -00045 -00046 if(res != sizeof(canmsg_t)) // No new message -00047 return 1; -00048 -00049 if(canmsg.flags&MSG_EXT){ -00050 /* There is no mark for extended messages in CanFestival */; -00051 } -00052 -00053 m->cob_id.w = canmsg.id; -00054 m->len = canmsg.length; -00055 if(canmsg.flags&MSG_RTR){ -00056 m->rtr = 1; -00057 }else{ -00058 m->rtr = 0; -00059 memcpy(m->data,canmsg.data,8); -00060 } -00061 -00062 return 0; -00063 } -00064 -00065 /***************************************************************************/ -00066 UNS8 canSend_driver(CAN_HANDLE fd0, Message *m) -00067 { -00068 int res; -00069 struct canmsg_t canmsg; -00070 -00071 -00072 canmsg.flags = 0; -00073 canmsg.id = m->cob_id.w; -00074 canmsg.length = m->len; -00075 if(m->rtr){ -00076 canmsg.flags |= MSG_RTR; -00077 }else{ -00078 memcpy(canmsg.data,m->data,8); -00079 } -00080 -00081 if(canmsg.id >= 0x800){ -00082 canmsg.flags |= MSG_EXT; -00083 } -00084 -00085 res = write(fd0,&canmsg,sizeof(canmsg_t)); -00086 if(res!=sizeof(canmsg_t)) -00087 return 1; -00088 -00089 return 0; -00090 } -00091 -00092 /***************************************************************************/ -00093 static const char lnx_can_dev_prefix[] = "/dev/can"; -00094 -00095 CAN_HANDLE canOpen_driver(s_BOARD *board) -00096 { -00097 int name_len = strlen(board->busname); -00098 int prefix_len = strlen(lnx_can_dev_prefix); -00099 char dev_name[prefix_len+name_len+1]; -00100 int o_flags = 0; -00101 CAN_HANDLE fd0; -00102 -00103 fd0=malloc(sizeof(*fd0)); -00104 if(fd0==NULL) -00105 return NULL; -00106 -00107 /*o_flags = O_NONBLOCK;*/ -00108 -00109 memcpy(dev_name,lnx_can_dev_prefix,prefix_len); -00110 memcpy(dev_name+prefix_len,board->busname,name_len); -00111 dev_name[prefix_len+name_len] = 0; -00112 -00113 fd0 = open(dev_name, O_RDWR|o_flags); -00114 if(fd0 < 0){ -00115 fprintf(stderr,"!!! Board %s is unknown. See can_lincan.c\n", board->busname); -00116 goto error_ret; -00117 } -00118 -00119 return fd0; -00120 -00121 error_ret: -00122 free(fd0); -00123 return NULL; -00124 } -00125 -00126 /***************************************************************************/ -00127 int canClose_driver(CAN_HANDLE fd0) -00128 { -00129 if(!fd0) -00130 return 0; -00131 close(fd0); -00132 return 0; -00133 } -
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include "canmsg.h"
#include "lincan.h"
#include "can_driver.h"
-Include dependency graph for can_lincan.c:
-Go to the source code of this file.
Functions | |
UNS8 | canReceive_driver (CAN_HANDLE fd0, Message *m) |
UNS8 | canSend_driver (CAN_HANDLE fd0, Message *m) |
CAN_HANDLE | canOpen_driver (s_BOARD *board) |
int | canClose_driver (CAN_HANDLE fd0) |
int canClose_driver | -( | -CAN_HANDLE | -fd0 | -) | -- |
- -
-Definition at line 127 of file can_lincan.c. -
CAN_HANDLE canOpen_driver | -( | -s_BOARD * | -board | -) | -- |
UNS8 canReceive_driver | -( | -CAN_HANDLE | -fd0, | -|
- | - | Message * | -m | - |
- | ) | -- |
- -
-Definition at line 34 of file can_lincan.c. -
-References Message::cob_id, canmsg_t::data, Message::data, canmsg_t::flags, canmsg_t::id, Message::len, canmsg_t::length, MSG_EXT, MSG_RTR, Message::rtr, and SHORT_CAN::w. -
UNS8 canSend_driver | -( | -CAN_HANDLE | -fd0, | -|
- | - | Message * | -m | - |
- | ) | -- |
- -
-Definition at line 66 of file can_lincan.c. -
-References Message::cob_id, Message::data, canmsg_t::data, canmsg_t::flags, canmsg_t::id, Message::len, canmsg_t::length, MSG_EXT, MSG_RTR, Message::rtr, and SHORT_CAN::w. -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #include <stdio.h> -00024 #include <string.h> -00025 #include <errno.h> -00026 #include <fcntl.h> -00027 -00028 /* driver pcan pci for Peak board */ -00029 //#include "libpcan.h" -00030 //#include "pcan.h" -00031 -00032 #include "libpcan.h" // for CAN_HANDLE -00033 -00034 #include "can_driver.h" -00035 -00036 // Define for rtr CAN message -00037 #define CAN_INIT_TYPE_ST_RTR MSGTYPE_STANDARD | MSGTYPE_RTR -00038 -00039 /*********functions which permit to communicate with the board****************/ -00040 UNS8 canReceive_driver(CAN_HANDLE fd0, Message *m) -00041 { -00042 UNS8 data; -00043 TPCANMsg peakMsg; -00044 if ((errno = CAN_Read(fd0, & peakMsg))) { // Blocks until no new message or error. -00045 if(errno != -EIDRM && errno != -EPERM) // error is not "Can Port closed while reading" -00046 { -00047 perror("canReceive_driver (Peak_Linux) : error of reading.\n"); -00048 } -00049 return 1; -00050 } -00051 m->cob_id.w = peakMsg.ID; -00052 if (peakMsg.MSGTYPE == CAN_INIT_TYPE_ST) /* bits of MSGTYPE_*/ -00053 m->rtr = 0; -00054 else -00055 m->rtr = 1; -00056 m->len = peakMsg.LEN; /* count of data bytes (0..8) */ -00057 for(data = 0 ; data < peakMsg.LEN ; data++) -00058 m->data[data] = peakMsg.DATA[data]; /* data bytes, up to 8 */ -00059 -00060 return 0; -00061 } -00062 -00063 /***************************************************************************/ -00064 UNS8 canSend_driver(CAN_HANDLE fd0, Message *m) -00065 { -00066 UNS8 data; -00067 TPCANMsg peakMsg; -00068 peakMsg.ID=m -> cob_id.w; /* 11/29 bit code */ -00069 if(m->rtr == 0) -00070 peakMsg.MSGTYPE = CAN_INIT_TYPE_ST; /* bits of MSGTYPE_*/ -00071 else { -00072 peakMsg.MSGTYPE = CAN_INIT_TYPE_ST_RTR; /* bits of MSGTYPE_*/ -00073 } -00074 peakMsg.LEN = m->len; -00075 /* count of data bytes (0..8) */ -00076 for(data = 0 ; data < m->len; data ++) -00077 peakMsg.DATA[data] = m->data[data]; /* data bytes, up to 8 */ -00078 -00079 if((errno = CAN_Write(fd0, & peakMsg))) { -00080 perror("canSend_driver (Peak_Linux) : error of writing.\n"); -00081 return 1; -00082 } -00083 return 0; -00084 -00085 } -00086 -00087 -00088 /***************************************************************************/ -00089 int TranslateBaudeRate(char* optarg){ -00090 if(!strcmp( optarg, "1M")) return CAN_BAUD_1M; -00091 if(!strcmp( optarg, "500K")) return CAN_BAUD_500K; -00092 if(!strcmp( optarg, "250K")) return CAN_BAUD_250K; -00093 if(!strcmp( optarg, "125K")) return CAN_BAUD_125K; -00094 if(!strcmp( optarg, "100K")) return CAN_BAUD_100K; -00095 if(!strcmp( optarg, "50K")) return CAN_BAUD_50K; -00096 if(!strcmp( optarg, "20K")) return CAN_BAUD_20K; -00097 if(!strcmp( optarg, "10K")) return CAN_BAUD_10K; -00098 if(!strcmp( optarg, "5K")) return CAN_BAUD_5K; -00099 if(!strcmp( optarg, "none")) return 0; -00100 return 0x0000; -00101 } -00102 -00103 /***************************************************************************/ -00104 CAN_HANDLE canOpen_driver(s_BOARD *board) -00105 { -00106 HANDLE fd0 = NULL; -00107 char busname[64]; -00108 char* pEnd; -00109 int i; -00110 int baudrate; -00111 -00112 if(strtol(board->busname, &pEnd,0) >= 0) -00113 { -00114 sprintf(busname,"/dev/pcan%s",board->busname); -00115 fd0 = LINUX_CAN_Open(busname, O_RDWR); -00116 } -00117 -00118 if(fd0 && (baudrate = TranslateBaudeRate(board->baudrate))) -00119 { -00120 CAN_Init(fd0, baudrate, CAN_INIT_TYPE_ST); -00121 }else{ -00122 fprintf(stderr, "canOpen_driver (Peak_Linux) : error opening %s\n", busname); -00123 } -00124 -00125 return (CAN_HANDLE)fd0; -00126 } -00127 -00128 /***************************************************************************/ -00129 int canClose_driver(CAN_HANDLE fd0) -00130 { -00131 CAN_Close(fd0); -00132 return 0; -00133 } -
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include "libpcan.h"
#include "can_driver.h"
-Include dependency graph for can_peak_linux.c:
-Go to the source code of this file.
Defines | |
#define | CAN_INIT_TYPE_ST_RTR MSGTYPE_STANDARD | MSGTYPE_RTR |
Functions | |
UNS8 | canReceive_driver (CAN_HANDLE fd0, Message *m) |
UNS8 | canSend_driver (CAN_HANDLE fd0, Message *m) |
int | TranslateBaudeRate (char *optarg) |
CAN_HANDLE | canOpen_driver (s_BOARD *board) |
int | canClose_driver (CAN_HANDLE fd0) |
#define CAN_INIT_TYPE_ST_RTR MSGTYPE_STANDARD | MSGTYPE_RTR | -
-
int canClose_driver | -( | -CAN_HANDLE | -fd0 | -) | -- |
- -
-Definition at line 129 of file can_peak_linux.c. -
CAN_HANDLE canOpen_driver | -( | -s_BOARD * | -board | -) | -- |
- -
-Definition at line 104 of file can_peak_linux.c. -
-References struct_s_BOARD::baudrate, struct_s_BOARD::busname, and TranslateBaudeRate(). -
-Here is the call graph for this function:
UNS8 canReceive_driver | -( | -CAN_HANDLE | -fd0, | -|
- | - | Message * | -m | - |
- | ) | -- |
- -
-Definition at line 40 of file can_peak_linux.c. -
-References Message::cob_id, Message::data, Message::len, Message::rtr, UNS8, and SHORT_CAN::w. -
UNS8 canSend_driver | -( | -CAN_HANDLE | -fd0, | -|
- | - | Message * | -m | - |
- | ) | -- |
- -
-Definition at line 64 of file can_peak_linux.c. -
-References CAN_INIT_TYPE_ST_RTR, Message::data, Message::len, Message::rtr, and UNS8. -
int TranslateBaudeRate | -( | -char * | -optarg | -) | -- |
- -
-Definition at line 89 of file can_peak_linux.c. -
-Referenced by canInit(), and canOpen_driver(). -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #if defined(WIN32) && !defined(__CYGWIN__) -00024 #define usleep(micro) Sleep(micro%1000 ? (micro/1000) + 1 : (micro/1000)) -00025 #else -00026 #include <stdio.h> -00027 #include <string.h> -00028 #include <errno.h> -00029 #include <fcntl.h> -00030 #endif -00031 -00032 #include "cancfg.h" -00033 #include "can_driver.h" -00034 -00035 #ifndef extra_PCAN_init_params -00036 #define extra_PCAN_init_params -00037 #else -00038 #define extra_PCAN_init_params\ -00039 ,getenv("PCANHwType") ? strtol(getenv("PCANHwType"),NULL,0):0\ -00040 ,getenv("PCANIO_Port") ? strtol(getenv("PCANIO_Port"),NULL,0):0\ -00041 ,getenv("PCANInterupt") ? strtol(getenv("PCANInterupt"),NULL,0):0 -00042 #endif -00043 -00044 static s_BOARD *first_board = NULL; -00045 #ifdef PCAN2_HEADER_ -00046 static s_BOARD *second_board = NULL; -00047 #endif -00048 -00049 //pthread_mutex_t PeakCan_mutex = PTHREAD_MUTEX_INITIALIZER; -00050 -00051 // Define for rtr CAN message -00052 #define CAN_INIT_TYPE_ST_RTR MSGTYPE_STANDARD | MSGTYPE_RTR -00053 -00054 /***************************************************************************/ -00055 int TranslateBaudeRate(char* optarg){ -00056 if(!strcmp( optarg, "1M")) return CAN_BAUD_1M; -00057 if(!strcmp( optarg, "500K")) return CAN_BAUD_500K; -00058 if(!strcmp( optarg, "250K")) return CAN_BAUD_250K; -00059 if(!strcmp( optarg, "125K")) return CAN_BAUD_125K; -00060 if(!strcmp( optarg, "100K")) return CAN_BAUD_100K; -00061 if(!strcmp( optarg, "50K")) return CAN_BAUD_50K; -00062 if(!strcmp( optarg, "20K")) return CAN_BAUD_20K; -00063 if(!strcmp( optarg, "10K")) return CAN_BAUD_10K; -00064 if(!strcmp( optarg, "5K")) return CAN_BAUD_5K; -00065 if(!strcmp( optarg, "none")) return 0; -00066 return 0x0000; -00067 } -00068 -00069 void -00070 canInit (s_BOARD *board) -00071 { -00072 int baudrate; -00073 -00074 #ifdef PCAN2_HEADER_ -00075 // if not the first handler -00076 if(second_board == (s_BOARD *)board) -00077 if(baudrate = TranslateBaudeRate(board->baudrate)) -00078 CAN2_Init (baudrate, -00079 CAN_INIT_TYPE_ST extra_PCAN_init_params); -00080 #endif -00081 if(first_board == (s_BOARD *)board) -00082 if(baudrate = TranslateBaudeRate(board->baudrate)) -00083 CAN_Init (baudrate, -00084 CAN_INIT_TYPE_ST extra_PCAN_init_params); -00085 } -00086 -00087 /*********functions which permit to communicate with the board****************/ -00088 UNS8 -00089 canReceive_driver (CAN_HANDLE fd0, Message * m) -00090 { -00091 UNS8 data; -00092 TPCANMsg peakMsg; -00093 -00094 DWORD Res; -00095 -00096 do{ -00097 // We read the queue looking for messages. -00098 // -00099 //pthread_mutex_lock (&PeakCan_mutex); -00100 #ifdef PCAN2_HEADER_ -00101 // if not the first handler -00102 if(second_board == (s_BOARD *)fd0) -00103 Res = CAN2_Read (&peakMsg); -00104 else -00105 #endif -00106 if(first_board == (s_BOARD *)fd0) -00107 Res = CAN_Read (&peakMsg); -00108 else -00109 Res = CAN_ERR_BUSOFF; -00110 -00111 // A message was received -00112 // We process the message(s) -00113 // -00114 if (Res == CAN_ERR_OK) -00115 { -00116 // if something different that 11bit or rtr... problem -00117 if (peakMsg.MSGTYPE & ~(MSGTYPE_STANDARD | MSGTYPE_RTR)) -00118 { -00119 if (peakMsg.MSGTYPE == CAN_ERR_BUSOFF) -00120 { -00121 printf ("!!! Peak board read : re-init\n"); -00122 canInit((s_BOARD*) fd0); -00123 usleep (10000); -00124 } -00125 -00126 // If status, return status if 29bit, return overrun -00127 //pthread_mutex_unlock (&PeakCan_mutex); -00128 return peakMsg.MSGTYPE == -00129 MSGTYPE_STATUS ? peakMsg.DATA[2] : CAN_ERR_OVERRUN; -00130 } -00131 m->cob_id.w = peakMsg.ID; -00132 if (peakMsg.MSGTYPE == CAN_INIT_TYPE_ST) /* bits of MSGTYPE_ */ -00133 m->rtr = 0; -00134 else -00135 m->rtr = 1; -00136 m->len = peakMsg.LEN; /* count of data bytes (0..8) */ -00137 for (data = 0; data < peakMsg.LEN; data++) -00138 m->data[data] = peakMsg.DATA[data]; /* data bytes, up to 8 */ -00139 -00140 }else{ -00141 //pthread_mutex_unlock (&PeakCan_mutex); -00142 //if (Res != CAN_ERR_OK) -00143 //{ -00144 if (! -00145 (Res & CAN_ERR_QRCVEMPTY || Res & CAN_ERR_BUSLIGHT -00146 || Res & CAN_ERR_BUSHEAVY)) -00147 { -00148 printf ("canReceive returned error (%d)\n", Res); -00149 return 1; -00150 } -00151 usleep (1000); -00152 } -00153 }while(Res != CAN_ERR_OK); -00154 return 0; -00155 } -00156 -00157 /***************************************************************************/ -00158 UNS8 -00159 canSend_driver (CAN_HANDLE fd0, Message * m) -00160 { -00161 UNS8 data; -00162 TPCANMsg peakMsg; -00163 peakMsg.ID = m->cob_id.w; /* 11/29 bit code */ -00164 if (m->rtr == 0) -00165 peakMsg.MSGTYPE = CAN_INIT_TYPE_ST; /* bits of MSGTYPE_ */ -00166 else -00167 { -00168 peakMsg.MSGTYPE = CAN_INIT_TYPE_ST_RTR; /* bits of MSGTYPE_ */ -00169 } -00170 peakMsg.LEN = m->len; -00171 /* count of data bytes (0..8) */ -00172 for (data = 0; data < m->len; data++) -00173 peakMsg.DATA[data] = m->data[data]; /* data bytes, up to 8 */ -00174 do -00175 { -00176 #ifdef PCAN2_HEADER_ -00177 // if not the first handler -00178 if(second_board == (s_BOARD *)fd0) -00179 errno = CAN2_Write (&peakMsg); -00180 else -00181 #endif -00182 if(first_board == (s_BOARD *)fd0) -00183 errno = CAN_Write (&peakMsg); -00184 else -00185 goto fail; -00186 if (errno) -00187 { -00188 if (errno == CAN_ERR_BUSOFF) -00189 { -00190 printf ("!!! Peak board write : re-init\n"); -00191 canInit((s_BOARD*)fd0); -00192 usleep (10000); -00193 } -00194 usleep (1000); -00195 } -00196 } -00197 while (errno != CAN_ERR_OK); -00198 return 0; -00199 fail: -00200 return 1; -00201 } -00202 -00203 /***************************************************************************/ -00204 CAN_HANDLE -00205 canOpen_driver (s_BOARD * board) -00206 { -00207 #ifdef PCAN2_HEADER_ -00208 if(first_board != NULL && second_board != NULL) -00209 #else -00210 if(first_board != NULL) -00211 #endif -00212 { -00213 fprintf (stderr, "Open failed.\n"); -00214 fprintf (stderr, -00215 "can_peak_win32.c: no more can port available with this pcan library\n"); -00216 fprintf (stderr, -00217 "can_peak_win32.c: please link another executable with another pcan lib\n"); -00218 return NULL; -00219 } -00220 -00221 #ifdef PCAN2_HEADER_ -00222 if(first_board == NULL) -00223 first_board = board; -00224 else -00225 second_board = board; -00226 #else -00227 first_board = board; -00228 #endif -00229 -00230 canInit(board); -00231 -00232 return (CAN_HANDLE)board; -00233 } -00234 -00235 /***************************************************************************/ -00236 int -00237 canClose_driver (CAN_HANDLE fd0) -00238 { -00239 #ifdef PCAN2_HEADER_ -00240 // if not the first handler -00241 if(second_board == (s_BOARD *)fd0) -00242 { -00243 CAN2_Close (); -00244 second_board = (s_BOARD *)NULL; -00245 }else -00246 #endif -00247 if(first_board == (s_BOARD *)fd0) -00248 { -00249 CAN_Close (); -00250 first_board = (s_BOARD *)NULL; -00251 } -00252 return 0; -00253 } -
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include "cancfg.h"
#include "can_driver.h"
-Include dependency graph for can_peak_win32.c:
-Go to the source code of this file.
Defines | |
#define | extra_PCAN_init_params |
#define | CAN_INIT_TYPE_ST_RTR MSGTYPE_STANDARD | MSGTYPE_RTR |
Functions | |
int | TranslateBaudeRate (char *optarg) |
void | canInit (s_BOARD *board) |
UNS8 | canReceive_driver (CAN_HANDLE fd0, Message *m) |
UNS8 | canSend_driver (CAN_HANDLE fd0, Message *m) |
CAN_HANDLE | canOpen_driver (s_BOARD *board) |
int | canClose_driver (CAN_HANDLE fd0) |
#define CAN_INIT_TYPE_ST_RTR MSGTYPE_STANDARD | MSGTYPE_RTR | -
- -
-Definition at line 52 of file can_peak_win32.c. -
#define extra_PCAN_init_params | -
-
int canClose_driver | -( | -CAN_HANDLE | -fd0 | -) | -- |
- -
-Definition at line 237 of file can_peak_win32.c. -
void canInit | -( | -s_BOARD * | -board | -) | -- |
- -
-Definition at line 70 of file can_peak_win32.c. -
-References struct_s_BOARD::baudrate, extra_PCAN_init_params, and TranslateBaudeRate(). -
-Referenced by canOpen_driver(), canReceive_driver(), canSend_driver(), and initSensor(). -
-Here is the call graph for this function:
CAN_HANDLE canOpen_driver | -( | -s_BOARD * | -board | -) | -- |
- -
-Definition at line 205 of file can_peak_win32.c. -
-References canInit(). -
-Here is the call graph for this function:
UNS8 canReceive_driver | -( | -CAN_HANDLE | -fd0, | -|
- | - | Message * | -m | - |
- | ) | -- |
- -
-Definition at line 89 of file can_peak_win32.c. -
-References canInit(), Message::cob_id, Message::data, Message::len, Message::rtr, UNS8, and SHORT_CAN::w. -
-Here is the call graph for this function:
UNS8 canSend_driver | -( | -CAN_HANDLE | -fd0, | -|
- | - | Message * | -m | - |
- | ) | -- |
- -
-Definition at line 159 of file can_peak_win32.c. -
-References CAN_INIT_TYPE_ST_RTR, canInit(), Message::cob_id, Message::data, Message::len, Message::rtr, UNS8, and SHORT_CAN::w. -
-Here is the call graph for this function:
int TranslateBaudeRate | -( | -char * | -optarg | -) | -- |
- -
-Definition at line 55 of file can_peak_win32.c. -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #include <stdio.h> -00024 #include <string.h> -00025 #include <stdlib.h> -00026 #include <stddef.h> /* for NULL */ -00027 #include <errno.h> -00028 -00029 #include "config.h" -00030 -00031 #ifdef RTCAN_SOCKET -00032 #include "rtdm/rtcan.h" -00033 #define CAN_IFNAME "rtcan%s" -00034 #define CAN_SOCKET rt_dev_socket -00035 #define CAN_CLOSE rt_dev_close -00036 #define CAN_RECV rt_dev_recv -00037 #define CAN_SEND rt_dev_send -00038 #define CAN_BIND rt_dev_bind -00039 #define CAN_IOCTL rt_dev_ioctl -00040 #define CAN_ERRNO(err) (-err) -00041 #else -00042 #include <sys/socket.h> -00043 #include <sys/ioctl.h> -00044 #include "linux/can.h" -00045 #include "linux/can/raw.h" -00046 #include "net/if.h" -00047 #define PF_CAN 29 -00048 #define AF_CAN PF_CAN -00049 //#include "af_can.h" -00050 #define CAN_IFNAME "can%s" -00051 #define CAN_SOCKET socket -00052 #define CAN_CLOSE close -00053 #define CAN_RECV recv -00054 #define CAN_SEND send -00055 #define CAN_BIND bind -00056 #define CAN_IOCTL ioctl -00057 #define CAN_ERRNO(err) errno -00058 #endif -00059 -00060 #include "can_driver.h" -00061 -00062 /*********functions which permit to communicate with the board****************/ -00063 UNS8 -00064 canReceive_driver (CAN_HANDLE fd0, Message * m) -00065 { -00066 int res; -00067 struct can_frame frame; -00068 -00069 res = CAN_RECV (*(int *) fd0, &frame, sizeof (frame), 0); -00070 if (res < 0) -00071 { -00072 fprintf (stderr, "Recv failed: %s\n", strerror (CAN_ERRNO (res))); -00073 return 1; -00074 } -00075 -00076 m->cob_id.w = frame.can_id & CAN_EFF_MASK; -00077 m->len = frame.can_dlc; -00078 if (frame.can_id & CAN_RTR_FLAG) -00079 m->rtr = 1; -00080 else -00081 m->rtr = 0; -00082 memcpy (m->data, frame.data, 8); -00083 -00084 return 0; -00085 } -00086 -00087 -00088 /***************************************************************************/ -00089 UNS8 -00090 canSend_driver (CAN_HANDLE fd0, Message * m) -00091 { -00092 int res; -00093 struct can_frame frame; -00094 -00095 frame.can_id = m->cob_id.w; -00096 if (frame.can_id >= 0x800) -00097 frame.can_id |= CAN_EFF_FLAG; -00098 frame.can_dlc = m->len; -00099 if (m->rtr) -00100 frame.can_id |= CAN_RTR_FLAG; -00101 else -00102 memcpy (frame.data, m->data, 8); -00103 -00104 res = CAN_SEND (*(int *) fd0, &frame, sizeof (frame), 0); -00105 if (res < 0) -00106 { -00107 fprintf (stderr, "Send failed: %s\n", strerror (CAN_ERRNO (res))); -00108 return 1; -00109 } -00110 -00111 return 0; -00112 } -00113 -00114 /***************************************************************************/ -00115 #ifdef RTCAN_SOCKET -00116 int -00117 TranslateBaudRate (const char *optarg) -00118 { -00119 int baudrate; -00120 int val, len; -00121 char *pos = NULL; -00122 -00123 len = strlen (optarg); -00124 if (!len) -00125 return 0; -00126 -00127 switch ((int) optarg[len - 1]) -00128 { -00129 case 'M': -00130 baudrate = 1000000; -00131 break; -00132 case 'K': -00133 baudrate = 1000; -00134 break; -00135 default: -00136 baudrate = 1; -00137 break; -00138 } -00139 if ((sscanf (optarg, "%i", &val)) == 1) -00140 baudrate *= val; -00141 else -00142 baudrate = 0;; -00143 -00144 return baudrate; -00145 } -00146 #endif -00147 -00148 /***************************************************************************/ -00149 CAN_HANDLE -00150 canOpen_driver (s_BOARD * board) -00151 { -00152 struct ifreq ifr; -00153 struct sockaddr_can addr; -00154 int err; -00155 CAN_HANDLE fd0 = malloc (sizeof (int)); -00156 #ifdef RTCAN_SOCKET -00157 can_baudrate_t *baudrate; -00158 can_mode_t *mode; -00159 #endif -00160 -00161 *(int *) fd0 = CAN_SOCKET (PF_CAN, SOCK_RAW, CAN_RAW); -00162 if (*(int *) fd0 < 0) -00163 { -00164 fprintf (stderr, "Socket creation failed: %s\n", -00165 strerror (CAN_ERRNO (*(int *) fd0))); -00166 goto error_ret; -00167 } -00168 -00169 if (*board->busname >= '0' && *board->busname <= '9') -00170 snprintf (ifr.ifr_name, IFNAMSIZ, CAN_IFNAME, board->busname); -00171 else -00172 strncpy (ifr.ifr_name, board->busname, IFNAMSIZ); -00173 err = CAN_IOCTL (*(int *) fd0, SIOCGIFINDEX, &ifr); -00174 if (err) -00175 { -00176 fprintf (stderr, "Getting IF index for %s failed: %s\n", -00177 ifr.ifr_name, strerror (CAN_ERRNO (err))); -00178 goto error_close; -00179 } -00180 -00181 addr.can_family = AF_CAN; -00182 addr.can_ifindex = ifr.ifr_ifindex; -00183 err = CAN_BIND (*(int *) fd0, (struct sockaddr *) &addr, sizeof (addr)); -00184 if (err) -00185 { -00186 fprintf (stderr, "Binding failed: %s\n", strerror (CAN_ERRNO (err))); -00187 goto error_close; -00188 } -00189 -00190 #ifdef RTCAN_SOCKET -00191 baudrate = (can_baudrate_t *) & ifr.ifr_ifru; -00192 *baudrate = TranslateBaudRate (board->baudrate); -00193 if (!*baudrate) -00194 goto error_close; -00195 -00196 err = CAN_IOCTL (*(int *) fd0, SIOCSCANBAUDRATE, &ifr); -00197 if (err) -00198 { -00199 fprintf (stderr, -00200 "Setting baudrate %d failed: %s\n", -00201 *baudrate, strerror (CAN_ERRNO (err))); -00202 goto error_close; -00203 } -00204 -00205 mode = (can_mode_t *) & ifr.ifr_ifru; -00206 *mode = CAN_MODE_START; -00207 err = CAN_IOCTL (*(int *) fd0, SIOCSCANMODE, &ifr); -00208 if (err) -00209 { -00210 fprintf (stderr, "Starting CAN device failed: %s\n", -00211 strerror (CAN_ERRNO (err))); -00212 goto error_close; -00213 } -00214 #endif -00215 -00216 return fd0; -00217 -00218 error_close: -00219 CAN_CLOSE (*(int *) fd0); -00220 -00221 error_ret: -00222 free (fd0); -00223 return NULL; -00224 } -00225 -00226 /***************************************************************************/ -00227 int -00228 canClose_driver (CAN_HANDLE fd0) -00229 { -00230 if (fd0) -00231 { -00232 CAN_CLOSE (*(int *) fd0); -00233 free (fd0); -00234 } -00235 return 0; -00236 } -
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stddef.h>
#include <errno.h>
#include "config.h"
#include <sys/socket.h>
#include <sys/ioctl.h>
#include "linux/can.h"
#include "linux/can/raw.h"
#include "net/if.h"
#include "can_driver.h"
-Include dependency graph for can_socket.c:
-Go to the source code of this file.
Defines | |
#define | PF_CAN 29 |
#define | AF_CAN PF_CAN |
#define | CAN_IFNAME "can%s" |
#define | CAN_SOCKET socket |
#define | CAN_CLOSE close |
#define | CAN_RECV recv |
#define | CAN_SEND send |
#define | CAN_BIND bind |
#define | CAN_IOCTL ioctl |
#define | CAN_ERRNO(err) errno |
Functions | |
UNS8 | canReceive_driver (CAN_HANDLE fd0, Message *m) |
UNS8 | canSend_driver (CAN_HANDLE fd0, Message *m) |
CAN_HANDLE | canOpen_driver (s_BOARD *board) |
int | canClose_driver (CAN_HANDLE fd0) |
#define AF_CAN PF_CAN | -
#define CAN_BIND bind | -
#define CAN_CLOSE close | -
- -
-Definition at line 52 of file can_socket.c. -
-Referenced by canClose_driver(), and canOpen_driver(). -
#define CAN_ERRNO | -( | -err | -- | ) | -errno | -
- -
-Definition at line 57 of file can_socket.c. -
-Referenced by canOpen_driver(), canReceive_driver(), and canSend_driver(). -
#define CAN_IFNAME "can%s" | -
#define CAN_IOCTL ioctl | -
#define CAN_RECV recv | -
#define CAN_SEND send | -
#define CAN_SOCKET socket | -
#define PF_CAN 29 | -
-
int canClose_driver | -( | -CAN_HANDLE | -fd0 | -) | -- |
CAN_HANDLE canOpen_driver | -( | -s_BOARD * | -board | -) | -- |
- -
-Definition at line 150 of file can_socket.c. -
-References AF_CAN, struct_s_BOARD::baudrate, struct_s_BOARD::busname, CAN_BIND, CAN_CLOSE, CAN_ERRNO, CAN_IFNAME, CAN_IOCTL, CAN_SOCKET, and PF_CAN. -
UNS8 canReceive_driver | -( | -CAN_HANDLE | -fd0, | -|
- | - | Message * | -m | - |
- | ) | -- |
- -
-Definition at line 64 of file can_socket.c. -
-References CAN_ERRNO, CAN_RECV, Message::cob_id, Message::data, Message::len, Message::rtr, and SHORT_CAN::w. -
UNS8 canSend_driver | -( | -CAN_HANDLE | -fd0, | -|
- | - | Message * | -m | - |
- | ) | -- |
- -
-Definition at line 90 of file can_socket.c. -
-References CAN_ERRNO, CAN_SEND, Message::cob_id, Message::data, Message::len, Message::rtr, and SHORT_CAN::w. -
-
00001 // can_uvccm_win32 adapter (http://www.gridconnect.com) -00002 // driver for CanFestival-3 Win32 port -00003 // Copyright (C) 2007 Leonid Tochinski, ChattenAssociates, Inc. -00004 -00005 -00006 #include <sstream> -00007 #include <iomanip> -00008 #if 0 // change to 1 if you use boost -00009 #include <boost/algorithm/string/case_conv.hpp> -00010 #else -00011 #include <algorithm> -00012 #endif -00013 -00014 extern "C" { -00015 #include "can_driver.h" -00016 } -00017 class can_uvccm_win32 -00018 { -00019 public: -00020 class error -00021 { -00022 }; -00023 can_uvccm_win32(s_BOARD *board); -00024 ~can_uvccm_win32(); -00025 bool send(const Message *m); -00026 bool receive(Message *m); -00027 private: -00028 bool open_rs232(int port = 1, int baud_rate = 57600); -00029 bool close_rs232(); -00030 bool get_can_data(const char* can_cmd_buf, long& bufsize, Message* m); -00031 bool set_can_data(const Message& m, std::string& can_cmd); -00032 private: -00033 HANDLE m_port; -00034 HANDLE m_read_event; -00035 HANDLE m_write_event; -00036 std::string m_residual_buffer; -00037 }; -00038 -00039 can_uvccm_win32::can_uvccm_win32(s_BOARD *board) : m_port(INVALID_HANDLE_VALUE), -00040 m_read_event(0), -00041 m_write_event(0) -00042 { -00043 if (strcmp( board->baudrate, "125K") || !open_rs232(1)) -00044 throw error(); -00045 } -00046 -00047 can_uvccm_win32::~can_uvccm_win32() -00048 { -00049 close_rs232(); -00050 } -00051 -00052 bool can_uvccm_win32::send(const Message *m) -00053 { -00054 if (m_port == INVALID_HANDLE_VALUE) -00055 return false; -00056 -00057 // build can_uvccm_win32 command string -00058 std::string can_cmd; -00059 set_can_data(*m, can_cmd); -00060 -00061 OVERLAPPED overlapped; -00062 ::memset(&overlapped, 0, sizeof overlapped); -00063 overlapped.hEvent = m_write_event; -00064 ::ResetEvent(overlapped.hEvent); -00065 -00066 unsigned long bytes_written = 0; -00067 ::WriteFile(m_port, can_cmd.c_str(), (unsigned long)can_cmd.size(), &bytes_written, &overlapped); -00068 // wait for write operation completion -00069 enum { WRITE_TIMEOUT = 1000 }; -00070 ::WaitForSingleObject(overlapped.hEvent, WRITE_TIMEOUT); -00071 // get number of bytes written -00072 ::GetOverlappedResult(m_port, &overlapped, &bytes_written, FALSE); -00073 -00074 bool result = (bytes_written == can_cmd.size()); -00075 -00076 return result; -00077 } -00078 -00079 -00080 bool can_uvccm_win32::receive(Message *m) -00081 { -00082 if (m_port == INVALID_HANDLE_VALUE) -00083 return false; -00084 -00085 long res_buffer_size = (long)m_residual_buffer.size(); -00086 bool result = get_can_data(m_residual_buffer.c_str(), res_buffer_size, m); -00087 if (result) -00088 { -00089 m_residual_buffer.erase(0, res_buffer_size); -00090 return true; -00091 } -00092 -00093 enum { READ_TIMEOUT = 500 }; -00094 -00095 OVERLAPPED overlapped; -00096 ::memset(&overlapped, 0, sizeof overlapped); -00097 overlapped.hEvent = m_read_event; -00098 ::ResetEvent(overlapped.hEvent); -00099 unsigned long event_mask = 0; -00100 -00101 if (FALSE == ::WaitCommEvent(m_port, &event_mask, &overlapped) && ERROR_IO_PENDING == ::GetLastError()) -00102 { -00103 if (WAIT_TIMEOUT == ::WaitForSingleObject(overlapped.hEvent, READ_TIMEOUT)) -00104 return false; -00105 } -00106 -00107 // get number of bytes in the input que -00108 COMSTAT stat; -00109 ::memset(&stat, 0, sizeof stat); -00110 unsigned long errors = 0; -00111 ::ClearCommError(m_port, &errors, &stat); -00112 if (stat.cbInQue == 0) -00113 return false; -00114 char buffer[3000]; -00115 -00116 unsigned long bytes_to_read = min(stat.cbInQue, sizeof (buffer)); -00117 -00118 unsigned long bytes_read = 0; -00119 ::ReadFile(m_port, buffer, bytes_to_read, &bytes_read, &overlapped); -00120 // wait for read operation completion -00121 ::WaitForSingleObject(overlapped.hEvent, READ_TIMEOUT); -00122 // get number of bytes read -00123 ::GetOverlappedResult(m_port, &overlapped, &bytes_read, FALSE); -00124 result = false; -00125 if (bytes_read > 0) -00126 { -00127 m_residual_buffer.append(buffer, bytes_read); -00128 res_buffer_size = (long)m_residual_buffer.size(); -00129 result = get_can_data(m_residual_buffer.c_str(), res_buffer_size, m); -00130 if (result) -00131 m_residual_buffer.erase(0, res_buffer_size); -00132 } -00133 return result; -00134 } -00135 -00136 bool can_uvccm_win32::open_rs232(int port, int baud_rate) -00137 { -00138 if (m_port != INVALID_HANDLE_VALUE) -00139 return true; -00140 -00141 std::ostringstream device_name; -00142 device_name << "COM" << port; -00143 -00144 m_port = ::CreateFile(device_name.str().c_str(), -00145 GENERIC_READ | GENERIC_WRITE, -00146 0, // exclusive access -00147 NULL, // no security -00148 OPEN_EXISTING, -00149 FILE_FLAG_OVERLAPPED, // overlapped I/O -00150 NULL); // null template -00151 -00152 // Check the returned handle for INVALID_HANDLE_VALUE and then set the buffer sizes. -00153 if (m_port == INVALID_HANDLE_VALUE) -00154 return false; -00155 -00156 // SetCommMask(m_hCom,EV_RXCHAR|EV_TXEMPTY|EV_CTS|EV_DSR|EV_RLSD|EV_BREAK|EV_ERR|EV_RING); // -00157 ::SetCommMask(m_port, EV_RXFLAG); -00158 -00159 COMMTIMEOUTS timeouts; -00160 ::memset(&timeouts, 0, sizeof (timeouts)); -00161 timeouts.ReadIntervalTimeout = -1; -00162 timeouts.ReadTotalTimeoutConstant = 0; -00163 timeouts.ReadTotalTimeoutMultiplier = 0; -00164 timeouts.WriteTotalTimeoutConstant = 5000; -00165 timeouts.WriteTotalTimeoutMultiplier = 0; -00166 SetCommTimeouts(m_port, &timeouts); // -00167 -00168 ::SetupComm(m_port, 1024, 512); // set buffer sizes -00169 -00170 // Port settings are specified in a Data Communication Block (DCB). The easiest way to initialize a DCB is to call GetCommState to fill in its default values, override the values that you want to change and then call SetCommState to set the values. -00171 DCB dcb; -00172 ::memset(&dcb, 0, sizeof (dcb)); -00173 ::GetCommState(m_port, &dcb); -00174 dcb.BaudRate = baud_rate; -00175 dcb.ByteSize = 8; -00176 dcb.Parity = NOPARITY; -00177 dcb.StopBits = ONESTOPBIT; -00178 dcb.fAbortOnError = TRUE; -00179 dcb.EvtChar = 0x0A; // '\n' character -00180 ::SetCommState(m_port, &dcb); -00181 -00182 ::PurgeComm(m_port, PURGE_RXABORT | PURGE_RXCLEAR | PURGE_TXABORT | PURGE_TXCLEAR); -00183 -00184 m_read_event = ::CreateEvent(NULL, TRUE, FALSE, NULL); -00185 m_write_event = ::CreateEvent(NULL, TRUE, FALSE, NULL); -00186 -00187 return true; -00188 } -00189 -00190 bool can_uvccm_win32::close_rs232() -00191 { -00192 if (m_port != INVALID_HANDLE_VALUE) -00193 { -00194 ::PurgeComm(m_port, PURGE_RXABORT | PURGE_RXCLEAR | PURGE_TXABORT | PURGE_TXCLEAR); -00195 ::CloseHandle(m_port); -00196 m_port = INVALID_HANDLE_VALUE; -00197 ::CloseHandle(m_read_event); -00198 m_read_event = 0; -00199 ::CloseHandle(m_write_event); -00200 m_write_event = 0; -00201 m_residual_buffer.clear(); -00202 } -00203 return true; -00204 } -00205 -00206 bool can_uvccm_win32::get_can_data(const char* can_cmd_buf, long& bufsize, Message* m) -00207 { -00208 if (bufsize < 5) -00209 { -00210 bufsize = 0; -00211 return false; -00212 } -00213 -00214 Message msg; -00215 ::memset(&msg, 0 , sizeof (msg)); -00216 char colon = 0, type = 0, request = 0; -00217 std::istringstream buf(std::string(can_cmd_buf, bufsize)); -00218 buf >> colon >> type >> std::hex >> msg.cob_id.w >> request; -00219 if (colon != ':' || (type != 'S' && type != 'X')) -00220 { -00221 bufsize = 0; -00222 return false; -00223 } -00224 if (request == 'N') -00225 { -00226 msg.rtr = 0; -00227 for (msg.len = 0; msg.len < 8; ++msg.len) -00228 { -00229 std::string data_byte_str; -00230 buf >> std::setw(2) >> data_byte_str; -00231 if (data_byte_str[0] == ';') -00232 break; -00233 long byte_val = -1; -00234 std::istringstream(data_byte_str) >> std::hex >> byte_val; -00235 if (byte_val == -1) -00236 { -00237 bufsize = 0; -00238 return false; -00239 } -00240 msg.data[msg.len] = (UNS8)byte_val; -00241 } -00242 if (msg.len == 8) -00243 { -00244 char semicolon = 0; -00245 buf >> semicolon; -00246 if (semicolon != ';') -00247 { -00248 bufsize = 0; -00249 return false; -00250 } -00251 } -00252 -00253 } -00254 else if (request == 'R') -00255 { -00256 msg.rtr = 1; -00257 buf >> msg.len; -00258 } -00259 else -00260 { -00261 bufsize = 0; -00262 return false; -00263 } -00264 -00265 bufsize = buf.tellg(); -00266 -00267 *m = msg; -00268 return true; -00269 } -00270 -00271 bool can_uvccm_win32::set_can_data(const Message& m, std::string& can_cmd) -00272 { -00273 // build can_uvccm_win32 command string -00274 std::ostringstream can_cmd_str; -00275 can_cmd_str << ":S" << std::hex << m.cob_id.w; -00276 if (m.rtr == 1) -00277 { -00278 can_cmd_str << 'R' << (long)m.len; -00279 } -00280 else -00281 { -00282 can_cmd_str << 'N'; -00283 for (int i = 0; i < m.len; ++i) -00284 can_cmd_str << std::hex << std::setfill('0') << std::setw(2) << (long)m.data[i]; -00285 } -00286 can_cmd_str << ';'; -00287 can_cmd = can_cmd_str.str(); -00288 #ifdef BOOST_VERSION -00289 boost::to_upper(can_cmd); -00290 #else -00291 std::transform(can_cmd.begin(),can_cmd.end(),can_cmd.begin(),::toupper); -00292 #endif -00293 return true; -00294 } -00295 -00296 -00297 //------------------------------------------------------------------------ -00298 extern "C" -00299 UNS8 canReceive_driver(CAN_HANDLE fd0, Message *m) -00300 { -00301 return (UNS8)(!(reinterpret_cast<can_uvccm_win32*>(fd0)->receive(m))); -00302 } -00303 -00304 extern "C" -00305 UNS8 canSend_driver(CAN_HANDLE fd0, Message *m) -00306 { -00307 return (UNS8)reinterpret_cast<can_uvccm_win32*>(fd0)->send(m); -00308 } -00309 -00310 extern "C" -00311 CAN_HANDLE canOpen_driver(s_BOARD *board) -00312 { -00313 try -00314 { -00315 return (CAN_HANDLE) new can_uvccm_win32(board); -00316 } -00317 catch (can_uvccm_win32::error&) -00318 { -00319 return NULL; -00320 } -00321 } -00322 -00323 extern "C" -00324 int canClose_driver(CAN_HANDLE inst) -00325 { -00326 delete reinterpret_cast<can_uvccm_win32*>(inst); -00327 return 1; -00328 } -00329 -00330 -00331 -
#include <sstream>
#include <iomanip>
#include <algorithm>
#include "can_driver.h"
-Include dependency graph for can_uvccm_win32.cpp:
-Go to the source code of this file.
Data Structures | |
class | can_uvccm_win32 |
class | can_uvccm_win32::error |
Functions | |
UNS8 | canReceive_driver (CAN_HANDLE fd0, Message *m) |
UNS8 | canSend_driver (CAN_HANDLE fd0, Message *m) |
CAN_HANDLE | canOpen_driver (s_BOARD *board) |
int | canClose_driver (CAN_HANDLE inst) |
int canClose_driver | -( | -CAN_HANDLE | -inst | -) | -- |
- -
-Definition at line 324 of file can_uvccm_win32.cpp. -
CAN_HANDLE canOpen_driver | -( | -s_BOARD * | -board | -) | -- |
- -
-Definition at line 311 of file can_uvccm_win32.cpp. -
UNS8 canReceive_driver | -( | -CAN_HANDLE | -fd0, | -|
- | - | Message * | -m | - |
- | ) | -- |
UNS8 canSend_driver | -( | -CAN_HANDLE | -fd0, | -|
- | - | Message * | -m | - |
- | ) | -- |
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 /* -00024 Virtual CAN driver. -00025 */ -00026 -00027 #include <stdio.h> -00028 #include <unistd.h> -00029 -00030 #include "can_driver.h" -00031 #include "def.h" -00032 -00033 #define MAX_NB_CAN_PIPES 16 -00034 -00035 typedef struct { -00036 char used; -00037 int pipe[2]; -00038 } CANPipe; -00039 -00040 CANPipe canpipes[MAX_NB_CAN_PIPES] = {{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},}; -00041 -00042 /*********functions which permit to communicate with the board****************/ -00043 UNS8 canReceive_driver(CAN_HANDLE fd0, Message *m) -00044 { -00045 if(read(((CANPipe*)fd0)->pipe[0], m, sizeof(Message)) != (ssize_t)sizeof(Message)) -00046 { -00047 return 1; -00048 } -00049 return 0; -00050 } -00051 -00052 #define MyCase(fc) case fc: printf(#fc);break; -00053 void print_message(Message *m) -00054 { -00055 int i; -00056 switch(m->cob_id.w >> 7) -00057 { -00058 MyCase(SYNC) -00059 MyCase(TIME_STAMP) -00060 MyCase(PDO1tx) -00061 MyCase(PDO1rx) -00062 MyCase(PDO2tx) -00063 MyCase(PDO2rx) -00064 MyCase(PDO3tx) -00065 MyCase(PDO3rx) -00066 MyCase(PDO4tx) -00067 MyCase(PDO4rx) -00068 MyCase(SDOtx) -00069 MyCase(SDOrx) -00070 MyCase(NODE_GUARD) -00071 MyCase(NMT) -00072 } -00073 printf(" rtr:%d", m->rtr); -00074 printf(" len:%d", m->len); -00075 for (i = 0 ; i < m->len ; i++) -00076 printf(" %02x", m->data[i]); -00077 printf("\n"); -00078 } -00079 -00080 /***************************************************************************/ -00081 UNS8 canSend_driver(CAN_HANDLE fd0, Message *m) -00082 { -00083 int i; -00084 -00085 printf("%x->[ ", (CANPipe*)fd0 - &canpipes[0]); -00086 for(i=0; i < MAX_NB_CAN_PIPES; i++) -00087 { -00088 if(canpipes[i].used && &canpipes[i] != (CANPipe*)fd0) -00089 { -00090 printf("%x ",i); -00091 } -00092 } -00093 printf(" ]"); -00094 print_message(m); -00095 -00096 // Send to all readers, except myself -00097 for(i=0; i < MAX_NB_CAN_PIPES; i++) -00098 { -00099 if(canpipes[i].used && &canpipes[i] != (CANPipe*)fd0) -00100 { -00101 write(canpipes[i].pipe[1], m, sizeof(Message)); -00102 } -00103 } -00104 return 0; -00105 } -00106 /* -00107 int TranslateBaudeRate(char* optarg){ -00108 if(!strcmp( optarg, "1M")) return 1000; -00109 if(!strcmp( optarg, "500K")) return 500; -00110 if(!strcmp( optarg, "250K")) return 250; -00111 if(!strcmp( optarg, "125K")) return 125; -00112 if(!strcmp( optarg, "100K")) return 100; -00113 if(!strcmp( optarg, "50K")) return 50; -00114 if(!strcmp( optarg, "20K")) return 20; -00115 if(!strcmp( optarg, "10K")) return 10; -00116 if(!strcmp( optarg, "5K")) return 5; -00117 if(!strcmp( optarg, "none")) return 0; -00118 return 0; -00119 }*/ -00120 /***************************************************************************/ -00121 CAN_HANDLE canOpen_driver(s_BOARD *board) -00122 { -00123 int i; -00124 for(i=0; i < MAX_NB_CAN_PIPES; i++) -00125 { -00126 if(!canpipes[i].used) -00127 break; -00128 } -00129 -00130 /* Create the pipe. */ -00131 if (i==MAX_NB_CAN_PIPES || pipe(canpipes[i].pipe)) -00132 { -00133 fprintf (stderr, "Open failed.\n"); -00134 return (CAN_HANDLE)NULL; -00135 } -00136 -00137 canpipes[i].used = 1; -00138 return (CAN_HANDLE) &canpipes[i]; -00139 } -00140 -00141 /***************************************************************************/ -00142 int canClose_driver(CAN_HANDLE fd0) -00143 { -00144 close(((CANPipe*)fd0)->pipe[0]); -00145 close(((CANPipe*)fd0)->pipe[1]); -00146 ((CANPipe*)fd0)->used = 0; -00147 return 0; -00148 } -00149 -00150 -
#include <stdio.h>
#include <unistd.h>
#include "can_driver.h"
#include "def.h"
-Include dependency graph for can_virtual.c:
-Go to the source code of this file.
Data Structures | |
struct | CANPipe |
Defines | |
#define | MAX_NB_CAN_PIPES 16 |
#define | MyCase(fc) case fc: printf(#fc);break; |
Functions | |
UNS8 | canReceive_driver (CAN_HANDLE fd0, Message *m) |
void | print_message (Message *m) |
UNS8 | canSend_driver (CAN_HANDLE fd0, Message *m) |
CAN_HANDLE | canOpen_driver (s_BOARD *board) |
int | canClose_driver (CAN_HANDLE fd0) |
Variables | |
CANPipe | canpipes [MAX_NB_CAN_PIPES] = {{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},} |
#define MAX_NB_CAN_PIPES 16 | -
- -
-Definition at line 33 of file can_virtual.c. -
-Referenced by canOpen_driver(), and canSend_driver(). -
#define MyCase | -( | -fc | -- | ) | -case fc: printf(#fc);break; | -
-
int canClose_driver | -( | -CAN_HANDLE | -fd0 | -) | -- |
- -
-Definition at line 142 of file can_virtual.c. -
CAN_HANDLE canOpen_driver | -( | -s_BOARD * | -board | -) | -- |
- -
-Definition at line 121 of file can_virtual.c. -
-References canpipes, MAX_NB_CAN_PIPES, and CANPipe::used. -
UNS8 canReceive_driver | -( | -CAN_HANDLE | -fd0, | -|
- | - | Message * | -m | - |
- | ) | -- |
- -
-Definition at line 43 of file can_virtual.c. -
UNS8 canSend_driver | -( | -CAN_HANDLE | -fd0, | -|
- | - | Message * | -m | - |
- | ) | -- |
- -
-Definition at line 81 of file can_virtual.c. -
-References canpipes, MAX_NB_CAN_PIPES, and print_message(). -
-Here is the call graph for this function:
void print_message | -( | -Message * | -m | -) | -- |
- -
-Definition at line 53 of file can_virtual.c. -
-References Message::cob_id, Message::data, Message::len, MyCase, NMT, NODE_GUARD, PDO1rx, PDO1tx, PDO2rx, PDO2tx, PDO3rx, PDO3tx, PDO4rx, PDO4tx, Message::rtr, SDOrx, SDOtx, SYNC, TIME_STAMP, and SHORT_CAN::w. -
-Referenced by canSend_driver(). -
-
CANPipe canpipes[MAX_NB_CAN_PIPES] = {{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},} | -
- -
-Definition at line 40 of file can_virtual.c. -
-Referenced by canOpen_driver(), and canSend_driver(). -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #ifndef __CANDRIVER__ -00024 #define __CANDRIVER__ -00025 -00026 //#include DEBUG_CAN -00027 -00028 #include <can.h> -00029 #include <objdictdef.h> -00030 -00031 -00032 /* -00033 The CAN message received are stored in a fifo stack -00034 We consider one stack for all the 5 can devices. It is a choice ! -00035 */ -00036 -00037 /* Be free to change this value */ -00038 #define MAX_STACK_MSG_RCV 5 -00039 -00040 /* Number of incomings and outcomings CAN Line. The layer CanOpen must be -00041 used only for ONE line CAN. But you may used one or more CAN drivers, without -00042 a CanOpen layer. -00043 Only 2 lines are implemented. If more lines are needed, copy void __attribute__((interrupt)) can0HdlRcv (void) to void __attribute__((interrupt)) canXHdlRcv (void) and make -00044 changes : [0] to [x], CAN0 to CANX, etc -00045 */ -00046 #define NB_LINE_CAN 1 -00047 -00048 /* Whose hardware HCS12 CAN block is used for CanOpen ? Chose between CAN0, ..., CAN4 -00049 If you use CANOPEN_LINE_NUMBER_USED = CANI, the value of NB_LINE_CAN must be -00050 more or equal to I + 1 -00051 Value other than CAN0 not tested, but should work fine. -00052 */ -00053 #define CANOPEN_LINE_NUMBER_USED CAN0 -00054 -00055 /* Stack of received messages -00056 MSG received on CAN0 module is stored in stackMsgRcv[0], etc -00057 */ -00058 extern volatile Message stackMsgRcv[NB_LINE_CAN][MAX_STACK_MSG_RCV]; -00059 -00060 -00061 /* Copy from the stack of the message to treat */ -00062 extern Message msgRcv; -00063 -00064 -00065 /* To move on the stack of messages -00066 */ -00067 typedef struct { -00068 UNS8 w ; /* received */ -00069 UNS8 r ; /* To transmit */ -00070 } t_pointerStack; -00071 -00072 -00073 /* Pointer for write or read a message in/from the reception stack */ -00074 extern volatile t_pointerStack ptrMsgRcv[NB_LINE_CAN]; -00075 -00076 /* -00077 Parameters to define the clock system for the CAN bus -00078 example : -00079 CAN_BUS_TIME clk = { -00080 1, // clksrc: Use the bus clock : 16 MHz, the freq. of the quartz's board -00081 0, // brp : chose btw 0 and 63 (6 bits). freq time quantum = 16MHz / (brp + 1) -00082 1, // sjw : chose btw 0 and 3 (2 bits). Sync on (sjw + 1 ) time quantum -00083 1, // samp : chose btw 0 and 3 (2 bits) (samp + 1 ) samples per bit -00084 4, // tseg2 : chose btw 0 and 7 (3 bits) Segment 2 width = (tseg2 + 1) tq -00085 9, // tseg1 : chose btw 0 and 15 (4 bits) Segment 1 width = (tseg1 + 1) tq -00086 -00087 -00088 With these values, -00089 - The width of the bit time is 16 time quantum : -00090 - 1 tq for the SYNC segment (could not be modified) -00091 - 10 tq for the TIME 1 segment (tseg1 = 9) -00092 - 5 tq for the TIME 2 segment (tseg2 = 4) -00093 - Because the bus clock of the MSCAN is 16 MHZ, and the -00094 freq of the time quantum is 16 MHZ (brp = 0), and there are 16 tq in the bit time, -00095 so the freq of the bit time is 1 MHz. -00096 -00097 }; -00098 */ -00099 typedef struct { -00100 UNS8 clksrc; /* use of internal clock or clock bus */ -00101 UNS8 brp; /* define the bus speed */ -00102 UNS8 sjw; /* Number of time quantum for synchro - 1 */ -00103 UNS8 samp; /* Number of sample per bit (1 or 3) */ -00104 UNS8 tseg2; /* Width of the time segment 2 (in tq) - 1 */ -00105 UNS8 tseg1; /* Width of the time segment 1 (in tq) - 1 */ -00106 } canBusTime; -00107 -00108 /* -00109 Parameters to init the filters for received messages -00110 */ -00111 typedef struct { -00112 UNS8 idam; /* Put 0x01 for 16 bits acceptance filter */ -00113 UNS8 canidar0; -00114 UNS8 canidmr0; -00115 UNS8 canidar1; -00116 UNS8 canidmr1; -00117 UNS8 canidar2; -00118 UNS8 canidmr2; -00119 UNS8 canidar3; -00120 UNS8 canidmr3; -00121 UNS8 canidar4; -00122 UNS8 canidmr4; -00123 UNS8 canidar5; -00124 UNS8 canidmr5; -00125 UNS8 canidar6; -00126 UNS8 canidmr6; -00127 UNS8 canidar7; -00128 UNS8 canidmr7; -00129 } canBusFilterInit; -00130 -00131 /* -00132 Parameters to init MSCAN -00133 Example -00134 CAN_BUS_INIT bi = { -00135 0, no low power -00136 0, no time stamp -00137 1, enable MSCAN -00138 0, clock source : oscillator -00139 0, no loop back -00140 0, no listen only -00141 0, no low pass filter for wk up -00142 { -00143 1, Use the oscillator clock -00144 0, Quartz oscillator : freq time quantum = freq oscillator clock / (0 + 1) -00145 1, Sync on (1 + 1) time quantum -00146 1, 1 sample per bit -00147 4, time segment 2 width : (4 + 1) tq -00148 9, time segment 1 width : (9 + 1) tq -00149 } -00150 }; -00151 */ -00152 -00153 typedef struct { -00154 UNS8 cswai; /* Low power/normal in wait mode (1/0) */ -00155 UNS8 time; /* Timer for time-stamp enable/disable (1/0) */ -00156 UNS8 cane; /* Enable MSCAN (yes=1) Do it ! */ -00157 UNS8 clksrc; /* clock source bus/oscillator (1/0) */ -00158 UNS8 loopb; /* loop back mode for test (yes=1/no=0) */ -00159 UNS8 listen; /* MSCAN is listen only (yes=1/no=0 ie normal)*/ -00160 UNS8 wupm; /* low pas filter for wake up (yes=1/no=0) */ -00161 canBusTime -00162 clk; /* Values for clock system init */ -00163 canBusFilterInit -00164 fi; /* Values for filter acceptance msg init */ -00165 -00166 } canBusInit; -00167 -00168 extern canBusInit bi; -00169 -00170 -00171 -00172 /* -00173 For the received messsage, add a Identificator to -00174 the list of ID to accept. -00175 You can use several times this function to accept several messages. -00176 It configures registers on 16 bits. -00177 Automatically, it configure the filter to -00178 - not accepting the msg on 29 bits (ide=1 refused) -00179 - not filtering on rtr state (rtr = 1 and rtr = 0 are accepted) -00180 Algo : -00181 if CANIDARx = 0 then CANIDARx = id . else do nothing -00182 CANIDMRx = CANIDMRx OR (CANIDARx XOR id ) -00183 nFilter : 0 to 3 -00184 Must be in init mode before. -00185 */ -00186 char canAddIdToFilter ( -00187 UNS16 adrCAN, -00188 UNS8 nFilter, -00189 UNS16 id /* 11 bits, the 5 msb not used */ -00190 ); -00191 -00192 /* -00193 Use this function to change the CAN message acceptance filters and masks. -00194 */ -00195 char canChangeFilter (UNS16 adrCAN, canBusFilterInit fi); -00196 -00197 -00198 /* -00199 Enable one of the 5 MSCAN. -00200 Must be done only one time after a reset of the CPU. -00201 To do before any CAN initialisation -00202 */ -00203 char canEnable ( -00204 UNS16 adrCAN /* First address of MSCANx registers */ -00205 ); -00206 -00207 -00208 /* -00209 Initialize one of the 5 mscan -00210 can be done multiple times in your code -00211 Return 0 : OK -00212 When it return from the function, -00213 mscan is on sleep mode with wake up disabled. -00214 is not on init mode -00215 */ -00216 char canInit ( -00217 UNS16 adrCAN, /* First address of MSCANx registers */ -00218 canBusInit -00219 bi /* All the parameters to init the bus */ -00220 ); -00221 /* -00222 Initialize the parameters of the system clock for the MSCAN -00223 You must put the MSCAN in sleep mode before with canSleepMode() -00224 Return 0 : OK -00225 1 : Not in sleep mode. Unable to init MSCAN -00226 */ -00227 char canInitClock ( -00228 UNS16 adrCAN, /* First address of MSCANx registers */ -00229 canBusTime clk); -00230 -00231 /* -00232 Initialize one filter for acceptance of received msg. -00233 Filters MUST be configured on 16 bits -00234 (See doc Motorola mscan bloc guide fig 4.3) -00235 Must be in init mode before. -00236 adrCAN : adress of the first register of the mscan module -00237 nFilter : the filter : 0 to 3. -00238 ar : Value to write in acceptance register -00239 Beware ! hight byte and low byte inverted. -00240 for example if nFilter = 0, hight byte of ar -> CANIDAR0 -00241 low byte of ar -> CANIDAR1 -00242 mr : Value to write in mask register -00243 Beware ! hight byte and low byte inverted. -00244 for example if nFilter = 2, hight byte of ar -> CANIDMR4 -00245 low byte of ar -> CANIDMR5 -00246 */ -00247 char canInit1Filter ( -00248 UNS16 adrCAN, -00249 UNS8 nFilter, -00250 UNS16 ar, -00251 UNS16 mr -00252 ); -00253 -00254 /* -00255 Initialise the parameters for filtering the messages received. -00256 You must put the MSCAN in init mode before with canInitMode() -00257 Return 0 : OK -00258 1 : Not in init mode. Unable to init MSCAN -00259 */ -00260 -00261 char canInitFilter ( -00262 UNS16 adrCAN, /* First address of MSCANx registers */ -00263 canBusFilterInit fi); -00264 /* -00265 Put one of the 5 mscan in Init mode -00266 Loop until init mode is reached. -00267 */ -00268 -00269 char canInitMode ( -00270 UNS16 adrCAN /* First address of MSCANx registers */ -00271 ); -00272 -00273 /* -00274 Leave the Init mode -00275 loop until init mode leaved. -00276 */ -00277 -00278 char canInitModeQ ( -00279 UNS16 adrCAN /* First address of MSCANx registers */ -00280 ); -00281 -00282 -00283 -00284 /* -00285 Transmit a msg on CAN "adrCan" -00286 Return : 0 No error -00287 other error : no buffer available to make the transmission -00288 */ -00289 -00290 char canMsgTransmit ( -00291 UNS16 adrCAN, /* First address of MSCANx registers */ -00292 Message msg /* Message to transmit */ -00293 ); -00294 -00295 /* -00296 Set the interruptions. Must be call just after having left the init mode. -00297 */ -00298 char canSetInterrupt (UNS16 adrCAN); -00299 -00300 /* -00301 Put one of the 5 mscan in sleep mode -00302 Beware! If some messages are to be sent, -00303 or if it is receiving, going into sleep mode -00304 may take time. -00305 Wake up is disabled : stay in sleep mode even if -00306 bus traffic detected. -00307 return 0 if 0K, other if error : mscan is on init mode. -00308 Stay in this function until the sleep mode -00309 is reached. -00310 */ -00311 char canSleepMode ( -00312 UNS16 adrCAN /* First address of MSCANx registers */ -00313 ); -00314 -00315 /* -00316 Leave the sleep mode -00317 loop until sleep mode leaved. -00318 return 0 : OK -00319 return 1 : error : in init mode -00320 */ -00321 char canSleepModeQ ( -00322 UNS16 adrCAN /* First address of MSCANx registers */ -00323 ); -00324 -00325 /* -00326 Put one of the 5 mscan in sleep mode -00327 MSCAN must not be in init mode. -00328 wake up is enabled : wake up if traffic on CAN is detected -00329 Beware! If some messages are to be sent, -00330 or if it is receiving, going into sleep mode -00331 may take time. -00332 Loop until sleep mode reached. -00333 return 0 if 0K, other if error -00334 */ -00335 char canSleepWupMode ( -00336 UNS16 adrCAN /* First address of MSCANx registers */ -00337 ); -00338 -00339 /* -00340 Test if one of the 5 mscan is in init mode. -00341 Return -00342 0 -> Not in init mode -00343 other -> In init mode -00344 */ -00345 char canTestInitMode ( -00346 UNS16 adrCAN /* First address of MSCANx registers */ -00347 ); -00348 -00349 /* -00350 Test if one of the 5 mscan is in sleep mode. -00351 Return -00352 0 -> Not in sleep mode -00353 other -> In sleep mode -00354 */ -00355 char canTestSleepMode ( -00356 UNS16 adrCAN /* First address of MSCANx registers */ -00357 ); -00358 -00359 -00360 -00361 #endif /*__CANDRIVER__*/ -00362 -
#include <can.h>
#include <objdictdef.h>
-Include dependency graph for candriver.h:
-Go to the source code of this file.
Data Structures | |
struct | t_pointerStack |
struct | canBusTime |
struct | canBusFilterInit |
struct | canBusInit |
Defines | |
#define | MAX_STACK_MSG_RCV 5 |
#define | NB_LINE_CAN 1 |
#define | CANOPEN_LINE_NUMBER_USED CAN0 |
Functions | |
char | canAddIdToFilter (UNS16 adrCAN, UNS8 nFilter, UNS16 id) |
char | canChangeFilter (UNS16 adrCAN, canBusFilterInit fi) |
char | canEnable (UNS16 adrCAN) |
char | canInit (UNS16 adrCAN, canBusInit bi) |
char | canInitClock (UNS16 adrCAN, canBusTime clk) |
char | canInit1Filter (UNS16 adrCAN, UNS8 nFilter, UNS16 ar, UNS16 mr) |
char | canInitFilter (UNS16 adrCAN, canBusFilterInit fi) |
char | canInitMode (UNS16 adrCAN) |
char | canInitModeQ (UNS16 adrCAN) |
char | canMsgTransmit (UNS16 adrCAN, Message msg) |
char | canSetInterrupt (UNS16 adrCAN) |
char | canSleepMode (UNS16 adrCAN) |
char | canSleepModeQ (UNS16 adrCAN) |
char | canSleepWupMode (UNS16 adrCAN) |
char | canTestInitMode (UNS16 adrCAN) |
char | canTestSleepMode (UNS16 adrCAN) |
Variables | |
volatile Message | stackMsgRcv [NB_LINE_CAN][MAX_STACK_MSG_RCV] |
Message | msgRcv |
volatile t_pointerStack | ptrMsgRcv [NB_LINE_CAN] |
canBusInit | bi |
#define CANOPEN_LINE_NUMBER_USED CAN0 | -
- -
-Definition at line 53 of file candriver.h. -
-Referenced by canSend(), f_can_receive(), gene_SYNC_operational(), gene_SYNC_preOperational(), and initSensor(). -
#define MAX_STACK_MSG_RCV 5 | -
#define NB_LINE_CAN 1 | -
- -
-Definition at line 46 of file candriver.h. -
-
char canAddIdToFilter | -( | -UNS16 | -adrCAN, | -|
- | - | UNS8 | -nFilter, | -|
- | - | UNS16 | -id | - |
- | ) | -- |
- -
-Definition at line 210 of file canOpenDriver.c. -
-References CANIDAR0, CANIDAR2, CANIDAR4, CANIDAR6, canTestInitMode(), IO_PORTS_16, IO_PORTS_8, MSG_WAR, and UNS8. -
-Here is the call graph for this function:
char canChangeFilter | -( | -UNS16 | -adrCAN, | -|
- | - | canBusFilterInit | -fi | - |
- | ) | -- |
- -
-Definition at line 250 of file canOpenDriver.c. -
-References canInitFilter(), canInitMode(), canInitModeQ(), canSetInterrupt(), canSleepMode(), canSleepModeQ(), and canTestInitMode(). -
-Referenced by gene_SYNC_operational(), and gene_SYNC_preOperational(). -
-Here is the call graph for this function:
char canEnable | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 266 of file canOpenDriver.c. -
-References CANCTL1, and IO_PORTS_8. -
-Referenced by canInit(). -
char canInit | -( | -UNS16 | -adrCAN, | -|
- | - | canBusInit | -bi | - |
- | ) | -- |
- -
-Definition at line 277 of file canOpenDriver.c. -
-References CANCTL0, CANCTL1, canBusInit::cane, canEnable(), canInitClock(), canInitFilter(), canInitMode(), canInitModeQ(), canSetInterrupt(), canSleepMode(), canSleepModeQ(), canTestInitMode(), canBusInit::clk, canBusInit::cswai, canBusInit::fi, IO_PORTS_8, canBusInit::listen, canBusInit::loopb, canBusInit::time, and canBusInit::wupm. -
-Here is the call graph for this function:
char canInit1Filter | -( | -UNS16 | -adrCAN, | -|
- | - | UNS8 | -nFilter, | -|
- | - | UNS16 | -ar, | -|
- | - | UNS16 | -mr | - |
- | ) | -- |
- -
-Definition at line 335 of file canOpenDriver.c. -
-References CANIDAR0, CANIDAR2, CANIDAR4, CANIDAR6, canTestInitMode(), IO_PORTS_8, MSG_WAR, and UNS8. -
-Here is the call graph for this function:
char canInitClock | -( | -UNS16 | -adrCAN, | -|
- | - | canBusTime | -clk | - |
- | ) | -- |
- -
-Definition at line 313 of file canOpenDriver.c. -
-References canBusTime::brp, CANBTR0, CANBTR1, CANCTL1, canTestInitMode(), canBusTime::clksrc, IO_PORTS_8, MSG_WAR, canBusTime::samp, canBusTime::sjw, canBusTime::tseg1, and canBusTime::tseg2. -
-Referenced by canInit(). -
-Here is the call graph for this function:
char canInitFilter | -( | -UNS16 | -adrCAN, | -|
- | - | canBusFilterInit | -fi | - |
- | ) | -- |
- -
-Definition at line 364 of file canOpenDriver.c. -
-References CANIDAC, canBusFilterInit::canidar0, CANIDAR0, canBusFilterInit::canidar1, CANIDAR1, canBusFilterInit::canidar2, CANIDAR2, canBusFilterInit::canidar3, CANIDAR3, canBusFilterInit::canidar4, CANIDAR4, canBusFilterInit::canidar5, CANIDAR5, canBusFilterInit::canidar6, CANIDAR6, canBusFilterInit::canidar7, CANIDAR7, canBusFilterInit::canidmr0, CANIDMR0, canBusFilterInit::canidmr1, CANIDMR1, canBusFilterInit::canidmr2, CANIDMR2, canBusFilterInit::canidmr3, CANIDMR3, canBusFilterInit::canidmr4, CANIDMR4, canBusFilterInit::canidmr5, CANIDMR5, canBusFilterInit::canidmr6, CANIDMR6, canBusFilterInit::canidmr7, CANIDMR7, canTestInitMode(), canBusFilterInit::idam, IO_PORTS_8, and MSG_WAR. -
-Referenced by canChangeFilter(), and canInit(). -
-Here is the call graph for this function:
char canInitMode | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 392 of file canOpenDriver.c. -
-References CANCTL0, canTestInitMode(), and IO_PORTS_8. -
-Referenced by canChangeFilter(), and canInit(). -
-Here is the call graph for this function:
char canInitModeQ | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 401 of file canOpenDriver.c. -
-References CANCTL0, canTestInitMode(), and IO_PORTS_8. -
-Referenced by canChangeFilter(), and canInit(). -
-Here is the call graph for this function:
char canMsgTransmit | -( | -UNS16 | -adrCAN, | -|
- | - | Message | -msg | - |
- | ) | -- |
- -
-Definition at line 410 of file canOpenDriver.c. -
-References CANTBSEL, CANTFLG, CANTRSDTA, CANTRSID, CANTRSLEN, CANTRSPRI, Message::cob_id, Message::data, IO_PORTS_8, Message::len, MSG_WAR, Message::rtr, UNS8, and SHORT_CAN::w. -
-Referenced by canSend(). -
char canSetInterrupt | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 445 of file canOpenDriver.c. -
-References CANRIER, CANTIER, and IO_PORTS_8. -
-Referenced by canChangeFilter(), and canInit(). -
char canSleepMode | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 452 of file canOpenDriver.c. -
-References CANCTL0, canTestSleepMode(), and IO_PORTS_8. -
-Referenced by canChangeFilter(), and canInit(). -
-Here is the call graph for this function:
char canSleepModeQ | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 466 of file canOpenDriver.c. -
-References CANCTL0, canTestInitMode(), canTestSleepMode(), IO_PORTS_8, and MSG_WAR. -
-Referenced by canChangeFilter(), and canInit(). -
-Here is the call graph for this function:
char canSleepWupMode | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 480 of file canOpenDriver.c. -
-References CANCTL0, canTestInitMode(), canTestSleepMode(), IO_PORTS_8, and MSG_WAR. -
-Here is the call graph for this function:
char canTestInitMode | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 493 of file canOpenDriver.c. -
-References CANCTL1, and IO_PORTS_8. -
-Referenced by canAddIdToFilter(), canChangeFilter(), canInit(), canInit1Filter(), canInitClock(), canInitFilter(), canInitMode(), canInitModeQ(), canSleepModeQ(), and canSleepWupMode(). -
char canTestSleepMode | -( | -UNS16 | -adrCAN | -) | -- |
- -
-Definition at line 499 of file canOpenDriver.c. -
-References CANCTL1, and IO_PORTS_8. -
-Referenced by canSleepMode(), canSleepModeQ(), and canSleepWupMode(). -
-
canBusInit bi | -
- -
volatile t_pointerStack ptrMsgRcv[NB_LINE_CAN] | -
- -
volatile Message stackMsgRcv[NB_LINE_CAN][MAX_STACK_MSG_RCV] | -
- -
-
00001 /* canmsg.h - common kernel-space and user-space CAN message structure -00002 * Linux CAN-bus device driver. -00003 * Written by Pavel Pisa - OCERA team member -00004 * email:pisa@cmp.felk.cvut.cz -00005 * This software is released under the GPL-License. -00006 * Version lincan-0.3 17 Jun 2004 -00007 */ -00008 -00009 #ifndef _CANMSG_T_H -00010 #define _CANMSG_T_H -00011 -00012 #ifdef __KERNEL__ -00013 -00014 #include <linux/time.h> -00015 #include <linux/types.h> -00016 -00017 #else /* __KERNEL__ */ -00018 -00019 #include <sys/time.h> -00020 #include <sys/types.h> -00021 -00022 #endif /* __KERNEL__ */ -00023 -00024 #ifdef __cplusplus -00025 extern "C" { -00026 #endif -00027 -00028 /* -00029 * CAN_MSG_VERSION_2 enables new canmsg_t layout compatible with -00030 * can4linux project from http://www.port.de/ -00031 * -00032 */ -00033 #define CAN_MSG_VERSION_2 -00034 -00035 /* Number of data bytes in one CAN message */ -00036 #define CAN_MSG_LENGTH 8 -00037 -00038 #ifdef CAN_MSG_VERSION_2 -00039 -00040 typedef struct timeval canmsg_tstamp_t ; -00041 -00042 typedef unsigned long canmsg_id_t; -00043 -00059 struct canmsg_t { -00060 int flags; -00061 int cob; -00062 canmsg_id_t id; -00063 canmsg_tstamp_t timestamp; -00064 unsigned short length; -00065 unsigned char data[CAN_MSG_LENGTH]; -00066 }; -00067 -00068 #else /*CAN_MSG_VERSION_2*/ -00069 #ifndef PACKED -00070 #define PACKED __attribute__((packed)) -00071 #endif -00072 /* Old, deprecated version of canmsg_t structure */ -00073 struct canmsg_t { -00074 short flags; -00075 int cob; -00076 canmsg_id_t id; -00077 unsigned long timestamp; -00078 unsigned int length; -00079 unsigned char data[CAN_MSG_LENGTH]; -00080 } PACKED; -00081 #endif /*CAN_MSG_VERSION_2*/ -00082 -00083 typedef struct canmsg_t canmsg_t; -00084 -00105 struct canfilt_t { -00106 int flags; -00107 int queid; -00108 int cob; -00109 canmsg_id_t id; -00110 canmsg_id_t mask; -00111 }; -00112 -00113 typedef struct canfilt_t canfilt_t; -00114 -00115 /* Definitions to use for canmsg_t and canfilt_t flags */ -00116 #define MSG_RTR (1<<0) -00117 #define MSG_OVR (1<<1) -00118 #define MSG_EXT (1<<2) -00119 #define MSG_LOCAL (1<<3) -00120 /* If you change above lines, check canque_filtid2internal function */ -00121 -00122 /* Additional definitions used for canfilt_t only */ -00123 #define MSG_FILT_MASK_SHIFT 8 -00124 #define MSG_RTR_MASK (MSG_RTR<<MSG_FILT_MASK_SHIFT) -00125 #define MSG_EXT_MASK (MSG_EXT<<MSG_FILT_MASK_SHIFT) -00126 #define MSG_LOCAL_MASK (MSG_LOCAL<<MSG_FILT_MASK_SHIFT) -00127 #define MSG_PROCESSLOCAL (MSG_OVR<<MSG_FILT_MASK_SHIFT) -00128 -00129 /* Can message ID mask */ -00130 #define MSG_ID_MASK ((1l<<29)-1) -00131 -00132 #ifdef __cplusplus -00133 } /* extern "C"*/ -00134 #endif -00135 -00136 #endif /*_CANMSG_T_H*/ -
#include <sys/time.h>
#include <sys/types.h>
-Include dependency graph for canmsg.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Data Structures | |
struct | canmsg_t |
struct | canfilt_t |
Defines | |
#define | CAN_MSG_VERSION_2 |
#define | CAN_MSG_LENGTH 8 |
#define | MSG_RTR (1<<0) |
#define | MSG_OVR (1<<1) |
#define | MSG_EXT (1<<2) |
#define | MSG_LOCAL (1<<3) |
#define | MSG_FILT_MASK_SHIFT 8 |
#define | MSG_RTR_MASK (MSG_RTR<<MSG_FILT_MASK_SHIFT) |
#define | MSG_EXT_MASK (MSG_EXT<<MSG_FILT_MASK_SHIFT) |
#define | MSG_LOCAL_MASK (MSG_LOCAL<<MSG_FILT_MASK_SHIFT) |
#define | MSG_PROCESSLOCAL (MSG_OVR<<MSG_FILT_MASK_SHIFT) |
#define | MSG_ID_MASK ((1l<<29)-1) |
Typedefs | |
typedef timeval | canmsg_tstamp_t |
typedef unsigned long | canmsg_id_t |
typedef canmsg_t | canmsg_t |
typedef canfilt_t | canfilt_t |
#define MSG_EXT (1<<2) | -
- -
-Definition at line 118 of file canmsg.h. -
-Referenced by canReceive_driver(), and canSend_driver(). -
#define MSG_EXT_MASK (MSG_EXT<<MSG_FILT_MASK_SHIFT) | -
#define MSG_ID_MASK ((1l<<29)-1) | -
#define MSG_LOCAL_MASK (MSG_LOCAL<<MSG_FILT_MASK_SHIFT) | -
#define MSG_PROCESSLOCAL (MSG_OVR<<MSG_FILT_MASK_SHIFT) | -
#define MSG_RTR (1<<0) | -
- -
-Definition at line 116 of file canmsg.h. -
-Referenced by canReceive_driver(), and canSend_driver(). -
#define MSG_RTR_MASK (MSG_RTR<<MSG_FILT_MASK_SHIFT) | -
-
typedef unsigned long canmsg_id_t | -
typedef struct timeval canmsg_tstamp_t | -
-
Public Member Functions | |
can_uvccm_win32 (s_BOARD *board) | |
~can_uvccm_win32 () | |
bool | send (const Message *m) |
bool | receive (Message *m) |
Private Member Functions | |
bool | open_rs232 (int port=1, int baud_rate=57600) |
bool | close_rs232 () |
bool | get_can_data (const char *can_cmd_buf, long &bufsize, Message *m) |
bool | set_can_data (const Message &m, std::string &can_cmd) |
Private Attributes | |
HANDLE | m_port |
HANDLE | m_read_event |
HANDLE | m_write_event |
std::string | m_residual_buffer |
Data Structures | |
class | error |
- -
-Definition at line 17 of file can_uvccm_win32.cpp.
can_uvccm_win32::can_uvccm_win32 | -( | -s_BOARD * | -board | -) | -- |
- -
-Definition at line 39 of file can_uvccm_win32.cpp. -
-References struct_s_BOARD::baudrate, and open_rs232(). -
-Here is the call graph for this function:
can_uvccm_win32::~can_uvccm_win32 | -( | -- | ) | -- |
- -
-Definition at line 47 of file can_uvccm_win32.cpp. -
-References close_rs232(). -
-Here is the call graph for this function:
-
bool can_uvccm_win32::send | -( | -const Message * | -m | -) | -- |
- -
-Definition at line 52 of file can_uvccm_win32.cpp. -
-References FALSE, m_port, m_write_event, and set_can_data(). -
-Here is the call graph for this function:
bool can_uvccm_win32::receive | -( | -Message * | -m | -) | -- |
- -
-Definition at line 80 of file can_uvccm_win32.cpp. -
-References FALSE, get_can_data(), m_port, m_read_event, and m_residual_buffer. -
-Here is the call graph for this function:
bool can_uvccm_win32::open_rs232 | -( | -int | - port = 1 , |
- |
- | - | int | - baud_rate = 57600 | - |
- | ) | - [private] |
-
- -
-Definition at line 136 of file can_uvccm_win32.cpp. -
-References FALSE, m_port, m_read_event, m_write_event, and TRUE. -
-Referenced by can_uvccm_win32(). -
bool can_uvccm_win32::close_rs232 | -( | -- | ) | - [private] |
-
- -
-Definition at line 190 of file can_uvccm_win32.cpp. -
-References m_port, m_read_event, m_residual_buffer, and m_write_event. -
-Referenced by ~can_uvccm_win32(). -
bool can_uvccm_win32::get_can_data | -( | -const char * | -can_cmd_buf, | -|
- | - | long & | -bufsize, | -|
- | - | Message * | -m | - |
- | ) | - [private] |
-
- -
-Definition at line 206 of file can_uvccm_win32.cpp. -
-References Message::cob_id, Message::data, Message::len, Message::rtr, UNS8, and SHORT_CAN::w. -
-Referenced by receive(). -
bool can_uvccm_win32::set_can_data | -( | -const Message & | -m, | -|
- | - | std::string & | -can_cmd | - |
- | ) | - [private] |
-
- -
-Definition at line 271 of file can_uvccm_win32.cpp. -
-References Message::cob_id, Message::data, Message::len, Message::rtr, and SHORT_CAN::w. -
-Referenced by send(). -
-
HANDLE can_uvccm_win32::m_port [private] |
-
- -
-Definition at line 33 of file can_uvccm_win32.cpp. -
-Referenced by close_rs232(), open_rs232(), receive(), and send(). -
HANDLE can_uvccm_win32::m_read_event [private] |
-
- -
-Definition at line 34 of file can_uvccm_win32.cpp. -
-Referenced by close_rs232(), open_rs232(), and receive(). -
HANDLE can_uvccm_win32::m_write_event [private] |
-
- -
-Definition at line 35 of file can_uvccm_win32.cpp. -
-Referenced by close_rs232(), open_rs232(), and send(). -
std::string can_uvccm_win32::m_residual_buffer [private] |
-
- -
-Definition at line 36 of file can_uvccm_win32.cpp. -
-Referenced by close_rs232(), and receive(). -
-
- -
-Definition at line 20 of file can_uvccm_win32.cpp.
Public Member Functions | |
ccritical_section () | |
~ccritical_section () | |
void | enter () |
void | leave () |
Private Attributes | |
CRITICAL_SECTION | m_cs |
- -
-Definition at line 38 of file timers_win32.cpp.
ccritical_section::ccritical_section | -( | -- | ) | - [inline] |
-
ccritical_section::~ccritical_section | -( | -- | ) | - [inline] |
-
-
void ccritical_section::enter | -( | -- | ) | - [inline] |
-
- -
-Definition at line 49 of file timers_win32.cpp. -
-References m_cs. -
-Referenced by EnterMutex(). -
void ccritical_section::leave | -( | -- | ) | - [inline] |
-
- -
-Definition at line 53 of file timers_win32.cpp. -
-References m_cs. -
-Referenced by LeaveMutex(). -
-
CRITICAL_SECTION ccritical_section::m_cs [private] |
-
- -
-Definition at line 58 of file timers_win32.cpp. -
-Referenced by ccritical_section(), enter(), leave(), and ~ccritical_section(). -
-
Public Member Functions | |
class_timers () | |
~class_timers () | |
void | start_timer_thread () |
void | resume_timer_thread () |
void | stop_timer_thread () |
void | set_timer (TIMEVAL value) |
TIMEVAL | get_elapsed_time () |
Private Member Functions | |
TIMEVAL | get_timer () const |
Static Private Member Functions | |
static DWORD WINAPI | timer_loop_thread_proc (void *arg) |
Private Attributes | |
TIMEVAL | m_last_occured_alarm_time |
volatile TIMEVAL | m_last_alarm_set_time |
HANDLE | m_timer_thread |
volatile bool | m_continue_timer_loop |
bool | m_use_hi_res_timer |
double | m_counts_per_usec |
- -
-Definition at line 94 of file timers_win32.cpp.
class_timers::class_timers | -( | -- | ) | -- |
- -
-Definition at line 116 of file timers_win32.cpp. -
-References m_counts_per_usec, and m_use_hi_res_timer. -
class_timers::~class_timers | -( | -- | ) | -- |
- -
-Definition at line 133 of file timers_win32.cpp. -
-References stop_timer_thread(). -
-Here is the call graph for this function:
-
void class_timers::start_timer_thread | -( | -- | ) | -- |
- -
-Definition at line 173 of file timers_win32.cpp. -
-References get_timer(), m_last_alarm_set_time, m_last_occured_alarm_time, m_timer_thread, timer_loop_thread_proc(), and TIMEVAL_MAX. -
-Referenced by StartTimerLoop(). -
-Here is the call graph for this function:
void class_timers::resume_timer_thread | -( | -- | ) | -- |
- -
-Definition at line 184 of file timers_win32.cpp. -
-References m_continue_timer_loop, and m_timer_thread. -
-Referenced by StartTimerLoop(). -
void class_timers::stop_timer_thread | -( | -- | ) | -- |
- -
-Definition at line 193 of file timers_win32.cpp. -
-References m_continue_timer_loop, and m_timer_thread. -
-Referenced by StopTimerLoop(), and ~class_timers(). -
void class_timers::set_timer | -( | -TIMEVAL | -value | -) | -- |
- -
-Definition at line 204 of file timers_win32.cpp. -
-References get_timer(), m_last_alarm_set_time, and TIMEVAL_MAX. -
-Referenced by setTimer(). -
-Here is the call graph for this function:
TIMEVAL class_timers::get_elapsed_time | -( | -- | ) | -- |
- -
-Definition at line 210 of file timers_win32.cpp. -
-References get_timer(), and m_last_occured_alarm_time. -
-Referenced by getElapsedTime(). -
-Here is the call graph for this function:
TIMEVAL class_timers::get_timer | -( | -- | ) | - const [private] |
-
- -
-Definition at line 139 of file timers_win32.cpp. -
-References m_counts_per_usec, m_use_hi_res_timer, and TIMEVAL. -
-Referenced by get_elapsed_time(), set_timer(), start_timer_thread(), and timer_loop_thread_proc(). -
DWORD WINAPI class_timers::timer_loop_thread_proc | -( | -void * | -arg | -) | - [static, private] |
-
- -
-Definition at line 151 of file timers_win32.cpp. -
-References EnterMutex(), get_timer(), LeaveMutex(), m_continue_timer_loop, m_last_alarm_set_time, m_last_occured_alarm_time, TimeDispatch(), TIMEVAL, and TIMEVAL_MAX. -
-Referenced by start_timer_thread(). -
-Here is the call graph for this function:
-
TIMEVAL class_timers::m_last_occured_alarm_time [private] |
-
- -
-Definition at line 108 of file timers_win32.cpp. -
-Referenced by get_elapsed_time(), start_timer_thread(), and timer_loop_thread_proc(). -
volatile TIMEVAL class_timers::m_last_alarm_set_time [private] |
-
- -
-Definition at line 109 of file timers_win32.cpp. -
-Referenced by set_timer(), start_timer_thread(), and timer_loop_thread_proc(). -
HANDLE class_timers::m_timer_thread [private] |
-
- -
-Definition at line 110 of file timers_win32.cpp. -
-Referenced by resume_timer_thread(), start_timer_thread(), and stop_timer_thread(). -
volatile bool class_timers::m_continue_timer_loop [private] |
-
- -
-Definition at line 111 of file timers_win32.cpp. -
-Referenced by resume_timer_thread(), stop_timer_thread(), and timer_loop_thread_proc(). -
bool class_timers::m_use_hi_res_timer [private] |
-
- -
-Definition at line 112 of file timers_win32.cpp. -
-Referenced by class_timers(), and get_timer(). -
double class_timers::m_counts_per_usec [private] |
-
- -
-Definition at line 113 of file timers_win32.cpp. -
-Referenced by class_timers(), and get_timer(). -
-
Public Member Functions | |
driver_procs () | |
~driver_procs () | |
HMODULE | load_canfestival_driver (LPCTSTR driver_name) |
bool | can_driver_valid () const |
Data Fields | |
CANRECEIVE_DRIVER_PROC | m_canReceive |
CANSEND_DRIVER_PROC | m_canSend |
CANOPEN_DRIVER_PROC | m_canOpen |
CANCLOSE_DRIVER_PROC | m_canClose |
HMODULE | m_driver_handle |
- -
-Definition at line 46 of file drivers_win32.cpp.
driver_procs::driver_procs | -( | -- | ) | -- |
- -
-Definition at line 66 of file drivers_win32.cpp. -
driver_procs::~driver_procs | -( | -- | ) | -- |
-
HMODULE driver_procs::load_canfestival_driver | -( | -LPCTSTR | -driver_name | -) | -- |
- -
-Definition at line 94 of file drivers_win32.cpp. -
-References can_driver_valid(), m_canClose, m_canOpen, m_canReceive, m_canSend, m_driver_handle, and myTEXT. -
-Referenced by LoadCanDriver(). -
-Here is the call graph for this function:
bool driver_procs::can_driver_valid | -( | -- | ) | -const | -
- -
-Definition at line 79 of file drivers_win32.cpp. -
-References m_canClose, m_canOpen, m_canReceive, and m_canSend. -
-Referenced by load_canfestival_driver(). -
-
CANRECEIVE_DRIVER_PROC driver_procs::m_canReceive | -
- -
-Definition at line 57 of file drivers_win32.cpp. -
-Referenced by can_driver_valid(), canReceive(), and load_canfestival_driver(). -
CANSEND_DRIVER_PROC driver_procs::m_canSend | -
- -
-Definition at line 58 of file drivers_win32.cpp. -
-Referenced by can_driver_valid(), canSend(), and load_canfestival_driver(). -
CANOPEN_DRIVER_PROC driver_procs::m_canOpen | -
- -
-Definition at line 59 of file drivers_win32.cpp. -
-Referenced by can_driver_valid(), canOpen(), and load_canfestival_driver(). -
CANCLOSE_DRIVER_PROC driver_procs::m_canClose | -
- -
-Definition at line 60 of file drivers_win32.cpp. -
-Referenced by can_driver_valid(), canClose(), and load_canfestival_driver(). -
HMODULE driver_procs::m_driver_handle | -
- -
-Definition at line 63 of file drivers_win32.cpp. -
-Referenced by load_canfestival_driver(), and ~driver_procs(). -
-
00001 /* !!!!!!!!!! FILE GENERATED by configure. DO NOT EDIT !!!!!!!!!!*/ -00002 -00003 /* -00004 This file is part of CanFestival, a library implementing CanOpen Stack. -00005 -00006 Copyright (C): Edouard TISSERANT and Francis DUPIN -00007 See COPYING file for copyrights details. -00008 -00009 This library is free software; you can redistribute it and/or -00010 modify it under the terms of the GNU Lesser General Public -00011 License as published by the Free Software Foundation; either -00012 version 2.1 of the License, or (at your option) any later version. -00013 -00014 This library is distributed in the hope that it will be useful, -00015 but WITHOUT ANY WARRANTY; without even the implied warranty of -00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00017 Lesser General Public License for more details. -00018 -00019 You should have received a copy of the GNU Lesser General Public -00020 License along with this library; if not, write to the Free Software -00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00022 */ -00023 -00024 #ifndef _CONFIG_H_ -00025 #define _CONFIG_H_ -00026 -00027 #define MAX_CAN_BUS_ID 1 -00028 #define SDO_MAX_LENGTH_TRANSFERT 32 -00029 #define SDO_MAX_SIMULTANEOUS_TRANSFERTS 4 -00030 #define NMT_MAX_NODE_ID 128 -00031 #define SDO_TIMEOUT_MS 3000 -00032 #define MAX_NB_TIMER 32 -00033 /* CANOPEN_BIG_ENDIAN is not defined */ -00034 /* US_TO_TIMEVAL_FACTOR is not defined */ -00035 /* TIMEVAL is not defined */ -00036 /* TIMEVAL_MAX is not defined */ -00037 /* RTCAN_SOCKET is not defined */ -00038 -00039 #define REPEAT_SDO_MAX_SIMULTANEOUS_TRANSFERTS_TIMES(repeat)\ -00040 repeat repeat repeat repeat -00041 #define REPEAT_NMT_MAX_NODE_ID_TIMES(repeat)\ -00042 repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat -00043 #endif /* _CONFIG_H_ */ -
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Defines | |
#define | MAX_CAN_BUS_ID 1 |
#define | SDO_MAX_LENGTH_TRANSFERT 32 |
#define | SDO_MAX_SIMULTANEOUS_TRANSFERTS 4 |
#define | NMT_MAX_NODE_ID 128 |
#define | SDO_TIMEOUT_MS 3000 |
#define | MAX_NB_TIMER 32 |
#define | REPEAT_SDO_MAX_SIMULTANEOUS_TRANSFERTS_TIMES(repeat) repeat repeat repeat repeat |
#define | REPEAT_NMT_MAX_NODE_ID_TIMES(repeat) repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat |
#define MAX_NB_TIMER 32 | -
#define NMT_MAX_NODE_ID 128 | -
#define REPEAT_NMT_MAX_NODE_ID_TIMES | -( | -repeat | -- | ) | -repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat | -
#define REPEAT_SDO_MAX_SIMULTANEOUS_TRANSFERTS_TIMES | -( | -repeat | -- | ) | -repeat repeat repeat repeat | -
#define SDO_MAX_LENGTH_TRANSFERT 32 | -
- -
-Definition at line 28 of file config.h. -
-Referenced by lineToSDO(), resetSDOline(), SDOtoLine(), and setSDOlineRestBytes(). -
#define SDO_MAX_SIMULTANEOUS_TRANSFERTS 4 | -
- -
-Definition at line 29 of file config.h. -
-Referenced by getSDOfreeLine(), getSDOlineOnUse(), and resetSDO(). -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 -00024 #ifndef __data_h__ -00025 #define __data_h__ -00026 -00027 /* declaration of CO_Data type let us include all necessary headers -00028 struct struct_CO_Data can then be defined later -00029 */ -00030 typedef struct struct_CO_Data CO_Data; -00031 -00032 #include "applicfg.h" -00033 #include "def.h" -00034 #include "can.h" -00035 #include "objdictdef.h" -00036 #include "objacces.h" -00037 #include "sdo.h" -00038 #include "pdo.h" -00039 #include "states.h" -00040 #include "lifegrd.h" -00041 #include "sync.h" -00042 #include "nmtMaster.h" -00043 -00044 /* This structurs contains all necessary information for a CanOpen node */ -00045 struct struct_CO_Data { -00046 /* Object dictionary */ -00047 UNS8 *bDeviceNodeId; -00048 const indextable *objdict; -00049 s_PDO_status *PDO_status; -00050 quick_index *firstIndex; -00051 quick_index *lastIndex; -00052 UNS16 *ObjdictSize; -00053 const UNS8 *iam_a_slave; -00054 valueRangeTest_t valueRangeTest; -00055 -00056 /* SDO */ -00057 s_transfer transfers[SDO_MAX_SIMULTANEOUS_TRANSFERTS]; -00058 /* s_sdo_parameter *sdo_parameters; */ -00059 -00060 /* State machine */ -00061 e_nodeState nodeState; -00062 s_state_communication CurrentCommunicationState; -00063 initialisation_t initialisation; -00064 preOperational_t preOperational; -00065 operational_t operational; -00066 stopped_t stopped; -00067 -00068 /* NMT-heartbeat */ -00069 UNS8 *ConsumerHeartbeatCount; -00070 UNS32 *ConsumerHeartbeatEntries; -00071 TIMER_HANDLE *ConsumerHeartBeatTimers; -00072 UNS16 *ProducerHeartBeatTime; -00073 TIMER_HANDLE ProducerHeartBeatTimer; -00074 heartbeatError_t heartbeatError; -00075 e_nodeState NMTable[NMT_MAX_NODE_ID]; -00076 -00077 /* SYNC */ -00078 TIMER_HANDLE syncTimer; -00079 UNS32 *COB_ID_Sync; -00080 UNS32 *Sync_Cycle_Period; -00081 /*UNS32 *Sync_window_length;;*/ -00082 post_sync_t post_sync; -00083 post_TPDO_t post_TPDO; -00084 -00085 /* General */ -00086 UNS8 toggle; -00087 CAN_HANDLE canHandle; -00088 scanIndexOD_t scanIndexOD; -00089 storeODSubIndex_t storeODSubIndex; -00090 -00091 /* DCF concise */ -00092 UNS8* dcf_cursor; -00093 UNS32 dcf_count_targets; -00094 -00095 }; -00096 -00097 #define NMTable_Initializer Unknown_state, -00098 -00099 #define s_transfer_Initializer {\ -00100 0, /* nodeId */\ -00101 0, /* wohami */\ -00102 SDO_RESET, /* state */\ -00103 0, /* toggle */\ -00104 0, /* abortCode */\ -00105 0, /* index */\ -00106 0, /* subIndex */\ -00107 0, /* count */\ -00108 0, /* offset */\ -00109 {0}, /* data (static use, so that all the table is initialize at 0)*/\ -00110 0, /* dataType */\ -00111 -1, /* timer */\ -00112 NULL /* Callback */\ -00113 }, -00114 -00115 /* A macro to initialize the data in client app.*/ -00116 /* CO_Data structure */ -00117 #define CANOPEN_NODE_DATA_INITIALIZER(NODE_PREFIX) {\ -00118 /* Object dictionary*/\ -00119 & NODE_PREFIX ## _bDeviceNodeId, /* bDeviceNodeId */\ -00120 NODE_PREFIX ## _objdict, /* objdict */\ -00121 NODE_PREFIX ## _PDO_status, /* PDO_status */\ -00122 & NODE_PREFIX ## _firstIndex, /* firstIndex */\ -00123 & NODE_PREFIX ## _lastIndex, /* lastIndex */\ -00124 & NODE_PREFIX ## _ObjdictSize, /* ObjdictSize */\ -00125 & NODE_PREFIX ## _iam_a_slave, /* iam_a_slave */\ -00126 NODE_PREFIX ## _valueRangeTest, /* valueRangeTest */\ -00127 \ -00128 /* SDO, structure s_transfer */\ -00129 {\ -00130 REPEAT_SDO_MAX_SIMULTANEOUS_TRANSFERTS_TIMES(s_transfer_Initializer)\ -00131 },\ -00132 \ -00133 /* State machine*/\ -00134 Unknown_state, /* nodeState */\ -00135 /* structure s_state_communication */\ -00136 {\ -00137 0, /* csBoot_Up */\ -00138 0, /* csSDO */\ -00139 0, /* csEmergency */\ -00140 0, /* csSYNC */\ -00141 0, /* csHeartbeat */\ -00142 0 /* csPDO */\ -00143 },\ -00144 _initialisation, /* initialisation */\ -00145 _preOperational, /* preOperational */\ -00146 _operational, /* operational */\ -00147 _stopped, /* stopped */\ -00148 \ -00149 /* NMT-heartbeat */\ -00150 & NODE_PREFIX ## _highestSubIndex_obj1016, /* ConsumerHeartbeatCount */\ -00151 NODE_PREFIX ## _obj1016, /* ConsumerHeartbeatEntries */\ -00152 NODE_PREFIX ## _heartBeatTimers, /* ConsumerHeartBeatTimers */\ -00153 & NODE_PREFIX ## _obj1017, /* ProducerHeartBeatTime */\ -00154 TIMER_NONE, /* ProducerHeartBeatTimer */\ -00155 _heartbeatError, /* heartbeatError */\ -00156 \ -00157 {REPEAT_NMT_MAX_NODE_ID_TIMES(NMTable_Initializer)},\ -00158 /* is well initialized at "Unknown_state". Is it ok ? (FD)*/\ -00159 \ -00160 /* SYNC */\ -00161 TIMER_NONE, /* syncTimer */\ -00162 & NODE_PREFIX ## _obj1005, /* COB_ID_Sync */\ -00163 & NODE_PREFIX ## _obj1006, /* Sync_Cycle_Period */\ -00164 /*& NODE_PREFIX ## _obj1007, */ /* Sync_window_length */\ -00165 _post_sync, /* post_sync */\ -00166 _post_TPDO, /* post_TPDO */\ -00167 \ -00168 /* General */\ -00169 0, /* toggle */\ -00170 NULL, /* canSend */\ -00171 NODE_PREFIX ## _scanIndexOD, /* scanIndexOD */\ -00172 _storeODSubIndex, /* storeODSubIndex */\ -00173 NULL, /*dcf_cursor*/\ -00174 1 /*dcf_count_targets*/\ -00175 } -00176 -00177 #endif /* __data_h__ */ -00178 -00179 -
#include "applicfg.h"
#include "def.h"
#include "can.h"
#include "objdictdef.h"
#include "objacces.h"
#include "sdo.h"
#include "pdo.h"
#include "states.h"
#include "lifegrd.h"
#include "sync.h"
#include "nmtMaster.h"
-Include dependency graph for data.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Data Structures | |
struct | struct_CO_Data |
Typedefs | |
typedef struct_CO_Data | CO_Data |
typedef struct struct_CO_Data CO_Data | -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen -00003 Stack. -00004 -00005 Copyright (C): Edouard TISSERANT and Francis DUPIN -00006 -00007 See COPYING file for copyrights details. -00008 -00009 This library is free software; you can redistribute it and/or -00010 modify it under the terms of the GNU Lesser General Public -00011 License as published by the Free Software Foundation; either -00012 version 2.1 of the License, or (at your option) any later version. -00013 -00014 This library is distributed in the hope that it will be useful, -00015 but WITHOUT ANY WARRANTY; without even the implied warranty of -00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00017 Lesser General Public License for more details. -00018 -00019 You should have received a copy of the GNU Lesser General Public -00020 License along with this library; if not, write to the Free Software -00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -00022 USA -00023 */ -00024 -00025 -00037 #include "objacces.h" -00038 #include "sdo.h" -00039 #include "dcf.h" -00040 #include "sysdep.h" -00041 -00042 extern UNS8 _writeNetworkDict (CO_Data* d, UNS8 nodeId, UNS16 index, -00043 UNS8 subIndex, UNS8 count, UNS8 dataType, void *data, SDOCallback_t Callback, UNS8 endianize); -00044 -00045 const indextable *ptrTable; -00046 -00053 static void CheckSDOAndContinue(CO_Data* d, UNS8 nodeId) -00054 { -00055 UNS32 abortCode; -00056 -00057 if(getWriteResultNetworkDict (d, nodeId, &abortCode) != SDO_FINISHED) -00058 { -00059 MSG_ERR(0x1A01, "SDO error in consise DCF", abortCode); -00060 MSG_WAR(0x2A02, "server node : ", nodeId); -00061 } -00062 -00063 closeSDOtransfer(d, nodeId, SDO_CLIENT); -00064 decompo_dcf(d,nodeId); -00065 } -00066 -00075 UNS32 decompo_dcf(CO_Data* d,UNS8 nodeId) -00076 { -00077 UNS32 errorCode; -00078 UNS16 target_Index; -00079 UNS8 target_Subindex; -00080 UNS32 target_Size; -00081 UNS32 res; -00082 ODCallback_t *Callback; -00083 -00084 ptrTable = (*d->scanIndexOD)(0x1F22, &errorCode, &Callback); -00085 if (errorCode != OD_SUCCESSFUL) -00086 { -00087 return errorCode; -00088 } -00089 -00090 /* Loop on all Nodes supported in DCF subindexes*/ -00091 while (nodeId < ptrTable->bSubCount){ -00092 UNS32 nb_targets; -00093 -00094 UNS8 szData = ptrTable->pSubindex[nodeId].size; -00095 UNS8* dcfend; -00096 -00097 { -00098 UNS8* dcf = *((UNS8**)ptrTable->pSubindex[nodeId].pObject); -00099 dcfend = dcf + szData; -00100 if (!d->dcf_cursor){ -00101 d->dcf_cursor = (UNS8*)dcf + 4; -00102 d->dcf_count_targets = 0; -00103 } -00104 nb_targets = UNS32_LE(*((UNS32*)dcf)); -00105 } -00106 -00107 /* condition on consise DCF string for NodeID, if big enough */ -00108 if((UNS8*)d->dcf_cursor + 7 < (UNS8*)dcfend && d->dcf_count_targets < nb_targets) -00109 { -00110 /* pointer to the DCF string for NodeID */ -00111 target_Index = UNS16_LE(*((UNS16*)(d->dcf_cursor))); d->dcf_cursor += 2; -00112 target_Subindex = *((UNS8*)(((UNS8*)d->dcf_cursor)++)); -00113 target_Size = UNS32_LE(*((UNS32*)(d->dcf_cursor))); d->dcf_cursor += 4; -00114 -00115 /* printf("Master : ConfigureSlaveNode %2.2x (Concise -00116 DCF)\n",nodeId);*/ -00117 res = _writeNetworkDict(d, /* CO_Data* d*/ -00118 nodeId, /* UNS8 nodeId*/ -00119 target_Index, /* UNS16 index*/ -00120 target_Subindex, /* UNS8 subindex*/ -00121 target_Size, /* UNS8 count*/ -00122 0, /* UNS8 dataType*/ -00123 d->dcf_cursor,/* void *data*/ -00124 CheckSDOAndContinue,/* SDOCallback_t -00125 Callback*/ -00126 0); /* no endianize*/ -00127 /* Push d->dcf_cursor to the end of data*/ -00128 -00129 d->dcf_cursor += target_Size; -00130 d->dcf_count_targets++; -00131 -00132 return ; -00133 } -00134 nodeId++; -00135 d->dcf_cursor = NULL; -00136 } -00137 /* Switch Master to preOperational state */ -00138 (*d->preOperational)(); -00139 -00140 } -
-#include "objacces.h"
-#include "sdo.h"
-#include "dcf.h"
-#include "sysdep.h"
-
-
-Include dependency graph for dcf.c:
-Go to the source code of this file.
Functions | |
UNS8 | _writeNetworkDict (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 count, UNS8 dataType, void *data, SDOCallback_t Callback, UNS8 endianize) |
UNS32 | decompo_dcf (CO_Data *d, UNS8 nodeId) |
Variables | |
const indextable * | ptrTable |
-
--Definition in file dcf.c.
INLINE UNS8 _writeNetworkDict | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId, | -|
- | - | UNS16 | -index, | -|
- | - | UNS8 | -subIndex, | -|
- | - | UNS8 | -count, | -|
- | - | UNS8 | -dataType, | -|
- | - | void * | -data, | -|
- | - | SDOCallback_t | -Callback, | -|
- | - | UNS8 | -endianize | - |
- | ) | -- |
-
d | ||
nodeId | ||
index | ||
subIndex | ||
count | ||
dataType | ||
data | ||
Callback | ||
endianize |
-Normal transfert -
-Definition at line 1247 of file sdo.c. -
-References struct_s_SDO::body, td_indextable::bSubCount, struct_s_transfer::Callback, CANOPEN_BIG_ENDIAN, struct_s_transfer::count, struct_s_timer_entry::d, BODY::data, struct_s_transfer::data, struct_s_transfer::dataType, struct_CO_Data::firstIndex, getSDOfreeLine(), getSDOlineOnUse(), initSDOline(), struct_CO_Data::lastIndex, MSG_ERR, MSG_WAR, struct_s_SDO::nodeId, struct_CO_Data::objdict, struct_s_transfer::offset, td_subindex::pObject, td_indextable::pSubindex, resetSDOline(), SDO_CLIENT, s_quick_index::SDO_CLT, SDO_DOWNLOAD_IN_PROGRESS, sendSDO(), struct_CO_Data::transfers, UNS16, UNS32, and UNS8. -
-Referenced by decompo_dcf(), writeNetworkDict(), and writeNetworkDictCallBack(). -
-Here is the call graph for this function:
UNS32 decompo_dcf | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId | - |
- | ) | -- |
-
d | ||
nodeId |
-Definition at line 75 of file dcf.c. -
-References _writeNetworkDict(), struct_s_timer_entry::d, struct_CO_Data::dcf_count_targets, struct_CO_Data::dcf_cursor, OD_SUCCESSFUL, td_subindex::pObject, struct_CO_Data::preOperational, td_indextable::pSubindex, ptrTable, struct_CO_Data::scanIndexOD, td_subindex::size, UNS16, UNS16_LE, UNS32, UNS32_LE, and UNS8. -
-Referenced by setState(). -
-Here is the call graph for this function:
-
const indextable* ptrTable | -
- -
-Definition at line 45 of file dcf.c. -
-Referenced by _getODentry(), _setODentry(), decompo_dcf(), and setState(). -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 -00024 UNS32 decompo_dcf(CO_Data* d, UNS8 nodeId); -
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Functions | |
UNS32 | decompo_dcf (CO_Data *d, UNS8 nodeId) |
UNS32 decompo_dcf | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId | - |
- | ) | -- |
-
d | ||
nodeId |
-Definition at line 75 of file dcf.c. -
-References _writeNetworkDict(), struct_s_timer_entry::d, struct_CO_Data::dcf_count_targets, struct_CO_Data::dcf_cursor, OD_SUCCESSFUL, td_subindex::pObject, struct_CO_Data::preOperational, td_indextable::pSubindex, ptrTable, struct_CO_Data::scanIndexOD, td_subindex::size, UNS16, UNS16_LE, UNS32, UNS32_LE, and UNS8. -
-Referenced by setState(). -
-Here is the call graph for this function:
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 -00024 #ifndef __def_h__ -00025 #define __def_h__ -00026 -00027 #include "config.h" -00028 -00031 #define OD_SUCCESSFUL 0x00000000 -00032 #define OD_READ_NOT_ALLOWED 0x06010001 -00033 #define OD_WRITE_NOT_ALLOWED 0x06010002 -00034 #define OD_NO_SUCH_OBJECT 0x06020000 -00035 #define OD_NOT_MAPPABLE 0x06040041 -00036 #define OD_LENGTH_DATA_INVALID 0x06070010 -00037 #define OD_NO_SUCH_SUBINDEX 0x06090011 -00038 #define OD_VALUE_TOO_LOW 0x06090031 /* Value range test result */ -00039 #define OD_VALUE_TOO_HIGH 0x06090032 /* Value range test result */ -00040 /* Others SDO abort codes -00041 */ -00042 #define SDOABT_TOGGLE_NOT_ALTERNED 0x05030000 -00043 #define SDOABT_TIMED_OUT 0x05040000 -00044 #define SDOABT_OUT_OF_MEMORY 0x05040005 /* Size data exceed SDO_MAX_LENGTH_TRANSFERT */ -00045 #define SDOABT_GENERAL_ERROR 0x08000000 /* Error size of SDO message */ -00046 #define SDOABT_LOCAL_CTRL_ERROR 0x08000021 -00047 -00048 /******************** CONSTANTS ****************/ -00049 -00053 /* Should not be modified */ -00054 #define REQUEST 1 -00055 #define NOT_A_REQUEST 0 -00056 -00057 /* Misc constants */ -00058 /* -------------- */ -00059 /* Should not be modified */ -00060 #define Rx 0 -00061 #define Tx 1 -00062 #define TRUE 1 -00063 #define FALSE 0 -00064 -00065 -00068 #define SDO_RESET 0x0 /* Transmission not started. Init state. */ -00069 #define SDO_FINISHED 0x1 /* data are available */ -00070 #define SDO_ABORTED_RCV 0x80 /* Received an abort message. Data not available */ -00071 #define SDO_ABORTED_INTERNAL 0x85 /* Aborted but not because of an abort message. */ -00072 #define SDO_DOWNLOAD_IN_PROGRESS 0x2 -00073 #define SDO_UPLOAD_IN_PROGRESS 0x3 -00074 -00075 /* Status of the node during the SDO transfert : */ -00076 #define SDO_SERVER 0x1 -00077 #define SDO_CLIENT 0x2 -00078 #define SDO_UNKNOWN 0x3 -00079 -00080 /* Function Codes -00081 --------------- -00082 defined in the canopen DS301 -00083 */ -00084 #define NMT 0x0 -00085 #define SYNC 0x1 -00086 #define TIME_STAMP 0x2 -00087 #define PDO1tx 0x3 -00088 #define PDO1rx 0x4 -00089 #define PDO2tx 0x5 -00090 #define PDO2rx 0x6 -00091 #define PDO3tx 0x7 -00092 #define PDO3rx 0x8 -00093 #define PDO4tx 0x9 -00094 #define PDO4rx 0xA -00095 #define SDOtx 0xB -00096 #define SDOrx 0xC -00097 #define NODE_GUARD 0xE -00098 -00099 /* NMT Command Specifier, sent by master to change a slave state */ -00100 /* ------------------------------------------------------------- */ -00101 /* Should not be modified */ -00102 #define NMT_Start_Node 0x01 -00103 #define NMT_Stop_Node 0x02 -00104 #define NMT_Enter_PreOperational 0x80 -00105 #define NMT_Reset_Node 0x81 -00106 #define NMT_Reset_Comunication 0x82 -00107 -00108 /* constantes used in the different state machines */ -00109 /* ----------------------------------------------- */ -00110 /* Must not be modified */ -00111 #define state1 0x01 -00112 #define state2 0x02 -00113 #define state3 0x03 -00114 #define state4 0x04 -00115 #define state5 0x05 -00116 #define state6 0x06 -00117 #define state7 0x07 -00118 #define state8 0x08 -00119 #define state9 0x09 -00120 #define state10 0x0A -00121 #define state11 0x0B -00122 -00123 #endif /* __def_h__ */ -00124 -
#include "config.h"
-Include dependency graph for def.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Defines | |
#define | OD_SUCCESSFUL 0x00000000 |
#define | OD_READ_NOT_ALLOWED 0x06010001 |
#define | OD_WRITE_NOT_ALLOWED 0x06010002 |
#define | OD_NO_SUCH_OBJECT 0x06020000 |
#define | OD_NOT_MAPPABLE 0x06040041 |
#define | OD_LENGTH_DATA_INVALID 0x06070010 |
#define | OD_NO_SUCH_SUBINDEX 0x06090011 |
#define | OD_VALUE_TOO_LOW 0x06090031 |
#define | OD_VALUE_TOO_HIGH 0x06090032 |
#define | SDOABT_TOGGLE_NOT_ALTERNED 0x05030000 |
#define | SDOABT_TIMED_OUT 0x05040000 |
#define | SDOABT_OUT_OF_MEMORY 0x05040005 |
#define | SDOABT_GENERAL_ERROR 0x08000000 |
#define | SDOABT_LOCAL_CTRL_ERROR 0x08000021 |
#define | REQUEST 1 |
#define | NOT_A_REQUEST 0 |
#define | Rx 0 |
#define | Tx 1 |
#define | TRUE 1 |
#define | FALSE 0 |
#define | SDO_RESET 0x0 |
#define | SDO_FINISHED 0x1 |
#define | SDO_ABORTED_RCV 0x80 |
#define | SDO_ABORTED_INTERNAL 0x85 |
#define | SDO_DOWNLOAD_IN_PROGRESS 0x2 |
#define | SDO_UPLOAD_IN_PROGRESS 0x3 |
#define | SDO_SERVER 0x1 |
#define | SDO_CLIENT 0x2 |
#define | SDO_UNKNOWN 0x3 |
#define | NMT 0x0 |
#define | SYNC 0x1 |
#define | TIME_STAMP 0x2 |
#define | PDO1tx 0x3 |
#define | PDO1rx 0x4 |
#define | PDO2tx 0x5 |
#define | PDO2rx 0x6 |
#define | PDO3tx 0x7 |
#define | PDO3rx 0x8 |
#define | PDO4tx 0x9 |
#define | PDO4rx 0xA |
#define | SDOtx 0xB |
#define | SDOrx 0xC |
#define | NODE_GUARD 0xE |
#define | NMT_Start_Node 0x01 |
#define | NMT_Stop_Node 0x02 |
#define | NMT_Enter_PreOperational 0x80 |
#define | NMT_Reset_Node 0x81 |
#define | NMT_Reset_Comunication 0x82 |
#define | state1 0x01 |
#define | state2 0x02 |
#define | state3 0x03 |
#define | state4 0x04 |
#define | state5 0x05 |
#define | state6 0x06 |
#define | state7 0x07 |
#define | state8 0x08 |
#define | state9 0x09 |
#define | state10 0x0A |
#define | state11 0x0B |
#define FALSE 0 | -
- -
-Definition at line 63 of file def.h. -
-Referenced by can_uvccm_win32::open_rs232(), can_uvccm_win32::receive(), and can_uvccm_win32::send(). -
#define NMT 0x0 | -
- -
-Definition at line 84 of file def.h. -
-Referenced by canDispatch(), and print_message(). -
#define NMT_Enter_PreOperational 0x80 | -
#define NMT_Reset_Comunication 0x82 | -
#define NMT_Reset_Node 0x81 | -
- -
-Definition at line 105 of file def.h. -
-Referenced by main(), and proceedNMTstateChange(). -
#define NMT_Start_Node 0x01 | -
- -
-Definition at line 102 of file def.h. -
-Referenced by main(), and proceedNMTstateChange(). -
#define NMT_Stop_Node 0x02 | -
- -
-Definition at line 103 of file def.h. -
-Referenced by main(), and proceedNMTstateChange(). -
#define NODE_GUARD 0xE | -
- -
-Definition at line 97 of file def.h. -
-Referenced by canDispatch(), masterSendNMTnodeguard(), print_message(), and slaveSendBootUp(). -
#define NOT_A_REQUEST 0 | -
- -
-Definition at line 55 of file def.h. -
-Referenced by buildPDO(), masterSendNMTstateChange(), proceedPDO(), sendSDO(), sendSYNC(), and slaveSendBootUp(). -
#define OD_LENGTH_DATA_INVALID 0x06070010 | -
- -
-Definition at line 36 of file def.h. -
-Referenced by _getODentry(), _setODentry(), and accessDictionaryError(). -
#define OD_NO_SUCH_OBJECT 0x06020000 | -
- -
-Definition at line 34 of file def.h. -
-Referenced by accessDictionaryError(), gene_SYNC_scanIndexOD(), TestMaster_scanIndexOD(), TestSlave_scanIndexOD(), and win32test_scanIndexOD(). -
#define OD_NO_SUCH_SUBINDEX 0x06090011 | -
- -
-Definition at line 37 of file def.h. -
-Referenced by _getODentry(), _setODentry(), and accessDictionaryError(). -
#define OD_NOT_MAPPABLE 0x06040041 | -
#define OD_READ_NOT_ALLOWED 0x06010001 | -
#define OD_SUCCESSFUL 0x00000000 | -
-definitions used for object dictionary access. ie SDO Abort codes . (See DS 301 v.4.02 p.48) -
-Definition at line 31 of file def.h. -
-Referenced by _getODentry(), _setODentry(), buildPDO(), decompo_dcf(), gene_SYNC_scanIndexOD(), main(), objdictToSDOline(), PDOInit(), proceedPDO(), RegisterSetODentryCallBack(), SDOlineToObjdict(), setState(), TestMaster_scanIndexOD(), TestSlave_scanIndexOD(), and win32test_scanIndexOD(). -
#define OD_VALUE_TOO_HIGH 0x06090032 | -
#define OD_VALUE_TOO_LOW 0x06090031 | -
#define OD_WRITE_NOT_ALLOWED 0x06010002 | -
- -
-Definition at line 33 of file def.h. -
-Referenced by _getODentry(), _setODentry(), and accessDictionaryError(). -
#define PDO1rx 0x4 | -
- -
-Definition at line 88 of file def.h. -
-Referenced by canDispatch(), and print_message(). -
#define PDO1tx 0x3 | -
- -
-Definition at line 87 of file def.h. -
-Referenced by canDispatch(), and print_message(). -
#define PDO2rx 0x6 | -
- -
-Definition at line 90 of file def.h. -
-Referenced by canDispatch(), and print_message(). -
#define PDO2tx 0x5 | -
- -
-Definition at line 89 of file def.h. -
-Referenced by canDispatch(), and print_message(). -
#define PDO3rx 0x8 | -
- -
-Definition at line 92 of file def.h. -
-Referenced by canDispatch(), and print_message(). -
#define PDO3tx 0x7 | -
- -
-Definition at line 91 of file def.h. -
-Referenced by canDispatch(), and print_message(). -
#define PDO4rx 0xA | -
- -
-Definition at line 94 of file def.h. -
-Referenced by canDispatch(), and print_message(). -
#define PDO4tx 0x9 | -
- -
-Definition at line 93 of file def.h. -
-Referenced by canDispatch(), and print_message(). -
#define REQUEST 1 | -
-Constantes which permit to define if a PDO frame is a request one or a data one -
-Definition at line 54 of file def.h. -
-Referenced by masterSendNMTnodeguard(), proceedPDO(), and sendPDOrequest(). -
#define SDO_ABORTED_INTERNAL 0x85 | -
- -
-Definition at line 71 of file def.h. -
-Referenced by failedSDO(), getReadResultNetworkDict(), getWriteResultNetworkDict(), SDOTimeoutAlarm(), and TestMaster_post_TPDO(). -
#define SDO_ABORTED_RCV 0x80 | -
- -
-Definition at line 70 of file def.h. -
-Referenced by proceedSDO(), and TestMaster_post_TPDO(). -
#define SDO_CLIENT 0x2 | -
- -
-Definition at line 77 of file def.h. -
-Referenced by _readNetworkDict(), _writeNetworkDict(), failedSDO(), getReadResultNetworkDict(), getWriteResultNetworkDict(), proceedSDO(), ReadSDO(), and TestMaster_post_TPDO(). -
#define SDO_DOWNLOAD_IN_PROGRESS 0x2 | -
- -
-Definition at line 72 of file def.h. -
-Referenced by _writeNetworkDict(), initSDOline(), proceedSDO(), and TestMaster_post_TPDO(). -
#define SDO_FINISHED 0x1 | -
- -
-Definition at line 69 of file def.h. -
-Referenced by getReadResultNetworkDict(), proceedSDO(), ReadSDO(), and TestMaster_post_TPDO(). -
#define SDO_RESET 0x0 | -
-Status of the SDO transmission -
-Definition at line 68 of file def.h. -
-Referenced by getSDOfreeLine(), getSDOlineOnUse(), resetSDOline(), and TestMaster_post_TPDO(). -
#define SDO_SERVER 0x1 | -
- -
-Definition at line 76 of file def.h. -
-Referenced by failedSDO(), proceedSDO(), SDOTimeoutAlarm(), and sendSDO(). -
#define SDO_UNKNOWN 0x3 | -
#define SDO_UPLOAD_IN_PROGRESS 0x3 | -
- -
-Definition at line 73 of file def.h. -
-Referenced by _readNetworkDict(), initSDOline(), proceedSDO(), ReadSDO(), and TestMaster_post_TPDO(). -
#define SDOABT_GENERAL_ERROR 0x08000000 | -
#define SDOABT_LOCAL_CTRL_ERROR 0x08000021 | -
#define SDOABT_OUT_OF_MEMORY 0x05040005 | -
#define SDOABT_TIMED_OUT 0x05040000 | -
#define SDOABT_TOGGLE_NOT_ALTERNED 0x05030000 | -
#define SDOrx 0xC | -
- -
-Definition at line 96 of file def.h. -
-Referenced by canDispatch(), and print_message(). -
#define SDOtx 0xB | -
- -
-Definition at line 95 of file def.h. -
-Referenced by canDispatch(), and print_message(). -
#define state1 0x01 | -
#define state11 0x0B | -
#define state2 0x02 | -
#define state3 0x03 | -
#define state4 0x04 | -
#define state5 0x05 | -
- -
-Definition at line 115 of file def.h. -
-Referenced by _sendPDOevent(), and proceedPDO(). -
#define SYNC 0x1 | -
- -
-Definition at line 85 of file def.h. -
-Referenced by canDispatch(), and print_message(). -
#define TIME_STAMP 0x2 | -
#define TRUE 1 | -
-
File in drivers » can_lincan | Includes file in include |
---|---|
can_lincan.c | can_driver.h |
File in drivers » can_peak_linux | Includes file in include |
---|---|
can_peak_linux.c | can_driver.h |
File in drivers » can_peak_win32 | Includes file in include |
---|---|
can_peak_win32.c | can_driver.h |
File in drivers » can_socket | Includes file in include |
---|---|
can_socket.c | can_driver.h |
can_socket.c | win32 / config.h |
File in drivers » can_uvccm_win32 | Includes file in include |
---|---|
can_uvccm_win32.cpp | can_driver.h |
File in drivers » can_virtual | Includes file in include |
---|---|
can_virtual.c | can_driver.h |
can_virtual.c | def.h |
File in drivers » timers_unix | Includes file in include |
---|---|
timers_unix.c | win32 / applicfg.h |
timers_unix.c | timer.h |
File in drivers » timers_xeno | Includes file in include |
---|---|
timers_xeno.c | win32 / applicfg.h |
timers_xeno.c | can_driver.h |
timers_xeno.c | timer.h |
File in drivers » unix | Includes file in include |
---|---|
unix.c | can_driver.h |
unix.c | win32 / canfestival.h |
unix.c | data.h |
unix.c | timers_driver.h |
File in examples » gene_SYNC_HCS12 | Includes file in include |
---|---|
appli.c | win32 / applicfg.h |
appli.c | hcs12 / interrupt.h |
appli.c | hcs12 / asm-m68hc12 / ports.h |
appli.c | hcs12 / asm-m68hc12 / ports_def.h |
appli.c | hcs12 / asm-m68hc12 / portsaccess.h |
objdict.h | data.h |
File in examples » TestMasterMicroMod | Includes file in include |
---|---|
TestMaster.h | data.h |
TestMasterMicroMod.c | win32 / canfestival.h |
TestMasterMicroMod.h | win32 / canfestival.h |
File in examples » TestMasterSlave | Includes file in include |
---|---|
TestMaster.h | data.h |
TestMasterSlave.c | win32 / canfestival.h |
TestMasterSlave.h | win32 / canfestival.h |
TestSlave.h | data.h |
File in examples » win32test | Includes file in include |
---|---|
main.c | win32 / canfestival.h |
win32test.h | data.h |
File in include » unix | Includes file in include » win32 |
---|---|
canfestival.h | timerscfg.h |
-
Directories | |
directory | win32 |
Files | |
file | dcf.c [code] |
EXEMPLE OF SOMMARY. | |
file | lifegrd.c [code] |
file | nmtMaster.c [code] |
file | nmtSlave.c [code] |
file | objacces.c [code] |
file | pdo.c [code] |
file | sdo.c [code] |
file | states.c [code] |
file | sync.c [code] |
file | timer.c [code] |
-
Files | |
file | main.c [code] |
file | win32test.c [code] |
file | win32test.h [code] |
-
Files | |
file | unix.c [code] |
-
Files | |
file | canOpenDriver.c [code] |
file | interrupt.c [code] |
-
Files | |
file | can_socket.c [code] |
-
Directories | |
directory | arch |
-
Files | |
file | getopt.c [code] |
file | getopt.h [code] |
file | Master.c [code] |
file | Master.h [code] |
file | Slave.c [code] |
file | Slave.h [code] |
file | TestMaster.c [code] |
file | TestMaster.h [code] |
file | TestMasterSlave.c [code] |
file | TestMasterSlave.h [code] |
file | TestSlave.c [code] |
file | TestSlave.h [code] |
-
Directories | |
directory | can_lincan |
directory | can_peak_linux |
directory | can_peak_win32 |
directory | can_socket |
directory | can_uvccm_win32 |
directory | can_virtual |
directory | hcs12 |
directory | timers_unix |
directory | timers_xeno |
directory | unix |
directory | win32 |
-
Files | |
file | resource.h [code] |
-
Files | |
file | can_uvccm_win32.cpp [code] |
-
Directories | |
directory | gene_SYNC_HCS12 |
directory | TestMasterMicroMod |
directory | TestMasterSlave |
directory | win32test |
-
Files | |
file | drivers_win32.cpp [code] |
file | timers_win32.cpp [code] |
-
Files | |
file | timerscfg.h [code] |
-
Files | |
file | can_peak_win32.c [code] |
-
Directories | |
directory | hcs12 |
directory | timers_unix |
directory | timers_xeno |
directory | unix |
directory | win32 |
Files | |
file | can.h [code] |
file | can_driver.h [code] |
file | config.h [code] |
file | data.h [code] |
file | dcf.h [code] |
file | def.h [code] |
file | lifegrd.h [code] |
file | nmtMaster.h [code] |
file | nmtSlave.h [code] |
file | objacces.h [code] |
Responsible for accessing the object dictionary. | |
file | objdictdef.h [code] |
file | pdo.h [code] |
file | sdo.h [code] |
file | states.h [code] |
file | sync.h [code] |
file | sysdep.h [code] |
file | timer.h [code] |
file | timers_driver.h [code] |
-
Files | |
file | exit.h [code] |
file | interrupts.h [code] |
file | param.h [code] |
-
Files | |
file | getopt.c [code] |
file | getopt.h [code] |
file | TestMaster.c [code] |
file | TestMaster.h [code] |
file | TestMasterMicroMod.c [code] |
file | TestMasterMicroMod.h [code] |
-
Files | |
file | applicfg.h [code] |
file | canfestival.h [code] |
file | config.h [code] |
file | timerscfg.h [code] |
-
Directories | |
directory | asm-m68hc12 |
directory | board |
Files | |
file | applicfg.h [code] |
file | candriver.h [code] |
file | canOpenDriver.h [code] |
file | error.h [code] |
file | interrupt.h [code] |
file | regbase.h [code] |
-
Files | |
file | appli.c [code] |
file | objdict.c [code] |
file | objdict.h [code] |
-
Files | |
file | can_peak_linux.c [code] |
-
Files | |
file | can_lincan.c [code] |
file | canmsg.h [code] |
file | lincan.h [code] |
-
Files | |
file | can_virtual.c [code] |
-
Files | |
file | timers_unix.c [code] |
-
Files | |
file | applicfg.h [code] |
file | canfestival.h [code] |
-
Files | |
file | timerscfg.h [code] |
-
Files | |
file | ports.h [code] |
file | ports_def.h [code] |
file | portsaccess.h [code] |
file | regs.h [code] |
-
Files | |
file | timers_xeno.c [code] |
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 Copyright (C) Win32 Port Leonid Tochinski -00006 -00007 See COPYING file for copyrights details. -00008 -00009 This library is free software; you can redistribute it and/or -00010 modify it under the terms of the GNU Lesser General Public -00011 License as published by the Free Software Foundation; either -00012 version 2.1 of the License, or (at your option) any later version. -00013 -00014 This library is distributed in the hope that it will be useful, -00015 but WITHOUT ANY WARRANTY; without even the implied warranty of -00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00017 Lesser General Public License for more details. -00018 -00019 You should have received a copy of the GNU Lesser General Public -00020 License along with this library; if not, write to the Free Software -00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00022 */ -00023 -00024 /* -00025 CAN driver interface. -00026 */ -00027 -00028 #include <windows.h> -00029 -00030 extern "C" -00031 { -00032 #define DLL_CALL(funcname) (*_##funcname) -00033 #define FCT_PTR_INIT =NULL -00034 #include "canfestival.h" -00035 #include "timer.h" -00036 -00037 #include "timers_driver.h" -00038 }; -00039 -00040 typedef UNS8 (*CANRECEIVE_DRIVER_PROC)(void* inst, Message *m); -00041 typedef UNS8 (*CANSEND_DRIVER_PROC)(void* inst, const Message *m); -00042 typedef void* (*CANOPEN_DRIVER_PROC)(s_BOARD *board); -00043 typedef int (*CANCLOSE_DRIVER_PROC)(void* inst); -00044 -00045 -00046 class driver_procs -00047 { -00048 public: -00049 driver_procs(); -00050 ~driver_procs(); -00051 -00052 HMODULE load_canfestival_driver(LPCTSTR driver_name); -00053 bool can_driver_valid() const; -00054 -00055 public: -00056 // can driver -00057 CANRECEIVE_DRIVER_PROC m_canReceive; -00058 CANSEND_DRIVER_PROC m_canSend; -00059 CANOPEN_DRIVER_PROC m_canOpen; -00060 CANCLOSE_DRIVER_PROC m_canClose; -00061 -00062 // driver module habndle -00063 HMODULE m_driver_handle; -00064 }; -00065 -00066 driver_procs::driver_procs() : m_canReceive(0), -00067 m_canSend(0), -00068 m_canOpen(0), -00069 m_canClose(0), -00070 m_driver_handle(0) -00071 {} -00072 -00073 driver_procs::~driver_procs() -00074 { -00075 if (m_driver_handle) -00076 ::FreeLibrary(m_driver_handle); -00077 } -00078 -00079 bool driver_procs::can_driver_valid() const -00080 { -00081 return ((m_canReceive != NULL) && -00082 (m_canSend != NULL) && -00083 (m_canOpen != NULL) && -00084 (m_canClose != NULL)); -00085 } -00086 -00087 // GetProcAddress doesn't have an UNICODE version for NT -00088 #ifdef UNDER_CE -00089 #define myTEXT(str) TEXT(str) -00090 #else -00091 #define myTEXT(str) str -00092 #endif -00093 -00094 HMODULE driver_procs::load_canfestival_driver(LPCTSTR driver_name) -00095 { -00096 if (can_driver_valid()) -00097 return m_driver_handle; -00098 m_driver_handle = ::LoadLibrary(driver_name); -00099 if (m_driver_handle == NULL) -00100 return NULL; -00101 -00102 m_canReceive = (CANRECEIVE_DRIVER_PROC)::GetProcAddress(m_driver_handle, myTEXT("canReceive_driver")); -00103 m_canSend = (CANSEND_DRIVER_PROC)::GetProcAddress(m_driver_handle, myTEXT("canSend_driver")); -00104 m_canOpen = (CANOPEN_DRIVER_PROC)::GetProcAddress(m_driver_handle, myTEXT("canOpen_driver")); -00105 m_canClose = (CANCLOSE_DRIVER_PROC)::GetProcAddress(m_driver_handle, myTEXT("canClose_driver")); -00106 return can_driver_valid()?m_driver_handle:NULL; -00107 } -00108 -00109 struct driver_data -00110 { -00111 CO_Data * d; -00112 HANDLE receive_thread; -00113 void* inst; -00114 volatile bool continue_receive_thread; -00115 }; -00116 -00117 driver_procs s_driver_procs; -00118 -00119 LIB_HANDLE LoadCanDriver(char* driver_name) -00120 { -00121 return s_driver_procs.load_canfestival_driver((LPCTSTR)driver_name); -00122 } -00123 -00124 UNS8 canReceive(CAN_PORT fd0, Message *m) -00125 { -00126 if (fd0 != NULL && s_driver_procs.m_canReceive != NULL) -00127 { -00128 driver_data* data = (driver_data*)fd0; -00129 return (*s_driver_procs.m_canReceive)(data->inst, m); -00130 } -00131 return 1; -00132 } -00133 -00134 void* canReceiveLoop(CAN_PORT fd0) -00135 { -00136 driver_data* data = (driver_data*)fd0; -00137 Message m; -00138 while (data->continue_receive_thread) -00139 { -00140 if (!canReceive(fd0, &m)) -00141 { -00142 EnterMutex(); -00143 canDispatch(data->d, &m); -00144 LeaveMutex(); -00145 } -00146 else -00147 { -00148 break; -00149 ::Sleep(1); -00150 } -00151 } -00152 return 0; -00153 } -00154 -00155 /***************************************************************************/ -00156 UNS8 canSend(CAN_PORT fd0, Message *m) -00157 { -00158 if (fd0 != NULL && s_driver_procs.m_canSend != NULL) -00159 { -00160 UNS8 res; -00161 driver_data* data = (driver_data*)fd0; -00162 LeaveMutex(); -00163 res = (*s_driver_procs.m_canSend)(data->inst, m); -00164 EnterMutex(); -00165 if (res) -00166 return 0; -00167 } -00168 return 1; -00169 } -00170 -00171 /***************************************************************************/ -00172 CAN_HANDLE canOpen(s_BOARD *board, CO_Data * d) -00173 { -00174 if (board != NULL && s_driver_procs.m_canOpen != NULL) -00175 { -00176 void* inst = (*s_driver_procs.m_canOpen)(board); -00177 if (inst != NULL) -00178 { -00179 driver_data* data = new driver_data; -00180 data->d = d; -00181 data->inst = inst; -00182 data->continue_receive_thread = true; -00183 CreateReceiveTask(data, &data->receive_thread, &canReceiveLoop); -00184 EnterMutex(); -00185 d->canHandle = data; -00186 LeaveMutex(); -00187 return data; -00188 } -00189 } -00190 return NULL; -00191 } -00192 -00193 /***************************************************************************/ -00194 int canClose(CO_Data * d) -00195 { -00196 if (s_driver_procs.m_canClose != NULL) -00197 { -00198 driver_data* data; -00199 EnterMutex(); -00200 if(d->canHandle != NULL){ -00201 data = (driver_data*)d->canHandle; -00202 d->canHandle = NULL; -00203 data->continue_receive_thread = false;} -00204 LeaveMutex(); -00205 WaitReceiveTaskEnd(&data->receive_thread); -00206 (*s_driver_procs.m_canClose)(data->inst); -00207 delete data; -00208 return 0; -00209 } -00210 return 0; -00211 } -00212 -00213 -
#include <windows.h>
#include "canfestival.h"
#include "timer.h"
#include "timers_driver.h"
-Include dependency graph for drivers_win32.cpp:
-Go to the source code of this file.
Data Structures | |
class | driver_procs |
struct | driver_data |
Defines | |
#define | DLL_CALL(funcname) (*_##funcname) |
#define | FCT_PTR_INIT =NULL |
#define | myTEXT(str) str |
Typedefs | |
typedef UNS8(*) | CANRECEIVE_DRIVER_PROC (void *inst, Message *m) |
typedef UNS8(*) | CANSEND_DRIVER_PROC (void *inst, const Message *m) |
typedef void *(*) | CANOPEN_DRIVER_PROC (s_BOARD *board) |
typedef int(*) | CANCLOSE_DRIVER_PROC (void *inst) |
Functions | |
LIB_HANDLE | LoadCanDriver (char *driver_name) |
UNS8 | canReceive (CAN_PORT fd0, Message *m) |
void * | canReceiveLoop (CAN_PORT fd0) |
UNS8 | canSend (CAN_PORT fd0, Message *m) |
CAN_HANDLE | canOpen (s_BOARD *board, CO_Data *d) |
int | canClose (CO_Data *d) |
Variables | |
driver_procs | s_driver_procs |
#define DLL_CALL | -( | -funcname | -- | ) | -(*_##funcname) | -
- -
-Definition at line 32 of file drivers_win32.cpp. -
#define FCT_PTR_INIT =NULL | -
- -
-Definition at line 33 of file drivers_win32.cpp. -
#define myTEXT | -( | -str | -- | ) | -str | -
- -
-Definition at line 91 of file drivers_win32.cpp. -
-Referenced by driver_procs::load_canfestival_driver(). -
-
typedef int(*) CANCLOSE_DRIVER_PROC(void *inst) | -
- -
-Definition at line 43 of file drivers_win32.cpp. -
typedef void*(*) CANOPEN_DRIVER_PROC(s_BOARD *board) | -
- -
-Definition at line 42 of file drivers_win32.cpp. -
typedef UNS8(*) CANRECEIVE_DRIVER_PROC(void *inst, Message *m) | -
- -
-Definition at line 40 of file drivers_win32.cpp. -
typedef UNS8(*) CANSEND_DRIVER_PROC(void *inst, const Message *m) | -
- -
-Definition at line 41 of file drivers_win32.cpp. -
-
int canClose | -( | -CO_Data * | -d | -) | -- |
- -
-Definition at line 194 of file drivers_win32.cpp. -
-References canClose(), struct_CO_Data::canHandle, driver_data::continue_receive_thread, DLL_CALL, EnterMutex(), CANPort::fd, driver_data::inst, LeaveMutex(), driver_procs::m_canClose, driver_data::receive_thread, CANPort::receiveTask, s_driver_procs, and WaitReceiveTaskEnd(). -
-Here is the call graph for this function:
CAN_HANDLE canOpen | -( | -s_BOARD * | -board, | -|
- | - | CO_Data * | -d | - |
- | ) | -- |
- -
-Definition at line 172 of file drivers_win32.cpp. -
-References struct_s_BOARD::baudrate, struct_s_BOARD::busname, struct_CO_Data::canHandle, canOpen(), canports, canReceiveLoop(), driver_data::continue_receive_thread, CreateReceiveTask(), CANPort::d, driver_data::d, DLL_CALL, EnterMutex(), CANPort::fd, driver_data::inst, LeaveMutex(), driver_procs::m_canOpen, MAX_NB_CAN_PORTS, driver_data::receive_thread, s_driver_procs, and CANPort::used. -
-Here is the call graph for this function:
- -
-Definition at line 124 of file drivers_win32.cpp. -
-References driver_data::inst, driver_procs::m_canReceive, and s_driver_procs. -
-Referenced by canReceiveLoop(), and LoadCanDriver(). -
void* canReceiveLoop | -( | -CAN_PORT | -fd0 | -) | -- |
- -
-Definition at line 134 of file drivers_win32.cpp. -
-References canDispatch(), canReceive(), driver_data::continue_receive_thread, driver_data::d, EnterMutex(), and LeaveMutex(). -
-Here is the call graph for this function:
- -
-Definition at line 156 of file drivers_win32.cpp. -
-References canSend(), DLL_CALL, EnterMutex(), driver_data::inst, LeaveMutex(), driver_procs::m_canSend, s_driver_procs, and UNS8. -
-Here is the call graph for this function:
LIB_HANDLE LoadCanDriver | -( | -char * | -driver_name | -) | -- |
- -
-Definition at line 119 of file drivers_win32.cpp. -
-References canClose(), canOpen(), canReceive(), canSend(), DLSYM, driver_procs::load_canfestival_driver(), and s_driver_procs. -
-Here is the call graph for this function:
-
driver_procs s_driver_procs | -
- -
-Definition at line 117 of file drivers_win32.cpp. -
-Referenced by canClose(), canOpen(), canReceive(), canSend(), and LoadCanDriver(). -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #ifndef __ERROR__ -00024 #define __ERROR__ -00025 -00026 -00027 #define ERR_CAN_ADD_ID_TO_FILTER "1 Not in init mode" -00028 #define ERR_CAN_INIT_CLOCK "4 Not in init mode" -00029 #define ERR_CAN_INIT_1_FILTER "5 Not in init mode" -00030 #define ERR_CAN_INIT_FILTER "6 Not in init mode" -00031 #define ERR_CAN_MSG_TRANSMIT "7 No buffer free " -00032 #define ERR_CAN_SLEEP_MODE "8 Is in init mode" -00033 #define ERR_CAN_SLEEP_MODE_Q "9 Is in init mode" -00034 #define ERR_CAN_SLEEP_WUP_MODE "10 Is in init mode" -00035 #define ERR_CAN0HDLRCV_STACK_FULL "11 Stack R full" -00036 -00037 #endif /* __ERROR__ */ -
-Go to the source code of this file.
Defines | |
#define | ERR_CAN_ADD_ID_TO_FILTER "1 Not in init mode" |
#define | ERR_CAN_INIT_CLOCK "4 Not in init mode" |
#define | ERR_CAN_INIT_1_FILTER "5 Not in init mode" |
#define | ERR_CAN_INIT_FILTER "6 Not in init mode" |
#define | ERR_CAN_MSG_TRANSMIT "7 No buffer free " |
#define | ERR_CAN_SLEEP_MODE "8 Is in init mode" |
#define | ERR_CAN_SLEEP_MODE_Q "9 Is in init mode" |
#define | ERR_CAN_SLEEP_WUP_MODE "10 Is in init mode" |
#define | ERR_CAN0HDLRCV_STACK_FULL "11 Stack R full" |
#define ERR_CAN0HDLRCV_STACK_FULL "11 Stack R full" | -
#define ERR_CAN_ADD_ID_TO_FILTER "1 Not in init mode" | -
#define ERR_CAN_INIT_1_FILTER "5 Not in init mode" | -
#define ERR_CAN_INIT_CLOCK "4 Not in init mode" | -
#define ERR_CAN_INIT_FILTER "6 Not in init mode" | -
#define ERR_CAN_MSG_TRANSMIT "7 No buffer free " | -
#define ERR_CAN_SLEEP_MODE "8 Is in init mode" | -
#define ERR_CAN_SLEEP_MODE_Q "9 Is in init mode" | -
#define ERR_CAN_SLEEP_WUP_MODE "10 Is in init mode" | -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 /* exit.h - 32K Board specific parameters -00024 Copyright (C) 2002 Free Software Foundation, Inc. -00025 Written by Stephane Carrez (stcarrez@nerim.fr) -00026 -00027 This file is free software; you can redistribute it and/or modify it -00028 under the terms of the GNU General Public License as published by the -00029 Free Software Foundation; either version 2, or (at your option) any -00030 later version. -00031 -00032 In addition to the permissions in the GNU General Public License, the -00033 Free Software Foundation gives you unlimited permission to link the -00034 compiled version of this file with other programs, and to distribute -00035 those programs without any restriction coming from the use of this -00036 file. (The General Public License restrictions do apply in other -00037 respects; for example, they cover modification of the file, and -00038 distribution when not linked into another program.) -00039 -00040 This file is distributed in the hope that it will be useful, but -00041 WITHOUT ANY WARRANTY; without even the implied warranty of -00042 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00043 General Public License for more details. -00044 -00045 You should have received a copy of the GNU General Public License -00046 along with this program; see the file COPYING. If not, write to -00047 the Free Software Foundation, 59 Temple Place - Suite 330, -00048 Boston, MA 02111-1307, USA. */ -00049 -00050 #ifndef _M68HC11_ARCH_32K_EXIT_H -00051 #define _M68HC11_ARCH_32K_EXIT_H -00052 -00053 extern void _exit (short status) __attribute__((noreturn)); -00054 -00055 /* For the simulator, the wai stops everything and exits with the -00056 error code stored in register d. -00057 -00058 For a real 68HC11, enable interrupts and wait forever. */ -00059 extern inline void -00060 _exit (short status) -00061 { -00062 /* Use 'd' constraint to force the status to be in the D -00063 register before execution of the asm. */ -00064 while (1) -00065 { -00066 __asm__ __volatile__ ("cli\n" -00067 "wai" : : "d"(status)); -00068 } -00069 } -00070 -00071 #endif -
-Go to the source code of this file.
Functions | |
void | _exit (short status) __attribute__((noreturn)) |
void _exit | -( | -short | -status | -) | - [inline] |
-
-
drivers/can_lincan/can_lincan.c [code] | |
drivers/can_lincan/canmsg.h [code] | |
drivers/can_lincan/lincan.h [code] | |
drivers/can_peak_linux/can_peak_linux.c [code] | |
drivers/can_peak_win32/can_peak_win32.c [code] | |
drivers/can_socket/can_socket.c [code] | |
drivers/can_uvccm_win32/can_uvccm_win32.cpp [code] | |
drivers/can_virtual/can_virtual.c [code] | |
drivers/hcs12/canOpenDriver.c [code] | |
drivers/hcs12/interrupt.c [code] | |
drivers/timers_unix/timers_unix.c [code] | |
drivers/timers_xeno/timers_xeno.c [code] | |
drivers/unix/unix.c [code] | |
drivers/win32/drivers_win32.cpp [code] | |
drivers/win32/timers_win32.cpp [code] | |
examples/gene_SYNC_HCS12/appli.c [code] | |
examples/gene_SYNC_HCS12/objdict.c [code] | |
examples/gene_SYNC_HCS12/objdict.h [code] | |
examples/TestMasterMicroMod/getopt.c [code] | |
examples/TestMasterMicroMod/getopt.h [code] | |
examples/TestMasterMicroMod/TestMaster.c [code] | |
examples/TestMasterMicroMod/TestMaster.h [code] | |
examples/TestMasterMicroMod/TestMasterMicroMod.c [code] | |
examples/TestMasterMicroMod/TestMasterMicroMod.h [code] | |
examples/TestMasterSlave/getopt.c [code] | |
examples/TestMasterSlave/getopt.h [code] | |
examples/TestMasterSlave/Master.c [code] | |
examples/TestMasterSlave/Master.h [code] | |
examples/TestMasterSlave/Slave.c [code] | |
examples/TestMasterSlave/Slave.h [code] | |
examples/TestMasterSlave/TestMaster.c [code] | |
examples/TestMasterSlave/TestMaster.h [code] | |
examples/TestMasterSlave/TestMasterSlave.c [code] | |
examples/TestMasterSlave/TestMasterSlave.h [code] | |
examples/TestMasterSlave/TestSlave.c [code] | |
examples/TestMasterSlave/TestSlave.h [code] | |
examples/win32test/main.c [code] | |
examples/win32test/win32test.c [code] | |
examples/win32test/win32test.h [code] | |
include/can.h [code] | |
include/can_driver.h [code] | |
include/config.h [code] | |
include/data.h [code] | |
include/dcf.h [code] | |
include/def.h [code] | |
include/lifegrd.h [code] | |
include/nmtMaster.h [code] | |
include/nmtSlave.h [code] | |
include/objacces.h [code] | Responsible for accessing the object dictionary |
include/objdictdef.h [code] | |
include/pdo.h [code] | |
include/sdo.h [code] | |
include/states.h [code] | |
include/sync.h [code] | |
include/sysdep.h [code] | |
include/timer.h [code] | |
include/timers_driver.h [code] | |
include/hcs12/applicfg.h [code] | |
include/hcs12/candriver.h [code] | |
include/hcs12/canOpenDriver.h [code] | |
include/hcs12/error.h [code] | |
include/hcs12/interrupt.h [code] | |
include/hcs12/regbase.h [code] | |
include/hcs12/asm-m68hc12/ports.h [code] | |
include/hcs12/asm-m68hc12/ports_def.h [code] | |
include/hcs12/asm-m68hc12/portsaccess.h [code] | |
include/hcs12/asm-m68hc12/regs.h [code] | |
include/hcs12/board/arch/exit.h [code] | |
include/hcs12/board/arch/interrupts.h [code] | |
include/hcs12/board/arch/param.h [code] | |
include/timers_unix/timerscfg.h [code] | |
include/timers_xeno/timerscfg.h [code] | |
include/unix/applicfg.h [code] | |
include/unix/canfestival.h [code] | |
include/win32/applicfg.h [code] | |
include/win32/canfestival.h [code] | |
include/win32/config.h [code] | |
include/win32/timerscfg.h [code] | |
src/dcf.c [code] | EXEMPLE OF SOMMARY |
src/lifegrd.c [code] | |
src/nmtMaster.c [code] | |
src/nmtSlave.c [code] | |
src/objacces.c [code] | |
src/pdo.c [code] | |
src/sdo.c [code] | |
src/states.c [code] | |
src/sync.c [code] | |
src/timer.c [code] | |
src/win32/resource.h [code] |
-Here is a list of all struct and union fields with links to the structures/unions they belong to: -
-
-
- -
-
-Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: -
-
-Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: -
-
-Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: -
-
-Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: -
-
-Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: -
-
-Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: -
-
-Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: -
-
-Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: -
-
-Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: -
-
-Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: -
-
-Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: -
-
-Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: -
-
-Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: -
-
-Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: -
-
-Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: -
-
-Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: -
-
-Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: -
-
-Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: -
-
-Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: -
-
-Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: -
-
-Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: -
-
-Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
--
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-Consider the following example:
/*! Invisible class because of truncation */ -class Invisible { }; - -/*! Truncated class, inheritance relation is hidden */ -class Truncated : public Invisible { }; - -/* Class not documented with doxygen comments */ -class Undocumented { }; - -/*! Class that is inherited using public inheritance */ -class PublicBase : public Truncated { }; - -/*! A template class */ -template<class T> class Templ { }; - -/*! Class that is inherited using protected inheritance */ -class ProtectedBase { }; - -/*! Class that is inherited using private inheritance */ -class PrivateBase { }; - -/*! Class that is used by the Inherited class */ -class Used { }; - -/*! Super class that inherits a number of other classes */ -class Inherited : public PublicBase, - protected ProtectedBase, - private PrivateBase, - public Undocumented - public Templ<int> -{ - private: - Used *m_usedClass; -}; -
MAX_DOT_GRAPH_HEIGHT
tag in the configuration file is set to 240 this will result in the following graph:-
-The boxes in the above graph have the following meaning:
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #ifndef __APPLICFG_HC12__ -00024 #define __APPLICFG_HC12__ -00025 -00026 #include <string.h> -00027 #include <stdio.h> -00028 -00029 #include <../include/hcs12/asm-m68hc12/portsaccess.h> -00030 #include <../include/hcs12/asm-m68hc12/ports_def.h> -00031 #include <../include/hcs12/asm-m68hc12/ports.h> -00032 #include <../include/hcs12/interrupt.h> -00033 -00034 -00036 // ----------------------------------------------------- -00037 // Test : -00038 // UNS32 v = 0x1234ABCD; -00039 // char *data = &v; -00040 // -00041 // Result for a little_endian architecture : -00042 // data[0] = 0xCD; -00043 // data[1] = 0xAB; -00044 // data[2] = 0x34; -00045 // data[3] = 0x12; -00046 // -00047 // Result for a big_endian architecture : -00048 // data[0] = 0x12; -00049 // data[1] = 0x34; -00050 // data[2] = 0xAB; -00051 // data[3] = 0xCD; -00052 -00053 /* CANOPEN_BIG_ENDIAN now defined in config.h*/ -00054 #ifndef CANOPEN_BIG_ENDIAN -00055 # define CANOPEN_BIG_ENDIAN 1 -00056 #endif -00057 -00058 -00059 // Use or not the PLL -00060 //#define USE_PLL -00061 -00062 #ifdef USE_PLL -00063 # define BUS_CLOCK 24 // If the quartz on the board is 16 MHz. If different, change this value -00064 #else -00065 # define BUS_CLOCK 8 // If the quartz on the board is 16 MHz. If different, change this value -00066 #endif -00067 -00069 // Tested : -00070 // SERIAL_SCI0_BAUD_RATE 9600 BUS_CLOCK 8 Send OK Receive not tested -00071 // SERIAL_SCI0_BAUD_RATE 19200 BUS_CLOCK 8 Send OK Receive not tested -00072 // SERIAL_SCI0_BAUD_RATE 38400 BUS_CLOCK 8 Send OK Receive not tested -00073 // SERIAL_SCI0_BAUD_RATE 57600 BUS_CLOCK 8 Send Failed Receive not tested -00074 // SERIAL_SCI0_BAUD_RATE 115200 BUS_CLOCK 8 Send Failed Receive not tested -00075 -00076 // SERIAL_SCI0_BAUD_RATE 9600 BUS_CLOCK 24 Send OK Receive not tested -00077 // SERIAL_SCI0_BAUD_RATE 19200 BUS_CLOCK 24 Send OK Receive not tested -00078 // SERIAL_SCI0_BAUD_RATE 38400 BUS_CLOCK 24 Send OK but init problems Receive not tested -00079 // SERIAL_SCI0_BAUD_RATE 57600 BUS_CLOCK 24 Send Failed Receive not tested -00080 // SERIAL_SCI0_BAUD_RATE 115200 BUS_CLOCK 24 Send Failed Receive not tested -00081 -00082 #define SERIAL_SCI0_BAUD_RATE 38400 -00083 #define SERIAL_SCI1_BAUD_RATE 9600 -00084 -00085 -00086 -00087 -00088 -00089 -00090 // Several hardware definitions functions -00091 // -------------------------------------- -00092 -00093 -00095 extern void initSCI_0 (void); -00096 -00098 extern void initSCI_1 (void); -00099 -00110 extern char * -00111 hex_convert (char *buf, unsigned long value, char lastCar); -00112 -00115 extern void printSCI_str (char sci, const char * str); -00116 -00119 extern void printSCI_nbr (char sci, unsigned long nbr, char lastCar); -00120 -00123 extern void initPLL (void); -00124 -00126 extern void initHCS12 (void); -00127 -00128 // Integers -00129 #define INTEGER8 signed char -00130 #define INTEGER16 short -00131 #define INTEGER24 -00132 #define INTEGER32 long -00133 #define INTEGER40 -00134 #define INTEGER48 -00135 #define INTEGER56 -00136 #define INTEGER64 -00137 -00138 // Unsigned integers -00139 #define UNS8 unsigned char -00140 #define UNS16 unsigned short -00141 #define UNS32 unsigned long -00142 #define UNS24 -00143 #define UNS40 -00144 #define UNS48 -00145 #define UNS56 -00146 #define UNS64 -00147 -00148 // Whatever your microcontroller, the timer wont work if -00149 // TIMEVAL is not at least on 32 bits -00150 #define TIMEVAL UNS32 -00151 -00152 // The timer of the hcs12 counts from 0000 to 0xFFFF -00153 #define TIMEVAL_MAX 0xFFFF -00154 -00155 // The timer is incrementing every 4 us. -00156 #define MS_TO_TIMEVAL(ms) (ms * 250) -00157 #define US_TO_TIMEVAL(us) (us>>2) -00158 -00159 -00160 // Reals -00161 #define REAL32 float -00162 #define REAL64 double -00163 -00164 #include "can.h" -00165 -00166 -00168 // --------------------- -00169 #ifdef DEBUG_ERR_CONSOLE_ON -00170 # define MSG_ERR(num, str, val) \ -00171 initSCI_0(); \ -00172 printSCI_nbr(SCI0, num, ' '); \ -00173 /* large printing on console */ \ -00174 printSCI_str(SCI0, str); \ -00175 printSCI_nbr(SCI0, val, '\n'); -00176 #else -00177 # define MSG_ERR(num, str, val) -00178 #endif -00179 -00181 // --------------------- -00182 #ifdef DEBUG_WAR_CONSOLE_ON -00183 # define MSG_WAR(num, str, val) \ -00184 initSCI_0(); \ -00185 printSCI_nbr(SCI0, num, ' '); \ -00186 /* large printing on console */ \ -00187 printSCI_str(SCI0, str); \ -00188 printSCI_nbr(SCI0, val, '\n'); -00189 #else -00190 # define MSG_WAR(num, str, val) -00191 #endif -00192 -00193 -00194 #endif -00195 -00196 -
#include <string.h>
#include <stdio.h>
#include <../include/hcs12/asm-m68hc12/portsaccess.h>
#include <../include/hcs12/asm-m68hc12/ports_def.h>
#include <../include/hcs12/asm-m68hc12/ports.h>
#include <../include/hcs12/interrupt.h>
#include "can.h"
-Include dependency graph for applicfg.h:
-Go to the source code of this file.
Defines | |
#define | CANOPEN_BIG_ENDIAN 1 |
Define the architecture : little_endian or big_endian. | |
#define | BUS_CLOCK 8 |
#define | SERIAL_SCI0_BAUD_RATE 38400 |
Configuration of the serials port SCI0 and SCI1. | |
#define | SERIAL_SCI1_BAUD_RATE 9600 |
#define | INTEGER8 signed char |
#define | INTEGER16 short |
#define | INTEGER24 |
#define | INTEGER32 long |
#define | INTEGER40 |
#define | INTEGER48 |
#define | INTEGER56 |
#define | INTEGER64 |
#define | UNS8 unsigned char |
#define | UNS16 unsigned short |
#define | UNS32 unsigned long |
#define | UNS24 |
#define | UNS40 |
#define | UNS48 |
#define | UNS56 |
#define | UNS64 |
#define | TIMEVAL UNS32 |
#define | TIMEVAL_MAX 0xFFFF |
#define | MS_TO_TIMEVAL(ms) (ms * 250) |
#define | US_TO_TIMEVAL(us) (us>>2) |
#define | REAL32 float |
#define | REAL64 double |
#define | MSG_ERR(num, str, val) |
Definition of MSG_ERR. | |
#define | MSG_WAR(num, str, val) |
Definition of MSG_WAR. | |
Functions | |
void | initSCI_0 (void) |
Initialisation of the serial port 0. | |
void | initSCI_1 (void) |
Initialisation of the serial port 1. | |
char * | hex_convert (char *buf, unsigned long value, char lastCar) |
void | printSCI_str (char sci, const char *str) |
void | printSCI_nbr (char sci, unsigned long nbr, char lastCar) |
void | initPLL (void) |
void | initHCS12 (void) |
Put here all the code to init the HCS12. |
#define BUS_CLOCK 8 | -
#define CANOPEN_BIG_ENDIAN 1 | -
-Define the architecture : little_endian or big_endian. -
- -
-Definition at line 55 of file applicfg.h. -
-Referenced by _writeNetworkDict(), and getReadResultNetworkDict(). -
#define INTEGER16 short | -
- -
-Definition at line 130 of file applicfg.h. -
#define INTEGER24 | -
- -
-Definition at line 131 of file applicfg.h. -
#define INTEGER32 long | -
- -
-Definition at line 132 of file applicfg.h. -
#define INTEGER40 | -
- -
-Definition at line 133 of file applicfg.h. -
#define INTEGER48 | -
- -
-Definition at line 134 of file applicfg.h. -
#define INTEGER56 | -
- -
-Definition at line 135 of file applicfg.h. -
#define INTEGER64 | -
- -
-Definition at line 136 of file applicfg.h. -
#define INTEGER8 signed char | -
#define MS_TO_TIMEVAL | -( | -ms | -- | ) | -(ms * 250) | -
- -
-Definition at line 156 of file applicfg.h. -
-Referenced by _sendPDOevent(), heartbeatInit(), and proceedNODE_GUARD(). -
#define MSG_ERR | -( | -num, | |||
- | - | str, | |||
- | - | val | -- | ) | -- |
-Definition of MSG_ERR. -
- -
-Definition at line 177 of file applicfg.h. -
-Referenced by _readNetworkDict(), _sendPDOevent(), _writeNetworkDict(), buildPDO(), gene_SYNC_heartbeatError(), getReadResultNetworkDict(), getWriteResultNetworkDict(), lineToSDO(), proceedPDO(), proceedSDO(), SDOTimeoutAlarm(), SDOtoLine(), sendPDOrequest(), sendSDO(), and setSDOlineRestBytes(). -
#define MSG_WAR | -( | -num, | |||
- | - | str, | |||
- | - | val | -- | ) | -- |
-Definition of MSG_WAR. -
- -
-Definition at line 190 of file applicfg.h. -
-Referenced by _getODentry(), _readNetworkDict(), _sendPDOevent(), _setODentry(), _writeNetworkDict(), accessDictionaryError(), buildPDO(), canAddIdToFilter(), canInit1Filter(), canInitClock(), canInitFilter(), canMsgTransmit(), canSleepModeQ(), canSleepWupMode(), closeSDOtransfer(), DelAlarm(), failedSDO(), gene_SYNC_initialisation(), gene_SYNC_operational(), gene_SYNC_preOperational(), gene_SYNC_stopped(), initHCS12(), initSDOline(), initSensor(), main(), masterSendNMTnodeguard(), masterSendNMTstateChange(), objdictToSDOline(), proceedNMTstateChange(), proceedNODE_GUARD(), proceedPDO(), proceedSDO(), proceedSYNC(), ProducerHearbeatAlarm(), resetSDOline(), SDOlineToObjdict(), SDOTimeoutAlarm(), sendPDOrequest(), sendSDO(), sendSDOabort(), sendSYNC(), and slaveSendBootUp(). -
#define REAL32 float | -
- -
-Definition at line 161 of file applicfg.h. -
#define REAL64 double | -
- -
-Definition at line 162 of file applicfg.h. -
#define SERIAL_SCI0_BAUD_RATE 38400 | -
-Configuration of the serials port SCI0 and SCI1. -
- -
-Definition at line 82 of file applicfg.h. -
-Referenced by initSCI_0(). -
#define SERIAL_SCI1_BAUD_RATE 9600 | -
#define TIMEVAL UNS32 | -
- -
-Definition at line 150 of file applicfg.h. -
-Referenced by class_timers::get_timer(), heartbeatInit(), proceedNODE_GUARD(), StartTimerLoop(), TimeDispatch(), and class_timers::timer_loop_thread_proc(). -
#define TIMEVAL_MAX 0xFFFF | -
- -
-Definition at line 153 of file applicfg.h. -
-Referenced by class_timers::set_timer(), setTimer(), class_timers::start_timer_thread(), TimeDispatch(), and class_timers::timer_loop_thread_proc(). -
#define UNS16 unsigned short | -
- -
-Definition at line 140 of file applicfg.h. -
-Referenced by _readNetworkDict(), _sendPDOevent(), _writeNetworkDict(), buildPDO(), decompo_dcf(), gene_SYNC_operational(), heartbeatInit(), PDOInit(), PDOStop(), proceedPDO(), proceedSDO(), sendPDOrequest(), sendSDO(), setNodeId(), and setState(). -
#define UNS24 | -
- -
-Definition at line 142 of file applicfg.h. -
#define UNS32 unsigned long | -
- -
-Definition at line 141 of file applicfg.h. -
-Referenced by _getODentry(), _readNetworkDict(), _sendPDOevent(), _setODentry(), _writeNetworkDict(), buildPDO(), ConsumerHearbeatAlarm(), decompo_dcf(), heartbeatInit(), main(), objdictToSDOline(), PDOInit(), proceedNODE_GUARD(), proceedPDO(), proceedSDO(), ReadSDO(), RegisterSetODentryCallBack(), SDOlineToObjdict(), sendPDOrequest(), sendSDO(), setNodeId(), setState(), TestMaster_initialisation(), and TestMaster_post_TPDO(). -
#define UNS40 | -
- -
-Definition at line 143 of file applicfg.h. -
#define UNS48 | -
- -
-Definition at line 144 of file applicfg.h. -
#define UNS56 | -
- -
-Definition at line 145 of file applicfg.h. -
#define UNS64 | -
#define UNS8 unsigned char | -
- -
-Definition at line 139 of file applicfg.h. -
-Referenced by _getODentry(), _readNetworkDict(), _sendPDOevent(), _setODentry(), _writeNetworkDict(), buildPDO(), canAddIdToFilter(), canInit1Filter(), canMsgTransmit(), canReceive_driver(), canSend(), canSend_driver(), closeSDOtransfer(), ConsumerHearbeatAlarm(), CopyBits(), decompo_dcf(), f_can_receive(), failedSDO(), gene_SYNC_operational(), can_uvccm_win32::get_can_data(), getReadResultNetworkDict(), getSDOfreeLine(), getSDOlineOnUse(), getSDOlineRestBytes(), getWriteResultNetworkDict(), heartbeatInit(), heartbeatStop(), initSensor(), lineToSDO(), main(), masterRequestNodeState(), objdictToSDOline(), PDOStop(), proceedNODE_GUARD(), proceedPDO(), proceedSDO(), proceedSYNC(), ProducerHearbeatAlarm(), ReadSDO(), resetSDO(), resetSDOline(), SDOlineToObjdict(), SDOTimeoutAlarm(), SDOtoLine(), sendSDO(), sendSDOabort(), sendSYNC(), setNodeId(), TestMaster_initialisation(), TestMaster_post_TPDO(), and TPDO_Communication_Parameter_Callback(). -
#define US_TO_TIMEVAL | -( | -us | -- | ) | -(us>>2) | -
- -
-Definition at line 157 of file applicfg.h. -
-Referenced by _sendPDOevent(), and startSYNC(). -
-
char* hex_convert | -( | -char * | -buf, | -|
- | - | unsigned long | -value, | -|
- | - | char | -lastCar | - |
- | ) | -- |
-Convert an integer to a string in hexadecimal format If you do not wants to use a lastCar, put lastCar = '' (end of string) ex : value = 0XABCDEF and lastCar = '
-' buf[0] = '0' buf[1] = 'X' buf[2] = 'A' .... buf[7] = 'F' buf[8] = '
-' buf[9] = ''
-
-Definition at line 135 of file canOpenDriver.c. -
-Referenced by printSCI_nbr(). -
void initHCS12 | -( | -void | -- | ) | -- |
-Put here all the code to init the HCS12. -
- -
-Definition at line 199 of file canOpenDriver.c. -
-References initPLL(), and MSG_WAR. -
-Referenced by initSensor(). -
-Here is the call graph for this function:
void initPLL | -( | -void | -- | ) | -- |
-to start using the PLL. Bus clock becomes 24 MHz if the quartz on the board is at 16 MHz -
-Definition at line 188 of file canOpenDriver.c. -
-References CLKSEL, CRGFLG, IO_PORTS_8, PLLCTL, REFDV, and SYNR. -
-Referenced by initHCS12(). -
void initSCI_0 | -( | -void | -- | ) | -- |
-Initialisation of the serial port 0. -
- -
-Definition at line 115 of file canOpenDriver.c. -
-References BUS_CLOCK, IO_PORTS_16, IO_PORTS_8, SCI0, SCIBDH, SCICR1, SCICR2, and SERIAL_SCI0_BAUD_RATE. -
void initSCI_1 | -( | -void | -- | ) | -- |
-Initialisation of the serial port 1. -
- -
-Definition at line 124 of file canOpenDriver.c. -
-References BUS_CLOCK, IO_PORTS_16, IO_PORTS_8, SCI1, SCIBDH, SCICR1, SCICR2, and SERIAL_SCI1_BAUD_RATE. -
void printSCI_nbr | -( | -char | -sci, | -|
- | - | unsigned long | -nbr, | -|
- | - | char | -lastCar | - |
- | ) | -- |
-Print the number in hexadecimal to the serial port sci (sci takes the values SCI0 or SCI1) -
-Definition at line 179 of file canOpenDriver.c. -
-References hex_convert(), and printSCI_str(). -
-Here is the call graph for this function:
void printSCI_str | -( | -char | -sci, | -|
- | - | const char * | -str | - |
- | ) | -- |
-Print the string to the serial port sci (sci takes the values SCI0 or SCI1) -
-Definition at line 162 of file canOpenDriver.c. -
-References IO_PORTS_8, SCIDRL, and SCISR1. -
-Referenced by printSCI_nbr(). -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 /* -00024 Functions called by interrupts vectors. -00025 */ -00026 /* -00027 This is a part of the driver, of course ! -00028 But you have to put your code in this functions, -00029 if you plan to use interruptions. -00030 */ -00031 -00032 #include "../include/data.h" -00033 #include "../include/hcs12/applicfg.h" -00034 #include "../include/hcs12/error.h" -00035 #include "../include/hcs12/candriver.h" -00036 #include "../include/hcs12/asm-m68hc12/regs.h" -00037 #include "../include/hcs12/asm-m68hc12/portsaccess.h" -00038 #include "../include/hcs12/asm-m68hc12/ports_def.h" -00039 #include "../include/hcs12/asm-m68hc12/ports.h" -00040 #include "../include/hcs12/interrupt.h" -00041 -00042 extern volatile char msgRecu; -00043 extern volatile Message canMsgRcv; -00044 -00045 -00046 -00047 /* Inhibe les interruptions */ -00048 -00049 void lock (void) -00050 { -00051 unsigned short mask; -00052 __asm__ __volatile__ ("tpa\n\tsei" : "=d"(mask)); -00053 -00054 } -00055 -00056 /* Autorise les interruptions */ -00057 void unlock (void) -00058 { -00059 __asm__ __volatile__ ("cli"); -00060 } -00061 -00062 -00063 -00064 -
#include "../include/data.h"
#include "../include/hcs12/applicfg.h"
#include "../include/hcs12/error.h"
#include "../include/hcs12/candriver.h"
#include "../include/hcs12/asm-m68hc12/regs.h"
#include "../include/hcs12/asm-m68hc12/portsaccess.h"
#include "../include/hcs12/asm-m68hc12/ports_def.h"
#include "../include/hcs12/asm-m68hc12/ports.h"
#include "../include/hcs12/interrupt.h"
-Include dependency graph for interrupt.c:
-Go to the source code of this file.
Functions | |
void | lock (void) |
void | unlock (void) |
Variables | |
volatile char | msgRecu |
volatile Message | canMsgRcv |
void lock | -( | -void | -- | ) | -- |
-Disable interrupts -
-Definition at line 49 of file interrupt.c. -
-References __asm__(). -
-Referenced by initTimer(), and main(). -
-Here is the call graph for this function:
void unlock | -( | -void | -- | ) | -- |
-Enable interrupts -
-Definition at line 57 of file interrupt.c. -
-References __asm__(). -
-Referenced by initSensor(), initTimer(), and main(). -
-Here is the call graph for this function:
-
volatile char msgRecu | -
- -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #ifndef __INTERRUPT__ -00024 #define __INTERRUPT__ -00025 -00026 -00030 void lock (void); -00031 -00035 void unlock (void); -00036 -00040 void __attribute__((interrupt)) timerOvflHdl (void); -00041 -00045 void __attribute__((interrupt)) can0HdlTra (void); -00046 -00050 void __attribute__((interrupt)) can0HdlRcv (void); -00051 -00056 void __attribute__((interrupt)) can0HdlWup (void); -00057 -00061 void __attribute__((interrupt)) can0HdlErr (void); -00062 -00066 void __attribute__((interrupt)) can1HdlTra (void); -00067 -00071 void __attribute__((interrupt)) can1HdlRcv (void); -00072 -00076 void __attribute__((interrupt)) can1HdlWup (void); -00077 -00081 void __attribute__((interrupt)) can1HdlErr (void); -00082 -00086 void __attribute__((interrupt)) can2HdlTra (void); -00087 -00091 void __attribute__((interrupt)) can2HdlRcv (void); -00092 -00093 /* -00094 Message error on MSCAN 2 -00095 */ -00096 void __attribute__((interrupt)) can2HdlWup (void); -00097 -00101 void __attribute__((interrupt)) can2HdlErr (void); -00102 -00106 void __attribute__((interrupt)) can3HdlTra (void); -00107 -00111 void __attribute__((interrupt)) can3HdlRcv (void); -00112 -00116 void __attribute__((interrupt)) can3HdlWup (void); -00117 -00121 void __attribute__((interrupt)) can3HdlErr (void); -00122 -00126 void __attribute__((interrupt)) can4HdlTra (void); -00127 -00131 void __attribute__((interrupt)) can4HdlRcv (void); -00132 -00133 /* -00134 Message error on MSCAN 4 -00135 */ -00136 void __attribute__((interrupt)) can4HdlWup (void); -00137 -00141 void __attribute__((interrupt)) can4HdlErr (void); -00142 -00143 -00144 #endif /* __INTERRUPT__ */ -
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Functions | |
void | lock (void) |
void | unlock (void) |
void | __attribute__ ((interrupt)) timerOvflHdl(void) |
void __attribute__ | -( | -(interrupt) | -- | ) | -- |
-Message transmitted on MSCAN 0 -
-Definition at line 54 of file canOpenDriver.c. -
-References IO_PORTS_16, and TC4H. -
void lock | -( | -void | -- | ) | -- |
-Disable interrupts -
-Definition at line 49 of file interrupt.c. -
-References __asm__(). -
-Referenced by initTimer(), and main(). -
-Here is the call graph for this function:
void unlock | -( | -void | -- | ) | -- |
-Enable interrupts -
-Definition at line 57 of file interrupt.c. -
-References __asm__(). -
-Referenced by initSensor(), initTimer(), and main(). -
-Here is the call graph for this function:
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 /* Interrupt Vectors -- ROM mode -00023 Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. -00024 Written by Stephane Carrez (stcarrez@worldnet.fr) -00025 -00026 This file is free software; you can redistribute it and/or modify it -00027 under the terms of the GNU General Public License as published by the -00028 Free Software Foundation; either version 2, or (at your option) any -00029 later version. -00030 -00031 In addition to the permissions in the GNU General Public License, the -00032 Free Software Foundation gives you unlimited permission to link the -00033 compiled version of this file with other programs, and to distribute -00034 those programs without any restriction coming from the use of this -00035 file. (The General Public License restrictions do apply in other -00036 respects; for example, they cover modification of the file, and -00037 distribution when not linked into another program.) -00038 -00039 This file is distributed in the hope that it will be useful, but -00040 WITHOUT ANY WARRANTY; without even the implied warranty of -00041 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00042 General Public License for more details. -00043 -00044 You should have received a copy of the GNU General Public License -00045 along with this program; see the file COPYING. If not, write to -00046 the Free Software Foundation, 59 Temple Place - Suite 330, -00047 Boston, MA 02111-1307, USA. */ -00048 -00049 #ifndef _M68HC11_ARCH_32K_INTERRUPTS_H -00050 #define _M68HC11_ARCH_32K_INTERRUPTS_H -00051 -00052 /* For ROM-boards, interrupts are in ROM and are not installed -00053 at run time. Implementation is empty. */ -00054 extern inline void -00055 set_interrupt_handler (interrupt_vector_id id ATTRIBUTE_UNUSED, -00056 interrupt_t handler ATTRIBUTE_UNUSED) -00057 { -00058 } -00059 -00060 #endif -
-Go to the source code of this file.
Functions | |
void | set_interrupt_handler (interrupt_vector_id id ATTRIBUTE_UNUSED, interrupt_t handler ATTRIBUTE_UNUSED) |
void set_interrupt_handler | -( | -interrupt_vector_id id | -ATTRIBUTE_UNUSED, | -|
- | - | interrupt_t handler | -ATTRIBUTE_UNUSED | - |
- | ) | - [inline] |
-
- -
-Definition at line 55 of file interrupts.h. -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen -00003 Stack. -00004 -00005 Copyright (C): Edouard TISSERANT and Francis DUPIN -00006 -00007 See COPYING file for copyrights details. -00008 -00009 This library is free software; you can redistribute it and/or -00010 modify it under the terms of the GNU Lesser General Public -00011 License as published by the Free Software Foundation; either -00012 version 2.1 of the License, or (at your option) any later version. -00013 -00014 This library is distributed in the hope that it will be useful, -00015 but WITHOUT ANY WARRANTY; without even the implied warranty of -00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00017 Lesser General Public License for more details. -00018 -00019 You should have received a copy of the GNU Lesser General Public -00020 License along with this library; if not, write to the Free Software -00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -00022 USA -00023 */ -00024 -00035 #include <data.h> -00036 #include "lifegrd.h" -00037 #include "canfestival.h" -00038 -00039 -00040 void ConsumerHearbeatAlarm(CO_Data* d, UNS32 id); -00041 -00042 -00043 void ProducerHearbeatAlarm(CO_Data* d, UNS32 id); -00044 -00045 UNS32 OnHearbeatProducerUpdate(CO_Data* d, const indextable * unsused_indextable, UNS8 unsused_bSubindex); -00046 -00055 e_nodeState getNodeState (CO_Data* d, UNS8 nodeId) -00056 { -00057 e_nodeState networkNodeState = d->NMTable[nodeId]; -00058 return networkNodeState; -00059 } -00060 -00067 void ConsumerHearbeatAlarm(CO_Data* d, UNS32 id) -00068 { -00069 /*MSG_WAR(0x00, "ConsumerHearbeatAlarm", 0x00);*/ -00070 -00072 (*d->heartbeatError)((UNS8)( ((d->ConsumerHeartbeatEntries[id]) & (UNS32)0x00FF0000) >> (UNS8)16 )); -00073 } -00074 -00081 void proceedNODE_GUARD(CO_Data* d, Message* m ) -00082 { -00083 UNS8 nodeId = (UNS8) GET_NODE_ID((*m)); -00084 -00085 if((m->rtr == 1) ) -00090 { -00097 if (nodeId == *d->bDeviceNodeId ) -00098 { -00099 Message msg; -00100 msg.cob_id.w = *d->bDeviceNodeId + 0x700; -00101 msg.len = (UNS8)0x01; -00102 msg.rtr = 0; -00103 msg.data[0] = d->nodeState; -00104 if (d->toggle) -00105 { -00106 msg.data[0] |= 0x80 ; -00107 d->toggle = 0 ; -00108 } -00109 else -00110 d->toggle = 1 ; -00111 /* send the nodeguard response. */ -00112 MSG_WAR(0x3130, "Sending NMT Nodeguard to master, state: ", d->nodeState); -00113 canSend(d->canHandle,&msg ); -00114 } -00115 -00116 }else{ /* Not a request CAN */ -00117 -00118 MSG_WAR(0x3110, "Received NMT nodeId : ", nodeId); -00119 /* the slave's state receievd is stored in the NMTable */ -00120 /* The state is stored on 7 bit */ -00121 d->NMTable[nodeId] = (e_nodeState) ((*m).data[0] & 0x7F) ; -00122 -00123 /* Boot-Up frame reception */ -00124 if ( d->NMTable[nodeId] == Initialisation) -00125 { -00126 /* -00127 ** The device send the boot-up message (Initialisation) -00128 ** to indicate the master that it is entered in -00129 ** pre_operational mode -00130 ** Because the device enter automaticaly in pre_operational -00131 ** mode, -00132 ** the pre_operational mode is stored -00133 ** NMTable[bus_id][nodeId] = Pre_operational -00134 */ -00135 MSG_WAR(0x3100, "The NMT is a bootup from node : ", nodeId); -00136 } -00137 -00138 if( d->NMTable[nodeId] != Unknown_state ) { -00139 UNS8 index, ConsummerHeartBeat_nodeId ; -00140 for( index = (UNS8)0x00; index < *d->ConsumerHeartbeatCount; index++ ) -00141 { -00142 ConsummerHeartBeat_nodeId = (UNS8)( ((d->ConsumerHeartbeatEntries[index]) & (UNS32)0x00FF0000) >> (UNS8)16 ); -00143 if ( nodeId == ConsummerHeartBeat_nodeId ) -00144 { -00145 TIMEVAL time = ( (d->ConsumerHeartbeatEntries[index]) & (UNS32)0x0000FFFF ) ; -00146 /* Renew alarm for next heartbeat. */ -00147 DelAlarm(d->ConsumerHeartBeatTimers[index]); -00148 d->ConsumerHeartBeatTimers[index] = SetAlarm(d, index, &ConsumerHearbeatAlarm, MS_TO_TIMEVAL(time), 0); -00149 } -00150 } -00151 } -00152 } -00153 } -00154 -00161 void ProducerHearbeatAlarm(CO_Data* d, UNS32 id) -00162 { -00163 if(*d->ProducerHeartBeatTime) -00164 { -00165 Message msg; -00166 /* Time expired, the heartbeat must be sent immediately -00167 ** generate the correct node-id: this is done by the offset 1792 -00168 ** (decimal) and additionaly -00169 ** the node-id of this device. -00170 */ -00171 -00172 msg.cob_id.w = *d->bDeviceNodeId + 0x700; -00173 msg.len = (UNS8)0x01; -00174 msg.rtr = 0; -00175 msg.data[0] = d->nodeState; /* No toggle for heartbeat !*/ -00176 /* send the heartbeat */ -00177 MSG_WAR(0x3130, "Producing heartbeat: ", d->nodeState); -00178 canSend(d->canHandle,&msg ); -00179 -00180 }else{ -00181 d->ProducerHeartBeatTimer = DelAlarm(d->ProducerHeartBeatTimer); -00182 } -00183 } -00184 -00194 UNS32 OnHeartbeatProducerUpdate(CO_Data* d, const indextable * unsused_indextable, UNS8 unsused_bSubindex) -00195 { -00196 heartbeatStop(d); -00197 heartbeatInit(d); -00198 return 0; -00199 } -00200 -00206 void heartbeatInit(CO_Data* d) -00207 { -00208 -00209 UNS8 index; /* Index to scan the table of heartbeat consumers */ -00210 RegisterSetODentryCallBack(d, 0x1017, 0x00, &OnHeartbeatProducerUpdate); -00211 -00212 d->toggle = 0; -00213 -00214 for( index = (UNS8)0x00; index < *d->ConsumerHeartbeatCount; index++ ) -00215 { -00216 TIMEVAL time = (UNS16) ( (d->ConsumerHeartbeatEntries[index]) & (UNS32)0x0000FFFF ) ; -00217 /* MSG_WAR(0x3121, "should_time : ", should_time ) ; */ -00218 if ( time ) -00219 { -00220 d->ConsumerHeartBeatTimers[index] = SetAlarm(d, index, &ConsumerHearbeatAlarm, MS_TO_TIMEVAL(time), 0); -00221 } -00222 } -00223 -00224 if ( *d->ProducerHeartBeatTime ) -00225 { -00226 TIMEVAL time = *d->ProducerHeartBeatTime; -00227 d->ProducerHeartBeatTimer = SetAlarm(d, 0, &ProducerHearbeatAlarm, MS_TO_TIMEVAL(time), MS_TO_TIMEVAL(time)); -00228 } -00229 } -00230 -00236 void heartbeatStop(CO_Data* d) -00237 { -00238 UNS8 index; -00239 for( index = (UNS8)0x00; index < *d->ConsumerHeartbeatCount; index++ ) -00240 { -00241 d->ConsumerHeartBeatTimers[index + 1] = DelAlarm(d->ConsumerHeartBeatTimers[index + 1]);; -00242 } -00243 -00244 d->ProducerHeartBeatTimer = DelAlarm(d->ProducerHeartBeatTimer);; -00245 } -00246 -00252 void _heartbeatError(UNS8 heartbeatID){} -
#include <data.h>
#include "lifegrd.h"
#include "canfestival.h"
-Include dependency graph for lifegrd.c:
-Go to the source code of this file.
Functions | |
void | ConsumerHearbeatAlarm (CO_Data *d, UNS32 id) |
void | ProducerHearbeatAlarm (CO_Data *d, UNS32 id) |
UNS32 | OnHearbeatProducerUpdate (CO_Data *d, const indextable *unsused_indextable, UNS8 unsused_bSubindex) |
e_nodeState | getNodeState (CO_Data *d, UNS8 nodeId) |
void | proceedNODE_GUARD (CO_Data *d, Message *m) |
UNS32 | OnHeartbeatProducerUpdate (CO_Data *d, const indextable *unsused_indextable, UNS8 unsused_bSubindex) |
void | heartbeatInit (CO_Data *d) |
void | heartbeatStop (CO_Data *d) |
void | _heartbeatError (UNS8 heartbeatID) |
-Definition in file lifegrd.c.
void _heartbeatError | -( | -UNS8 | -heartbeatID | -) | -- |
void ConsumerHearbeatAlarm | -( | -CO_Data * | -d, | -|
- | - | UNS32 | -id | - |
- | ) | -- |
-The Consumer Timer Callback
-
d | ||
id |
-call heartbeat error with NodeId -
-Definition at line 67 of file lifegrd.c. -
-References struct_CO_Data::ConsumerHeartbeatEntries, struct_s_timer_entry::d, struct_CO_Data::heartbeatError, UNS32, and UNS8. -
-Referenced by heartbeatInit(), and proceedNODE_GUARD(). -
e_nodeState getNodeState | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId | - |
- | ) | -- |
-
d | ||
nodeId |
-Definition at line 55 of file lifegrd.c. -
-References struct_s_timer_entry::d, and struct_CO_Data::NMTable. -
-Referenced by GetChangeStateResults(). -
void heartbeatInit | -( | -CO_Data * | -d | -) | -- |
-
d |
-Definition at line 206 of file lifegrd.c. -
-References ConsumerHearbeatAlarm(), struct_CO_Data::ConsumerHeartbeatCount, struct_CO_Data::ConsumerHeartbeatEntries, struct_CO_Data::ConsumerHeartBeatTimers, struct_s_timer_entry::d, MS_TO_TIMEVAL, OnHeartbeatProducerUpdate(), ProducerHearbeatAlarm(), struct_CO_Data::ProducerHeartBeatTime, struct_CO_Data::ProducerHeartBeatTimer, RegisterSetODentryCallBack(), SetAlarm(), TIMEVAL, struct_CO_Data::toggle, UNS16, UNS32, and UNS8. -
-Referenced by OnHeartbeatProducerUpdate(), and switchCommunicationState(). -
-Here is the call graph for this function:
void heartbeatStop | -( | -CO_Data * | -d | -) | -- |
-
d |
-Definition at line 236 of file lifegrd.c. -
-References struct_CO_Data::ConsumerHeartbeatCount, struct_CO_Data::ConsumerHeartBeatTimers, struct_s_timer_entry::d, DelAlarm(), struct_CO_Data::ProducerHeartBeatTimer, and UNS8. -
-Referenced by OnHeartbeatProducerUpdate(), and switchCommunicationState(). -
-Here is the call graph for this function:
UNS32 OnHearbeatProducerUpdate | -( | -CO_Data * | -d, | -|
- | - | const indextable * | -unsused_indextable, | -|
- | - | UNS8 | -unsused_bSubindex | - |
- | ) | -- |
- -
UNS32 OnHeartbeatProducerUpdate | -( | -CO_Data * | -d, | -|
- | - | const indextable * | -unsused_indextable, | -|
- | - | UNS8 | -unsused_bSubindex | - |
- | ) | -- |
-This is called when Index 0x1017 is updated.
-
d | ||
unsused_indextable | ||
unsused_bSubindex |
-Definition at line 194 of file lifegrd.c. -
-References struct_s_timer_entry::d, heartbeatInit(), and heartbeatStop(). -
-Referenced by heartbeatInit(). -
-Here is the call graph for this function:
-
d | ||
m |
-Notice that only the master can have sent this node guarding request
-Receiving a NMT NodeGuarding (request of the state by the master) Only answer to the NMT NodeGuarding request, the master is not checked (not implemented) -
-Definition at line 81 of file lifegrd.c. -
-References struct_CO_Data::bDeviceNodeId, struct_CO_Data::canHandle, canSend(), Message::cob_id, ConsumerHearbeatAlarm(), struct_CO_Data::ConsumerHeartbeatCount, struct_CO_Data::ConsumerHeartbeatEntries, struct_CO_Data::ConsumerHeartBeatTimers, struct_s_timer_entry::d, Message::data, DelAlarm(), GET_NODE_ID, Initialisation, Message::len, MS_TO_TIMEVAL, MSG_WAR, struct_CO_Data::NMTable, struct_CO_Data::nodeState, Message::rtr, SetAlarm(), TIMEVAL, struct_CO_Data::toggle, Unknown_state, UNS32, UNS8, and SHORT_CAN::w. -
-Referenced by canDispatch(). -
-Here is the call graph for this function:
void ProducerHearbeatAlarm | -( | -CO_Data * | -d, | -|
- | - | UNS32 | -id | - |
- | ) | -- |
-The Consumer Timer Callback
-
d | ||
id |
-Definition at line 161 of file lifegrd.c. -
-References struct_CO_Data::bDeviceNodeId, struct_CO_Data::canHandle, canSend(), Message::cob_id, struct_s_timer_entry::d, Message::data, DelAlarm(), Message::len, MSG_WAR, struct_CO_Data::nodeState, struct_CO_Data::ProducerHeartBeatTime, struct_CO_Data::ProducerHeartBeatTimer, Message::rtr, UNS8, and SHORT_CAN::w. -
-Referenced by heartbeatInit(). -
-Here is the call graph for this function:
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #ifndef __lifegrd_h__ -00024 #define __lifegrd_h__ -00025 -00026 -00027 #include <applicfg.h> -00028 -00029 typedef void (*heartbeatError_t)(UNS8); -00030 void _heartbeatError(UNS8 heartbeatID); -00031 -00032 #include "data.h" -00033 -00034 /************************************************************************* -00035 * Functions -00036 *************************************************************************/ -00037 -00038 -00043 e_nodeState getNodeState (CO_Data* d, UNS8 nodeId); -00044 -00049 void heartbeatInit(CO_Data* d); -00050 -00053 void heartbeatStop(CO_Data* d); -00054 -00061 void proceedNODE_GUARD (CO_Data* d, Message* m); -00062 -00063 #endif /*__lifegrd_h__ */ -
#include <applicfg.h>
#include "data.h"
-Include dependency graph for lifegrd.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Typedefs | |
typedef void(*) | heartbeatError_t (UNS8) |
Functions | |
void | _heartbeatError (UNS8 heartbeatID) |
e_nodeState | getNodeState (CO_Data *d, UNS8 nodeId) |
void | heartbeatInit (CO_Data *d) |
void | heartbeatStop (CO_Data *d) |
void | proceedNODE_GUARD (CO_Data *d, Message *m) |
typedef void(*) heartbeatError_t(UNS8) | -
-
void _heartbeatError | -( | -UNS8 | -heartbeatID | -) | -- |
e_nodeState getNodeState | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId | - |
- | ) | -- |
-
d | ||
nodeId |
-Definition at line 55 of file lifegrd.c. -
-References struct_s_timer_entry::d, and struct_CO_Data::NMTable. -
-Referenced by GetChangeStateResults(). -
void heartbeatInit | -( | -CO_Data * | -d | -) | -- |
-
d |
-Definition at line 206 of file lifegrd.c. -
-References ConsumerHearbeatAlarm(), struct_CO_Data::ConsumerHeartbeatCount, struct_CO_Data::ConsumerHeartbeatEntries, struct_CO_Data::ConsumerHeartBeatTimers, struct_s_timer_entry::d, MS_TO_TIMEVAL, OnHeartbeatProducerUpdate(), ProducerHearbeatAlarm(), struct_CO_Data::ProducerHeartBeatTime, struct_CO_Data::ProducerHeartBeatTimer, RegisterSetODentryCallBack(), SetAlarm(), TIMEVAL, struct_CO_Data::toggle, UNS16, UNS32, and UNS8. -
-Referenced by OnHeartbeatProducerUpdate(), and switchCommunicationState(). -
-Here is the call graph for this function:
void heartbeatStop | -( | -CO_Data * | -d | -) | -- |
-
d |
-Definition at line 236 of file lifegrd.c. -
-References struct_CO_Data::ConsumerHeartbeatCount, struct_CO_Data::ConsumerHeartBeatTimers, struct_s_timer_entry::d, DelAlarm(), struct_CO_Data::ProducerHeartBeatTimer, and UNS8. -
-Referenced by OnHeartbeatProducerUpdate(), and switchCommunicationState(). -
-Here is the call graph for this function:
-
d | ||
m |
-Notice that only the master can have sent this node guarding request
-Receiving a NMT NodeGuarding (request of the state by the master) Only answer to the NMT NodeGuarding request, the master is not checked (not implemented) -
-Definition at line 81 of file lifegrd.c. -
-References struct_CO_Data::bDeviceNodeId, struct_CO_Data::canHandle, canSend(), Message::cob_id, ConsumerHearbeatAlarm(), struct_CO_Data::ConsumerHeartbeatCount, struct_CO_Data::ConsumerHeartbeatEntries, struct_CO_Data::ConsumerHeartBeatTimers, struct_s_timer_entry::d, Message::data, DelAlarm(), GET_NODE_ID, Initialisation, Message::len, MS_TO_TIMEVAL, MSG_WAR, struct_CO_Data::NMTable, struct_CO_Data::nodeState, Message::rtr, SetAlarm(), TIMEVAL, struct_CO_Data::toggle, Unknown_state, UNS32, UNS8, and SHORT_CAN::w. -
-Referenced by canDispatch(). -
-Here is the call graph for this function:
-
00001 /* can.h -00002 * Header file for the Linux CAN-bus driver. -00003 * Written by Arnaud Westenberg email:arnaud@wanadoo.nl -00004 * Rewritten for new CAN queues by Pavel Pisa - OCERA team member -00005 * email:pisa@cmp.felk.cvut.cz -00006 * This software is released under the GPL-License. -00007 * Version lincan-0.3 17 Jun 2004 -00008 */ -00009 -00010 #ifndef _CAN_DRVAPI_T_H -00011 #define _CAN_DRVAPI_T_H -00012 -00013 #ifdef __KERNEL__ -00014 -00015 #include <linux/time.h> -00016 #include <linux/types.h> -00017 #include <linux/ioctl.h> -00018 -00019 #else /* __KERNEL__ */ -00020 -00021 #include <sys/time.h> -00022 #include <sys/types.h> -00023 #include <sys/ioctl.h> -00024 -00025 #endif /* __KERNEL__ */ -00026 -00027 #include "./canmsg.h" -00028 -00029 #ifdef __cplusplus -00030 extern "C" { -00031 #endif -00032 -00033 /* CAN ioctl magic number */ -00034 #define CAN_IOC_MAGIC 'd' -00035 -00036 typedef unsigned long bittiming_t; -00037 typedef unsigned short channel_t; -00038 -00049 struct can_baudparams_t { -00050 long flags; -00051 long baudrate; -00052 long sjw; -00053 long sample_pt; -00054 }; -00055 -00056 /* CAN ioctl functions */ -00057 #define CAN_DRV_QUERY _IO(CAN_IOC_MAGIC, 0) -00058 #define CAN_DRV_QRY_BRANCH 0 /* returns driver branch value - "LINC" for LinCAN driver */ -00059 #define CAN_DRV_QRY_VERSION 1 /* returns driver version as (major<<16) | (minor<<8) | patch */ -00060 #define CAN_DRV_QRY_MSGFORMAT 2 /* format of canmsg_t structure */ -00061 -00062 #define CMD_START _IOW(CAN_IOC_MAGIC, 1, channel_t) -00063 #define CMD_STOP _IOW(CAN_IOC_MAGIC, 2, channel_t) -00064 //#define CMD_RESET 3 -00065 -00066 #define CONF_BAUD _IOW(CAN_IOC_MAGIC, 4, bittiming_t) -00067 //#define CONF_ACCM -00068 //#define CONF_XTDACCM -00069 //#define CONF_TIMING -00070 //#define CONF_OMODE -00071 #define CONF_FILTER _IOW(CAN_IOC_MAGIC, 8, unsigned char) -00072 -00073 //#define CONF_FENABLE -00074 //#define CONF_FDISABLE -00075 -00076 #define STAT _IO(CAN_IOC_MAGIC, 9) -00077 #define CANQUE_FILTER _IOW(CAN_IOC_MAGIC, 10, struct canfilt_t) -00078 #define CANQUE_FLUSH _IO(CAN_IOC_MAGIC, 11) -00079 #define CONF_BAUDPARAMS _IOW(CAN_IOC_MAGIC, 11, struct can_baudparams_t) -00080 #define CANRTR_READ _IOWR(CAN_IOC_MAGIC, 12, struct canmsg_t) -00081 -00082 #ifdef __cplusplus -00083 } /* extern "C"*/ -00084 #endif -00085 -00086 #endif /*_CAN_DRVAPI_T_H*/ -
#include <sys/time.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include "./canmsg.h"
-Include dependency graph for lincan.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Data Structures | |
struct | can_baudparams_t |
Defines | |
#define | CAN_IOC_MAGIC 'd' |
#define | CAN_DRV_QUERY _IO(CAN_IOC_MAGIC, 0) |
#define | CAN_DRV_QRY_BRANCH 0 |
#define | CAN_DRV_QRY_VERSION 1 |
#define | CAN_DRV_QRY_MSGFORMAT 2 |
#define | CMD_START _IOW(CAN_IOC_MAGIC, 1, channel_t) |
#define | CMD_STOP _IOW(CAN_IOC_MAGIC, 2, channel_t) |
#define | CONF_BAUD _IOW(CAN_IOC_MAGIC, 4, bittiming_t) |
#define | CONF_FILTER _IOW(CAN_IOC_MAGIC, 8, unsigned char) |
#define | STAT _IO(CAN_IOC_MAGIC, 9) |
#define | CANQUE_FILTER _IOW(CAN_IOC_MAGIC, 10, struct canfilt_t) |
#define | CANQUE_FLUSH _IO(CAN_IOC_MAGIC, 11) |
#define | CONF_BAUDPARAMS _IOW(CAN_IOC_MAGIC, 11, struct can_baudparams_t) |
#define | CANRTR_READ _IOWR(CAN_IOC_MAGIC, 12, struct canmsg_t) |
Typedefs | |
typedef unsigned long | bittiming_t |
typedef unsigned short | channel_t |
#define CAN_DRV_QRY_MSGFORMAT 2 | -
#define CAN_DRV_QUERY _IO(CAN_IOC_MAGIC, 0) | -
#define CANQUE_FILTER _IOW(CAN_IOC_MAGIC, 10, struct canfilt_t) | -
#define CANQUE_FLUSH _IO(CAN_IOC_MAGIC, 11) | -
#define CANRTR_READ _IOWR(CAN_IOC_MAGIC, 12, struct canmsg_t) | -
#define CMD_START _IOW(CAN_IOC_MAGIC, 1, channel_t) | -
#define CMD_STOP _IOW(CAN_IOC_MAGIC, 2, channel_t) | -
#define CONF_BAUD _IOW(CAN_IOC_MAGIC, 4, bittiming_t) | -
#define CONF_BAUDPARAMS _IOW(CAN_IOC_MAGIC, 11, struct can_baudparams_t) | -
#define CONF_FILTER _IOW(CAN_IOC_MAGIC, 8, unsigned char) | -
#define STAT _IO(CAN_IOC_MAGIC, 9) | -
-
typedef unsigned long bittiming_t | -
typedef unsigned short channel_t | -
-
-
00001 /************************************************************************** -00002 CanFestival3 win32 port example -00003 -00004 This sample demonstrates CanFestival usage with Win32 -00005 -00006 Program implements master node. It starts CANOpen slave node, modifies OD, -00007 performs SDO reads and prints some slave node information. -00008 -00009 Usage: -00010 -00011 win32test <node_id> -00012 -00013 where node_id is node ID in decimal format -00014 -00015 You should have CanFestival-3.dll CAN-uVCCM.dll in the search path to run this sample. -00016 Code will work with non-UNICODE CanFestival-3.dll CAN-uVCCM.dll libraries. -00017 -00018 Sample can work on other platdorms as well. -00019 -00020 Copyright (C) 2007 Leonid Tochinski (ltochinski AT chattenassociates DOT com) -00021 ***************************************************************************/ -00022 -00023 #include <stdio.h> -00024 #include <stdlib.h> -00025 #include "win32test.h" -00026 #include "canfestival.h" -00027 -00028 #ifdef WIN32 -00029 #define sleep_proc(ms) Sleep(ms) -00030 #define uptime_ms_proc() GetTickCount() -00031 #else -00032 #include <time.h> -00033 #define sleep_proc(ms) -00034 #define uptime_ms_proc (1000*(time()%86400)) // TOD -00035 #endif -00036 -00037 UNS8 GetChangeStateResults(UNS8 node_id, UNS8 expected_state, unsigned long timeout_ms) -00038 { -00039 unsigned long start_time = 0; -00040 -00041 // reset nodes state -00042 win32test_Data.NMTable[node_id] = Unknown_state; -00043 -00044 // request node state -00045 masterRequestNodeState(&win32test_Data, node_id); -00046 -00047 start_time = uptime_ms_proc(); -00048 while(uptime_ms_proc() - start_time < timeout_ms) -00049 { -00050 if (getNodeState(&win32test_Data, node_id) == expected_state) -00051 return 0; -00052 sleep_proc(1); -00053 } -00054 return 0xFF; -00055 } -00056 -00057 UNS8 ReadSDO(UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 dataType, void* data, UNS8* size) -00058 { -00059 UNS32 abortCode = 0; -00060 UNS8 res = SDO_UPLOAD_IN_PROGRESS; -00061 // Read SDO -00062 UNS8 err = readNetworkDict (&win32test_Data, nodeId, index, subIndex, dataType); -00063 if (err) -00064 return 0xFF; -00065 for(;;) -00066 { -00067 res = getReadResultNetworkDict (&win32test_Data, nodeId, data, size, &abortCode); -00068 if (res != SDO_UPLOAD_IN_PROGRESS) -00069 break; -00070 sleep_proc(1); -00071 continue; -00072 } -00073 closeSDOtransfer(&win32test_Data, nodeId, SDO_CLIENT); -00074 if (res == SDO_FINISHED) -00075 return 0; -00076 return 0xFF; -00077 } -00078 -00079 int main(int argc, char *argv[]) -00080 { -00081 UNS8 node_id = 0; -00082 s_BOARD MasterBoard = {"1", "125K"}; -00083 char* dll_file_name; -00084 -00085 /* process command line arguments */ -00086 if (argc < 2) -00087 { -00088 printf("USAGE: win32test node_id [dll_file_name]\n"); -00089 return 1; -00090 } -00091 -00092 node_id = atoi(argv[1]); -00093 if (node_id < 2 || node_id > 127) -00094 { -00095 printf("ERROR: node_id shoule be >=2 and <= 127\n"); -00096 return 1; -00097 } -00098 -00099 if (argc > 2) -00100 dll_file_name = argv[2]; -00101 else -00102 dll_file_name = "can_uvccm_win32.dll"; -00103 -00104 // load can driver -00105 if (!LoadCanDriver(dll_file_name)) -00106 { -00107 printf("ERROR: could not load diver %s\n", dll_file_name); -00108 return 1; -00109 } -00110 -00111 if (canOpen(&MasterBoard,&win32test_Data)) -00112 { -00113 /* Defining the node Id */ -00114 setNodeId(&win32test_Data, 0x01); -00115 -00116 /* init */ -00117 setState(&win32test_Data, Initialisation); -00118 -00119 /****************************** START *******************************/ -00120 /* Put the master in operational mode */ -00121 setState(&win32test_Data, Operational); -00122 -00123 /* Ask slave node to go in operational mode */ -00124 masterSendNMTstateChange (&win32test_Data, 0, NMT_Start_Node); -00125 -00126 printf("\nStarting node %d (%xh) ...\n",(int)node_id,(int)node_id); -00127 -00128 /* wait untill mode will switch to operational state*/ -00129 if (GetChangeStateResults(node_id, Operational, 3000) != 0xFF) -00130 { -00131 /* modify Client SDO 1 Parameter */ -00132 UNS32 COB_ID_Client_to_Server_Transmit_SDO = 0x600 + node_id; -00133 UNS32 COB_ID_Server_to_Client_Receive_SDO = 0x580 + node_id; -00134 UNS32 Node_ID_of_the_SDO_Server = node_id; -00135 UNS8 ExpectedSize = sizeof (UNS32); -00136 -00137 if (OD_SUCCESSFUL == writeLocalDict(&win32test_Data, 0x1280, 1, &COB_ID_Client_to_Server_Transmit_SDO, &ExpectedSize, RW) -00138 && OD_SUCCESSFUL == writeLocalDict(&win32test_Data, 0x1280, 2, &COB_ID_Server_to_Client_Receive_SDO, &ExpectedSize, RW) -00139 && OD_SUCCESSFUL == writeLocalDict(&win32test_Data, 0x1280, 3, &Node_ID_of_the_SDO_Server, &ExpectedSize, RW)) -00140 { -00141 UNS32 dev_type = 0; -00142 char device_name[64]=""; -00143 char hw_ver[64]=""; -00144 char sw_ver[64]=""; -00145 UNS32 vendor_id = 0; -00146 UNS32 prod_code = 0; -00147 UNS32 ser_num = 0; -00148 UNS8 size; -00149 UNS8 res; -00150 -00151 printf("\nnode_id: %d (%xh) info\n",(int)node_id,(int)node_id); -00152 printf("********************************************\n"); -00153 -00154 size = sizeof (dev_type); -00155 res = ReadSDO(node_id, 0x1000, 0, uint32, &dev_type, &size); -00156 printf("device type: %d\n",dev_type & 0xFFFF); -00157 -00158 size = sizeof (device_name); -00159 res = ReadSDO(node_id, 0x1008, 0, visible_string, device_name, &size); -00160 printf("device name: %s\n",device_name); -00161 -00162 size = sizeof (hw_ver); -00163 res = ReadSDO(node_id, 0x1009, 0, visible_string, hw_ver, &size); -00164 printf("HW version: %s\n",hw_ver); -00165 -00166 size = sizeof (sw_ver); -00167 res = ReadSDO(node_id, 0x100A, 0, visible_string, sw_ver, &size); -00168 printf("SW version: %s\n",sw_ver); -00169 -00170 size = sizeof (vendor_id); -00171 res = ReadSDO(node_id, 0x1018, 1, uint32, &vendor_id, &size); -00172 printf("vendor id: %d\n",vendor_id); -00173 -00174 size = sizeof (prod_code); -00175 res = ReadSDO(node_id, 0x1018, 2, uint32, &prod_code, &size); -00176 printf("product code: %d\n",prod_code); -00177 -00178 size = sizeof (ser_num); -00179 res = ReadSDO(node_id, 0x1018, 4, uint32, &ser_num, &size); -00180 printf("serial number: %d\n",ser_num); -00181 -00182 printf("********************************************\n"); -00183 } -00184 else -00185 { -00186 printf("ERROR: Object dictionary access failed\n"); -00187 } -00188 } -00189 else -00190 { -00191 printf("ERROR: node_id %d (%xh) is not responding\n",(int)node_id,(int)node_id); -00192 } -00193 -00194 masterSendNMTstateChange (&win32test_Data, 0x02, NMT_Stop_Node); -00195 -00196 setState(&win32test_Data, Stopped); -00197 -00198 canClose(&win32test_Data); -00199 } -00200 return 0; -00201 } -00202 -00203 -
#include <stdio.h>
#include <stdlib.h>
#include "win32test.h"
#include "canfestival.h"
#include <time.h>
-Include dependency graph for main.c:
-Go to the source code of this file.
Defines | |
#define | sleep_proc(ms) |
#define | uptime_ms_proc (1000*(time()%86400)) |
Functions | |
UNS8 | GetChangeStateResults (UNS8 node_id, UNS8 expected_state, unsigned long timeout_ms) |
UNS8 | ReadSDO (UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 dataType, void *data, UNS8 *size) |
int | main (int argc, char *argv[]) |
#define sleep_proc | -( | -ms | -- | ) | -- |
- -
-Definition at line 33 of file main.c. -
-Referenced by GetChangeStateResults(), and ReadSDO(). -
#define uptime_ms_proc (1000*(time()%86400)) | -
-
UNS8 GetChangeStateResults | -( | -UNS8 | -node_id, | -|
- | - | UNS8 | -expected_state, | -|
- | - | unsigned long | -timeout_ms | - |
- | ) | -- |
- -
-Definition at line 37 of file main.c. -
-References getNodeState(), masterRequestNodeState(), struct_CO_Data::NMTable, sleep_proc, Unknown_state, uptime_ms_proc, and win32test_Data. -
-Referenced by main(). -
-Here is the call graph for this function:
int main | -( | -int | -argc, | -|
- | - | char * | -argv[] | - |
- | ) | -- |
- -
-Definition at line 79 of file main.c. -
-References canClose(), canOpen(), GetChangeStateResults(), Initialisation, LoadCanDriver(), MasterBoard, masterSendNMTstateChange(), NMT_Start_Node, NMT_Stop_Node, OD_SUCCESSFUL, Operational, ReadSDO(), RW, setNodeId(), setState(), Stopped, uint32, UNS32, UNS8, visible_string, win32test_Data, and writeLocalDict(). -
-Here is the call graph for this function:
UNS8 ReadSDO | -( | -UNS8 | -nodeId, | -|
- | - | UNS16 | -index, | -|
- | - | UNS8 | -subIndex, | -|
- | - | UNS8 | -dataType, | -|
- | - | void * | -data, | -|
- | - | UNS8 * | -size | - |
- | ) | -- |
- -
-Definition at line 57 of file main.c. -
-References closeSDOtransfer(), getReadResultNetworkDict(), readNetworkDict(), SDO_CLIENT, SDO_FINISHED, SDO_UPLOAD_IN_PROGRESS, sleep_proc, UNS32, UNS8, and win32test_Data. -
-Referenced by main(). -
-Here is the call graph for this function:
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen -00003 Stack. -00004 -00005 Copyright (C): Edouard TISSERANT and Francis DUPIN -00006 -00007 See COPYING file for copyrights details. -00008 -00009 This library is free software; you can redistribute it and/or -00010 modify it under the terms of the GNU Lesser General Public -00011 License as published by the Free Software Foundation; either -00012 version 2.1 of the License, or (at your option) any later version. -00013 -00014 This library is distributed in the hope that it will be useful, -00015 but WITHOUT ANY WARRANTY; without even the implied warranty of -00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00017 Lesser General Public License for more details. -00018 -00019 You should have received a copy of the GNU Lesser General Public -00020 License along with this library; if not, write to the Free Software -00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -00022 USA -00023 */ -00033 #include "nmtMaster.h" -00034 #include "canfestival.h" -00035 -00045 UNS8 masterSendNMTstateChange(CO_Data* d, UNS8 Node_ID, UNS8 cs) -00046 { -00047 Message m; -00048 -00049 MSG_WAR(0x3501, "Send_NMT cs : ", cs); -00050 MSG_WAR(0x3502, " to node : ", Node_ID); -00051 /* message configuration */ -00052 m.cob_id.w = 0x0000; /*(NMT) << 7*/ -00053 m.rtr = NOT_A_REQUEST; -00054 m.len = 2; -00055 m.data[0] = cs; -00056 m.data[1] = Node_ID; -00057 -00058 return canSend(d->canHandle,&m); -00059 } -00060 -00061 -00070 UNS8 masterSendNMTnodeguard(CO_Data* d, UNS8 nodeId) -00071 { -00072 Message m; -00073 -00074 MSG_WAR(0x3503, "Send_NODE_GUARD to node : ", nodeId); -00075 -00076 /* message configuration */ -00077 m.cob_id.w = nodeId | (NODE_GUARD << 7); -00078 m.rtr = REQUEST; -00079 m.len = 1; -00080 -00081 return canSend(d->canHandle,&m); -00082 } -00083 -00090 void masterRequestNodeState(CO_Data* d, UNS8 nodeId) -00091 { -00092 /* FIXME: should warn for bad toggle bit. */ -00093 -00094 /* NMTable configuration to indicate that the master is waiting -00095 for a Node_Guard frame from the slave whose node_id is ID -00096 */ -00097 d->NMTable[nodeId] = Unknown_state; /* A state that does not exist -00098 */ -00099 -00100 if (nodeId == 0) { /* NMT broadcast */ -00101 UNS8 i = 0; -00102 for (i = 0 ; i < NMT_MAX_NODE_ID ; i++) { -00103 d->NMTable[i] = Unknown_state; -00104 } -00105 } -00106 masterSendNMTnodeguard(d,nodeId); -00107 } -00108 -
#include "nmtMaster.h"
#include "canfestival.h"
-Include dependency graph for nmtMaster.c:
-Go to the source code of this file.
Functions | |
UNS8 | masterSendNMTstateChange (CO_Data *d, UNS8 Node_ID, UNS8 cs) |
UNS8 | masterSendNMTnodeguard (CO_Data *d, UNS8 nodeId) |
void | masterRequestNodeState (CO_Data *d, UNS8 nodeId) |
-Definition in file nmtMaster.c.
void masterRequestNodeState | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId | - |
- | ) | -- |
-
d | ||
nodeId |
-Definition at line 90 of file nmtMaster.c. -
-References struct_s_timer_entry::d, masterSendNMTnodeguard(), NMT_MAX_NODE_ID, struct_CO_Data::NMTable, Unknown_state, and UNS8. -
-Referenced by GetChangeStateResults(). -
-Here is the call graph for this function:
UNS8 masterSendNMTnodeguard | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId | - |
- | ) | -- |
-
d | ||
nodeId |
-Definition at line 70 of file nmtMaster.c. -
-References struct_CO_Data::canHandle, canSend(), Message::cob_id, struct_s_timer_entry::d, Message::len, MSG_WAR, NODE_GUARD, REQUEST, Message::rtr, and SHORT_CAN::w. -
-Referenced by masterRequestNodeState(). -
-Here is the call graph for this function:
UNS8 masterSendNMTstateChange | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -Node_ID, | -|
- | - | UNS8 | -cs | - |
- | ) | -- |
-
d | ||
Node_ID | ||
cs |
-Definition at line 45 of file nmtMaster.c. -
-References struct_CO_Data::canHandle, canSend(), Message::cob_id, struct_s_timer_entry::d, Message::data, Message::len, MSG_WAR, NOT_A_REQUEST, Message::rtr, and SHORT_CAN::w. -
-Referenced by main(). -
-Here is the call graph for this function:
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #ifndef __nmtMaster_h__ -00024 #define __nmtMaster_h__ -00025 -00026 #include "data.h" -00027 -00045 UNS8 masterSendNMTstateChange (CO_Data* d, UNS8 Node_ID, UNS8 cs); -00046 -00052 UNS8 masterSendNMTnodeguard (CO_Data* d, UNS8 nodeId); -00053 -00054 -00061 void masterRequestNodeState (CO_Data* d, UNS8 nodeId); -00062 -00063 -00064 #endif /* __nmtMaster_h__ */ -
#include "data.h"
-Include dependency graph for nmtMaster.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Functions | |
UNS8 | masterSendNMTstateChange (CO_Data *d, UNS8 Node_ID, UNS8 cs) |
UNS8 | masterSendNMTnodeguard (CO_Data *d, UNS8 nodeId) |
void | masterRequestNodeState (CO_Data *d, UNS8 nodeId) |
void masterRequestNodeState | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId | - |
- | ) | -- |
-
d | ||
nodeId |
-Definition at line 90 of file nmtMaster.c. -
-References struct_s_timer_entry::d, masterSendNMTnodeguard(), NMT_MAX_NODE_ID, struct_CO_Data::NMTable, Unknown_state, and UNS8. -
-Referenced by GetChangeStateResults(). -
-Here is the call graph for this function:
UNS8 masterSendNMTnodeguard | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId | - |
- | ) | -- |
-
d | ||
nodeId |
-Definition at line 70 of file nmtMaster.c. -
-References struct_CO_Data::canHandle, canSend(), Message::cob_id, struct_s_timer_entry::d, Message::len, MSG_WAR, NODE_GUARD, REQUEST, Message::rtr, and SHORT_CAN::w. -
-Referenced by masterRequestNodeState(). -
-Here is the call graph for this function:
UNS8 masterSendNMTstateChange | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -Node_ID, | -|
- | - | UNS8 | -cs | - |
- | ) | -- |
-
d | ||
Node_ID | ||
cs |
-Definition at line 45 of file nmtMaster.c. -
-References struct_CO_Data::canHandle, canSend(), Message::cob_id, struct_s_timer_entry::d, Message::data, Message::len, MSG_WAR, NOT_A_REQUEST, Message::rtr, and SHORT_CAN::w. -
-Referenced by main(). -
-Here is the call graph for this function:
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen -00003 Stack. -00004 -00005 Copyright (C): Edouard TISSERANT and Francis DUPIN -00006 -00007 See COPYING file for copyrights details. -00008 -00009 This library is free software; you can redistribute it and/or -00010 modify it under the terms of the GNU Lesser General Public -00011 License as published by the Free Software Foundation; either -00012 version 2.1 of the License, or (at your option) any later version. -00013 -00014 This library is distributed in the hope that it will be useful, -00015 but WITHOUT ANY WARRANTY; without even the implied warranty of -00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00017 Lesser General Public License for more details. -00018 -00019 You should have received a copy of the GNU Lesser General Public -00020 License along with this library; if not, write to the Free Software -00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -00022 USA -00023 */ -00033 #include "nmtSlave.h" -00034 #include "states.h" -00035 #include "canfestival.h" -00036 -00043 void proceedNMTstateChange(CO_Data* d, Message *m) -00044 { -00045 if( d->nodeState == Pre_operational || -00046 d->nodeState == Operational || -00047 d->nodeState == Stopped ) { -00048 -00049 MSG_WAR(0x3400, "NMT received. for node : ", (*m).data[1]); -00050 -00051 /* Check if this NMT-message is for this node */ -00052 /* byte 1 = 0 : all the nodes are concerned (broadcast) */ -00053 -00054 if( ( (*m).data[1] == 0 ) || ( (*m).data[1] == *d->bDeviceNodeId ) ){ -00055 -00056 switch( (*m).data[0]){ /* command specifier (cs) */ -00057 case NMT_Start_Node: -00058 if ( (d->nodeState == Pre_operational) || (d->nodeState == Stopped) ) -00059 setState(d,Operational); -00060 break; -00061 -00062 case NMT_Stop_Node: -00063 if ( d->nodeState == Pre_operational || -00064 d->nodeState == Operational ) -00065 setState(d,Stopped); -00066 break; -00067 -00068 case NMT_Enter_PreOperational: -00069 if ( d->nodeState == Operational || -00070 d->nodeState == Stopped ) -00071 setState(d,Pre_operational); -00072 break; -00073 -00074 case NMT_Reset_Node: -00075 setState(d,Initialisation); -00076 break; -00077 -00078 case NMT_Reset_Comunication: -00079 setState(d,Initialisation); -00080 break; -00081 -00082 }/* end switch */ -00083 -00084 }/* end if( ( (*m).data[1] == 0 ) || ( (*m).data[1] == -00085 bDeviceNodeId ) ) */ -00086 } -00087 } -00088 -00089 -00097 UNS8 slaveSendBootUp(CO_Data* d) -00098 { -00099 Message m; -00100 -00101 MSG_WAR(0x3407, "Send a Boot-Up msg ", 0); -00102 -00103 /* message configuration */ -00104 m.cob_id.w = NODE_GUARD << 7 | *d->bDeviceNodeId; -00105 m.rtr = NOT_A_REQUEST; -00106 m.len = 1; -00107 m.data[0] = 0x00; -00108 -00109 return canSend(d->canHandle,&m); -00110 } -00111 -
#include "nmtSlave.h"
#include "states.h"
#include "canfestival.h"
-Include dependency graph for nmtSlave.c:
-Go to the source code of this file.
Functions | |
void | proceedNMTstateChange (CO_Data *d, Message *m) |
UNS8 | slaveSendBootUp (CO_Data *d) |
-Definition in file nmtSlave.c.
-put the slave in the state wanted by the master
-
d | ||
m |
-Definition at line 43 of file nmtSlave.c. -
-References struct_CO_Data::bDeviceNodeId, struct_s_timer_entry::d, Initialisation, MSG_WAR, NMT_Enter_PreOperational, NMT_Reset_Comunication, NMT_Reset_Node, NMT_Start_Node, NMT_Stop_Node, struct_CO_Data::nodeState, Operational, Pre_operational, setState(), and Stopped. -
-Referenced by canDispatch(). -
-Here is the call graph for this function:
UNS8 slaveSendBootUp | -( | -CO_Data * | -d | -) | -- |
-
d |
-Definition at line 97 of file nmtSlave.c. -
-References struct_CO_Data::bDeviceNodeId, struct_CO_Data::canHandle, canSend(), Message::cob_id, struct_s_timer_entry::d, Message::data, Message::len, MSG_WAR, NODE_GUARD, NOT_A_REQUEST, Message::rtr, and SHORT_CAN::w. -
-Referenced by switchCommunicationState(). -
-Here is the call graph for this function:
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #ifndef __nmtSlave_h__ -00024 #define __nmtSlave_h__ -00025 -00026 #include <applicfg.h> -00027 #include "data.h" -00028 -00035 void proceedNMTstateChange (CO_Data* d, Message * m); -00036 -00042 UNS8 slaveSendBootUp (CO_Data* d); -00043 -00044 -00045 #endif /* __nmtSlave_h__ */ -
#include <applicfg.h>
#include "data.h"
-Include dependency graph for nmtSlave.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Functions | |
void | proceedNMTstateChange (CO_Data *d, Message *m) |
UNS8 | slaveSendBootUp (CO_Data *d) |
-put the slave in the state wanted by the master
-
d | ||
m |
-Definition at line 43 of file nmtSlave.c. -
-References struct_CO_Data::bDeviceNodeId, struct_s_timer_entry::d, Initialisation, MSG_WAR, NMT_Enter_PreOperational, NMT_Reset_Comunication, NMT_Reset_Node, NMT_Start_Node, NMT_Stop_Node, struct_CO_Data::nodeState, Operational, Pre_operational, setState(), and Stopped. -
-Referenced by canDispatch(). -
-Here is the call graph for this function:
UNS8 slaveSendBootUp | -( | -CO_Data * | -d | -) | -- |
-
d |
-Definition at line 97 of file nmtSlave.c. -
-References struct_CO_Data::bDeviceNodeId, struct_CO_Data::canHandle, canSend(), Message::cob_id, struct_s_timer_entry::d, Message::data, Message::len, MSG_WAR, NODE_GUARD, NOT_A_REQUEST, Message::rtr, and SHORT_CAN::w. -
-Referenced by switchCommunicationState(). -
-Here is the call graph for this function:
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen -00003 Stack. -00004 -00005 Copyright (C): Edouard TISSERANT and Francis DUPIN -00006 -00007 See COPYING file for copyrights details. -00008 -00009 This library is free software; you can redistribute it and/or -00010 modify it under the terms of the GNU Lesser General Public -00011 License as published by the Free Software Foundation; either -00012 version 2.1 of the License, or (at your option) any later version. -00013 -00014 This library is distributed in the hope that it will be useful, -00015 but WITHOUT ANY WARRANTY; without even the implied warranty of -00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00017 Lesser General Public License for more details. -00018 -00019 You should have received a copy of the GNU Lesser General Public -00020 License along with this library; if not, write to the Free Software -00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -00022 USA -00023 */ -00037 /* #define DEBUG_WAR_CONSOLE_ON */ -00038 /* #define DEBUG_ERR_CONSOLE_ON */ -00039 -00040 -00041 #include "objacces.h" -00042 -00043 -00055 UNS8 accessDictionaryError(UNS16 index, UNS8 subIndex, -00056 UNS8 sizeDataDict, UNS8 sizeDataGiven, UNS32 code) -00057 { -00058 #ifdef DEBUG_WAR_CONSOLE_ON -00059 MSG_WAR(0x2B09,"Dictionary index : ", index); -00060 MSG_WAR(0X2B10," subindex : ", subIndex); -00061 switch (code) { -00062 case OD_NO_SUCH_OBJECT: -00063 MSG_WAR(0x2B11,"Index not found ", index); -00064 break; -00065 case OD_NO_SUCH_SUBINDEX : -00066 MSG_WAR(0x2B12,"SubIndex not found ", subIndex); -00067 break; -00068 case OD_WRITE_NOT_ALLOWED : -00069 MSG_WAR(0x2B13,"Write not allowed, data is read only ", index); -00070 break; -00071 case OD_LENGTH_DATA_INVALID : -00072 MSG_WAR(0x2B14,"Conflict size data. Should be (bytes) : ", sizeDataDict); -00073 MSG_WAR(0x2B15,"But you have given the size : ", sizeDataGiven); -00074 break; -00075 case OD_NOT_MAPPABLE : -00076 MSG_WAR(0x2B16,"Not mappable data in a PDO at index : ", index); -00077 break; -00078 case OD_VALUE_TOO_LOW : -00079 MSG_WAR(0x2B17,"Value range error : value too low. SDOabort : ", code); -00080 break; -00081 case OD_VALUE_TOO_HIGH : -00082 MSG_WAR(0x2B18,"Value range error : value too high. SDOabort : ", code); -00083 break; -00084 default : -00085 MSG_WAR(0x2B20, "Unknown error code : ", code); -00086 } -00087 #endif -00088 return 0; -00089 } -00090 -00105 UNS32 _getODentry( CO_Data* d, -00106 UNS16 wIndex, -00107 UNS8 bSubindex, -00108 void * pDestData, -00109 UNS8 * pExpectedSize, -00110 UNS8 * pDataType, -00111 UNS8 checkAccess, -00112 UNS8 endianize) -00113 { /* DO NOT USE MSG_ERR because the macro may send a PDO -> infinite -00114 loop if it fails. */ -00115 UNS32 errorCode; -00116 UNS8 szData; -00117 const indextable *ptrTable; -00118 ODCallback_t *Callback; -00119 -00120 ptrTable = (*d->scanIndexOD)(wIndex, &errorCode, &Callback); -00121 -00122 if (errorCode != OD_SUCCESSFUL) -00123 return errorCode; -00124 if( ptrTable->bSubCount <= bSubindex ) { -00125 /* Subindex not found */ -00126 accessDictionaryError(wIndex, bSubindex, 0, 0, OD_NO_SUCH_SUBINDEX); -00127 return OD_NO_SUCH_SUBINDEX; -00128 } -00129 -00130 if (checkAccess && !(ptrTable->pSubindex[bSubindex].bAccessType & WO)) { -00131 MSG_WAR(0x2B30, "Access Type : ", ptrTable->pSubindex[bSubindex].bAccessType); -00132 accessDictionaryError(wIndex, bSubindex, 0, 0, OD_WRITE_NOT_ALLOWED); -00133 return OD_READ_NOT_ALLOWED; -00134 } -00135 -00136 *pDataType = ptrTable->pSubindex[bSubindex].bDataType; -00137 szData = ptrTable->pSubindex[bSubindex].size; -00138 -00139 if(*pExpectedSize == 0 || -00140 *pExpectedSize == szData || -00141 (*pDataType == visible_string && *pExpectedSize < szData)) { -00142 /* We -00143 allow to fetch a shorter string than expected */ -00144 -00145 # ifdef CANOPEN_BIG_ENDIAN -00146 if(endianize && *pDataType > boolean && *pDataType < visible_string) { -00147 /* data must be transmited with low byte first */ -00148 UNS8 i, j = 0; -00149 MSG_WAR(boolean, "data type ", *pDataType); -00150 MSG_WAR(visible_string, "data type ", *pDataType); -00151 for ( i = szData ; i > 0 ; i--) { -00152 MSG_WAR(i," ", j); -00153 ((UNS8*)pDestData)[j++] = -00154 ((UNS8*)ptrTable->pSubindex[bSubindex].pObject)[i-1]; -00155 } -00156 } -00157 else /* It it is a visible string no endianisation to perform */ -00158 memcpy(pDestData, ptrTable->pSubindex[bSubindex].pObject,szData); -00159 # else -00160 memcpy(pDestData, ptrTable->pSubindex[bSubindex].pObject,szData); -00161 # endif -00162 -00163 *pExpectedSize = szData; -00164 #if 0 -00165 /* Me laisser a, please ! (FD) */ -00166 { -00167 UNS8 i; -00168 for (i = 0 ; i < 10 ; i++) { -00169 MSG_WAR(*pExpectedSize, "dic data= ", -00170 *(UNS8 *)(ptrTable->pSubindex[bSubindex].pObject + i)); -00171 } -00172 -00173 } -00174 #endif -00175 return OD_SUCCESSFUL; -00176 } -00177 else { /* Error ! */ -00178 *pExpectedSize = szData; -00179 accessDictionaryError(wIndex, bSubindex, szData, -00180 *pExpectedSize, OD_LENGTH_DATA_INVALID); -00181 return OD_LENGTH_DATA_INVALID; -00182 } -00183 } -00184 -00198 UNS32 getODentry( CO_Data* d, -00199 UNS16 wIndex, -00200 UNS8 bSubindex, -00201 void * pDestData, -00202 UNS8 * pExpectedSize, -00203 UNS8 * pDataType, -00204 UNS8 checkAccess) -00205 { -00206 return _getODentry( d, -00207 wIndex, -00208 bSubindex, -00209 pDestData, -00210 pExpectedSize, -00211 pDataType, -00212 checkAccess, -00213 1);//endianize -00214 } -00215 -00229 UNS32 readLocalDict( CO_Data* d, -00230 UNS16 wIndex, -00231 UNS8 bSubindex, -00232 void * pDestData, -00233 UNS8 * pExpectedSize, -00234 UNS8 * pDataType, -00235 UNS8 checkAccess) -00236 { -00237 return _getODentry( d, -00238 wIndex, -00239 bSubindex, -00240 pDestData, -00241 pExpectedSize, -00242 pDataType, -00243 checkAccess, -00244 0);//do not endianize -00245 } -00246 -00260 UNS32 _setODentry( CO_Data* d, -00261 UNS16 wIndex, -00262 UNS8 bSubindex, -00263 void * pSourceData, -00264 UNS8 * pExpectedSize, -00265 UNS8 checkAccess, -00266 UNS8 endianize) -00267 { -00268 UNS8 szData; -00269 UNS8 dataType; -00270 UNS32 errorCode; -00271 const indextable *ptrTable; -00272 ODCallback_t *Callback; -00273 -00274 ptrTable =(*d->scanIndexOD)(wIndex, &errorCode, &Callback); -00275 if (errorCode != OD_SUCCESSFUL) -00276 return errorCode; -00277 -00278 if( ptrTable->bSubCount <= bSubindex ) { -00279 /* Subindex not found */ -00280 accessDictionaryError(wIndex, bSubindex, 0, *pExpectedSize, OD_NO_SUCH_SUBINDEX); -00281 return OD_NO_SUCH_SUBINDEX; -00282 } -00283 if (checkAccess && (ptrTable->pSubindex[bSubindex].bAccessType == RO)) { -00284 MSG_WAR(0x2B25, "Access Type : ", ptrTable->pSubindex[bSubindex].bAccessType); -00285 accessDictionaryError(wIndex, bSubindex, 0, *pExpectedSize, OD_WRITE_NOT_ALLOWED); -00286 return OD_WRITE_NOT_ALLOWED; -00287 } -00288 -00289 -00290 dataType = ptrTable->pSubindex[bSubindex].bDataType; -00291 szData = ptrTable->pSubindex[bSubindex].size; -00292 -00293 if( *pExpectedSize == 0 || -00294 *pExpectedSize == szData || -00295 (dataType == visible_string && *pExpectedSize < szData)) /* We -00296 allow to store a shorter string than entry size */ -00297 { -00298 #ifdef CANOPEN_BIG_ENDIAN -00299 if(endianize && dataType > boolean && dataType < visible_string) -00300 { -00301 /* we invert the data source directly. This let us do range -00302 testing without */ -00303 /* additional temp variable */ -00304 UNS8 i; -00305 for ( i = 0 ; i < ( ptrTable->pSubindex[bSubindex].size >> 1) ; i++) -00306 { -00307 UNS8 tmp =((UNS8 *)pSourceData) [(ptrTable->pSubindex[bSubindex].size - 1) - i]; -00308 ((UNS8 *)pSourceData) [(ptrTable->pSubindex[bSubindex].size - 1) - i] = ((UNS8 *)pSourceData)[i]; -00309 ((UNS8 *)pSourceData)[i] = tmp; -00310 } -00311 } -00312 #endif -00313 errorCode = (*d->valueRangeTest)(dataType, pSourceData); -00314 if (errorCode) { -00315 accessDictionaryError(wIndex, bSubindex, szData, *pExpectedSize, errorCode); -00316 return errorCode; -00317 } -00318 memcpy(ptrTable->pSubindex[bSubindex].pObject,pSourceData, *pExpectedSize); -00319 *pExpectedSize = szData; -00320 -00321 /* Callbacks */ -00322 if(Callback && Callback[bSubindex]){ -00323 (*Callback[bSubindex])(d, ptrTable, bSubindex); -00324 } -00325 -00326 /* TODO : Store dans NVRAM */ -00327 if (ptrTable->pSubindex[bSubindex].bAccessType & TO_BE_SAVE){ -00328 (*d->storeODSubIndex)(wIndex, bSubindex); -00329 } -00330 return OD_SUCCESSFUL; -00331 }else{ -00332 *pExpectedSize = szData; -00333 accessDictionaryError(wIndex, bSubindex, szData, *pExpectedSize, OD_LENGTH_DATA_INVALID); -00334 return OD_LENGTH_DATA_INVALID; -00335 } -00336 } -00337 -00350 UNS32 setODentry( CO_Data* d, -00351 UNS16 wIndex, -00352 UNS8 bSubindex, -00353 void * pSourceData, -00354 UNS8 * pExpectedSize, -00355 UNS8 checkAccess) -00356 { -00357 return _setODentry( d, -00358 wIndex, -00359 bSubindex, -00360 pSourceData, -00361 pExpectedSize, -00362 checkAccess, -00363 1);//endianize -00364 } -00365 -00378 UNS32 writeLocalDict( CO_Data* d, -00379 UNS16 wIndex, -00380 UNS8 bSubindex, -00381 void * pSourceData, -00382 UNS8 * pExpectedSize, -00383 UNS8 checkAccess) -00384 { -00385 return _setODentry( d, -00386 wIndex, -00387 bSubindex, -00388 pSourceData, -00389 pExpectedSize, -00390 checkAccess, -00391 0);//do not endianize -00392 } -00393 -00404 const indextable * scanIndexOD (CO_Data* d, UNS16 wIndex, UNS32 *errorCode, ODCallback_t **Callback) -00405 { -00406 return (*d->scanIndexOD)(wIndex, errorCode, Callback); -00407 } -00408 -00419 UNS32 RegisterSetODentryCallBack(CO_Data* d, UNS16 wIndex, UNS8 bSubindex, ODCallback_t Callback) -00420 { -00421 UNS32 errorCode; -00422 ODCallback_t *CallbackList; -00423 -00424 scanIndexOD (d, wIndex, &errorCode, &CallbackList); -00425 if(errorCode == OD_SUCCESSFUL && CallbackList) -00426 CallbackList[bSubindex] = Callback; -00427 return errorCode; -00428 } -00429 -00436 void _storeODSubIndex (UNS16 wIndex, UNS8 bSubindex){} -
#include "objacces.h"
-Include dependency graph for objacces.c:
-Go to the source code of this file.
Functions | |
UNS8 | accessDictionaryError (UNS16 index, UNS8 subIndex, UNS8 sizeDataDict, UNS8 sizeDataGiven, UNS32 code) |
UNS32 | _getODentry (CO_Data *d, UNS16 wIndex, UNS8 bSubindex, void *pDestData, UNS8 *pExpectedSize, UNS8 *pDataType, UNS8 checkAccess, UNS8 endianize) |
UNS32 | getODentry (CO_Data *d, UNS16 wIndex, UNS8 bSubindex, void *pDestData, UNS8 *pExpectedSize, UNS8 *pDataType, UNS8 checkAccess) |
UNS32 | readLocalDict (CO_Data *d, UNS16 wIndex, UNS8 bSubindex, void *pDestData, UNS8 *pExpectedSize, UNS8 *pDataType, UNS8 checkAccess) |
UNS32 | _setODentry (CO_Data *d, UNS16 wIndex, UNS8 bSubindex, void *pSourceData, UNS8 *pExpectedSize, UNS8 checkAccess, UNS8 endianize) |
UNS32 | setODentry (CO_Data *d, UNS16 wIndex, UNS8 bSubindex, void *pSourceData, UNS8 *pExpectedSize, UNS8 checkAccess) |
UNS32 | writeLocalDict (CO_Data *d, UNS16 wIndex, UNS8 bSubindex, void *pSourceData, UNS8 *pExpectedSize, UNS8 checkAccess) |
const indextable * | scanIndexOD (CO_Data *d, UNS16 wIndex, UNS32 *errorCode, ODCallback_t **Callback) |
UNS32 | RegisterSetODentryCallBack (CO_Data *d, UNS16 wIndex, UNS8 bSubindex, ODCallback_t Callback) |
void | _storeODSubIndex (UNS16 wIndex, UNS8 bSubindex) |
-Definition in file objacces.c.
UNS32 _getODentry | -( | -CO_Data * | -d, | -|
- | - | UNS16 | -wIndex, | -|
- | - | UNS8 | -bSubindex, | -|
- | - | void * | -pDestData, | -|
- | - | UNS8 * | -pExpectedSize, | -|
- | - | UNS8 * | -pDataType, | -|
- | - | UNS8 | -checkAccess, | -|
- | - | UNS8 | -endianize | - |
- | ) | -- |
-
d | ||
wIndex | ||
bSubindex | ||
pDestData | ||
pExpectedSize | ||
pDataType | ||
checkAccess | ||
endianize |
-Definition at line 105 of file objacces.c. -
-References accessDictionaryError(), td_subindex::bAccessType, td_subindex::bDataType, td_indextable::bSubCount, struct_s_timer_entry::d, MSG_WAR, OD_LENGTH_DATA_INVALID, OD_NO_SUCH_SUBINDEX, OD_READ_NOT_ALLOWED, OD_SUCCESSFUL, OD_WRITE_NOT_ALLOWED, td_subindex::pObject, td_indextable::pSubindex, ptrTable, struct_CO_Data::scanIndexOD, td_subindex::size, UNS32, UNS8, visible_string, and WO. -
-Referenced by getODentry(), and readLocalDict(). -
-Here is the call graph for this function:
UNS32 _setODentry | -( | -CO_Data * | -d, | -|
- | - | UNS16 | -wIndex, | -|
- | - | UNS8 | -bSubindex, | -|
- | - | void * | -pSourceData, | -|
- | - | UNS8 * | -pExpectedSize, | -|
- | - | UNS8 | -checkAccess, | -|
- | - | UNS8 | -endianize | - |
- | ) | -- |
-
d | ||
wIndex | ||
bSubindex | ||
pSourceData | ||
pExpectedSize | ||
checkAccess | ||
endianize |
-Definition at line 260 of file objacces.c. -
-References accessDictionaryError(), td_subindex::bAccessType, td_subindex::bDataType, td_indextable::bSubCount, struct_s_timer_entry::d, MSG_WAR, OD_LENGTH_DATA_INVALID, OD_NO_SUCH_SUBINDEX, OD_SUCCESSFUL, OD_WRITE_NOT_ALLOWED, td_subindex::pObject, td_indextable::pSubindex, ptrTable, RO, struct_CO_Data::scanIndexOD, td_subindex::size, struct_CO_Data::storeODSubIndex, TO_BE_SAVE, UNS32, UNS8, struct_CO_Data::valueRangeTest, and visible_string. -
-Referenced by setODentry(), and writeLocalDict(). -
-Here is the call graph for this function:
void _storeODSubIndex | -( | -UNS16 | -wIndex, | -|
- | - | UNS8 | -bSubindex | - |
- | ) | -- |
UNS8 accessDictionaryError | -( | -UNS16 | -index, | -|
- | - | UNS8 | -subIndex, | -|
- | - | UNS8 | -sizeDataDict, | -|
- | - | UNS8 | -sizeDataGiven, | -|
- | - | UNS32 | -code | - |
- | ) | -- |
-
index | ||
subIndex | ||
sizeDataDict | ||
sizeDataGiven | ||
code |
-Definition at line 55 of file objacces.c. -
-References MSG_WAR, OD_LENGTH_DATA_INVALID, OD_NO_SUCH_OBJECT, OD_NO_SUCH_SUBINDEX, OD_NOT_MAPPABLE, OD_VALUE_TOO_HIGH, OD_VALUE_TOO_LOW, and OD_WRITE_NOT_ALLOWED. -
-Referenced by _getODentry(), and _setODentry(). -
UNS32 getODentry | -( | -CO_Data * | -d, | -|
- | - | UNS16 | -wIndex, | -|
- | - | UNS8 | -bSubindex, | -|
- | - | void * | -pDestData, | -|
- | - | UNS8 * | -pExpectedSize, | -|
- | - | UNS8 * | -pDataType, | -|
- | - | UNS8 | -checkAccess | - |
- | ) | -- |
-
d | ||
wIndex | ||
bSubindex | ||
pDestData | ||
pExpectedSize | ||
pDataType | ||
checkAccess |
-Definition at line 198 of file objacces.c. -
-References _getODentry(), and struct_s_timer_entry::d. -
-Referenced by buildPDO(), and objdictToSDOline(). -
-Here is the call graph for this function:
UNS32 readLocalDict | -( | -CO_Data * | -d, | -|
- | - | UNS16 | -wIndex, | -|
- | - | UNS8 | -bSubindex, | -|
- | - | void * | -pDestData, | -|
- | - | UNS8 * | -pExpectedSize, | -|
- | - | UNS8 * | -pDataType, | -|
- | - | UNS8 | -checkAccess | - |
- | ) | -- |
-
d | ||
wIndex | ||
bSubindex | ||
pDestData | ||
pExpectedSize | ||
pDataType | ||
checkAccess |
-Definition at line 229 of file objacces.c. -
-References _getODentry(), and struct_s_timer_entry::d. -
-Here is the call graph for this function:
UNS32 RegisterSetODentryCallBack | -( | -CO_Data * | -d, | -|
- | - | UNS16 | -wIndex, | -|
- | - | UNS8 | -bSubindex, | -|
- | - | ODCallback_t | -Callback | - |
- | ) | -- |
-
d | ||
wIndex | ||
bSubindex | ||
Callback |
-Definition at line 419 of file objacces.c. -
-References struct_s_timer_entry::d, OD_SUCCESSFUL, scanIndexOD(), and UNS32. -
-Referenced by heartbeatInit(), InitNodes(), and startSYNC(). -
-Here is the call graph for this function:
const indextable* scanIndexOD | -( | -CO_Data * | -d, | -|
- | - | UNS16 | -wIndex, | -|
- | - | UNS32 * | -errorCode, | -|
- | - | ODCallback_t ** | -Callback | - |
- | ) | -- |
-
d | ||
wIndex | ||
errorCode | ||
Callback |
-Definition at line 404 of file objacces.c. -
-References struct_s_timer_entry::d, and struct_CO_Data::scanIndexOD. -
-Referenced by PDOInit(), and RegisterSetODentryCallBack(). -
UNS32 setODentry | -( | -CO_Data * | -d, | -|
- | - | UNS16 | -wIndex, | -|
- | - | UNS8 | -bSubindex, | -|
- | - | void * | -pSourceData, | -|
- | - | UNS8 * | -pExpectedSize, | -|
- | - | UNS8 | -checkAccess | - |
- | ) | -- |
-
d | ||
wIndex | ||
bSubindex | ||
pSourceData | ||
pExpectedSize | ||
checkAccess |
-Definition at line 350 of file objacces.c. -
-References _setODentry(), and struct_s_timer_entry::d. -
-Referenced by proceedPDO(), and SDOlineToObjdict(). -
-Here is the call graph for this function:
UNS32 writeLocalDict | -( | -CO_Data * | -d, | -|
- | - | UNS16 | -wIndex, | -|
- | - | UNS8 | -bSubindex, | -|
- | - | void * | -pSourceData, | -|
- | - | UNS8 * | -pExpectedSize, | -|
- | - | UNS8 | -checkAccess | - |
- | ) | -- |
-
d | ||
wIndex | ||
bSubindex | ||
pSourceData | ||
pExpectedSize | ||
checkAccess |
-Definition at line 378 of file objacces.c. -
-References _setODentry(), and struct_s_timer_entry::d. -
-Referenced by main(), and TestMaster_initialisation(). -
-Here is the call graph for this function:
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00034 #ifndef __objacces_h__ -00035 #define __objacces_h__ -00036 -00037 #include <applicfg.h> -00038 -00039 typedef UNS32 (*valueRangeTest_t)(UNS8 typeValue, void *Value); -00040 typedef void (* storeODSubIndex_t)(UNS16 wIndex, UNS8 bSubindex); -00041 void _storeODSubIndex (UNS16 wIndex, UNS8 bSubindex); -00042 -00043 #include "data.h" -00044 -00045 -00046 -00047 /* -00048 Print MSG_WAR (s) if error to the access to the object dictionary occurs. -00049 You must uncomment the lines -00050 //#define DEBUG_CAN -00051 //#define DEBUG_WAR_CONSOLE_ON -00052 //#define DEBUG_ERR_CONSOLE_ON -00053 in the file objaccess.c -00054 sizeDataDict : Size of the data defined in the dictionary -00055 sizeDataGiven : Size data given by the user. -00056 code : error code to print. (SDO abort code. See file def.h) -00057 Beware that sometimes, we force the sizeDataDict or sizeDataGiven to 0, when we wants to use -00058 this function but we do not have the access to the right value. One example is -00059 getSDOerror(). So do not take attention to these variables if they are null. -00060 */ -00061 -00062 UNS8 accessDictionaryError(UNS16 index, UNS8 subIndex, -00063 UNS8 sizeDataDict, UNS8 sizeDataGiven, UNS32 code); -00064 -00065 -00066 /* Reads an entry from the object dictionary.\n -00067 * \code -00068 * // Example usage: -00069 * UNS8 *pbData; -00070 * UNS8 length; -00071 * UNS32 returnValue; -00072 * -00073 * returnValue = getODentry( (UNS16)0x100B, (UNS8)1, -00074 * (void * *)&pbData, (UNS8 *)&length ); -00075 * if( returnValue != SUCCESSFUL ) -00076 * { -00077 * // error handling -00078 * } -00079 * \endcode -00080 * \param wIndex The index in the object dictionary where you want to read -00081 * an entry -00082 * \param bSubindex The subindex of the Index. e.g. mostly subindex 0 is -00083 * used to tell you how many valid entries you can find -00084 * in this index. Look at the canopen standard for further -00085 * information -00086 * \param ppbData Pointer to the pointer which points to the variable where -00087 * the value of this object dictionary entry should be copied -00088 * \param pdwSize This function writes the size of the copied value (in Byte) -00089 * into this variable. -00090 * \param pDataType : The type of the data. See objdictdef.h -00091 * \param CheckAccess if other than 0, do not read if the data is Write Only -00092 * [Not used today. Put always 0]. -00093 * \return OD_SUCCESSFUL or SDO abort code. (See file def.h) -00094 */ -00095 UNS32 getODentry( CO_Data* d, -00096 UNS16 wIndex, -00097 UNS8 bSubindex, -00098 void * pDestData, -00099 UNS8 * pExpectedSize, -00100 UNS8 * pDataType, -00101 UNS8 checkAccess); -00102 -00103 -00104 /* By this function you can write an entry into the object dictionary\n -00105 * \code -00106 * // Example usage: -00107 * UNS8 B; -00108 * B = 0xFF; // set transmission type -00109 * -00110 * retcode = setODentry( (UNS16)0x1800, (UNS8)2, &B, sizeof(UNS8), 1 ); -00111 * \endocde -00112 * \param wIndex The index in the object dictionary where you want to write -00113 * an entry -00114 * \param bSubindex The subindex of the Index. e.g. mostly subindex 0 is -00115 * used to tell you how many valid entries you can find -00116 * in this index. Look at the canopen standard for further -00117 * information -00118 * \param pbData Pointer to the variable that holds the value that should -00119 * be copied into the object dictionary -00120 * \param dwSize The size of the value (in Byte). -00121 * \param CheckAccess if other than 0, do not read if the data is Read Only or Constant -00122 * \return OD_SUCCESSFUL or SDO abort code. (See file def.h) -00123 */ -00124 UNS32 setODentry( CO_Data* d, -00125 UNS16 wIndex, -00126 UNS8 bSubindex, -00127 void * pSourceData, -00128 UNS8 * pExpectedSize, -00129 UNS8 checkAccess); -00130 -00131 /*The same, without endianisation*/ -00132 UNS32 writeLocalDict( CO_Data* d, -00133 UNS16 wIndex, -00134 UNS8 bSubindex, -00135 void * pSourceData, -00136 UNS8 * pExpectedSize, -00137 UNS8 checkAccess); -00138 -00139 -00140 /* Scan the index of object dictionary. Used only by setODentry and getODentry. -00141 * *errorCode : OD_SUCCESSFUL if index foundor SDO abort code. (See file def.h) -00142 * Return NULL if index not found. Else : return the table part of the object dictionary. -00143 */ -00144 const indextable * scanIndexOD (CO_Data* d, UNS16 wIndex, UNS32 *errorCode, ODCallback_t **Callback); -00145 -00146 UNS32 RegisterSetODentryCallBack(CO_Data* d, UNS16 wIndex, UNS8 bSubindex, ODCallback_t Callback); -00147 -00148 #endif /* __objacces_h__ */ -
-#include <applicfg.h>
-#include "data.h"
-
-
-Include dependency graph for objacces.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Typedefs | |
typedef UNS32(*) | valueRangeTest_t (UNS8 typeValue, void *Value) |
typedef void(*) | storeODSubIndex_t (UNS16 wIndex, UNS8 bSubindex) |
Functions | |
void | _storeODSubIndex (UNS16 wIndex, UNS8 bSubindex) |
UNS8 | accessDictionaryError (UNS16 index, UNS8 subIndex, UNS8 sizeDataDict, UNS8 sizeDataGiven, UNS32 code) |
UNS32 | getODentry (CO_Data *d, UNS16 wIndex, UNS8 bSubindex, void *pDestData, UNS8 *pExpectedSize, UNS8 *pDataType, UNS8 checkAccess) |
UNS32 | setODentry (CO_Data *d, UNS16 wIndex, UNS8 bSubindex, void *pSourceData, UNS8 *pExpectedSize, UNS8 checkAccess) |
UNS32 | writeLocalDict (CO_Data *d, UNS16 wIndex, UNS8 bSubindex, void *pSourceData, UNS8 *pExpectedSize, UNS8 checkAccess) |
const indextable * | scanIndexOD (CO_Data *d, UNS16 wIndex, UNS32 *errorCode, ODCallback_t **Callback) |
UNS32 | RegisterSetODentryCallBack (CO_Data *d, UNS16 wIndex, UNS8 bSubindex, ODCallback_t Callback) |
-This file contains functions for accessing the object dictionary and variables that are contained by the object dictionary. Accessing the object dictionary contains setting local variables as PDOs and accessing (read/write) all entries of the object dictionary
-Definition in file objacces.h.
typedef void(* ) storeODSubIndex_t(UNS16 wIndex, UNS8 bSubindex) | -
- -
-Definition at line 40 of file objacces.h. -
typedef UNS32(*) valueRangeTest_t(UNS8 typeValue, void *Value) | -
- -
-Definition at line 39 of file objacces.h. -
-
void _storeODSubIndex | -( | -UNS16 | -wIndex, | -|
- | - | UNS8 | -bSubindex | - |
- | ) | -- |
UNS8 accessDictionaryError | -( | -UNS16 | -index, | -|
- | - | UNS8 | -subIndex, | -|
- | - | UNS8 | -sizeDataDict, | -|
- | - | UNS8 | -sizeDataGiven, | -|
- | - | UNS32 | -code | - |
- | ) | -- |
-
index | ||
subIndex | ||
sizeDataDict | ||
sizeDataGiven | ||
code |
-Definition at line 55 of file objacces.c. -
-References MSG_WAR, OD_LENGTH_DATA_INVALID, OD_NO_SUCH_OBJECT, OD_NO_SUCH_SUBINDEX, OD_NOT_MAPPABLE, OD_VALUE_TOO_HIGH, OD_VALUE_TOO_LOW, and OD_WRITE_NOT_ALLOWED. -
-Referenced by _getODentry(), and _setODentry(). -
UNS32 getODentry | -( | -CO_Data * | -d, | -|
- | - | UNS16 | -wIndex, | -|
- | - | UNS8 | -bSubindex, | -|
- | - | void * | -pDestData, | -|
- | - | UNS8 * | -pExpectedSize, | -|
- | - | UNS8 * | -pDataType, | -|
- | - | UNS8 | -checkAccess | - |
- | ) | -- |
-
d | ||
wIndex | ||
bSubindex | ||
pDestData | ||
pExpectedSize | ||
pDataType | ||
checkAccess |
-Definition at line 198 of file objacces.c. -
-References _getODentry(), and struct_s_timer_entry::d. -
-Referenced by buildPDO(), and objdictToSDOline(). -
-Here is the call graph for this function:
UNS32 RegisterSetODentryCallBack | -( | -CO_Data * | -d, | -|
- | - | UNS16 | -wIndex, | -|
- | - | UNS8 | -bSubindex, | -|
- | - | ODCallback_t | -Callback | - |
- | ) | -- |
-
d | ||
wIndex | ||
bSubindex | ||
Callback |
-Definition at line 419 of file objacces.c. -
-References struct_s_timer_entry::d, OD_SUCCESSFUL, scanIndexOD(), and UNS32. -
-Referenced by heartbeatInit(), InitNodes(), and startSYNC(). -
-Here is the call graph for this function:
const indextable* scanIndexOD | -( | -CO_Data * | -d, | -|
- | - | UNS16 | -wIndex, | -|
- | - | UNS32 * | -errorCode, | -|
- | - | ODCallback_t ** | -Callback | - |
- | ) | -- |
-
d | ||
wIndex | ||
errorCode | ||
Callback |
-Definition at line 404 of file objacces.c. -
-References struct_s_timer_entry::d, and struct_CO_Data::scanIndexOD. -
-Referenced by PDOInit(), and RegisterSetODentryCallBack(). -
UNS32 setODentry | -( | -CO_Data * | -d, | -|
- | - | UNS16 | -wIndex, | -|
- | - | UNS8 | -bSubindex, | -|
- | - | void * | -pSourceData, | -|
- | - | UNS8 * | -pExpectedSize, | -|
- | - | UNS8 | -checkAccess | - |
- | ) | -- |
-
d | ||
wIndex | ||
bSubindex | ||
pSourceData | ||
pExpectedSize | ||
checkAccess |
-Definition at line 350 of file objacces.c. -
-References _setODentry(), and struct_s_timer_entry::d. -
-Referenced by proceedPDO(), and SDOlineToObjdict(). -
-Here is the call graph for this function:
UNS32 writeLocalDict | -( | -CO_Data * | -d, | -|
- | - | UNS16 | -wIndex, | -|
- | - | UNS8 | -bSubindex, | -|
- | - | void * | -pSourceData, | -|
- | - | UNS8 * | -pExpectedSize, | -|
- | - | UNS8 | -checkAccess | - |
- | ) | -- |
-
d | ||
wIndex | ||
bSubindex | ||
pSourceData | ||
pExpectedSize | ||
checkAccess |
-Definition at line 378 of file objacces.c. -
-References _setODentry(), and struct_s_timer_entry::d. -
-Referenced by main(), and TestMaster_initialisation(). -
-Here is the call graph for this function:
-
00001 -00002 /* File generated by gen_cfile.py. Should not be modified. */ -00003 -00004 #include "objdict.h" -00005 -00006 /**************************************************************************/ -00007 /* Declaration of the mapped variables */ -00008 /**************************************************************************/ -00009 UNS16 acceptanceFilter1 = 0x0; /* Mapped at index 0x2015, subindex 0x00 */ -00010 UNS16 acceptanceFilter2 = 0x0; /* Mapped at index 0x2016, subindex 0x00 */ -00011 UNS16 acceptanceFilter3 = 0x0; /* Mapped at index 0x2017, subindex 0x00 */ -00012 UNS16 acceptanceFilter4 = 0x0; /* Mapped at index 0x2018, subindex 0x00 */ -00013 UNS16 mask1 = 0x0; /* Mapped at index 0x2019, subindex 0x00 */ -00014 UNS16 mask2 = 0x0; /* Mapped at index 0x2020, subindex 0x00 */ -00015 UNS16 mask3 = 0x0; /* Mapped at index 0x2021, subindex 0x00 */ -00016 UNS16 mask4 = 0x0; /* Mapped at index 0x2022, subindex 0x00 */ -00017 UNS8 applyDownloadedFilters = 0x0; /* Mapped at index 0x2023, subindex 0x00 */ -00018 -00019 /**************************************************************************/ -00020 /* Declaration of the value range types */ -00021 /**************************************************************************/ -00022 -00023 UNS32 gene_SYNC_valueRangeTest (UNS8 typeValue, void * value) -00024 { -00025 switch (typeValue) { -00026 } -00027 return 0; -00028 } -00029 -00030 /**************************************************************************/ -00031 /* The node id */ -00032 /**************************************************************************/ -00033 /* node_id default value.*/ -00034 UNS8 gene_SYNC_bDeviceNodeId = 0x03; -00035 -00036 /**************************************************************************/ -00037 /* Array of message processing information */ -00038 -00039 const UNS8 gene_SYNC_iam_a_slave = 1; -00040 -00041 TIMER_HANDLE gene_SYNC_heartBeatTimers[1]; -00042 -00043 /* -00044 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -00045 -00046 OBJECT DICTIONARY -00047 -00048 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -00049 */ -00050 -00051 /* index 0x1000 : Device Type. */ -00052 UNS32 gene_SYNC_obj1000 = 0x0; /* 0 */ -00053 subindex gene_SYNC_Index1000[] = -00054 { -00055 { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1000 } -00056 }; -00057 -00058 /* index 0x1001 : Error Register. */ -00059 UNS8 gene_SYNC_obj1001 = 0x0; /* 0 */ -00060 subindex gene_SYNC_Index1001[] = -00061 { -00062 { RO, uint8, sizeof (UNS8), (void*)&gene_SYNC_obj1001 } -00063 }; -00064 -00065 /* index 0x1005 : SYNC COB ID. */ -00066 UNS32 gene_SYNC_obj1005 = 0x40000080; /* 1073741952 */ -00067 ODCallback_t gene_SYNC_Index1005_callbacks[] = -00068 { -00069 NULL, -00070 }; -00071 subindex gene_SYNC_Index1005[] = -00072 { -00073 { RW, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1005 } -00074 }; -00075 -00076 /* index 0x1006 : Communication / Cycle Period. */ -00077 UNS32 gene_SYNC_obj1006 = 0x2710; /* 10000 */ -00078 ODCallback_t gene_SYNC_Index1006_callbacks[] = -00079 { -00080 NULL, -00081 }; -00082 subindex gene_SYNC_Index1006[] = -00083 { -00084 { RW, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1006 } -00085 }; -00086 -00087 /* index 0x1008 : Manufacturer Device Name. */ -00088 UNS8 gene_SYNC_obj1008[10] = "GENE_SYNC"; -00089 subindex gene_SYNC_Index1008[] = -00090 { -00091 { RO, visible_string, sizeof (gene_SYNC_obj1008), (void*)&gene_SYNC_obj1008 } -00092 }; -00093 -00094 /* index 0x1016 : Consumer Heartbeat Time */ -00095 UNS8 gene_SYNC_highestSubIndex_obj1016 = 0; -00096 UNS32 gene_SYNC_obj1016[]; -00097 subindex gene_SYNC_Index1016[]; -00098 -00099 /* index 0x1017 : Producer Heartbeat Time */ -00100 UNS16 gene_SYNC_obj1017 = 0x0; /* 0 */ -00101 -00102 /* index 0x1018 : Identity. */ -00103 UNS8 gene_SYNC_highestSubIndex_obj1018 = 4; /* number of subindex - 1*/ -00104 UNS32 gene_SYNC_obj1018_Vendor_ID = 0x0; /* 0 */ -00105 UNS32 gene_SYNC_obj1018_Product_Code = 0x0; /* 0 */ -00106 UNS32 gene_SYNC_obj1018_Revision_Number = 0x0; /* 0 */ -00107 UNS32 gene_SYNC_obj1018_Serial_Number = 0x0; /* 0 */ -00108 subindex gene_SYNC_Index1018[] = -00109 { -00110 { RO, uint8, sizeof (UNS8), (void*)&gene_SYNC_highestSubIndex_obj1018 }, -00111 { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1018_Vendor_ID }, -00112 { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1018_Product_Code }, -00113 { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1018_Revision_Number }, -00114 { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1018_Serial_Number } -00115 }; -00116 -00117 /* index 0x1200 : Server SDO Parameter. */ -00118 UNS8 gene_SYNC_highestSubIndex_obj1200 = 2; /* number of subindex - 1*/ -00119 UNS32 gene_SYNC_obj1200_COB_ID_Client_to_Server_Receive_SDO = 0x0; /* 0 */ -00120 UNS32 gene_SYNC_obj1200_COB_ID_Server_to_Client_Transmit_SDO = 0x0; /* 0 */ -00121 subindex gene_SYNC_Index1200[] = -00122 { -00123 { RO, uint8, sizeof (UNS8), (void*)&gene_SYNC_highestSubIndex_obj1200 }, -00124 { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1200_COB_ID_Client_to_Server_Receive_SDO }, -00125 { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1200_COB_ID_Server_to_Client_Transmit_SDO } -00126 }; -00127 -00128 /* index 0x2015 : Mapped variable acceptanceFilter1 */ -00129 subindex gene_SYNC_Index2015[] = -00130 { -00131 { RW, uint16, sizeof (UNS16), (void*)&acceptanceFilter1 } -00132 }; -00133 -00134 /* index 0x2016 : Mapped variable acceptanceFilter2 */ -00135 subindex gene_SYNC_Index2016[] = -00136 { -00137 { RW, uint16, sizeof (UNS16), (void*)&acceptanceFilter2 } -00138 }; -00139 -00140 /* index 0x2017 : Mapped variable acceptanceFilter3 */ -00141 subindex gene_SYNC_Index2017[] = -00142 { -00143 { RW, uint16, sizeof (UNS16), (void*)&acceptanceFilter3 } -00144 }; -00145 -00146 /* index 0x2018 : Mapped variable acceptanceFilter4 */ -00147 subindex gene_SYNC_Index2018[] = -00148 { -00149 { RW, uint16, sizeof (UNS16), (void*)&acceptanceFilter4 } -00150 }; -00151 -00152 /* index 0x2019 : Mapped variable mask1 */ -00153 subindex gene_SYNC_Index2019[] = -00154 { -00155 { RW, uint16, sizeof (UNS16), (void*)&mask1 } -00156 }; -00157 -00158 /* index 0x2020 : Mapped variable mask2 */ -00159 subindex gene_SYNC_Index2020[] = -00160 { -00161 { RW, uint16, sizeof (UNS16), (void*)&mask2 } -00162 }; -00163 -00164 /* index 0x2021 : Mapped variable mask3 */ -00165 subindex gene_SYNC_Index2021[] = -00166 { -00167 { RW, uint16, sizeof (UNS16), (void*)&mask3 } -00168 }; -00169 -00170 /* index 0x2022 : Mapped variable mask4 */ -00171 subindex gene_SYNC_Index2022[] = -00172 { -00173 { RW, uint16, sizeof (UNS16), (void*)&mask4 } -00174 }; -00175 -00176 /* index 0x2023 : Mapped variable applyDownloadedFilters */ -00177 subindex gene_SYNC_Index2023[] = -00178 { -00179 { RW, uint8, sizeof (UNS8), (void*)&applyDownloadedFilters } -00180 }; -00181 -00182 const indextable gene_SYNC_objdict[] = -00183 { -00184 { (subindex*)gene_SYNC_Index1000,sizeof(gene_SYNC_Index1000)/sizeof(gene_SYNC_Index1000[0]), 0x1000}, -00185 { (subindex*)gene_SYNC_Index1001,sizeof(gene_SYNC_Index1001)/sizeof(gene_SYNC_Index1001[0]), 0x1001}, -00186 { (subindex*)gene_SYNC_Index1005,sizeof(gene_SYNC_Index1005)/sizeof(gene_SYNC_Index1005[0]), 0x1005}, -00187 { (subindex*)gene_SYNC_Index1006,sizeof(gene_SYNC_Index1006)/sizeof(gene_SYNC_Index1006[0]), 0x1006}, -00188 { (subindex*)gene_SYNC_Index1008,sizeof(gene_SYNC_Index1008)/sizeof(gene_SYNC_Index1008[0]), 0x1008}, -00189 { (subindex*)gene_SYNC_Index1018,sizeof(gene_SYNC_Index1018)/sizeof(gene_SYNC_Index1018[0]), 0x1018}, -00190 { (subindex*)gene_SYNC_Index1200,sizeof(gene_SYNC_Index1200)/sizeof(gene_SYNC_Index1200[0]), 0x1200}, -00191 { (subindex*)gene_SYNC_Index2015,sizeof(gene_SYNC_Index2015)/sizeof(gene_SYNC_Index2015[0]), 0x2015}, -00192 { (subindex*)gene_SYNC_Index2016,sizeof(gene_SYNC_Index2016)/sizeof(gene_SYNC_Index2016[0]), 0x2016}, -00193 { (subindex*)gene_SYNC_Index2017,sizeof(gene_SYNC_Index2017)/sizeof(gene_SYNC_Index2017[0]), 0x2017}, -00194 { (subindex*)gene_SYNC_Index2018,sizeof(gene_SYNC_Index2018)/sizeof(gene_SYNC_Index2018[0]), 0x2018}, -00195 { (subindex*)gene_SYNC_Index2019,sizeof(gene_SYNC_Index2019)/sizeof(gene_SYNC_Index2019[0]), 0x2019}, -00196 { (subindex*)gene_SYNC_Index2020,sizeof(gene_SYNC_Index2020)/sizeof(gene_SYNC_Index2020[0]), 0x2020}, -00197 { (subindex*)gene_SYNC_Index2021,sizeof(gene_SYNC_Index2021)/sizeof(gene_SYNC_Index2021[0]), 0x2021}, -00198 { (subindex*)gene_SYNC_Index2022,sizeof(gene_SYNC_Index2022)/sizeof(gene_SYNC_Index2022[0]), 0x2022}, -00199 { (subindex*)gene_SYNC_Index2023,sizeof(gene_SYNC_Index2023)/sizeof(gene_SYNC_Index2023[0]), 0x2023}, -00200 }; -00201 -00202 const indextable * gene_SYNC_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks) -00203 { -00204 int i; -00205 *callbacks = NULL; -00206 switch(wIndex){ -00207 case 0x1000: i = 0;break; -00208 case 0x1001: i = 1;break; -00209 case 0x1005: i = 2;*callbacks = gene_SYNC_Index1005_callbacks; break; -00210 case 0x1006: i = 3;*callbacks = gene_SYNC_Index1006_callbacks; break; -00211 case 0x1008: i = 4;break; -00212 case 0x1018: i = 5;break; -00213 case 0x1200: i = 6;break; -00214 case 0x2015: i = 7;break; -00215 case 0x2016: i = 8;break; -00216 case 0x2017: i = 9;break; -00217 case 0x2018: i = 10;break; -00218 case 0x2019: i = 11;break; -00219 case 0x2020: i = 12;break; -00220 case 0x2021: i = 13;break; -00221 case 0x2022: i = 14;break; -00222 case 0x2023: i = 15;break; -00223 default: -00224 *errorCode = OD_NO_SUCH_OBJECT; -00225 return NULL; -00226 } -00227 *errorCode = OD_SUCCESSFUL; -00228 return &gene_SYNC_objdict[i]; -00229 } -00230 -00231 /* To count at which received SYNC a PDO must be sent. -00232 * Even if no pdoTransmit are defined, at least one entry is computed -00233 * for compilations issues. -00234 */ -00235 UNS8 gene_SYNC_count_sync[1] = {0,}; -00236 -00237 quick_index gene_SYNC_firstIndex = { -00238 6, /* SDO_SVR */ -00239 0, /* SDO_CLT */ -00240 0, /* PDO_RCV */ -00241 0, /* PDO_RCV_MAP */ -00242 0, /* PDO_TRS */ -00243 0 /* PDO_TRS_MAP */ -00244 }; -00245 -00246 quick_index gene_SYNC_lastIndex = { -00247 6, /* SDO_SVR */ -00248 0, /* SDO_CLT */ -00249 0, /* PDO_RCV */ -00250 0, /* PDO_RCV_MAP */ -00251 0, /* PDO_TRS */ -00252 0 /* PDO_TRS_MAP */ -00253 }; -00254 -00255 UNS16 gene_SYNC_ObjdictSize = sizeof(gene_SYNC_objdict)/sizeof(gene_SYNC_objdict[0]); -00256 -00257 CO_Data gene_SYNC_Data = CANOPEN_NODE_DATA_INITIALIZER(gene_SYNC); -00258 -
#include "objdict.h"
-Include dependency graph for objdict.c:
-Go to the source code of this file.
const indextable* gene_SYNC_scanIndexOD | -( | -UNS16 | -wIndex, | -|
- | - | UNS32 * | -errorCode, | -|
- | - | ODCallback_t ** | -callbacks | - |
- | ) | -- |
- -
-Definition at line 202 of file objdict.c. -
-References gene_SYNC_Index1005_callbacks, gene_SYNC_Index1006_callbacks, gene_SYNC_objdict, OD_NO_SUCH_OBJECT, and OD_SUCCESSFUL. -
UNS32 gene_SYNC_valueRangeTest | -( | -UNS8 | -typeValue, | -|
- | - | void * | -value | - |
- | ) | -- |
-
UNS16 acceptanceFilter1 = 0x0 | -
UNS16 acceptanceFilter2 = 0x0 | -
UNS16 acceptanceFilter3 = 0x0 | -
UNS16 acceptanceFilter4 = 0x0 | -
UNS8 applyDownloadedFilters = 0x0 | -
- -
-Definition at line 17 of file objdict.c. -
-Referenced by gene_SYNC_operational(), and gene_SYNC_preOperational(). -
UNS8 gene_SYNC_bDeviceNodeId = 0x03 | -
UNS8 gene_SYNC_count_sync[1] = {0,} | -
CO_Data gene_SYNC_Data = CANOPEN_NODE_DATA_INITIALIZER(gene_SYNC) | -
quick_index gene_SYNC_firstIndex | -
TIMER_HANDLE gene_SYNC_heartBeatTimers[1] | -
UNS8 gene_SYNC_highestSubIndex_obj1016 = 0 | -
UNS8 gene_SYNC_highestSubIndex_obj1018 = 4 | -
UNS8 gene_SYNC_highestSubIndex_obj1200 = 2 | -
const UNS8 gene_SYNC_iam_a_slave = 1 | -
subindex gene_SYNC_Index1000[] | -
subindex gene_SYNC_Index1001[] | -
subindex gene_SYNC_Index1005[] | -
ODCallback_t gene_SYNC_Index1005_callbacks[] | -
-Initial value:
- { - NULL, - } -
-Definition at line 67 of file objdict.c. -
-Referenced by gene_SYNC_scanIndexOD(). -
subindex gene_SYNC_Index1006[] | -
ODCallback_t gene_SYNC_Index1006_callbacks[] | -
-Initial value:
- { - NULL, - } -
-Definition at line 78 of file objdict.c. -
-Referenced by gene_SYNC_scanIndexOD(). -
subindex gene_SYNC_Index1008[] | -
-Initial value:
- { - { RO, visible_string, sizeof (gene_SYNC_obj1008), (void*)&gene_SYNC_obj1008 } - } -
subindex gene_SYNC_Index1016[] | -
subindex gene_SYNC_Index1018[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&gene_SYNC_highestSubIndex_obj1018 }, - { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1018_Vendor_ID }, - { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1018_Product_Code }, - { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1018_Revision_Number }, - { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1018_Serial_Number } - } -
subindex gene_SYNC_Index1200[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&gene_SYNC_highestSubIndex_obj1200 }, - { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1200_COB_ID_Client_to_Server_Receive_SDO }, - { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1200_COB_ID_Server_to_Client_Transmit_SDO } - } -
subindex gene_SYNC_Index2015[] | -
subindex gene_SYNC_Index2016[] | -
subindex gene_SYNC_Index2017[] | -
subindex gene_SYNC_Index2018[] | -
subindex gene_SYNC_Index2019[] | -
subindex gene_SYNC_Index2020[] | -
subindex gene_SYNC_Index2021[] | -
subindex gene_SYNC_Index2022[] | -
subindex gene_SYNC_Index2023[] | -
quick_index gene_SYNC_lastIndex | -
UNS32 gene_SYNC_obj1000 = 0x0 | -
UNS8 gene_SYNC_obj1001 = 0x0 | -
UNS32 gene_SYNC_obj1005 = 0x40000080 | -
UNS32 gene_SYNC_obj1006 = 0x2710 | -
UNS8 gene_SYNC_obj1008[10] = "GENE_SYNC" | -
UNS32 gene_SYNC_obj1016[] | -
UNS16 gene_SYNC_obj1017 = 0x0 | -
UNS32 gene_SYNC_obj1018_Product_Code = 0x0 | -
UNS32 gene_SYNC_obj1018_Revision_Number = 0x0 | -
UNS32 gene_SYNC_obj1018_Serial_Number = 0x0 | -
UNS32 gene_SYNC_obj1018_Vendor_ID = 0x0 | -
UNS32 gene_SYNC_obj1200_COB_ID_Client_to_Server_Receive_SDO = 0x0 | -
UNS32 gene_SYNC_obj1200_COB_ID_Server_to_Client_Transmit_SDO = 0x0 | -
const indextable gene_SYNC_objdict[] | -
-Initial value:
-{ - { (subindex*)gene_SYNC_Index1000,sizeof(gene_SYNC_Index1000)/sizeof(gene_SYNC_Index1000[0]), 0x1000}, - { (subindex*)gene_SYNC_Index1001,sizeof(gene_SYNC_Index1001)/sizeof(gene_SYNC_Index1001[0]), 0x1001}, - { (subindex*)gene_SYNC_Index1005,sizeof(gene_SYNC_Index1005)/sizeof(gene_SYNC_Index1005[0]), 0x1005}, - { (subindex*)gene_SYNC_Index1006,sizeof(gene_SYNC_Index1006)/sizeof(gene_SYNC_Index1006[0]), 0x1006}, - { (subindex*)gene_SYNC_Index1008,sizeof(gene_SYNC_Index1008)/sizeof(gene_SYNC_Index1008[0]), 0x1008}, - { (subindex*)gene_SYNC_Index1018,sizeof(gene_SYNC_Index1018)/sizeof(gene_SYNC_Index1018[0]), 0x1018}, - { (subindex*)gene_SYNC_Index1200,sizeof(gene_SYNC_Index1200)/sizeof(gene_SYNC_Index1200[0]), 0x1200}, - { (subindex*)gene_SYNC_Index2015,sizeof(gene_SYNC_Index2015)/sizeof(gene_SYNC_Index2015[0]), 0x2015}, - { (subindex*)gene_SYNC_Index2016,sizeof(gene_SYNC_Index2016)/sizeof(gene_SYNC_Index2016[0]), 0x2016}, - { (subindex*)gene_SYNC_Index2017,sizeof(gene_SYNC_Index2017)/sizeof(gene_SYNC_Index2017[0]), 0x2017}, - { (subindex*)gene_SYNC_Index2018,sizeof(gene_SYNC_Index2018)/sizeof(gene_SYNC_Index2018[0]), 0x2018}, - { (subindex*)gene_SYNC_Index2019,sizeof(gene_SYNC_Index2019)/sizeof(gene_SYNC_Index2019[0]), 0x2019}, - { (subindex*)gene_SYNC_Index2020,sizeof(gene_SYNC_Index2020)/sizeof(gene_SYNC_Index2020[0]), 0x2020}, - { (subindex*)gene_SYNC_Index2021,sizeof(gene_SYNC_Index2021)/sizeof(gene_SYNC_Index2021[0]), 0x2021}, - { (subindex*)gene_SYNC_Index2022,sizeof(gene_SYNC_Index2022)/sizeof(gene_SYNC_Index2022[0]), 0x2022}, - { (subindex*)gene_SYNC_Index2023,sizeof(gene_SYNC_Index2023)/sizeof(gene_SYNC_Index2023[0]), 0x2023}, -} -
-Definition at line 182 of file objdict.c. -
-Referenced by gene_SYNC_scanIndexOD(). -
UNS16 gene_SYNC_ObjdictSize = sizeof(gene_SYNC_objdict)/sizeof(gene_SYNC_objdict[0]) | -
UNS16 mask1 = 0x0 | -
UNS16 mask2 = 0x0 | -
UNS16 mask3 = 0x0 | -
UNS16 mask4 = 0x0 | -
-
00001 -00002 /* File generated by gen_cfile.py. Should not be modified. */ -00003 -00004 #include "data.h" -00005 -00006 /* Prototypes of function provided by object dictionnary */ -00007 UNS32 gene_SYNC_valueRangeTest (UNS8 typeValue, void * value); -00008 const indextable * gene_SYNC_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks); -00009 -00010 /* prototypes of function to be filled by app. */ -00011 void gene_SYNC_heartbeatError(UNS8); -00012 -00013 UNS8 gene_SYNC_canSend(Message *); -00014 -00015 void gene_SYNC_initialisation(void); -00016 void gene_SYNC_preOperational(void); -00017 void gene_SYNC_operational(void); -00018 void gene_SYNC_stopped(void); -00019 -00020 void gene_SYNC_post_sync(void); -00021 void gene_SYNC_post_TPDO(void); -00022 -00023 /* Master node data struct */ -00024 extern CO_Data gene_SYNC_Data; -00025 -00026 extern UNS16 acceptanceFilter1; /* Mapped at index 0x2015, subindex 0x00*/ -00027 extern UNS16 acceptanceFilter2; /* Mapped at index 0x2016, subindex 0x00*/ -00028 extern UNS16 acceptanceFilter3; /* Mapped at index 0x2017, subindex 0x00*/ -00029 extern UNS16 acceptanceFilter4; /* Mapped at index 0x2018, subindex 0x00*/ -00030 extern UNS16 mask1; /* Mapped at index 0x2019, subindex 0x00*/ -00031 extern UNS16 mask2; /* Mapped at index 0x2020, subindex 0x00*/ -00032 extern UNS16 mask3; /* Mapped at index 0x2021, subindex 0x00*/ -00033 extern UNS16 mask4; /* Mapped at index 0x2022, subindex 0x00*/ -00034 extern UNS8 applyDownloadedFilters; /* Mapped at index 0x2023, subindex 0x00*/ -
#include "data.h"
-Include dependency graph for objdict.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Functions | |
UNS32 | gene_SYNC_valueRangeTest (UNS8 typeValue, void *value) |
const indextable * | gene_SYNC_scanIndexOD (UNS16 wIndex, UNS32 *errorCode, ODCallback_t **callbacks) |
void | gene_SYNC_heartbeatError (UNS8) |
UNS8 | gene_SYNC_canSend (Message *) |
void | gene_SYNC_initialisation (void) |
void | gene_SYNC_preOperational (void) |
void | gene_SYNC_operational (void) |
void | gene_SYNC_stopped (void) |
void | gene_SYNC_post_sync (void) |
void | gene_SYNC_post_TPDO (void) |
Variables | |
CO_Data | gene_SYNC_Data |
UNS16 | acceptanceFilter1 |
UNS16 | acceptanceFilter2 |
UNS16 | acceptanceFilter3 |
UNS16 | acceptanceFilter4 |
UNS16 | mask1 |
UNS16 | mask2 |
UNS16 | mask3 |
UNS16 | mask4 |
UNS8 | applyDownloadedFilters |
UNS8 gene_SYNC_canSend | -( | -Message * | -- | ) | -- |
- -
void gene_SYNC_heartbeatError | -( | -UNS8 | -- | ) | -- |
void gene_SYNC_initialisation | -( | -void | -- | ) | -- |
- -
-Definition at line 272 of file appli.c. -
-References initSensor(), IO_PORTS_8, MSG_WAR, and PORTB. -
-Referenced by main(). -
-Here is the call graph for this function:
void gene_SYNC_operational | -( | -void | -- | ) | -- |
- -
-Definition at line 314 of file appli.c. -
-References acceptanceFilter1, acceptanceFilter2, acceptanceFilter3, acceptanceFilter4, applyDownloadedFilters, canChangeFilter(), CANOPEN_LINE_NUMBER_USED, IO_PORTS_8, mask1, mask2, mask3, mask4, MSG_WAR, PORTB, UNS16, and UNS8. -
-Referenced by main(). -
-Here is the call graph for this function:
void gene_SYNC_post_sync | -( | -void | -- | ) | -- |
- -
void gene_SYNC_post_TPDO | -( | -void | -- | ) | -- |
- -
void gene_SYNC_preOperational | -( | -void | -- | ) | -- |
- -
-Definition at line 284 of file appli.c. -
-References applyDownloadedFilters, canChangeFilter(), CANOPEN_LINE_NUMBER_USED, IO_PORTS_8, MSG_WAR, and PORTB. -
-Referenced by main(). -
-Here is the call graph for this function:
const indextable* gene_SYNC_scanIndexOD | -( | -UNS16 | -wIndex, | -|
- | - | UNS32 * | -errorCode, | -|
- | - | ODCallback_t ** | -callbacks | - |
- | ) | -- |
- -
-Definition at line 202 of file objdict.c. -
-References gene_SYNC_Index1005_callbacks, gene_SYNC_Index1006_callbacks, gene_SYNC_objdict, OD_NO_SUCH_OBJECT, and OD_SUCCESSFUL. -
void gene_SYNC_stopped | -( | -void | -- | ) | -- |
UNS32 gene_SYNC_valueRangeTest | -( | -UNS8 | -typeValue, | -|
- | - | void * | -value | - |
- | ) | -- |
-
UNS16 acceptanceFilter1 | -
UNS16 acceptanceFilter2 | -
UNS16 acceptanceFilter3 | -
UNS16 acceptanceFilter4 | -
UNS8 applyDownloadedFilters | -
- -
-Definition at line 17 of file objdict.c. -
-Referenced by gene_SYNC_operational(), and gene_SYNC_preOperational(). -
CO_Data gene_SYNC_Data | -
UNS16 mask1 | -
UNS16 mask2 | -
UNS16 mask3 | -
UNS16 mask4 | -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #ifndef __objdictdef_h__ -00024 #define __objdictdef_h__ -00025 -00026 /************************* CONSTANTES **********************************/ -00032 #define boolean 0x01 -00033 #define int8 0x02 -00034 #define int16 0x03 -00035 #define int32 0x04 -00036 #define uint8 0x05 -00037 #define uint16 0x06 -00038 #define uint32 0x07 -00039 #define real32 0x08 -00040 #define visible_string 0x09 -00041 #define octet_string 0x0A -00042 #define unicode_string 0x0B -00043 #define time_of_day 0x0C -00044 #define time_difference 0x0D -00045 -00046 #define domain 0x0F -00047 #define int24 0x10 -00048 #define real64 0x11 -00049 #define int40 0x12 -00050 #define int48 0x13 -00051 #define int56 0x14 -00052 #define int64 0x15 -00053 #define uint24 0x16 -00054 -00055 #define uint40 0x18 -00056 #define uint48 0x19 -00057 #define uint56 0x1A -00058 #define uint64 0x1B -00059 -00060 #define pdo_communication_parameter 0x20 -00061 #define pdo_mapping 0x21 -00062 #define sdo_parameter 0x22 -00063 #define identity 0x23 -00064 -00065 /* CanFestival is using 0x24 to 0xFF to define some types containing a -00066 value range (See how it works in objdict.c) -00067 */ -00068 -00069 -00073 #define RW 0x00 -00074 #define WO 0x01 -00075 #define RO 0x02 -00076 -00077 #define TO_BE_SAVE 0x04 -00078 -00079 /************************ STRUCTURES ****************************/ -00083 typedef struct td_subindex -00084 { -00085 UNS8 bAccessType; -00086 UNS8 bDataType; /* Defines of what datatype the entry is */ -00087 UNS8 size; /* The size (in Byte) of the variable */ -00088 void* pObject; /* This is the pointer of the Variable */ -00089 } subindex; -00090 -00093 typedef struct td_indextable -00094 { -00095 subindex* pSubindex; /* Pointer to the subindex */ -00096 UNS8 bSubCount; /* the count of valid entries for this subindex -00097 * This count here defines how many memory has been -00098 * allocated. this memory does not have to be used. -00099 */ -00100 UNS16 index; -00101 } indextable; -00102 -00103 typedef struct s_quick_index{ -00104 UNS16 SDO_SVR; -00105 UNS16 SDO_CLT; -00106 UNS16 PDO_RCV; -00107 UNS16 PDO_RCV_MAP; -00108 UNS16 PDO_TRS; -00109 UNS16 PDO_TRS_MAP; -00110 }quick_index; -00111 -00112 -00113 /*typedef struct struct_CO_Data CO_Data; */ -00114 typedef UNS32 (*ODCallback_t)(CO_Data* d, const indextable *, UNS8 bSubindex); -00115 typedef const indextable * (*scanIndexOD_t)(UNS16 wIndex, UNS32 * errorCode, ODCallback_t **Callback); -00116 -00117 /************************** MACROS *********************************/ -00118 -00119 /* CANopen usefull helpers */ -00120 #define GET_NODE_ID(m) (m.cob_id.w & 0x7f) -00121 #define GET_FUNCTION_CODE(m) (m.cob_id.w >> 7) -00122 -00123 #endif /* __objdictdef_h__ */ -
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Data Structures | |
struct | td_subindex |
struct | td_indextable |
struct | s_quick_index |
Defines | |
#define | boolean 0x01 |
#define | int8 0x02 |
#define | int16 0x03 |
#define | int32 0x04 |
#define | uint8 0x05 |
#define | uint16 0x06 |
#define | uint32 0x07 |
#define | real32 0x08 |
#define | visible_string 0x09 |
#define | octet_string 0x0A |
#define | unicode_string 0x0B |
#define | time_of_day 0x0C |
#define | time_difference 0x0D |
#define | domain 0x0F |
#define | int24 0x10 |
#define | real64 0x11 |
#define | int40 0x12 |
#define | int48 0x13 |
#define | int56 0x14 |
#define | int64 0x15 |
#define | uint24 0x16 |
#define | uint40 0x18 |
#define | uint48 0x19 |
#define | uint56 0x1A |
#define | uint64 0x1B |
#define | pdo_communication_parameter 0x20 |
#define | pdo_mapping 0x21 |
#define | sdo_parameter 0x22 |
#define | identity 0x23 |
#define | RW 0x00 |
#define | WO 0x01 |
#define | RO 0x02 |
#define | TO_BE_SAVE 0x04 |
#define | GET_NODE_ID(m) (m.cob_id.w & 0x7f) |
#define | GET_FUNCTION_CODE(m) (m.cob_id.w >> 7) |
Typedefs | |
typedef td_subindex | subindex |
typedef td_indextable | indextable |
typedef s_quick_index | quick_index |
typedef UNS32(*) | ODCallback_t (CO_Data *d, const indextable *, UNS8 bSubindex) |
typedef const indextable *(*) | scanIndexOD_t (UNS16 wIndex, UNS32 *errorCode, ODCallback_t **Callback) |
#define boolean 0x01 | -
-this are static defined datatypes taken fCODE the canopen standard. They are located at index 0x0001 to 0x001B. As described in the standard, they are in the object dictionary for definition purpose only. a device does not to support all of this datatypes. -
-Definition at line 32 of file objdictdef.h. -
#define domain 0x0F | -
- -
-Definition at line 46 of file objdictdef.h. -
#define GET_FUNCTION_CODE | -( | -m | -- | ) | -(m.cob_id.w >> 7) | -
- -
-Definition at line 121 of file objdictdef.h. -
#define GET_NODE_ID | -( | -m | -- | ) | -(m.cob_id.w & 0x7f) | -
#define identity 0x23 | -
- -
-Definition at line 63 of file objdictdef.h. -
#define int16 0x03 | -
- -
-Definition at line 34 of file objdictdef.h. -
#define int24 0x10 | -
- -
-Definition at line 47 of file objdictdef.h. -
#define int32 0x04 | -
- -
-Definition at line 35 of file objdictdef.h. -
#define int40 0x12 | -
- -
-Definition at line 49 of file objdictdef.h. -
#define int48 0x13 | -
- -
-Definition at line 50 of file objdictdef.h. -
#define int56 0x14 | -
- -
-Definition at line 51 of file objdictdef.h. -
#define int64 0x15 | -
- -
-Definition at line 52 of file objdictdef.h. -
#define int8 0x02 | -
- -
-Definition at line 33 of file objdictdef.h. -
#define octet_string 0x0A | -
- -
-Definition at line 41 of file objdictdef.h. -
#define pdo_communication_parameter 0x20 | -
- -
-Definition at line 60 of file objdictdef.h. -
#define pdo_mapping 0x21 | -
- -
-Definition at line 61 of file objdictdef.h. -
#define real32 0x08 | -
- -
-Definition at line 39 of file objdictdef.h. -
#define real64 0x11 | -
- -
-Definition at line 48 of file objdictdef.h. -
#define RO 0x02 | -
#define RW 0x00 | -
-Each entry of the object dictionary can be READONLY (RO), READ/WRITE (RW), WRITE-ONLY (WO) -
-Definition at line 73 of file objdictdef.h. -
-Referenced by main(), and TestMaster_initialisation(). -
#define sdo_parameter 0x22 | -
- -
-Definition at line 62 of file objdictdef.h. -
#define time_difference 0x0D | -
- -
-Definition at line 44 of file objdictdef.h. -
#define time_of_day 0x0C | -
- -
-Definition at line 43 of file objdictdef.h. -
#define TO_BE_SAVE 0x04 | -
#define uint16 0x06 | -
- -
-Definition at line 37 of file objdictdef.h. -
#define uint24 0x16 | -
- -
-Definition at line 53 of file objdictdef.h. -
#define uint32 0x07 | -
#define uint40 0x18 | -
- -
-Definition at line 55 of file objdictdef.h. -
#define uint48 0x19 | -
- -
-Definition at line 56 of file objdictdef.h. -
#define uint56 0x1A | -
- -
-Definition at line 57 of file objdictdef.h. -
#define uint64 0x1B | -
- -
-Definition at line 58 of file objdictdef.h. -
#define uint8 0x05 | -
- -
-Definition at line 36 of file objdictdef.h. -
#define unicode_string 0x0B | -
- -
-Definition at line 42 of file objdictdef.h. -
#define visible_string 0x09 | -
- -
-Definition at line 40 of file objdictdef.h. -
-Referenced by _getODentry(), _setODentry(), getReadResultNetworkDict(), and main(). -
#define WO 0x01 | -
-
typedef struct td_indextable indextable | -
-Struct for creating entries in the communictaion profile -
typedef UNS32(*) ODCallback_t(CO_Data *d, const indextable *, UNS8 bSubindex) | -
- -
-Definition at line 114 of file objdictdef.h. -
typedef struct s_quick_index quick_index | -
- -
typedef const indextable*(*) scanIndexOD_t(UNS16 wIndex, UNS32 *errorCode, ODCallback_t **Callback) | -
- -
-Definition at line 115 of file objdictdef.h. -
typedef struct td_subindex subindex | -
-This are some structs which are neccessary for creating the entries of the object dictionary. -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 /* param.h - 32K Board specific parameters -00023 Copyright (C) 2002 Free Software Foundation, Inc. -00024 Written by Stephane Carrez (stcarrez@worldnet.fr) -00025 -00026 This file is free software; you can redistribute it and/or modify it -00027 under the terms of the GNU General Public License as published by the -00028 Free Software Foundation; either version 2, or (at your option) any -00029 later version. -00030 -00031 In addition to the permissions in the GNU General Public License, the -00032 Free Software Foundation gives you unlimited permission to link the -00033 compiled version of this file with other programs, and to distribute -00034 those programs without any restriction coming from the use of this -00035 file. (The General Public License restrictions do apply in other -00036 respects; for example, they cover modification of the file, and -00037 distribution when not linked into another program.) -00038 -00039 This file is distributed in the hope that it will be useful, but -00040 WITHOUT ANY WARRANTY; without even the implied warranty of -00041 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00042 General Public License for more details. -00043 -00044 You should have received a copy of the GNU General Public License -00045 along with this program; see the file COPYING. If not, write to -00046 the Free Software Foundation, 59 Temple Place - Suite 330, -00047 Boston, MA 02111-1307, USA. */ -00048 -00049 #ifndef _M68HC11_ARCH_32K_PARAM_H -00050 #define _M68HC11_ARCH_32K_PARAM_H -00051 -00052 /* Generic 32K board. */ -00053 #define M6811_ARCH_32K -00054 -00055 #undef M6811_DEF_BAUD -00056 #define M6811_DEF_BAUD 0x30 /* 9600 baud. */ -00057 -00058 #undef RAM_SIZE -00059 #define RAM_SIZE 32768 /* 32Kb of memory. */ -00060 -00061 #undef ROM_SIZE -00062 #define ROM_SIZE 32768 /* 32Kb of rom. */ -00063 -00064 #undef DATA_SIZE -00065 #define DATA_SIZE (0x8000-0x1040) /* Data section size. */ -00066 -00067 #undef TEXT_SIZE -00068 #define TEXT_SIZE ROM_SIZE /* Text section size. */ -00069 -00070 #endif -
-Go to the source code of this file.
Defines | |
#define | M6811_ARCH_32K |
#define | M6811_DEF_BAUD 0x30 |
#define | RAM_SIZE 32768 |
#define | ROM_SIZE 32768 |
#define | DATA_SIZE (0x8000-0x1040) |
#define | TEXT_SIZE ROM_SIZE |
#define DATA_SIZE (0x8000-0x1040) | -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen -00003 Stack. -00004 -00005 Copyright (C): Edouard TISSERANT and Francis DUPIN -00006 -00007 See COPYING file for copyrights details. -00008 -00009 This library is free software; you can redistribute it and/or -00010 modify it under the terms of the GNU Lesser General Public -00011 License as published by the Free Software Foundation; either -00012 version 2.1 of the License, or (at your option) any later version. -00013 -00014 This library is distributed in the hope that it will be useful, -00015 but WITHOUT ANY WARRANTY; without even the implied warranty of -00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00017 Lesser General Public License for more details. -00018 -00019 You should have received a copy of the GNU Lesser General Public -00020 License along with this library; if not, write to the Free Software -00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -00022 USA -00023 */ -00024 #include "pdo.h" -00025 #include "objacces.h" -00026 #include "canfestival.h" -00027 -00048 UNS8 buildPDO(CO_Data* d, UNS8 numPdo, Message *pdo) -00049 { -00050 const indextable* TPDO_com = d->objdict + d->firstIndex->PDO_TRS + numPdo; -00051 const indextable* TPDO_map = d->objdict + d->firstIndex->PDO_TRS_MAP + numPdo; -00052 -00053 UNS8 prp_j = 0x00; -00054 UNS8 offset = 0x00; -00055 const UNS8* pMappingCount = (UNS8*) TPDO_map->pSubindex[0].pObject; -00056 -00057 pdo->cob_id.w = *(UNS32*)TPDO_com->pSubindex[1].pObject & 0x7FF; -00058 pdo->rtr = NOT_A_REQUEST; -00059 -00060 MSG_WAR(0x3009, " PDO CobId is : ", *(UNS32*)TPDO_com->pSubindex[1].pObject); -00061 MSG_WAR(0x300D, " Number of objects mapped : ",*pMappingCount ); -00062 -00063 do{ -00064 UNS8 dataType; /* Unused */ -00065 UNS8 tmp[]= {0,0,0,0,0,0,0,0}; /* temporary space to hold bits */ -00066 -00067 /* pointer fo the var which holds the mapping parameter of an mapping entry */ -00068 UNS32* pMappingParameter = (UNS32*) TPDO_map->pSubindex[prp_j + 1].pObject; -00069 UNS16 index = (UNS16)((*pMappingParameter) >> 16); -00070 UNS8 Size = (UNS8)(*pMappingParameter); /* Size in bits */ -00071 UNS8 ByteSize = 1 + ((Size - 1) >> 3); /*1->8 => 1 ; 9->16 => 2, ... */ -00072 UNS8 subIndex = (UNS8)(( (*pMappingParameter) >> (UNS8)8 ) & (UNS32)0x000000FF); -00073 -00074 MSG_WAR(0x300F, " got mapping parameter : ", *pMappingParameter); -00075 MSG_WAR(0x3050, " at index : ", TPDO_map->index); -00076 MSG_WAR(0x3051, " sub-index : ", prp_j + 1); -00077 -00078 if( getODentry(d, index, subIndex, tmp, &ByteSize, &dataType, 0 ) != OD_SUCCESSFUL ){ -00079 MSG_ERR(0x1013, " Couldn't find mapped variable at index-subindex-size : ", (UNS16)(*pMappingParameter)); -00080 return 0xFF; -00081 } -00082 /* copy bit per bit in little endian*/ -00083 CopyBits(Size, ((UNS8*)tmp), 0 , 0, (UNS8*)&pdo->data[offset>>3], offset%8, 0); -00084 -00085 offset += Size ; -00086 prp_j++; -00087 }while( prp_j < *pMappingCount ); -00088 -00089 pdo->len = 1 + ((offset - 1) >> 3); -00090 -00091 MSG_WAR(0x3015, " End scan mapped variable", 0); -00092 -00093 return 0; -00094 } -00095 -00104 UNS8 sendPDOrequest( CO_Data* d, UNS16 RPDOIndex ) -00105 { -00106 UNS32 * pwCobId; -00107 UNS16 offset = d->firstIndex->PDO_RCV; -00108 UNS16 lastIndex = d->lastIndex->PDO_RCV; -00109 -00110 /* Sending the request only if the cobid have been found on the PDO -00111 receive */ -00112 /* part dictionary */ -00113 -00114 MSG_WAR(0x3930, "sendPDOrequest RPDO Index : ",RPDOIndex); -00115 -00116 if (offset && RPDOIndex >= 0x1400){ -00117 offset += RPDOIndex - 0x1400; -00118 if (offset <= lastIndex) { -00119 /* get the CobId*/ -00120 pwCobId = (UNS32*) d->objdict[offset].pSubindex[1].pObject; -00121 -00122 MSG_WAR(0x3930, "sendPDOrequest cobId is : ",*pwCobId); -00123 -00124 Message pdo = {*pwCobId, REQUEST, 0}; -00125 return canSend(d->canHandle,&pdo); -00126 } -00127 } -00128 MSG_ERR(0x1931, "sendPDOrequest : RPDO Index not found : ", RPDOIndex); -00129 return 0xFF; -00130 } -00131 -00132 -00141 UNS8 proceedPDO(CO_Data* d, Message *m) -00142 { -00143 UNS8 numPdo; -00144 UNS8 numMap; /* Number of the mapped varable */ -00145 UNS8 i; -00146 UNS8 * pMappingCount = NULL; /* count of mapped objects... */ -00147 /* pointer to the var which is mapped to a pdo... */ -00148 /* void * pMappedAppObject = NULL; */ -00149 /* pointer fo the var which holds the mapping parameter of an -00150 mapping entry */ -00151 UNS32 * pMappingParameter = NULL; -00152 UNS8 * pTransmissionType = NULL; /* pointer to the transmission -00153 type */ -00154 UNS32 * pwCobId = NULL; -00155 UNS8 Size; -00156 UNS8 dataType; -00157 UNS8 offset; -00158 UNS8 status; -00159 UNS32 objDict; -00160 UNS16 offsetObjdict; -00161 UNS16 lastIndex; -00162 -00163 status = state2; -00164 -00165 MSG_WAR(0x3935, "proceedPDO, cobID : ", ((*m).cob_id.w & 0x7ff)); -00166 offset = 0x00; -00167 numPdo = 0; -00168 numMap = 0; -00169 if((*m).rtr == NOT_A_REQUEST ) { /* The PDO received is not a -00170 request. */ -00171 -00172 offsetObjdict = d->firstIndex->PDO_RCV; -00173 lastIndex = d->lastIndex->PDO_RCV; -00174 -00175 /* study of all the PDO stored in the dictionary */ -00176 if(offsetObjdict) -00177 while (offsetObjdict <= lastIndex) { -00178 -00179 switch( status ) { -00180 -00181 case state2: -00182 /* get CobId of the dictionary correspondant to the received -00183 PDO */ -00184 pwCobId = (UNS32*) d->objdict[offsetObjdict].pSubindex[1].pObject; -00185 /* check the CobId coherance */ -00186 /*pwCobId is the cobId read in the dictionary at the state 3 -00187 */ -00188 if ( *pwCobId == (*m).cob_id.w ){ -00189 /* The cobId is recognized */ -00190 status = state4; -00191 MSG_WAR(0x3936, "cobId found at index ", 0x1400 + numPdo); -00192 break; -00193 } -00194 else { -00195 /* cobId received does not match with those write in the -00196 dictionnary */ -00197 numPdo++; -00198 offsetObjdict++; -00199 status = state2; -00200 break; -00201 } -00202 -00203 case state4:/* Get Mapped Objects Number */ -00204 /* The cobId of the message received has been found in the -00205 dictionnary. */ -00206 offsetObjdict = d->firstIndex->PDO_RCV_MAP; -00207 lastIndex = d->lastIndex->PDO_RCV_MAP; -00208 pMappingCount = (UNS8*) (d->objdict + offsetObjdict + numPdo)->pSubindex[0].pObject; -00209 numMap = 0; -00210 while (numMap < *pMappingCount) { -00211 UNS8 tmp[]= {0,0,0,0,0,0,0,0}; -00212 UNS8 ByteSize; -00213 pMappingParameter = (UNS32*) (d->objdict + offsetObjdict + numPdo)->pSubindex[numMap + 1].pObject; -00214 if (pMappingParameter == NULL) { -00215 MSG_ERR(0x1937, "Couldn't get mapping parameter : ", numMap + 1); -00216 return 0xFF; -00217 } -00218 /* Get the addresse of the mapped variable. */ -00219 /* detail of *pMappingParameter : */ -00220 /* The 16 hight bits contains the index, the medium 8 bits -00221 contains the subindex, */ -00222 /* and the lower 8 bits contains the size of the mapped -00223 variable. */ -00224 -00225 Size = (UNS8)(*pMappingParameter); -00226 -00227 /* copy bit per bit in little endian */ -00228 CopyBits(Size, (UNS8*)&m->data[offset>>3], offset%8, 0, ((UNS8*)tmp), 0, 0); -00229 -00230 ByteSize = 1 + ((Size - 1) >> 3); /*1->8 => 1 ; 9->16 => -00231 2, ... */ -00232 -00233 objDict = setODentry(d, (UNS16)((*pMappingParameter) >> 16), -00234 (UNS8)(((*pMappingParameter) >> 8 ) & 0xFF), -00235 tmp, &ByteSize, 0 ); -00236 -00237 if(objDict != OD_SUCCESSFUL) { -00238 MSG_ERR(0x1938, "error accessing to the mapped var : ", numMap + 1); -00239 MSG_WAR(0x2939, " Mapped at index : ", (*pMappingParameter) >> 16); -00240 MSG_WAR(0x2940, " subindex : ", ((*pMappingParameter) >> 8 ) & 0xFF); -00241 return 0xFF; -00242 } -00243 -00244 MSG_WAR(0x3942, "Variable updated with value received by PDO cobid : ", m->cob_id.w); -00245 MSG_WAR(0x3943, " Mapped at index : ", (*pMappingParameter) >> 16); -00246 MSG_WAR(0x3944, " subindex : ", ((*pMappingParameter) >> 8 ) & 0xFF); -00247 /* MSG_WAR(0x3945, " data : ",*((UNS32*)pMappedAppObject)); */ -00248 offset += Size; -00249 numMap++; -00250 /*TODO : check that offset is not not greater that message size (in bit) */ -00251 } /* end loop while on mapped variables */ -00252 -00253 offset=0x00; -00254 numMap = 0; -00255 return 0; -00256 -00257 }/* end switch status*/ -00258 }/* end while*/ -00259 }/* end if Donnees */ -00260 else if ((*m).rtr == REQUEST ){ -00261 MSG_WAR(0x3946, "Receive a PDO request cobId : ", m->cob_id.w); -00262 status = state1; -00263 offsetObjdict = d->firstIndex->PDO_TRS; -00264 lastIndex = d->lastIndex->PDO_TRS; -00265 if(offsetObjdict) while( offsetObjdict <= lastIndex ){ -00266 /* study of all PDO stored in the objects dictionary */ -00267 -00268 switch( status ){ -00269 -00270 case state1:/* check the CobId */ -00271 /* get CobId of the dictionary which match to the received PDO -00272 */ -00273 pwCobId = (UNS32*) (d->objdict + offsetObjdict)->pSubindex[1].pObject; -00274 if ( *pwCobId == (*m).cob_id.w ) { -00275 status = state4; -00276 break; -00277 } -00278 else { -00279 numPdo++; -00280 offsetObjdict++; -00281 } -00282 status = state1; -00283 break; -00284 -00285 -00286 case state4:/* check transmission type */ -00287 pTransmissionType = (UNS8*) d->objdict[offsetObjdict].pSubindex[2].pObject; -00288 /* If PDO is to be sampled and send on RTR, do it*/ -00289 if ( (*pTransmissionType == TRANS_RTR)) { -00290 status = state5; -00291 break; -00292 /* RTR_SYNC mean data is prepared at SYNC, and transmitted on RTR */ -00293 }else if ((*pTransmissionType == TRANS_RTR_SYNC )) { -00294 if(d->PDO_status[numPdo].transmit_type_parameter & PDO_RTR_SYNC_READY){ -00295 /*Data ready, just send*/ -00296 canSend(d->canHandle,&d->PDO_status[numPdo].last_message); -00297 return 0; -00298 }else{ -00299 /* if SYNC did never occur, force emission with current data */ -00300 /* DS301 do not tell what to do in such a case...*/ -00301 MSG_ERR(0x1947, "Not ready RTR_SYNC TPDO send current data : ", m->cob_id.w); -00302 status = state5; -00303 } -00304 break; -00305 }else if( -00306 (*pTransmissionType == TRANS_EVENT_PROFILE) || -00307 (*pTransmissionType == TRANS_EVENT_SPECIFIC) ) { -00308 /* Zap all timers and inhibit flag */ -00309 d->PDO_status[numPdo].event_timer = DelAlarm(d->PDO_status[numPdo].event_timer); -00310 d->PDO_status[numPdo].inhibit_timer = DelAlarm(d->PDO_status[numPdo].inhibit_timer); -00311 d->PDO_status[numPdo].transmit_type_parameter &= ~PDO_INHIBITED; -00312 /* Call PDOEventTimerAlarm for this TPDO, this will trigger emission et reset timers */ -00313 PDOEventTimerAlarm(d, numPdo); -00314 return 0; -00315 }else { -00316 /* The requested PDO is not to send on request. So, does -00317 nothing. */ -00318 MSG_WAR(0x2947, "PDO is not to send on request : ", m->cob_id.w); -00319 return 0xFF; -00320 } -00321 -00322 case state5:/* build and send requested PDO */ -00323 { -00324 Message pdo; -00325 if( buildPDO(d, numPdo, &pdo)) -00326 { -00327 MSG_ERR(0x1948, " Couldn't build TPDO n°", numPdo); -00328 return 0xFF; -00329 } -00330 canSend(d->canHandle,&pdo); -00331 return 0; -00332 } -00333 }/* end switch status */ -00334 }/* end while */ -00335 }/* end if Requete */ -00336 -00337 return 0; -00338 } -00339 -00351 void CopyBits(UNS8 NbBits, UNS8* SrcByteIndex, UNS8 SrcBitIndex, UNS8 SrcBigEndian, UNS8* DestByteIndex, UNS8 DestBitIndex, UNS8 DestBigEndian) -00352 { -00353 /* This loop copy as many bits that it can each time, crossing*/ -00354 /* successively bytes*/ -00355 // boundaries from LSB to MSB. -00356 while(NbBits > 0) -00357 { -00358 /* Bit missalignement between src and dest*/ -00359 INTEGER8 Vect = DestBitIndex - SrcBitIndex; -00360 -00361 /* We can now get src and align it to dest*/ -00362 UNS8 Aligned = Vect>0 ? *SrcByteIndex << Vect : *SrcByteIndex >> -Vect; -00363 -00364 /* Compute the nb of bit we will be able to copy*/ -00365 UNS8 BoudaryLimit = (Vect>0 ? 8 - DestBitIndex : 8 - SrcBitIndex ); -00366 UNS8 BitsToCopy = BoudaryLimit > NbBits ? NbBits : BoudaryLimit; -00367 -00368 /* Create a mask that will serve in:*/ -00369 UNS8 Mask = ((0xff << (DestBitIndex + BitsToCopy)) | (0xff >> (8 - DestBitIndex))); -00370 -00371 /* - Filtering src*/ -00372 UNS8 Filtered = Aligned & ~Mask; -00373 -00374 /* - and erase bits where we write, preserve where we don't*/ -00375 *DestByteIndex &= Mask; -00376 -00377 /* Then write.*/ -00378 *DestByteIndex |= Filtered ; -00379 -00380 /*Compute next time cursors for src*/ -00381 if((SrcBitIndex += BitsToCopy)>7)/* cross boundary ?*/ -00382 { -00383 SrcBitIndex = 0;/* First bit*/ -00384 SrcByteIndex += (SrcBigEndian ? -1 : 1);/* Next byte*/ -00385 } -00386 -00387 -00388 /*Compute next time cursors for dest*/ -00389 if((DestBitIndex += BitsToCopy)>7) -00390 { -00391 DestBitIndex = 0;/* First bit*/ -00392 DestByteIndex += (DestBigEndian ? -1 : 1);/* Next byte*/ -00393 } -00394 -00395 /*And decrement counter.*/ -00396 NbBits -= BitsToCopy; -00397 } -00398 -00399 } -00408 UNS8 sendPDOevent( CO_Data* d) -00409 { -00410 /* Calls _sendPDOevent specifying it is not a sync event */ -00411 return _sendPDOevent(d, 0); -00412 } -00413 -00414 -00415 void PDOEventTimerAlarm(CO_Data* d, UNS32 pdoNum) -00416 { -00417 /* This is needed to avoid deletion of re-attribuated timer */ -00418 d->PDO_status[pdoNum].event_timer = TIMER_NONE; -00419 /* force emission of PDO by artificially changing last emitted*/ -00420 d->PDO_status[pdoNum].last_message.cob_id.w = 0; -00421 _sendPDOevent( d, 0 ); /* not a Sync Event*/ -00422 } -00423 -00424 void PDOInhibitTimerAlarm(CO_Data* d, UNS32 pdoNum) -00425 { -00426 /* This is needed to avoid deletion of re-attribuated timer */ -00427 d->PDO_status[pdoNum].inhibit_timer = TIMER_NONE; -00428 /* Remove inhibit flag */ -00429 d->PDO_status[pdoNum].transmit_type_parameter &= ~PDO_INHIBITED; -00430 _sendPDOevent( d, 0 ); /* not a Sync Event*/ -00431 } -00432 -00442 UNS8 _sendPDOevent( CO_Data* d, UNS8 isSyncEvent ) -00443 { -00444 UNS8 pdoNum = 0x00; /* number of the actual processed pdo-nr. */ -00445 UNS8* pTransmissionType = NULL; -00446 UNS8 status = state3; -00447 UNS16 offsetObjdict = d->firstIndex->PDO_TRS; -00448 UNS16 offsetObjdictMap = d->firstIndex->PDO_TRS_MAP; -00449 UNS16 lastIndex = d->lastIndex->PDO_TRS; -00450 -00451 /* study all PDO stored in the objects dictionary */ -00452 if(offsetObjdict){ -00453 Message pdo = Message_Initializer; -00454 while( offsetObjdict <= lastIndex) { -00455 switch( status ) { -00456 case state3: -00457 if (/*d->objdict[offsetObjdict].bSubCount < 5 || not necessary with objdictedit (always 5)*/ -00458 /* check if TPDO is not valid */ -00459 *(UNS32*)d->objdict[offsetObjdict].pSubindex[0].pObject & 0x8000) { -00460 MSG_WAR(0x3960, "Not a valid PDO ", 0x1800 + pdoNum); -00461 /*Go next TPDO*/ -00462 status = state11; -00463 break; -00464 } -00465 /* get the PDO transmission type */ -00466 pTransmissionType = (UNS8*) d->objdict[offsetObjdict].pSubindex[2].pObject; -00467 MSG_WAR(0x3962, "Reading PDO at index : ", 0x1800 + pdoNum); -00468 -00469 /* check if transmission type is SYNCRONOUS */ -00470 /* The message is transmited every n SYNC with n=TransmissionType */ -00471 if( isSyncEvent && -00472 (*pTransmissionType >= TRANS_SYNC_MIN) && -00473 (*pTransmissionType <= TRANS_SYNC_MAX) && -00474 (++d->PDO_status[pdoNum].transmit_type_parameter == *pTransmissionType) ) { -00475 /*Reset count of SYNC*/ -00476 d->PDO_status[pdoNum].transmit_type_parameter = 0; -00477 MSG_WAR(0x3964, " PDO is on SYNCHRO. Trans type : ", *pTransmissionType); -00478 pdo = (Message)Message_Initializer; -00479 if(buildPDO(d, pdoNum, &pdo)) -00480 { -00481 MSG_ERR(0x1906, " Couldn't build TPDO number : ", pdoNum); -00482 status = state11; -00483 break; -00484 } -00485 status = state5; -00486 /* If transmission RTR, with data sampled on SYNC */ -00487 }else if( isSyncEvent && -00488 (*pTransmissionType == TRANS_RTR_SYNC)) { -00489 if(buildPDO(d, pdoNum, &d->PDO_status[pdoNum].last_message)) -00490 { -00491 MSG_ERR(0x1966, " Couldn't build TPDO number : ", pdoNum); -00492 d->PDO_status[pdoNum].transmit_type_parameter &= ~PDO_RTR_SYNC_READY; -00493 }else{ -00494 d->PDO_status[pdoNum].transmit_type_parameter |= PDO_RTR_SYNC_READY; -00495 } -00496 status = state11; -00497 break; -00498 /* If transmission on Event and not inhibited, check for changes */ -00499 }else if((*pTransmissionType == TRANS_EVENT_PROFILE || -00500 *pTransmissionType == TRANS_EVENT_SPECIFIC )&& -00501 !(d->PDO_status[pdoNum].transmit_type_parameter & PDO_INHIBITED)) { -00502 MSG_WAR(0x3968, " PDO is on EVENT. Trans type : ", *pTransmissionType); -00503 pdo = (Message)Message_Initializer; -00504 if(buildPDO(d, pdoNum, &pdo)) -00505 { -00506 MSG_ERR(0x3907, " Couldn't build TPDO number : ", pdoNum); -00507 status = state11; -00508 break; -00509 } -00510 -00511 /*Compare new and old PDO*/ -00512 if(d->PDO_status[pdoNum].last_message.cob_id.w == pdo.cob_id.w && -00513 d->PDO_status[pdoNum].last_message.len == pdo.len && -00514 *(UNS64*)(&d->PDO_status[pdoNum].last_message.data[0]) == *(UNS64*)(&pdo.data[0])){ -00515 /* No changes -> go to next pdo*/ -00516 status = state11; -00517 }else{ -00518 MSG_WAR(0x306A, "Changes TPDO number : ", pdoNum); -00519 /* Changes detected -> transmit message */ -00520 status = state5; -00521 -00522 /* Start both event_timer and inhibit_timer*/ -00523 DelAlarm(d->PDO_status[pdoNum].event_timer); -00524 d->PDO_status[pdoNum].event_timer = SetAlarm(d, pdoNum, &PDOEventTimerAlarm, MS_TO_TIMEVAL(*(UNS16*)d->objdict[offsetObjdict].pSubindex[5].pObject), 0); -00525 -00526 DelAlarm(d->PDO_status[pdoNum].inhibit_timer); -00527 d->PDO_status[pdoNum].inhibit_timer = SetAlarm(d, pdoNum, &PDOInhibitTimerAlarm, US_TO_TIMEVAL(*(UNS16*)d->objdict[offsetObjdict].pSubindex[3].pObject * 100), 0); -00528 -00529 /* and inhibit TPDO */ -00530 d->PDO_status[pdoNum].transmit_type_parameter |= PDO_INHIBITED; -00531 } -00532 }else{ -00533 MSG_WAR(0x306C, " PDO is not on EVENT or synchro or not at this SYNC. Trans type : ", *pTransmissionType); -00534 status = state11; -00535 } -00536 break; -00537 case state5: /*Send the pdo*/ -00538 /*store_as_last_message*/ -00539 d->PDO_status[pdoNum].last_message = pdo; -00540 MSG_WAR(0x396D, "sendPDO cobId :", pdo.cob_id.w); -00541 MSG_WAR(0x396E, " Nb octets : ", pdo.len); -00542 -00543 canSend(d->canHandle,&pdo); -00544 status = state11; -00545 break; -00546 case state11: /*Go to next TPDO*/ -00547 pdoNum++; -00548 offsetObjdict++; -00549 offsetObjdictMap++; -00550 MSG_WAR(0x3970, "next pdo index : ", pdoNum); -00551 status = state3; -00552 break; -00553 -00554 default: -00555 MSG_ERR(0x1972,"Unknown state has been reached : %d",status); -00556 return 0xFF; -00557 }/* end switch case */ -00558 -00559 }/* end while */ -00560 } -00561 return 0; -00562 } -00563 -00573 UNS32 TPDO_Communication_Parameter_Callback(CO_Data* d, const indextable * OD_entry, UNS8 bSubindex) -00574 { -00575 /* If PDO are actives */ -00576 if(d->CurrentCommunicationState.csPDO) switch(bSubindex) -00577 { -00578 case 2: /* Changed transmition type */ -00579 case 3: /* Changed inhibit time */ -00580 case 5: /* Changed event time */ -00581 { -00582 UNS8 pTransmissionType = *(UNS8*) OD_entry->pSubindex[2].pObject; -00583 const indextable* TPDO_com = d->objdict + d->firstIndex->PDO_TRS; -00584 UNS8 numPdo = OD_entry - TPDO_com; /* number of the actual processed pdo-nr. */ -00585 -00586 /* Zap all timers and inhibit flag */ -00587 d->PDO_status[numPdo].event_timer = DelAlarm(d->PDO_status[numPdo].event_timer); -00588 d->PDO_status[numPdo].inhibit_timer = DelAlarm(d->PDO_status[numPdo].inhibit_timer); -00589 d->PDO_status[numPdo].transmit_type_parameter = 0; -00590 /* Call PDOEventTimerAlarm for this TPDO, this will trigger emission et reset timers */ -00591 PDOEventTimerAlarm(d, numPdo); -00592 return 0; -00593 } -00594 -00595 default: /* other subindex are ignored*/ -00596 break; -00597 } -00598 return 0; -00599 } -00600 -00601 void PDOInit(CO_Data* d) -00602 { -00603 /* For each TPDO mapping parameters */ -00604 UNS16 pdoIndex = 0x1800; /* OD index of TDPO */ -00605 -00606 UNS16 offsetObjdict = d->firstIndex->PDO_TRS; -00607 UNS16 lastIndex = d->lastIndex->PDO_TRS; -00608 if(offsetObjdict) while( offsetObjdict <= lastIndex) { -00609 /* Assign callbacks to sensible TPDO mapping subindexes */ -00610 UNS32 errorCode; -00611 ODCallback_t *CallbackList; -00612 /* Find callback list */ -00613 scanIndexOD (d, pdoIndex, &errorCode, &CallbackList); -00614 if(errorCode == OD_SUCCESSFUL && CallbackList) -00615 { -00616 /*Assign callbacks to corresponding subindex*/ -00617 /* Transmission type */ -00618 CallbackList[2] = &TPDO_Communication_Parameter_Callback; -00619 /* Inhibit time */ -00620 CallbackList[3] = &TPDO_Communication_Parameter_Callback; -00621 /* Event timer */ -00622 CallbackList[5] = &TPDO_Communication_Parameter_Callback; -00623 } -00624 pdoIndex++; -00625 offsetObjdict++; -00626 } -00627 -00628 /* Trigger a non-sync event */ -00629 _sendPDOevent( d, 0 ); -00630 } -00631 -00632 void PDOStop(CO_Data* d) -00633 { -00634 /* For each TPDO mapping parameters */ -00635 UNS8 pdoNum = 0x00; /* number of the actual processed pdo-nr. */ -00636 UNS16 offsetObjdict = d->firstIndex->PDO_TRS; -00637 UNS16 lastIndex = d->lastIndex->PDO_TRS; -00638 if(offsetObjdict) while( offsetObjdict <= lastIndex) { -00639 /* Delete TPDO timers */ -00640 d->PDO_status[pdoNum].event_timer = DelAlarm(d->PDO_status[pdoNum].event_timer); -00641 d->PDO_status[pdoNum].inhibit_timer = DelAlarm(d->PDO_status[pdoNum].inhibit_timer); -00642 /* Reset transmit type parameter */ -00643 d->PDO_status[pdoNum].transmit_type_parameter = 0; -00644 d->PDO_status[pdoNum].last_message.cob_id.w = 0; -00645 pdoNum++; -00646 offsetObjdict++; -00647 } -00648 } -
#include "pdo.h"
#include "objacces.h"
#include "canfestival.h"
-Include dependency graph for pdo.c:
-Go to the source code of this file.
Functions | |
UNS8 | buildPDO (CO_Data *d, UNS8 numPdo, Message *pdo) |
UNS8 | sendPDOrequest (CO_Data *d, UNS16 RPDOIndex) |
UNS8 | proceedPDO (CO_Data *d, Message *m) |
void | CopyBits (UNS8 NbBits, UNS8 *SrcByteIndex, UNS8 SrcBitIndex, UNS8 SrcBigEndian, UNS8 *DestByteIndex, UNS8 DestBitIndex, UNS8 DestBigEndian) |
UNS8 | sendPDOevent (CO_Data *d) |
void | PDOEventTimerAlarm (CO_Data *d, UNS32 pdoNum) |
void | PDOInhibitTimerAlarm (CO_Data *d, UNS32 pdoNum) |
UNS8 | _sendPDOevent (CO_Data *d, UNS8 isSyncEvent) |
UNS32 | TPDO_Communication_Parameter_Callback (CO_Data *d, const indextable *OD_entry, UNS8 bSubindex) |
void | PDOInit (CO_Data *d) |
void | PDOStop (CO_Data *d) |
-Definition in file pdo.c.
UNS8 _sendPDOevent | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -isSyncEvent | - |
- | ) | -- |
-
d | ||
isSyncEvent |
-Definition at line 442 of file pdo.c. -
-References buildPDO(), struct_CO_Data::canHandle, canSend(), Message::cob_id, struct_s_timer_entry::d, Message::data, DelAlarm(), struct_CO_Data::firstIndex, struct_s_PDO_status::last_message, struct_CO_Data::lastIndex, Message::len, Message_Initializer, MS_TO_TIMEVAL, MSG_ERR, MSG_WAR, struct_CO_Data::objdict, struct_CO_Data::PDO_status, s_quick_index::PDO_TRS, s_quick_index::PDO_TRS_MAP, PDOEventTimerAlarm(), PDOInhibitTimerAlarm(), td_subindex::pObject, td_indextable::pSubindex, SetAlarm(), state11, state3, state5, struct_s_PDO_status::transmit_type_parameter, UNS16, UNS32, UNS64, UNS8, US_TO_TIMEVAL, and SHORT_CAN::w. -
-Referenced by PDOEventTimerAlarm(), PDOInhibitTimerAlarm(), PDOInit(), proceedSYNC(), and sendPDOevent(). -
-Here is the call graph for this function:
UNS8 buildPDO | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -numPdo, | -|
- | - | Message * | -pdo | - |
- | ) | -- |
-
d | ||
TPDO_com | TPDO communication parameters OD entry | |
TPDO_map | TPDO mapping parameters OD entry |
-Definition at line 48 of file pdo.c. -
-References Message::cob_id, CopyBits(), struct_s_timer_entry::d, Message::data, struct_CO_Data::firstIndex, getODentry(), td_indextable::index, Message::len, MSG_ERR, MSG_WAR, NOT_A_REQUEST, struct_CO_Data::objdict, OD_SUCCESSFUL, s_quick_index::PDO_TRS, s_quick_index::PDO_TRS_MAP, td_subindex::pObject, td_indextable::pSubindex, Message::rtr, UNS16, UNS32, UNS8, and SHORT_CAN::w. -
-Referenced by _sendPDOevent(), and proceedPDO(). -
-Here is the call graph for this function:
void CopyBits | -( | -UNS8 | -NbBits, | -|
- | - | UNS8 * | -SrcByteIndex, | -|
- | - | UNS8 | -SrcBitIndex, | -|
- | - | UNS8 | -SrcBigEndian, | -|
- | - | UNS8 * | -DestByteIndex, | -|
- | - | UNS8 | -DestBitIndex, | -|
- | - | UNS8 | -DestBigEndian | - |
- | ) | -- |
-
NbBits | ||
SrcByteIndex | ||
SrcBitIndex | ||
SrcBigEndian | ||
DestByteIndex | ||
DestBitIndex | ||
DestBigEndian |
-Definition at line 351 of file pdo.c. -
-References INTEGER8, and UNS8. -
-Referenced by buildPDO(), and proceedPDO(). -
void PDOEventTimerAlarm | -( | -CO_Data * | -d, | -|
- | - | UNS32 | -pdoNum | - |
- | ) | -- |
- -
-Definition at line 415 of file pdo.c. -
-References _sendPDOevent(), Message::cob_id, struct_s_timer_entry::d, struct_s_PDO_status::event_timer, struct_s_PDO_status::last_message, struct_CO_Data::PDO_status, and SHORT_CAN::w. -
-Referenced by _sendPDOevent(), proceedPDO(), and TPDO_Communication_Parameter_Callback(). -
-Here is the call graph for this function:
void PDOInhibitTimerAlarm | -( | -CO_Data * | -d, | -|
- | - | UNS32 | -pdoNum | - |
- | ) | -- |
- -
-Definition at line 424 of file pdo.c. -
-References _sendPDOevent(), struct_s_timer_entry::d, struct_s_PDO_status::inhibit_timer, struct_CO_Data::PDO_status, and struct_s_PDO_status::transmit_type_parameter. -
-Referenced by _sendPDOevent(). -
-Here is the call graph for this function:
void PDOInit | -( | -CO_Data * | -d | -) | -- |
- -
-Definition at line 601 of file pdo.c. -
-References _sendPDOevent(), struct_s_timer_entry::d, struct_CO_Data::firstIndex, struct_CO_Data::lastIndex, OD_SUCCESSFUL, s_quick_index::PDO_TRS, scanIndexOD(), TPDO_Communication_Parameter_Callback(), UNS16, and UNS32. -
-Referenced by switchCommunicationState(). -
-Here is the call graph for this function:
void PDOStop | -( | -CO_Data * | -d | -) | -- |
- -
-Definition at line 632 of file pdo.c. -
-References Message::cob_id, struct_s_timer_entry::d, DelAlarm(), struct_s_PDO_status::event_timer, struct_CO_Data::firstIndex, struct_s_PDO_status::inhibit_timer, struct_s_PDO_status::last_message, struct_CO_Data::lastIndex, struct_CO_Data::PDO_status, s_quick_index::PDO_TRS, struct_s_PDO_status::transmit_type_parameter, UNS16, UNS8, and SHORT_CAN::w. -
-Referenced by switchCommunicationState(). -
-Here is the call graph for this function:
-
d | ||
m |
-Definition at line 141 of file pdo.c. -
-References buildPDO(), struct_CO_Data::canHandle, canSend(), Message::cob_id, CopyBits(), struct_s_timer_entry::d, Message::data, DelAlarm(), struct_s_PDO_status::event_timer, struct_CO_Data::firstIndex, struct_s_PDO_status::inhibit_timer, struct_s_PDO_status::last_message, struct_CO_Data::lastIndex, MSG_ERR, MSG_WAR, NOT_A_REQUEST, struct_CO_Data::objdict, OD_SUCCESSFUL, s_quick_index::PDO_RCV, s_quick_index::PDO_RCV_MAP, struct_CO_Data::PDO_status, s_quick_index::PDO_TRS, PDOEventTimerAlarm(), td_subindex::pObject, td_indextable::pSubindex, REQUEST, setODentry(), state1, state2, state4, state5, struct_s_PDO_status::transmit_type_parameter, UNS16, UNS32, UNS8, and SHORT_CAN::w. -
-Referenced by canDispatch(). -
-Here is the call graph for this function:
UNS8 sendPDOevent | -( | -CO_Data * | -d | -) | -- |
-
d |
-Definition at line 408 of file pdo.c. -
-References _sendPDOevent(), and struct_s_timer_entry::d. -
-Here is the call graph for this function:
UNS8 sendPDOrequest | -( | -CO_Data * | -d, | -|
- | - | UNS16 | -RPDOIndex | - |
- | ) | -- |
-
d | ||
cobId |
-Definition at line 104 of file pdo.c. -
-References struct_CO_Data::canHandle, canSend(), struct_s_timer_entry::d, struct_CO_Data::firstIndex, struct_CO_Data::lastIndex, MSG_ERR, MSG_WAR, struct_CO_Data::objdict, s_quick_index::PDO_RCV, td_subindex::pObject, td_indextable::pSubindex, REQUEST, UNS16, and UNS32. -
-Referenced by TestMaster_post_TPDO(). -
-Here is the call graph for this function:
UNS32 TPDO_Communication_Parameter_Callback | -( | -CO_Data * | -d, | -|
- | - | const indextable * | -OD_entry, | -|
- | - | UNS8 | -bSubindex | - |
- | ) | -- |
-
d | ||
OD_entry | ||
bSubindex |
-Definition at line 573 of file pdo.c. -
-References s_state_communication::csPDO, struct_CO_Data::CurrentCommunicationState, struct_s_timer_entry::d, DelAlarm(), struct_s_PDO_status::event_timer, struct_CO_Data::firstIndex, struct_s_PDO_status::inhibit_timer, struct_CO_Data::objdict, struct_CO_Data::PDO_status, s_quick_index::PDO_TRS, PDOEventTimerAlarm(), td_subindex::pObject, td_indextable::pSubindex, struct_s_PDO_status::transmit_type_parameter, and UNS8. -
-Referenced by PDOInit(). -
-Here is the call graph for this function:
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #ifndef __pdo_h__ -00024 #define __pdo_h__ -00025 -00026 #include <applicfg.h> -00027 #include <def.h> -00028 -00029 #include "can.h" -00030 -00031 typedef struct struct_s_PDO_status s_PDO_status; -00032 -00033 #include "data.h" -00034 -00035 /* Status of the TPDO : */ -00036 #define PDO_INHIBITED 0x01 -00037 #define PDO_RTR_SYNC_READY 0x01 -00038 -00040 struct struct_s_PDO_status { -00041 UNS8 transmit_type_parameter; -00042 TIMER_HANDLE event_timer; -00043 TIMER_HANDLE inhibit_timer; -00044 Message last_message; -00045 }; -00046 -00047 #define s_PDO_staus_Initializer {0, TIMER_NONE, TIMER_NONE, Message_Initializer} -00048 -00053 #define TRANS_EVERY_N_SYNC(n) (n) /*n = 1 to 240 */ -00054 #define TRANS_SYNC_MIN 1 /* Trans after reception of n SYNC. n = 1 to 240 */ -00055 #define TRANS_SYNC_MAX 240 /* Trans after reception of n SYNC. n = 1 to 240 */ -00056 #define TRANS_RTR_SYNC 252 /* Transmission on request */ -00057 #define TRANS_RTR 253 /* Transmission on request */ -00058 #define TRANS_EVENT_SPECIFIC 254 /* Transmission on event */ -00059 #define TRANS_EVENT_PROFILE 255 /* Transmission on event */ -00060 -00069 UNS8 buildPDO(CO_Data* d, UNS8 numPdo, Message *pdo); -00070 -00076 UNS8 sendPDOrequest( CO_Data* d, UNS16 RPDOIndex ); -00077 -00082 UNS8 proceedPDO (CO_Data* d, Message *m); -00083 -00090 UNS8 sendPDOevent (CO_Data* d); -00091 -00095 UNS8 _sendPDOevent(CO_Data* d, UNS8 isSyncEvent); -00096 -00097 -00098 void PDOInit(CO_Data* d); -00099 void PDOStop(CO_Data* d); -00100 void PDOEventTimerAlarm(CO_Data* d, UNS32 pdoNum); -00101 void PDOInhibitTimerAlarm(CO_Data* d, UNS32 pdoNum); -00102 -00103 /* copy bit per bit in little endian */ -00104 void CopyBits(UNS8 NbBits, UNS8* SrcByteIndex, UNS8 SrcBitIndex, UNS8 SrcBigEndian, UNS8* DestByteIndex, UNS8 DestBitIndex, UNS8 DestBigEndian); -00105 #endif -
#include <applicfg.h>
#include <def.h>
#include "can.h"
#include "data.h"
-Include dependency graph for pdo.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Data Structures | |
struct | struct_s_PDO_status |
Typedefs | |
typedef struct_s_PDO_status | s_PDO_status |
Functions | |
UNS8 | buildPDO (CO_Data *d, UNS8 numPdo, Message *pdo) |
UNS8 | sendPDOrequest (CO_Data *d, UNS16 RPDOIndex) |
UNS8 | proceedPDO (CO_Data *d, Message *m) |
UNS8 | sendPDOevent (CO_Data *d) |
UNS8 | _sendPDOevent (CO_Data *d, UNS8 isSyncEvent) |
void | PDOInit (CO_Data *d) |
void | PDOStop (CO_Data *d) |
void | PDOEventTimerAlarm (CO_Data *d, UNS32 pdoNum) |
void | PDOInhibitTimerAlarm (CO_Data *d, UNS32 pdoNum) |
void | CopyBits (UNS8 NbBits, UNS8 *SrcByteIndex, UNS8 SrcBitIndex, UNS8 SrcBigEndian, UNS8 *DestByteIndex, UNS8 DestBitIndex, UNS8 DestBigEndian) |
typedef struct struct_s_PDO_status s_PDO_status | -
-
UNS8 _sendPDOevent | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -isSyncEvent | - |
- | ) | -- |
-
d | ||
isSyncEvent |
-Definition at line 442 of file pdo.c. -
-References buildPDO(), struct_CO_Data::canHandle, canSend(), Message::cob_id, struct_s_timer_entry::d, Message::data, DelAlarm(), struct_CO_Data::firstIndex, struct_s_PDO_status::last_message, struct_CO_Data::lastIndex, Message::len, Message_Initializer, MS_TO_TIMEVAL, MSG_ERR, MSG_WAR, struct_CO_Data::objdict, struct_CO_Data::PDO_status, s_quick_index::PDO_TRS, s_quick_index::PDO_TRS_MAP, PDOEventTimerAlarm(), PDOInhibitTimerAlarm(), td_subindex::pObject, td_indextable::pSubindex, SetAlarm(), state11, state3, state5, struct_s_PDO_status::transmit_type_parameter, UNS16, UNS32, UNS64, UNS8, US_TO_TIMEVAL, and SHORT_CAN::w. -
-Referenced by PDOEventTimerAlarm(), PDOInhibitTimerAlarm(), PDOInit(), proceedSYNC(), and sendPDOevent(). -
-Here is the call graph for this function:
UNS8 buildPDO | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -numPdo, | -|
- | - | Message * | -pdo | - |
- | ) | -- |
-
d | ||
TPDO_com | TPDO communication parameters OD entry | |
TPDO_map | TPDO mapping parameters OD entry |
-Definition at line 48 of file pdo.c. -
-References Message::cob_id, CopyBits(), struct_s_timer_entry::d, Message::data, struct_CO_Data::firstIndex, getODentry(), td_indextable::index, Message::len, MSG_ERR, MSG_WAR, NOT_A_REQUEST, struct_CO_Data::objdict, OD_SUCCESSFUL, s_quick_index::PDO_TRS, s_quick_index::PDO_TRS_MAP, td_subindex::pObject, td_indextable::pSubindex, Message::rtr, UNS16, UNS32, UNS8, and SHORT_CAN::w. -
-Referenced by _sendPDOevent(), and proceedPDO(). -
-Here is the call graph for this function:
void CopyBits | -( | -UNS8 | -NbBits, | -|
- | - | UNS8 * | -SrcByteIndex, | -|
- | - | UNS8 | -SrcBitIndex, | -|
- | - | UNS8 | -SrcBigEndian, | -|
- | - | UNS8 * | -DestByteIndex, | -|
- | - | UNS8 | -DestBitIndex, | -|
- | - | UNS8 | -DestBigEndian | - |
- | ) | -- |
-
NbBits | ||
SrcByteIndex | ||
SrcBitIndex | ||
SrcBigEndian | ||
DestByteIndex | ||
DestBitIndex | ||
DestBigEndian |
-Definition at line 351 of file pdo.c. -
-References INTEGER8, and UNS8. -
-Referenced by buildPDO(), and proceedPDO(). -
void PDOEventTimerAlarm | -( | -CO_Data * | -d, | -|
- | - | UNS32 | -pdoNum | - |
- | ) | -- |
- -
-Definition at line 415 of file pdo.c. -
-References _sendPDOevent(), Message::cob_id, struct_s_timer_entry::d, struct_s_PDO_status::event_timer, struct_s_PDO_status::last_message, struct_CO_Data::PDO_status, and SHORT_CAN::w. -
-Referenced by _sendPDOevent(), proceedPDO(), and TPDO_Communication_Parameter_Callback(). -
-Here is the call graph for this function:
void PDOInhibitTimerAlarm | -( | -CO_Data * | -d, | -|
- | - | UNS32 | -pdoNum | - |
- | ) | -- |
- -
-Definition at line 424 of file pdo.c. -
-References _sendPDOevent(), struct_s_timer_entry::d, struct_s_PDO_status::inhibit_timer, struct_CO_Data::PDO_status, and struct_s_PDO_status::transmit_type_parameter. -
-Referenced by _sendPDOevent(). -
-Here is the call graph for this function:
void PDOInit | -( | -CO_Data * | -d | -) | -- |
- -
-Definition at line 601 of file pdo.c. -
-References _sendPDOevent(), struct_s_timer_entry::d, struct_CO_Data::firstIndex, struct_CO_Data::lastIndex, OD_SUCCESSFUL, s_quick_index::PDO_TRS, scanIndexOD(), TPDO_Communication_Parameter_Callback(), UNS16, and UNS32. -
-Referenced by switchCommunicationState(). -
-Here is the call graph for this function:
void PDOStop | -( | -CO_Data * | -d | -) | -- |
- -
-Definition at line 632 of file pdo.c. -
-References Message::cob_id, struct_s_timer_entry::d, DelAlarm(), struct_s_PDO_status::event_timer, struct_CO_Data::firstIndex, struct_s_PDO_status::inhibit_timer, struct_s_PDO_status::last_message, struct_CO_Data::lastIndex, struct_CO_Data::PDO_status, s_quick_index::PDO_TRS, struct_s_PDO_status::transmit_type_parameter, UNS16, UNS8, and SHORT_CAN::w. -
-Referenced by switchCommunicationState(). -
-Here is the call graph for this function:
-
d | ||
m |
-Definition at line 141 of file pdo.c. -
-References buildPDO(), struct_CO_Data::canHandle, canSend(), Message::cob_id, CopyBits(), struct_s_timer_entry::d, Message::data, DelAlarm(), struct_s_PDO_status::event_timer, struct_CO_Data::firstIndex, struct_s_PDO_status::inhibit_timer, struct_s_PDO_status::last_message, struct_CO_Data::lastIndex, MSG_ERR, MSG_WAR, NOT_A_REQUEST, struct_CO_Data::objdict, OD_SUCCESSFUL, s_quick_index::PDO_RCV, s_quick_index::PDO_RCV_MAP, struct_CO_Data::PDO_status, s_quick_index::PDO_TRS, PDOEventTimerAlarm(), td_subindex::pObject, td_indextable::pSubindex, REQUEST, setODentry(), state1, state2, state4, state5, struct_s_PDO_status::transmit_type_parameter, UNS16, UNS32, UNS8, and SHORT_CAN::w. -
-Referenced by canDispatch(). -
-Here is the call graph for this function:
UNS8 sendPDOevent | -( | -CO_Data * | -d | -) | -- |
-
d |
-Definition at line 408 of file pdo.c. -
-References _sendPDOevent(), and struct_s_timer_entry::d. -
-Here is the call graph for this function:
UNS8 sendPDOrequest | -( | -CO_Data * | -d, | -|
- | - | UNS16 | -RPDOIndex | - |
- | ) | -- |
-
d | ||
cobId |
-Definition at line 104 of file pdo.c. -
-References struct_CO_Data::canHandle, canSend(), struct_s_timer_entry::d, struct_CO_Data::firstIndex, struct_CO_Data::lastIndex, MSG_ERR, MSG_WAR, struct_CO_Data::objdict, s_quick_index::PDO_RCV, td_subindex::pObject, td_indextable::pSubindex, REQUEST, UNS16, and UNS32. -
-Referenced by TestMaster_post_TPDO(). -
-Here is the call graph for this function:
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 /* m68hc11/ports.h -- Definition of 68HC11 ports -00023 Copyright 1999, 2000 Free Software Foundation, Inc. -00024 Written by Stephane Carrez (stcarrez@worldnet.fr) -00025 -00026 This file is part of GDB, GAS, and the GNU binutils. -00027 -00028 GDB, GAS, and the GNU binutils are free software; you can redistribute -00029 them and/or modify them under the terms of the GNU General Public -00030 License as published by the Free Software Foundation; either version -00031 1, or (at your option) any later version. -00032 -00033 GDB, GAS, and the GNU binutils are distributed in the hope that they -00034 will be useful, but WITHOUT ANY WARRANTY; without even the implied -00035 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -00036 the GNU General Public License for more details. -00037 -00038 You should have received a copy of the GNU General Public License -00039 along with this file; see the file COPYING. If not, write to the Free -00040 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -00041 -00042 -00043 /* Revised francis.dupin@inrets.fr 2003-07 */ -00044 -00045 #ifndef _M68HC11_PORTS_H -00046 #define _M68HC11_PORTS_H -00047 -00048 -00049 -00050 #include <asm-m68hc12/ports_def.h> -00051 -00052 /* Prototypes */ -00053 unsigned short get_timer_counter (void); -00054 void set_timer_counter (unsigned short value); -00055 void cop_reset (void); -00056 -00057 -00058 /* Must me adapted to hc12 -00059 void timer_acknowledge (void); -00060 void timer_initialize_rate (unsigned char divisor); -00061 void set_bus_expanded (void); -00062 void set_bus_single_chip (void); -00063 unsigned short * get_input_capture_1 (void); -00064 void set_input_capture_1 (unsigned short value); -00065 unsigned short * get_input_capture_2 (void); -00066 void set_input_capture_2 (unsigned short value); -00067 unsigned short * get_input_capture_3 (void); -00068 void set_input_capture_3 (unsigned short value); -00069 unsigned short * get_output_compare_1 (void); -00070 void set_output_compare_1 (unsigned short value); -00071 unsigned short * get_output_compare_2 (void); -00072 void set_output_compare_2 (unsigned short value); -00073 unsigned short * get_output_compare_3 (void); -00074 void set_output_compare_3 (unsigned short value); -00075 unsigned short * get_output_compare_4 (void); -00076 void set_output_compare_4 (unsigned short value); -00077 unsigned short * get_output_compare_5 (void); -00078 void set_output_compare_5 (unsigned short value); -00079 */ -00080 -00081 -00082 extern inline unsigned short -00083 get_timer_counter (void) -00084 { -00085 return ((unsigned volatile short*) &_io_ports[TCNTH])[0]; -00086 } -00087 -00088 extern inline void -00089 set_timer_counter (unsigned short value) -00090 { -00091 ((unsigned volatile short*) &_io_ports[TCNTH])[0] = value; -00092 } -00093 -00094 -00095 /* Reset the COP. */ -00096 extern inline void -00097 cop_reset (void) -00098 { -00099 _io_ports[ARMCOP] = 0x55; -00100 _io_ports[ARMCOP] = 0xAA; -00101 } -00102 -00103 -00104 #if 0 -00105 /* Acknowledge the timer interrupt. */ -00106 extern inline void -00107 timer_acknowledge (void) -00108 { -00109 _io_ports[TFLG2] = 0x80; -00110 } -00111 -00112 /* Initialize the timer. */ -00113 extern inline void -00114 timer_initialize_rate (unsigned char divisor) -00115 { -00116 _io_ports[M6811_TMSK2] = M6811_RTII | divisor; -00117 } -00118 -00119 extern inline void -00120 cop_optional_reset (void) -00121 { -00122 #if defined(M6811_USE_COP) && M6811_USE_COP == 1 -00123 cop_reset (); -00124 #endif -00125 } -00126 -00127 /* Set the board in the expanded mode to get access to external bus. */ -00128 extern inline void -00129 set_bus_expanded (void) -00130 { -00131 _io_ports[M6811_HPRIO] |= M6811_MDA; -00132 } -00133 -00134 -00135 /* Set the board in single chip mode. */ -00136 extern inline void -00137 set_bus_single_chip (void) -00138 { -00139 _io_ports[M6811_HPRIO] &= ~M6811_MDA; -00140 } -00141 -00142 extern inline unsigned short -00143 get_input_capture_1 (void) -00144 { -00145 return ((unsigned volatile short*) &_io_ports[M6811_TIC1_H])[0]; -00146 } -00147 -00148 extern inline void -00149 set_input_capture_1 (unsigned short value) -00150 { -00151 ((unsigned volatile short*) &_io_ports[M6811_TIC1_H])[0] = value; -00152 } -00153 -00154 extern inline unsigned short -00155 get_input_capture_2 (void) -00156 { -00157 return ((unsigned volatile short*) &_io_ports[M6811_TIC2_H])[0]; -00158 } -00159 -00160 extern inline void -00161 set_input_capture_2 (unsigned short value) -00162 { -00163 ((unsigned volatile short*) &_io_ports[M6811_TIC2_H])[0] = value; -00164 } -00165 -00166 extern inline unsigned short -00167 get_input_capture_3 (void) -00168 { -00169 return ((unsigned volatile short*) &_io_ports[M6811_TIC3_H])[0]; -00170 } -00171 -00172 extern inline void -00173 set_input_capture_3 (unsigned short value) -00174 { -00175 ((unsigned volatile short*) &_io_ports[M6811_TIC3_H])[0] = value; -00176 } -00177 -00178 /* Get output compare 16-bit register. */ -00179 extern inline unsigned short -00180 get_output_compare_1 (void) -00181 { -00182 return ((unsigned volatile short*) &_io_ports[M6811_TOC1_H])[0]; -00183 } -00184 -00185 extern inline void -00186 set_output_compare_1 (unsigned short value) -00187 { -00188 ((unsigned volatile short*) &_io_ports[M6811_TOC1_H])[0] = value; -00189 } -00190 -00191 extern inline unsigned short -00192 get_output_compare_2 (void) -00193 { -00194 return ((unsigned volatile short*) &_io_ports[M6811_TOC2_H])[0]; -00195 } -00196 -00197 extern inline void -00198 set_output_compare_2 (unsigned short value) -00199 { -00200 ((unsigned volatile short*) &_io_ports[M6811_TOC2_H])[0] = value; -00201 } -00202 -00203 extern inline unsigned short -00204 get_output_compare_3 (void) -00205 { -00206 return ((unsigned volatile short*) &_io_ports[M6811_TOC3_H])[0]; -00207 } -00208 -00209 extern inline void -00210 set_output_compare_3 (unsigned short value) -00211 { -00212 ((unsigned volatile short*) &_io_ports[M6811_TOC3_H])[0] = value; -00213 } -00214 -00215 extern inline unsigned short -00216 get_output_compare_4 (void) -00217 { -00218 return ((unsigned volatile short*) &_io_ports[M6811_TOC4_H])[0]; -00219 } -00220 -00221 extern inline void -00222 set_output_compare_4 (unsigned short value) -00223 { -00224 ((unsigned volatile short*) &_io_ports[M6811_TOC4_H])[0] = value; -00225 } -00226 -00227 extern inline unsigned short -00228 get_output_compare_5 (void) -00229 { -00230 return ((unsigned volatile short*) &_io_ports[M6811_TOC5_H])[0]; -00231 } -00232 -00233 extern inline void -00234 set_output_compare_5 (unsigned short value) -00235 { -00236 ((unsigned volatile short*) &_io_ports[M6811_TOC5_H])[0] = value; -00237 } -00238 -00239 #endif -00240 -00241 -00242 -00243 -00244 #endif /* _M68HC11_PORTS_H */ -00245 -
#include <asm-m68hc12/ports_def.h>
-Include dependency graph for ports.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Functions | |
unsigned short | get_timer_counter (void) |
void | set_timer_counter (unsigned short value) |
void | cop_reset (void) |
void cop_reset | -( | -void | -- | ) | - [inline] |
-
unsigned short get_timer_counter | -( | -void | -- | ) | - [inline] |
-
void set_timer_counter | -( | -unsigned short | -value | -) | - [inline] |
-
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 /* -00023 Definition of the i/o ports of the Motorola HCS12 -00024 */ -00025 -00026 /* -00027 On HCS12, ports are maped by default at 0X0000. (see ports.s) -00028 It can also be done at link stage with an option in -00029 command line : for example to map at 0X8000 -00030 --defsym _io_ports8=0X8000 --defsym _io_ports16=0X8000 -00031 Or in the file memory.x : -00032 PROVIDE (_io_ports8 = 0X8000); -00033 PROVIDE (_io_ports16 = 0X8000); -00034 (see portsaccess.h) -00035 I wonder if the value in INITRG must not be changed too -00036 at run time. -00037 */ -00038 -00039 #ifndef __HCS12_PORTS__ -00040 #define __HCS12_PORTS__ -00041 -00042 #define PORTA 0x0000 -00043 #define PORTB 0x0001 -00044 #define DDRA 0x0002 -00045 #define DDRB 0x0003 -00046 -00047 #define PORTE 0x0008 -00048 #define DDRE 0x0009 -00049 #define PEAR 0x000A -00050 #define MODE 0x000B -00051 #define PUCR 0x000C -00052 #define RDRIV 0x000D -00053 #define EBICTL 0x000E -00054 -00055 #define INITRM 0x0010 -00056 #define INITRG 0x0011 -00057 #define INITEE 0x0012 -00058 #define MISC 0x0013 -00059 #define MTST0 0x0014 -00060 #define ITCR 0x0015 -00061 #define ITEST 0x0016 -00062 #define MTST1 0x0017 -00063 -00064 #define PARTIDH 0x001A -00065 #define PARTIDL 0x001B -00066 #define MEMSIZ0 0x001C -00067 #define MEMSIZ1 0x001D -00068 #define INTCR 0x001E -00069 #define HPRIO 0x001F -00070 -00071 #define BKPCT0 0x0028 -00072 #define BKPCT1 0x0029 -00073 #define BKP0X 0x002A -00074 #define BKP0H 0x002B -00075 #define BKP0L 0x002C -00076 #define BKP1X 0x002D -00077 #define BKP1H 0x002E -00078 #define BKP1L 0x002F -00079 #define PPAGE 0x0030 -00080 -00081 #define PORTK 0x0032 -00082 #define DDRK 0x0033 -00083 #define SYNR 0x0034 -00084 #define REFDV 0x0035 -00085 #define CTFLG 0x0036 -00086 #define CRGFLG 0x0037 -00087 #define CRGINT 0x0038 -00088 #define CLKSEL 0x0039 -00089 #define PLLCTL 0x003A -00090 #define RTICTL 0x003B -00091 #define COPCTL 0x003C -00092 #define FORBYP 0x003D -00093 #define CTCTL 0x003E -00094 #define ARMCOP 0x003F -00095 #define TIOS 0x0040 -00096 #define TCFORC 0x0041 -00097 #define TOC7M 0x0042 -00098 #define TOC7D 0x0043 -00099 #define TCNTH 0x0044 -00100 #define TCNTL 0x0045 -00101 #define TSCR1 0x0046 -00102 #define TTOV 0x0047 -00103 #define TCTL1 0x0048 -00104 #define TCTL2 0x0049 -00105 #define TCTL3 0x004A -00106 #define TCTL4 0x004B -00107 #define TIE 0x004C -00108 #define TSCR2 0x004D -00109 #define TFLG1 0x004E -00110 #define TFLG2 0x004F -00111 #define TC0H 0x0050 -00112 #define TC0L 0x0051 -00113 #define TC1H 0x0052 -00114 #define TC1L 0x0053 -00115 #define TC2H 0x0054 -00116 #define TC2L 0x0055 -00117 #define TC3H 0x0056 -00118 #define TC3L 0x0057 -00119 #define TC4H 0x0058 -00120 #define TC4L 0x0059 -00121 #define TC5H 0x005A -00122 #define TC5L 0x005B -00123 #define TC6H 0x005C -00124 #define TC6L 0x005D -00125 #define TC7H 0x005E -00126 #define TC7L 0x005F -00127 #define PACTL 0x0060 -00128 #define PAFLG 0x0061 -00129 #define PACN3H 0x0062 -00130 #define PACN2L 0x0063 -00131 #define PACN1H 0x0064 -00132 #define PACN0L 0x0065 -00133 #define MCCTL 0x0066 -00134 #define MCFLG 0x0067 -00135 #define ICPAR 0x0068 -00136 #define DLYCT 0x0069 -00137 #define ICOVW 0x006A -00138 #define ICSYS 0x006B -00139 -00140 #define TIMTST 0x006D -00141 -00142 #define PBCTL 0x0070 -00143 #define PBFLG 0x0071 -00144 #define PA3H 0x0072 -00145 #define PA2H 0x0073 -00146 #define PA1H 0x0074 -00147 #define PA0H 0x0075 -00148 #define MCCNTH 0x0076 -00149 #define MCCNTL 0x0077 -00150 #define TC0HH 0x0078 -00151 #define TC0HL 0x0079 -00152 #define TC1HH 0x007A -00153 #define TC1HL 0x007B -00154 #define TC2HH 0x007C -00155 #define TC2HL 0x007D -00156 #define TC3HH 0x007E -00157 -00158 #define ATD0CTL0 0x0080 -00159 #define ATD00CTL1 0x0081 -00160 #define ATD0CTL2 0x0082 -00161 #define ATD0CTL3 0x0083 -00162 #define ATD0CTL4 0x0084 -00163 #define ATD0CTL5 0x0085 -00164 #define ATD0STAT0 0x0086 -00165 #define ATD0STAT1 0x0087 -00166 #define ATD0TEST0 0x0088 -00167 #define ATD0TEST1 0x0089 -00168 -00169 #define ATD0DIEN 0x008D -00170 -00171 #define PORTAD0 0x008F -00172 #define ATD0DR0H 0x0090 -00173 #define ATD0DR0L 0x0091 -00174 #define ATD0DR1H 0x0092 -00175 #define ATD0DR1L 0x0093 -00176 #define ATD0DR2H 0x0094 -00177 #define ATD0DR2L 0x0095 -00178 #define ATD0DR3H 0x0096 -00179 #define ATD0DR3L 0x0097 -00180 #define ATD0DR4H 0x0098 -00181 #define ATD0DR4L 0x0099 -00182 #define ATD0DR5H 0x009A -00183 #define ATD0DR5L 0x009B -00184 #define ATD0DR6H 0x009C -00185 #define ATD0DR6L 0x009D -00186 #define ATD0DR7H 0x009E -00187 #define ATD0DR7L 0x009F -00188 #define PWME 0x00A0 -00189 #define PWMPOL 0x00A1 -00190 #define PWMCLK 0x00A2 -00191 #define PWMPRCLK 0x00A3 -00192 #define PWMCAE 0x00A4 -00193 #define PWMCTL 0x00A5 -00194 #define PWMTST 0x00A6 -00195 #define PWMPRSC 0x00A7 -00196 #define PWMSCLA 0x00A8 -00197 #define PWMSCLB 0x00A9 -00198 #define PWMSCNTA 0x00AA -00199 #define PWMSCNTB 0x00AB -00200 #define PWMCNT0 0x00AC -00201 #define PWMCNT1 0x00AD -00202 #define PWMCNT2 0x00AE -00203 #define PWMCNT3 0x00AF -00204 #define PWMCNT4 0x00B0 -00205 #define PWMCNT5 0x00B1 -00206 #define PWMCNT6 0x00B2 -00207 #define PWMCNT7 0x00B3 -00208 #define PWMPER0 0x00B4 -00209 #define PWMPER1 0x00B5 -00210 #define PWMPER2 0x00B6 -00211 #define PWMPER3 0x00B7 -00212 #define PWMPER4 0x00B8 -00213 #define PWMPER5 0x00B9 -00214 #define PWMPER6 0x00BA -00215 #define PWMPER7 0x00BB -00216 #define PWMDTY0 0x00BC -00217 #define PWMDTY1 0x00BD -00218 #define PWMDTY2 0x00BE -00219 #define PWMDTY3 0x00BF -00220 #define PWMDTY4 0x00C0 -00221 #define PWMDTY5 0x00C1 -00222 #define PWMDTY6 0x00C2 -00223 #define PWMDTY7 0x00C3 -00224 #define PWMSDN 0x00C4 -00225 -00226 #define SCI0BDH 0x00C8 -00227 #define SCI0BDL 0x00C9 -00228 #define SC0CR1 0x00CA -00229 #define SCI0CR2 0x00CB -00230 #define SCI0SR1 0x00CC -00231 #define SC0SR2 0x00CD -00232 #define SCI0DRH 0x00CE -00233 #define SCI0DRL 0x00CF -00234 #define SCI1BDH 0x00D0 -00235 #define SCI1BDL 0x00D1 -00236 #define SC1CR1 0x00D2 -00237 #define SCI1CR2 0x00D3 -00238 #define SCI1SR1 0x00D4 -00239 #define SC1SR2 0x00D5 -00240 #define SCI1DRH 0x00D6 -00241 #define SCI1DRL 0x00D7 -00242 #define SPI0CR1 0x00D8 -00243 #define SPI0CR2 0x00D9 -00244 #define SPI0BR 0x00DA -00245 #define SPI0SR 0x00DB -00246 -00247 #define SPI0DR 0x00DD -00248 -00249 #define IBAD 0x00E0 -00250 #define IBFD 0x00E1 -00251 #define IBCR 0x00E2 -00252 #define IBSR 0x00E3 -00253 #define IICDR 0x00E4 -00254 -00255 #define DLCBCR1 0x00E8 -00256 #define DLCBSVR 0x00E9 -00257 #define DLCBCR2 0x00EA -00258 #define DLCBDR 0x00EB -00259 #define DLCBARD 0x00EC -00260 #define DLCBRSR 0x00ED -00261 #define DLCSCR 0x00EE -00262 #define DLCBSTAT 0x00EF -00263 #define SPI1CR1 0x00F0 -00264 #define SPI1CR2 0x00F1 -00265 #define SPI1BR 0x00F2 -00266 #define SPI1SR 0x00F3 -00267 -00268 #define SPI1DR 0x00F5 -00269 -00270 #define SPI2CR1 0x00F8 -00271 #define SPI2CR2 0x00F9 -00272 #define SPI2BR 0x00FA -00273 #define SPI2SR 0x00FB -00274 -00275 #define SPI2DR 0x00FD -00276 -00277 #define FCLKDIV 0x0100 -00278 #define FSEC 0x0101 -00279 -00280 #define FCNFG 0x0103 -00281 #define FPROT 0x0104 -00282 #define FSTAT 0x0105 -00283 #define FCMD 0x0106 -00284 -00285 #define ECLKDIV 0x0110 -00286 -00287 #define ECNFG 0x0113 -00288 #define EPROT 0x0114 -00289 #define ESTAT 0x0115 -00290 #define ECMD 0x0116 -00291 -00292 #define ATD1CTL0 0x0120 -00293 #define ATD1CTL1 0x0121 -00294 #define ATD1CTL2 0x0122 -00295 #define ATD1CTL3 0x0123 -00296 #define ATD1CTL4 0x0124 -00297 #define ATD1CTL5 0x0125 -00298 #define ATD1STAT0 0x0126 -00299 #define ATD1STAT1 0x0127 -00300 #define ATD1TEST0 0x0128 -00301 #define ATD1TEST1 0x0129 -00302 -00303 #define ATDDIEN 0x012D -00304 -00305 #define PORTAD1 0x012F -00306 #define ATD1DR0H 0x0130 -00307 #define ATD1DR0L 0x0131 -00308 #define ATD1DR1H 0x0132 -00309 #define ATD1DR1L 0x0133 -00310 #define ATD1DR2H 0x0134 -00311 #define ATD1DR2L 0x0135 -00312 #define ATD1DR3H 0x0136 -00313 #define ATD1DR3L 0x0137 -00314 #define ATD1DR4H 0x0138 -00315 #define ATD1DR4L 0x0139 -00316 #define ATD1DR5H 0x013A -00317 #define ATD1DR5L 0x013B -00318 #define ATD1DR6H 0x013C -00319 #define ATD1DR6L 0x013D -00320 #define ATD1DR7H 0x013E -00321 #define ATD1DR7L 0x013F -00322 #define CAN0CTL0 0x0140 -00323 #define CAN0CTL1 0x0141 -00324 #define CAN0BTR0 0x0142 -00325 #define CAN0BTR1 0x0143 -00326 #define CAN0RFLG 0x0144 -00327 #define CAN0RIER 0x0145 -00328 #define CAN0TFLG 0x0146 -00329 #define CAN0TIER 0x0147 -00330 #define CAN0TARQ 0x0148 -00331 #define CAN0TAAK 0x0149 -00332 #define CAN0TBSEL 0x014A -00333 #define CAN0IDAC 0x014B -00334 -00335 #define CAN0RXERR 0x014E -00336 #define CAN0TXERR 0x014F -00337 #define CAN0IDAR0 0x0150 -00338 #define CAN0IDAR1 0x0151 -00339 #define CAN0IDAR2 0x0152 -00340 #define CAN0IDAR3 0x0153 -00341 #define CAN0IDMR0 0x0154 -00342 #define CAN0IDMR1 0x0155 -00343 #define CAN0IDMR2 0x0156 -00344 #define CAN0IDMR3 0x0157 -00345 #define CAN0IDAR4 0x0158 -00346 #define CAN0IDAR5 0x0159 -00347 #define CAN0IDAR6 0x015A -00348 #define CAN0IDAR7 0x015B -00349 #define CAN0IDMR4 0x015C -00350 #define CAN0IDMR5 0x015D -00351 #define CAN0IDMR6 0x015E -00352 #define CAN0IDMR7 0x015F -00353 #define CAN0RXFG0 0x0160 -00354 #define CAN0RXFG1 0x0161 -00355 #define CAN0RXFG2 0x0162 -00356 #define CAN0RXFG3 0x0163 -00357 #define CAN0RXFG4 0x0164 -00358 #define CAN0RXFG5 0x0165 -00359 #define CAN0RXFG6 0x0166 -00360 #define CAN0RXFG7 0x0167 -00361 #define CAN0RXFG8 0x0168 -00362 #define CAN0RXFG9 0x0169 -00363 #define CAN0RXFGA 0x016A -00364 #define CAN0RXFGB 0x016B -00365 #define CAN0RXFGC 0x016C -00366 #define CAN0RXFGD 0x016D -00367 #define CAN0RXFGE 0x016E -00368 #define CAN0RXFGF 0x016F -00369 #define CAN0TXFG0 0x0170 -00370 #define CAN0TXFG1 0x0171 -00371 #define CAN0TXFG2 0x0172 -00372 #define CAN0TXFG3 0x0173 -00373 #define CAN0TXFG4 0x0174 -00374 #define CAN0TXFG5 0x0175 -00375 #define CAN0TXFG6 0x0176 -00376 #define CAN0TXFG7 0x0177 -00377 #define CAN0TXFG8 0x0178 -00378 #define CAN0TXFG9 0x0179 -00379 #define CAN0TXFGA 0x017A -00380 #define CAN0TXFGB 0x017B -00381 #define CAN0TXFGC 0x017C -00382 #define CAN0TXFGD 0x017D -00383 #define CAN0TXFGE 0x017E -00384 #define CAN0TXFGF 0x017F -00385 -00386 #define CAN1CTL0 0x0180 -00387 #define CAN1CTL1 0x0181 -00388 #define CAN1BTR0 0x0182 -00389 #define CAN1BTR1 0x0183 -00390 #define CAN1RFLG 0x0184 -00391 #define CAN1RIER 0x0185 -00392 #define CAN1TFLG 0x0186 -00393 #define CAN1TIER 0x0187 -00394 #define CAN1TARQ 0x0188 -00395 #define CAN1TAAK 0x0189 -00396 #define CAN1TBSEL 0x018A -00397 #define CAN1IDAC 0x018B -00398 #define CAN1RXERR 0x018E -00399 #define CAN1TXERR 0x018F -00400 #define CAN1IDAR0 0x0190 -00401 #define CAN1IDAR1 0x0191 -00402 #define CAN1IDAR2 0x0192 -00403 #define CAN1IDAR3 0x0193 -00404 #define CAN1IDMR0 0x0194 -00405 #define CAN1IDMR1 0x0195 -00406 #define CAN1IDMR2 0x0196 -00407 #define CAN1IDMR3 0x0197 -00408 #define CAN1IDAR4 0x0198 -00409 #define CAN1IDAR5 0x0199 -00410 #define CAN1IDAR6 0x019A -00411 #define CAN1IDAR7 0x019B -00412 #define CAN1IDMR4 0x019C -00413 #define CAN1IDMR5 0x019D -00414 #define CAN1IDMR6 0x019E -00415 #define CAN1IDMR7 0x019F -00416 -00417 #define CAN1RXFG0 0x01A0 -00418 #define CAN1RXFG1 0x01A1 -00419 #define CAN1RXFG2 0x01A2 -00420 #define CAN1RXFG3 0x01A3 -00421 #define CAN1RXFG4 0x01A4 -00422 #define CAN1RXFG5 0x01A5 -00423 #define CAN1RXFG6 0x01A6 -00424 #define CAN1RXFG7 0x01A7 -00425 #define CAN1RXFG8 0x01A8 -00426 #define CAN1RXFG9 0x01A9 -00427 #define CAN1RXFGA 0x01AA -00428 #define CAN1RXFGB 0x01AB -00429 #define CAN1RXFGC 0x01AC -00430 #define CAN1RXFGD 0x01AD -00431 #define CAN1RXFGE 0x01AE -00432 #define CAN1RXFGF 0x01AF -00433 #define CAN1TXFG0 0x01B0 -00434 #define CAN1TXFG1 0x01B1 -00435 #define CAN1TXFG2 0x01B2 -00436 #define CAN1TXFG3 0x01B3 -00437 #define CAN1TXFG4 0x01B4 -00438 #define CAN1TXFG5 0x01B5 -00439 #define CAN1TXFG6 0x01B6 -00440 #define CAN1TXFG7 0x01B7 -00441 #define CAN1TXFG8 0x01B8 -00442 #define CAN1TXFG9 0x01B9 -00443 #define CAN1TXFGA 0x01BA -00444 #define CAN1TXFGB 0x01BB -00445 #define CAN1TXFGC 0x01BC -00446 #define CAN1TXFGD 0x01BD -00447 #define CAN1TXFGE 0x01BE -00448 #define CAN1TXFGF 0x01BF -00449 #define CAN2CTL0 0x01C0 -00450 #define CAN2CTL1 0x01C1 -00451 #define CAN2BTR0 0x01C2 -00452 #define CAN2BTR1 0x01C3 -00453 #define CAN2RFLG 0x01C4 -00454 #define CAN2RIER 0x01C5 -00455 #define CAN2TFLG 0x01C6 -00456 #define CAN2TIER 0x01C7 -00457 #define CAN2TARQ 0x01C8 -00458 #define CAN2TAAK 0x01C9 -00459 #define CAN2TBSEL 0x01CA -00460 #define CAN2IDAC 0x01CB -00461 -00462 #define CAN2RXERR 0x01CE -00463 #define CAN2TXERR 0x01CF -00464 #define CAN2IDAR0 0x01D0 -00465 #define CAN2IDAR1 0x01D1 -00466 #define CAN2IDAR2 0x01D2 -00467 #define CAN2IDAR3 0x01D3 -00468 #define CAN2IDMR0 0x01D4 -00469 #define CAN2IDMR1 0x01D5 -00470 #define CAN2IDMR2 0x01D6 -00471 #define CAN2IDMR3 0x01D7 -00472 #define CAN2IDAR4 0x01D8 -00473 #define CAN2IDAR5 0x01D9 -00474 #define CAN2IDAR6 0x01DA -00475 #define CAN2IDAR7 0x01DB -00476 #define CAN2IDMR4 0x01DC -00477 #define CAN2IDMR5 0x01DD -00478 #define CAN2IDMR6 0x01DE -00479 #define CAN2IDMR7 0x01DF -00480 #define CAN2RXFG0 0x01E0 -00481 #define CAN2RXFG1 0x01E1 -00482 #define CAN2RXFG2 0x01E2 -00483 #define CAN2RXFG3 0x01E3 -00484 #define CAN2RXFG4 0x01E4 -00485 #define CAN2RXFG5 0x01E5 -00486 #define CAN2RXFG6 0x01E6 -00487 #define CAN2RXFG7 0x01E7 -00488 #define CAN2RXFG8 0x01E8 -00489 #define CAN2RXFG9 0x01E9 -00490 #define CAN2RXFGA 0x01EA -00491 #define CAN2RXFGB 0x01EB -00492 #define CAN2RXFGC 0x01EC -00493 #define CAN2RXFGD 0x01ED -00494 #define CAN2RXFGE 0x01EE -00495 #define CAN2RXFGF 0x01EF -00496 #define CAN2TXFG0 0x01F0 -00497 #define CAN2TXFG1 0x01F1 -00498 #define CAN2TXFG2 0x01F2 -00499 #define CAN2TXFG3 0x01F3 -00500 #define CAN2TXFG4 0x01F4 -00501 #define CAN2TXFG5 0x01F5 -00502 #define CAN2TXFG6 0x01F6 -00503 #define CAN2TXFG7 0x01F7 -00504 #define CAN2TXFG8 0x01F8 -00505 #define CAN2TXFG9 0x01F9 -00506 #define CAN2TXFGA 0x01FA -00507 #define CAN2TXFGB 0x01FB -00508 #define CAN2TXFGC 0x01FC -00509 #define CAN2TXFGD 0x01FD -00510 #define CAN2TXFGE 0x01FE -00511 #define CAN2TXFGF 0x01FF -00512 -00513 #define CAN3CTL0 0x0200 -00514 #define CAN3CTL1 0x0201 -00515 #define CAN3BTR0 0x0202 -00516 #define CAN3BTR1 0x0203 -00517 #define CAN3RFLG 0x0204 -00518 #define CAN3RIER 0x0205 -00519 #define CAN3TFLG 0x0206 -00520 #define CAN3TIER 0x0207 -00521 #define CAN3TARQ 0x0208 -00522 #define CAN3TAAK 0x0209 -00523 #define CAN3TBSEL 0x020A -00524 #define CAN3IDAC 0x020B -00525 -00526 #define CAN3RXERR 0x020E -00527 #define CAN3TXERR 0x020F -00528 #define CAN3IDAR0 0x0210 -00529 #define CAN3IDAR1 0x0211 -00530 #define CAN3IDAR2 0x0212 -00531 #define CAN3IDAR3 0x0213 -00532 #define CAN3IDMR0 0x0214 -00533 #define CAN3IDMR1 0x0215 -00534 #define CAN3IDMR2 0x0216 -00535 #define CAN3IDMR3 0x0217 -00536 #define CAN3IDAR4 0x0218 -00537 #define CAN3IDAR5 0x0219 -00538 #define CAN3IDAR6 0x021A -00539 #define CAN3IDAR7 0x021B -00540 #define CAN3IDMR4 0x021C -00541 #define CAN3IDMR5 0x021D -00542 #define CAN3IDMR6 0x021E -00543 #define CAN3IDMR7 0x021F -00544 -00545 #define CAN3RXFG0 0x0220 -00546 #define CAN3RXFG1 0x0221 -00547 #define CAN3RXFG2 0x0222 -00548 #define CAN3RXFG3 0x0223 -00549 #define CAN3RXFG4 0x0224 -00550 #define CAN3RXFG5 0x0225 -00551 #define CAN3RXFG6 0x0226 -00552 #define CAN3RXFG7 0x0227 -00553 #define CAN3RXFG8 0x0228 -00554 #define CAN3RXFG9 0x0229 -00555 #define CAN3RXFGA 0x022A -00556 #define CAN3RXFGB 0x022B -00557 #define CAN3RXFGC 0x022C -00558 #define CAN3RXFGD 0x022D -00559 #define CAN3RXFGE 0x022E -00560 #define CAN3RXFGF 0x022F -00561 #define CAN3TXFG0 0x0230 -00562 #define CAN3TXFG1 0x0231 -00563 #define CAN3TXFG2 0x0232 -00564 #define CAN3TXFG3 0x0233 -00565 #define CAN3TXFG4 0x0234 -00566 #define CAN3TXFG5 0x0235 -00567 #define CAN3TXFG6 0x0236 -00568 #define CAN3TXFG7 0x0237 -00569 #define CAN3TXFG8 0x0238 -00570 #define CAN3TXFG9 0x0239 -00571 #define CAN3TXFGA 0x023A -00572 #define CAN3TXFGB 0x023B -00573 #define CAN3TXFGC 0x023C -00574 #define CAN3TXFGD 0x023D -00575 #define CAN3TXFGE 0x023E -00576 #define CAN3TXFGF 0x023F -00577 -00578 #define PTT 0x0240 -00579 #define PTIT 0x0241 -00580 #define DDRT 0x0242 -00581 #define RDRT 0x0243 -00582 #define PERT 0x0244 -00583 #define PPST 0x0245 -00584 -00585 #define PTS 0x0248 -00586 #define PTIS 0x0249 -00587 #define DDRS 0x024A -00588 #define RDRS 0x024B -00589 #define PERS 0x024C -00590 #define PPSS 0x024D -00591 #define WOMS 0x024E -00592 -00593 #define PTM 0x0250 -00594 #define PTIM 0x0251 -00595 #define DDRM 0x0252 -00596 #define RDRM 0x0253 -00597 #define PERM 0x0254 -00598 #define PPSM 0x0255 -00599 #define WOMM 0x0256 -00600 -00601 #define PTP 0x0258 -00602 #define PTIP 0x0259 -00603 #define DDRP 0x025A -00604 #define RDRP 0x025B -00605 #define PERP 0x025C -00606 #define PPSP 0x025D -00607 #define PIEP 0x025E -00608 #define PIFP 0x025F -00609 #define PTH 0x0260 -00610 #define PTIH 0x0261 -00611 #define DDRH 0x0262 -00612 #define RDRH 0x0263 -00613 #define PERH 0x0264 -00614 #define PPSH 0x0265 -00615 #define PIEH 0x0266 -00616 #define PIFH 0x0267 -00617 #define PTJ 0x0268 -00618 #define PTIJ 0x0269 -00619 #define DDRJ 0x026A -00620 #define RDRJ 0x026B -00621 #define PERJ 0x026C -00622 #define PPSJ 0x026D -00623 #define PIEJ 0x026E -00624 #define PIFJ 0x026F -00625 -00626 #define CAN4CTL0 0x0280 -00627 #define CAN4CTL1 0x0281 -00628 #define CAN4BTR0 0x0282 -00629 #define CAN4BTR1 0x0283 -00630 #define CAN4RFLG 0x0284 -00631 #define CAN4RIER 0x0285 -00632 #define CAN4TFLG 0x0286 -00633 #define CAN4TIER 0x0287 -00634 #define CAN4TARQ 0x0288 -00635 #define CAN4TAAK 0x0289 -00636 #define CAN4TBSEL 0x028A -00637 #define CAN4IDAC 0x028B -00638 -00639 #define CAN4RXERR 0x028E -00640 #define CAN4TXERR 0x028F -00641 #define CAN4IDAR0 0x0290 -00642 #define CAN4IDAR1 0x0291 -00643 #define CAN4IDAR2 0x0292 -00644 #define CAN4IDAR3 0x0293 -00645 #define CAN4IDMR0 0x0294 -00646 #define CAN4IDMR1 0x0295 -00647 #define CAN4IDMR2 0x0296 -00648 #define CAN4IDMR3 0x0297 -00649 #define CAN4IDAR4 0x0298 -00650 #define CAN4IDAR5 0x0299 -00651 #define CAN4IDAR6 0x029A -00652 #define CAN4IDAR7 0x029B -00653 #define CAN4IDMR4 0x029C -00654 #define CAN4IDMR5 0x029D -00655 #define CAN4IDMR6 0x029E -00656 #define CAN4IDMR7 0x029F -00657 -00658 #define CAN4RXFG0 0x02A0 -00659 #define CAN4RXFG1 0x02A1 -00660 #define CAN4RXFG2 0x02A2 -00661 #define CAN4RXFG3 0x02A3 -00662 #define CAN4RXFG4 0x02A4 -00663 #define CAN4RXFG5 0x02A5 -00664 #define CAN4RXFG6 0x02A6 -00665 #define CAN4RXFG7 0x02A7 -00666 #define CAN4RXFG8 0x02A8 -00667 #define CAN4RXFG9 0x02A9 -00668 #define CAN4RXFGA 0x02AA -00669 #define CAN4RXFGB 0x02AB -00670 #define CAN4RXFGC 0x02AC -00671 #define CAN4RXFGD 0x02AD -00672 #define CAN4RXFGE 0x02AE -00673 #define CAN4RXFGF 0x02AF -00674 #define CAN4TXFG0 0x02B0 -00675 #define CAN4TXFG1 0x02B1 -00676 #define CAN4TXFG2 0x02B2 -00677 #define CAN4TXFG3 0x02B3 -00678 #define CAN4TXFG4 0x02B4 -00679 #define CAN4TXFG5 0x02B5 -00680 #define CAN4TXFG6 0x02B6 -00681 #define CAN4TXFG7 0x02B7 -00682 #define CAN4TXFG8 0x02B8 -00683 #define CAN4TXFG9 0x02B9 -00684 #define CAN4TXFGA 0x02BA -00685 #define CAN4TXFGB 0x02BB -00686 #define CAN4TXFGC 0x02BC -00687 #define CAN4TXFGD 0x02BD -00688 #define CAN4TXFGE 0x02BE -00689 #define CAN4TXFGF 0x02BF -00690 -00691 -00692 -00693 /*********************************************** -00694 Constants for MSCAN -00695 ************************************************ -00696 */ -00697 -00698 #define CAN0 0x0140 /* First address for MSCAN0 */ -00699 #define CAN1 0x0180 /* First address for MSCAN1 */ -00700 #define CAN2 0x01C0 /* First address for MSCAN2 */ -00701 #define CAN3 0x0200 /* First address for MSCAN3 */ -00702 #define CAN4 0x0280 /* First address for MSCAN4 */ -00703 -00704 #define CANCTL0 0X00 /* Control register 0 */ -00705 #define CANCTL1 0X01 /* Control register 1 */ -00706 #define CANBTR0 0X02 /* Bus timing register 0 */ -00707 #define CANBTR1 0X03 /* Bus timing register 1 */ -00708 #define CANRFLG 0X04 /* Receiver flag register */ -00709 #define CANRIER 0X05 /* Enable interruptions when reception */ -00710 #define CANTFLG 0X06 /* Transmit flag register */ -00711 #define CANTIER 0X07 /* Enable interruptions when transmission */ -00712 #define CANTBSEL 0X0A /* Select foreground buffer for transmit */ -00713 #define CANIDAC 0x0B /* Identifier acceptance control register */ -00714 #define CANIDAR0 0x10 -00715 #define CANIDAR1 0x11 -00716 #define CANIDAR2 0x12 -00717 #define CANIDAR3 0x13 -00718 #define CANIDMR0 0x14 -00719 #define CANIDMR1 0x15 -00720 #define CANIDMR2 0x16 -00721 #define CANIDMR3 0x17 -00722 #define CANIDAR4 0x18 -00723 #define CANIDAR5 0x19 -00724 #define CANIDAR6 0x1A -00725 #define CANIDAR7 0x1B -00726 #define CANIDMR4 0x1C -00727 #define CANIDMR5 0x1D -00728 #define CANIDMR6 0x1E -00729 #define CANIDMR7 0x1F -00730 -00731 /* Received foreground buffer */ -00732 #define CANRCVID 0x20 /* Base of identifier registers */ -00733 #define CANRCVDTA 0x24 /* Base of data registers */ -00734 #define CANRCVLEN 0x2C /* Data length register */ -00735 -00736 /* Transmit foreground buffer */ -00737 #define CANTRSID 0x30 /* Base of identifier registers */ -00738 #define CANTRSDTA 0x34 /* Base of data registers */ -00739 #define CANTRSLEN 0x3C /* Data length register */ -00740 #define CANTRSPRI 0x3D /* Priority register */ -00741 -00742 -00743 /* Constants for serials port */ -00744 #define SCI0 0x00C8 -00745 #define SCI1 0x00D0 -00746 -00747 #define SCIBDH 0x00 -00748 #define SCIBDL 0x01 -00749 #define SCICR1 0x02 -00750 #define SCICR2 0x03 -00751 #define SCISR1 0x04 -00752 #define SCISR2 0x05 -00753 #define SCIDRH 0x06 -00754 #define SCIDRL 0x07 -00755 -00756 -00757 #endif /* __HCS12_PORTS__ */ -00758 -00759 -00760 -00761 -00762 -00763 -00764 -00765 -00766 -00767 -00768 -
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Defines | |
#define | PORTA 0x0000 |
#define | PORTB 0x0001 |
#define | DDRA 0x0002 |
#define | DDRB 0x0003 |
#define | PORTE 0x0008 |
#define | DDRE 0x0009 |
#define | PEAR 0x000A |
#define | MODE 0x000B |
#define | PUCR 0x000C |
#define | RDRIV 0x000D |
#define | EBICTL 0x000E |
#define | INITRM 0x0010 |
#define | INITRG 0x0011 |
#define | INITEE 0x0012 |
#define | MISC 0x0013 |
#define | MTST0 0x0014 |
#define | ITCR 0x0015 |
#define | ITEST 0x0016 |
#define | MTST1 0x0017 |
#define | PARTIDH 0x001A |
#define | PARTIDL 0x001B |
#define | MEMSIZ0 0x001C |
#define | MEMSIZ1 0x001D |
#define | INTCR 0x001E |
#define | HPRIO 0x001F |
#define | BKPCT0 0x0028 |
#define | BKPCT1 0x0029 |
#define | BKP0X 0x002A |
#define | BKP0H 0x002B |
#define | BKP0L 0x002C |
#define | BKP1X 0x002D |
#define | BKP1H 0x002E |
#define | BKP1L 0x002F |
#define | PPAGE 0x0030 |
#define | PORTK 0x0032 |
#define | DDRK 0x0033 |
#define | SYNR 0x0034 |
#define | REFDV 0x0035 |
#define | CTFLG 0x0036 |
#define | CRGFLG 0x0037 |
#define | CRGINT 0x0038 |
#define | CLKSEL 0x0039 |
#define | PLLCTL 0x003A |
#define | RTICTL 0x003B |
#define | COPCTL 0x003C |
#define | FORBYP 0x003D |
#define | CTCTL 0x003E |
#define | ARMCOP 0x003F |
#define | TIOS 0x0040 |
#define | TCFORC 0x0041 |
#define | TOC7M 0x0042 |
#define | TOC7D 0x0043 |
#define | TCNTH 0x0044 |
#define | TCNTL 0x0045 |
#define | TSCR1 0x0046 |
#define | TTOV 0x0047 |
#define | TCTL1 0x0048 |
#define | TCTL2 0x0049 |
#define | TCTL3 0x004A |
#define | TCTL4 0x004B |
#define | TIE 0x004C |
#define | TSCR2 0x004D |
#define | TFLG1 0x004E |
#define | TFLG2 0x004F |
#define | TC0H 0x0050 |
#define | TC0L 0x0051 |
#define | TC1H 0x0052 |
#define | TC1L 0x0053 |
#define | TC2H 0x0054 |
#define | TC2L 0x0055 |
#define | TC3H 0x0056 |
#define | TC3L 0x0057 |
#define | TC4H 0x0058 |
#define | TC4L 0x0059 |
#define | TC5H 0x005A |
#define | TC5L 0x005B |
#define | TC6H 0x005C |
#define | TC6L 0x005D |
#define | TC7H 0x005E |
#define | TC7L 0x005F |
#define | PACTL 0x0060 |
#define | PAFLG 0x0061 |
#define | PACN3H 0x0062 |
#define | PACN2L 0x0063 |
#define | PACN1H 0x0064 |
#define | PACN0L 0x0065 |
#define | MCCTL 0x0066 |
#define | MCFLG 0x0067 |
#define | ICPAR 0x0068 |
#define | DLYCT 0x0069 |
#define | ICOVW 0x006A |
#define | ICSYS 0x006B |
#define | TIMTST 0x006D |
#define | PBCTL 0x0070 |
#define | PBFLG 0x0071 |
#define | PA3H 0x0072 |
#define | PA2H 0x0073 |
#define | PA1H 0x0074 |
#define | PA0H 0x0075 |
#define | MCCNTH 0x0076 |
#define | MCCNTL 0x0077 |
#define | TC0HH 0x0078 |
#define | TC0HL 0x0079 |
#define | TC1HH 0x007A |
#define | TC1HL 0x007B |
#define | TC2HH 0x007C |
#define | TC2HL 0x007D |
#define | TC3HH 0x007E |
#define | ATD0CTL0 0x0080 |
#define | ATD00CTL1 0x0081 |
#define | ATD0CTL2 0x0082 |
#define | ATD0CTL3 0x0083 |
#define | ATD0CTL4 0x0084 |
#define | ATD0CTL5 0x0085 |
#define | ATD0STAT0 0x0086 |
#define | ATD0STAT1 0x0087 |
#define | ATD0TEST0 0x0088 |
#define | ATD0TEST1 0x0089 |
#define | ATD0DIEN 0x008D |
#define | PORTAD0 0x008F |
#define | ATD0DR0H 0x0090 |
#define | ATD0DR0L 0x0091 |
#define | ATD0DR1H 0x0092 |
#define | ATD0DR1L 0x0093 |
#define | ATD0DR2H 0x0094 |
#define | ATD0DR2L 0x0095 |
#define | ATD0DR3H 0x0096 |
#define | ATD0DR3L 0x0097 |
#define | ATD0DR4H 0x0098 |
#define | ATD0DR4L 0x0099 |
#define | ATD0DR5H 0x009A |
#define | ATD0DR5L 0x009B |
#define | ATD0DR6H 0x009C |
#define | ATD0DR6L 0x009D |
#define | ATD0DR7H 0x009E |
#define | ATD0DR7L 0x009F |
#define | PWME 0x00A0 |
#define | PWMPOL 0x00A1 |
#define | PWMCLK 0x00A2 |
#define | PWMPRCLK 0x00A3 |
#define | PWMCAE 0x00A4 |
#define | PWMCTL 0x00A5 |
#define | PWMTST 0x00A6 |
#define | PWMPRSC 0x00A7 |
#define | PWMSCLA 0x00A8 |
#define | PWMSCLB 0x00A9 |
#define | PWMSCNTA 0x00AA |
#define | PWMSCNTB 0x00AB |
#define | PWMCNT0 0x00AC |
#define | PWMCNT1 0x00AD |
#define | PWMCNT2 0x00AE |
#define | PWMCNT3 0x00AF |
#define | PWMCNT4 0x00B0 |
#define | PWMCNT5 0x00B1 |
#define | PWMCNT6 0x00B2 |
#define | PWMCNT7 0x00B3 |
#define | PWMPER0 0x00B4 |
#define | PWMPER1 0x00B5 |
#define | PWMPER2 0x00B6 |
#define | PWMPER3 0x00B7 |
#define | PWMPER4 0x00B8 |
#define | PWMPER5 0x00B9 |
#define | PWMPER6 0x00BA |
#define | PWMPER7 0x00BB |
#define | PWMDTY0 0x00BC |
#define | PWMDTY1 0x00BD |
#define | PWMDTY2 0x00BE |
#define | PWMDTY3 0x00BF |
#define | PWMDTY4 0x00C0 |
#define | PWMDTY5 0x00C1 |
#define | PWMDTY6 0x00C2 |
#define | PWMDTY7 0x00C3 |
#define | PWMSDN 0x00C4 |
#define | SCI0BDH 0x00C8 |
#define | SCI0BDL 0x00C9 |
#define | SC0CR1 0x00CA |
#define | SCI0CR2 0x00CB |
#define | SCI0SR1 0x00CC |
#define | SC0SR2 0x00CD |
#define | SCI0DRH 0x00CE |
#define | SCI0DRL 0x00CF |
#define | SCI1BDH 0x00D0 |
#define | SCI1BDL 0x00D1 |
#define | SC1CR1 0x00D2 |
#define | SCI1CR2 0x00D3 |
#define | SCI1SR1 0x00D4 |
#define | SC1SR2 0x00D5 |
#define | SCI1DRH 0x00D6 |
#define | SCI1DRL 0x00D7 |
#define | SPI0CR1 0x00D8 |
#define | SPI0CR2 0x00D9 |
#define | SPI0BR 0x00DA |
#define | SPI0SR 0x00DB |
#define | SPI0DR 0x00DD |
#define | IBAD 0x00E0 |
#define | IBFD 0x00E1 |
#define | IBCR 0x00E2 |
#define | IBSR 0x00E3 |
#define | IICDR 0x00E4 |
#define | DLCBCR1 0x00E8 |
#define | DLCBSVR 0x00E9 |
#define | DLCBCR2 0x00EA |
#define | DLCBDR 0x00EB |
#define | DLCBARD 0x00EC |
#define | DLCBRSR 0x00ED |
#define | DLCSCR 0x00EE |
#define | DLCBSTAT 0x00EF |
#define | SPI1CR1 0x00F0 |
#define | SPI1CR2 0x00F1 |
#define | SPI1BR 0x00F2 |
#define | SPI1SR 0x00F3 |
#define | SPI1DR 0x00F5 |
#define | SPI2CR1 0x00F8 |
#define | SPI2CR2 0x00F9 |
#define | SPI2BR 0x00FA |
#define | SPI2SR 0x00FB |
#define | SPI2DR 0x00FD |
#define | FCLKDIV 0x0100 |
#define | FSEC 0x0101 |
#define | FCNFG 0x0103 |
#define | FPROT 0x0104 |
#define | FSTAT 0x0105 |
#define | FCMD 0x0106 |
#define | ECLKDIV 0x0110 |
#define | ECNFG 0x0113 |
#define | EPROT 0x0114 |
#define | ESTAT 0x0115 |
#define | ECMD 0x0116 |
#define | ATD1CTL0 0x0120 |
#define | ATD1CTL1 0x0121 |
#define | ATD1CTL2 0x0122 |
#define | ATD1CTL3 0x0123 |
#define | ATD1CTL4 0x0124 |
#define | ATD1CTL5 0x0125 |
#define | ATD1STAT0 0x0126 |
#define | ATD1STAT1 0x0127 |
#define | ATD1TEST0 0x0128 |
#define | ATD1TEST1 0x0129 |
#define | ATDDIEN 0x012D |
#define | PORTAD1 0x012F |
#define | ATD1DR0H 0x0130 |
#define | ATD1DR0L 0x0131 |
#define | ATD1DR1H 0x0132 |
#define | ATD1DR1L 0x0133 |
#define | ATD1DR2H 0x0134 |
#define | ATD1DR2L 0x0135 |
#define | ATD1DR3H 0x0136 |
#define | ATD1DR3L 0x0137 |
#define | ATD1DR4H 0x0138 |
#define | ATD1DR4L 0x0139 |
#define | ATD1DR5H 0x013A |
#define | ATD1DR5L 0x013B |
#define | ATD1DR6H 0x013C |
#define | ATD1DR6L 0x013D |
#define | ATD1DR7H 0x013E |
#define | ATD1DR7L 0x013F |
#define | CAN0CTL0 0x0140 |
#define | CAN0CTL1 0x0141 |
#define | CAN0BTR0 0x0142 |
#define | CAN0BTR1 0x0143 |
#define | CAN0RFLG 0x0144 |
#define | CAN0RIER 0x0145 |
#define | CAN0TFLG 0x0146 |
#define | CAN0TIER 0x0147 |
#define | CAN0TARQ 0x0148 |
#define | CAN0TAAK 0x0149 |
#define | CAN0TBSEL 0x014A |
#define | CAN0IDAC 0x014B |
#define | CAN0RXERR 0x014E |
#define | CAN0TXERR 0x014F |
#define | CAN0IDAR0 0x0150 |
#define | CAN0IDAR1 0x0151 |
#define | CAN0IDAR2 0x0152 |
#define | CAN0IDAR3 0x0153 |
#define | CAN0IDMR0 0x0154 |
#define | CAN0IDMR1 0x0155 |
#define | CAN0IDMR2 0x0156 |
#define | CAN0IDMR3 0x0157 |
#define | CAN0IDAR4 0x0158 |
#define | CAN0IDAR5 0x0159 |
#define | CAN0IDAR6 0x015A |
#define | CAN0IDAR7 0x015B |
#define | CAN0IDMR4 0x015C |
#define | CAN0IDMR5 0x015D |
#define | CAN0IDMR6 0x015E |
#define | CAN0IDMR7 0x015F |
#define | CAN0RXFG0 0x0160 |
#define | CAN0RXFG1 0x0161 |
#define | CAN0RXFG2 0x0162 |
#define | CAN0RXFG3 0x0163 |
#define | CAN0RXFG4 0x0164 |
#define | CAN0RXFG5 0x0165 |
#define | CAN0RXFG6 0x0166 |
#define | CAN0RXFG7 0x0167 |
#define | CAN0RXFG8 0x0168 |
#define | CAN0RXFG9 0x0169 |
#define | CAN0RXFGA 0x016A |
#define | CAN0RXFGB 0x016B |
#define | CAN0RXFGC 0x016C |
#define | CAN0RXFGD 0x016D |
#define | CAN0RXFGE 0x016E |
#define | CAN0RXFGF 0x016F |
#define | CAN0TXFG0 0x0170 |
#define | CAN0TXFG1 0x0171 |
#define | CAN0TXFG2 0x0172 |
#define | CAN0TXFG3 0x0173 |
#define | CAN0TXFG4 0x0174 |
#define | CAN0TXFG5 0x0175 |
#define | CAN0TXFG6 0x0176 |
#define | CAN0TXFG7 0x0177 |
#define | CAN0TXFG8 0x0178 |
#define | CAN0TXFG9 0x0179 |
#define | CAN0TXFGA 0x017A |
#define | CAN0TXFGB 0x017B |
#define | CAN0TXFGC 0x017C |
#define | CAN0TXFGD 0x017D |
#define | CAN0TXFGE 0x017E |
#define | CAN0TXFGF 0x017F |
#define | CAN1CTL0 0x0180 |
#define | CAN1CTL1 0x0181 |
#define | CAN1BTR0 0x0182 |
#define | CAN1BTR1 0x0183 |
#define | CAN1RFLG 0x0184 |
#define | CAN1RIER 0x0185 |
#define | CAN1TFLG 0x0186 |
#define | CAN1TIER 0x0187 |
#define | CAN1TARQ 0x0188 |
#define | CAN1TAAK 0x0189 |
#define | CAN1TBSEL 0x018A |
#define | CAN1IDAC 0x018B |
#define | CAN1RXERR 0x018E |
#define | CAN1TXERR 0x018F |
#define | CAN1IDAR0 0x0190 |
#define | CAN1IDAR1 0x0191 |
#define | CAN1IDAR2 0x0192 |
#define | CAN1IDAR3 0x0193 |
#define | CAN1IDMR0 0x0194 |
#define | CAN1IDMR1 0x0195 |
#define | CAN1IDMR2 0x0196 |
#define | CAN1IDMR3 0x0197 |
#define | CAN1IDAR4 0x0198 |
#define | CAN1IDAR5 0x0199 |
#define | CAN1IDAR6 0x019A |
#define | CAN1IDAR7 0x019B |
#define | CAN1IDMR4 0x019C |
#define | CAN1IDMR5 0x019D |
#define | CAN1IDMR6 0x019E |
#define | CAN1IDMR7 0x019F |
#define | CAN1RXFG0 0x01A0 |
#define | CAN1RXFG1 0x01A1 |
#define | CAN1RXFG2 0x01A2 |
#define | CAN1RXFG3 0x01A3 |
#define | CAN1RXFG4 0x01A4 |
#define | CAN1RXFG5 0x01A5 |
#define | CAN1RXFG6 0x01A6 |
#define | CAN1RXFG7 0x01A7 |
#define | CAN1RXFG8 0x01A8 |
#define | CAN1RXFG9 0x01A9 |
#define | CAN1RXFGA 0x01AA |
#define | CAN1RXFGB 0x01AB |
#define | CAN1RXFGC 0x01AC |
#define | CAN1RXFGD 0x01AD |
#define | CAN1RXFGE 0x01AE |
#define | CAN1RXFGF 0x01AF |
#define | CAN1TXFG0 0x01B0 |
#define | CAN1TXFG1 0x01B1 |
#define | CAN1TXFG2 0x01B2 |
#define | CAN1TXFG3 0x01B3 |
#define | CAN1TXFG4 0x01B4 |
#define | CAN1TXFG5 0x01B5 |
#define | CAN1TXFG6 0x01B6 |
#define | CAN1TXFG7 0x01B7 |
#define | CAN1TXFG8 0x01B8 |
#define | CAN1TXFG9 0x01B9 |
#define | CAN1TXFGA 0x01BA |
#define | CAN1TXFGB 0x01BB |
#define | CAN1TXFGC 0x01BC |
#define | CAN1TXFGD 0x01BD |
#define | CAN1TXFGE 0x01BE |
#define | CAN1TXFGF 0x01BF |
#define | CAN2CTL0 0x01C0 |
#define | CAN2CTL1 0x01C1 |
#define | CAN2BTR0 0x01C2 |
#define | CAN2BTR1 0x01C3 |
#define | CAN2RFLG 0x01C4 |
#define | CAN2RIER 0x01C5 |
#define | CAN2TFLG 0x01C6 |
#define | CAN2TIER 0x01C7 |
#define | CAN2TARQ 0x01C8 |
#define | CAN2TAAK 0x01C9 |
#define | CAN2TBSEL 0x01CA |
#define | CAN2IDAC 0x01CB |
#define | CAN2RXERR 0x01CE |
#define | CAN2TXERR 0x01CF |
#define | CAN2IDAR0 0x01D0 |
#define | CAN2IDAR1 0x01D1 |
#define | CAN2IDAR2 0x01D2 |
#define | CAN2IDAR3 0x01D3 |
#define | CAN2IDMR0 0x01D4 |
#define | CAN2IDMR1 0x01D5 |
#define | CAN2IDMR2 0x01D6 |
#define | CAN2IDMR3 0x01D7 |
#define | CAN2IDAR4 0x01D8 |
#define | CAN2IDAR5 0x01D9 |
#define | CAN2IDAR6 0x01DA |
#define | CAN2IDAR7 0x01DB |
#define | CAN2IDMR4 0x01DC |
#define | CAN2IDMR5 0x01DD |
#define | CAN2IDMR6 0x01DE |
#define | CAN2IDMR7 0x01DF |
#define | CAN2RXFG0 0x01E0 |
#define | CAN2RXFG1 0x01E1 |
#define | CAN2RXFG2 0x01E2 |
#define | CAN2RXFG3 0x01E3 |
#define | CAN2RXFG4 0x01E4 |
#define | CAN2RXFG5 0x01E5 |
#define | CAN2RXFG6 0x01E6 |
#define | CAN2RXFG7 0x01E7 |
#define | CAN2RXFG8 0x01E8 |
#define | CAN2RXFG9 0x01E9 |
#define | CAN2RXFGA 0x01EA |
#define | CAN2RXFGB 0x01EB |
#define | CAN2RXFGC 0x01EC |
#define | CAN2RXFGD 0x01ED |
#define | CAN2RXFGE 0x01EE |
#define | CAN2RXFGF 0x01EF |
#define | CAN2TXFG0 0x01F0 |
#define | CAN2TXFG1 0x01F1 |
#define | CAN2TXFG2 0x01F2 |
#define | CAN2TXFG3 0x01F3 |
#define | CAN2TXFG4 0x01F4 |
#define | CAN2TXFG5 0x01F5 |
#define | CAN2TXFG6 0x01F6 |
#define | CAN2TXFG7 0x01F7 |
#define | CAN2TXFG8 0x01F8 |
#define | CAN2TXFG9 0x01F9 |
#define | CAN2TXFGA 0x01FA |
#define | CAN2TXFGB 0x01FB |
#define | CAN2TXFGC 0x01FC |
#define | CAN2TXFGD 0x01FD |
#define | CAN2TXFGE 0x01FE |
#define | CAN2TXFGF 0x01FF |
#define | CAN3CTL0 0x0200 |
#define | CAN3CTL1 0x0201 |
#define | CAN3BTR0 0x0202 |
#define | CAN3BTR1 0x0203 |
#define | CAN3RFLG 0x0204 |
#define | CAN3RIER 0x0205 |
#define | CAN3TFLG 0x0206 |
#define | CAN3TIER 0x0207 |
#define | CAN3TARQ 0x0208 |
#define | CAN3TAAK 0x0209 |
#define | CAN3TBSEL 0x020A |
#define | CAN3IDAC 0x020B |
#define | CAN3RXERR 0x020E |
#define | CAN3TXERR 0x020F |
#define | CAN3IDAR0 0x0210 |
#define | CAN3IDAR1 0x0211 |
#define | CAN3IDAR2 0x0212 |
#define | CAN3IDAR3 0x0213 |
#define | CAN3IDMR0 0x0214 |
#define | CAN3IDMR1 0x0215 |
#define | CAN3IDMR2 0x0216 |
#define | CAN3IDMR3 0x0217 |
#define | CAN3IDAR4 0x0218 |
#define | CAN3IDAR5 0x0219 |
#define | CAN3IDAR6 0x021A |
#define | CAN3IDAR7 0x021B |
#define | CAN3IDMR4 0x021C |
#define | CAN3IDMR5 0x021D |
#define | CAN3IDMR6 0x021E |
#define | CAN3IDMR7 0x021F |
#define | CAN3RXFG0 0x0220 |
#define | CAN3RXFG1 0x0221 |
#define | CAN3RXFG2 0x0222 |
#define | CAN3RXFG3 0x0223 |
#define | CAN3RXFG4 0x0224 |
#define | CAN3RXFG5 0x0225 |
#define | CAN3RXFG6 0x0226 |
#define | CAN3RXFG7 0x0227 |
#define | CAN3RXFG8 0x0228 |
#define | CAN3RXFG9 0x0229 |
#define | CAN3RXFGA 0x022A |
#define | CAN3RXFGB 0x022B |
#define | CAN3RXFGC 0x022C |
#define | CAN3RXFGD 0x022D |
#define | CAN3RXFGE 0x022E |
#define | CAN3RXFGF 0x022F |
#define | CAN3TXFG0 0x0230 |
#define | CAN3TXFG1 0x0231 |
#define | CAN3TXFG2 0x0232 |
#define | CAN3TXFG3 0x0233 |
#define | CAN3TXFG4 0x0234 |
#define | CAN3TXFG5 0x0235 |
#define | CAN3TXFG6 0x0236 |
#define | CAN3TXFG7 0x0237 |
#define | CAN3TXFG8 0x0238 |
#define | CAN3TXFG9 0x0239 |
#define | CAN3TXFGA 0x023A |
#define | CAN3TXFGB 0x023B |
#define | CAN3TXFGC 0x023C |
#define | CAN3TXFGD 0x023D |
#define | CAN3TXFGE 0x023E |
#define | CAN3TXFGF 0x023F |
#define | PTT 0x0240 |
#define | PTIT 0x0241 |
#define | DDRT 0x0242 |
#define | RDRT 0x0243 |
#define | PERT 0x0244 |
#define | PPST 0x0245 |
#define | PTS 0x0248 |
#define | PTIS 0x0249 |
#define | DDRS 0x024A |
#define | RDRS 0x024B |
#define | PERS 0x024C |
#define | PPSS 0x024D |
#define | WOMS 0x024E |
#define | PTM 0x0250 |
#define | PTIM 0x0251 |
#define | DDRM 0x0252 |
#define | RDRM 0x0253 |
#define | PERM 0x0254 |
#define | PPSM 0x0255 |
#define | WOMM 0x0256 |
#define | PTP 0x0258 |
#define | PTIP 0x0259 |
#define | DDRP 0x025A |
#define | RDRP 0x025B |
#define | PERP 0x025C |
#define | PPSP 0x025D |
#define | PIEP 0x025E |
#define | PIFP 0x025F |
#define | PTH 0x0260 |
#define | PTIH 0x0261 |
#define | DDRH 0x0262 |
#define | RDRH 0x0263 |
#define | PERH 0x0264 |
#define | PPSH 0x0265 |
#define | PIEH 0x0266 |
#define | PIFH 0x0267 |
#define | PTJ 0x0268 |
#define | PTIJ 0x0269 |
#define | DDRJ 0x026A |
#define | RDRJ 0x026B |
#define | PERJ 0x026C |
#define | PPSJ 0x026D |
#define | PIEJ 0x026E |
#define | PIFJ 0x026F |
#define | CAN4CTL0 0x0280 |
#define | CAN4CTL1 0x0281 |
#define | CAN4BTR0 0x0282 |
#define | CAN4BTR1 0x0283 |
#define | CAN4RFLG 0x0284 |
#define | CAN4RIER 0x0285 |
#define | CAN4TFLG 0x0286 |
#define | CAN4TIER 0x0287 |
#define | CAN4TARQ 0x0288 |
#define | CAN4TAAK 0x0289 |
#define | CAN4TBSEL 0x028A |
#define | CAN4IDAC 0x028B |
#define | CAN4RXERR 0x028E |
#define | CAN4TXERR 0x028F |
#define | CAN4IDAR0 0x0290 |
#define | CAN4IDAR1 0x0291 |
#define | CAN4IDAR2 0x0292 |
#define | CAN4IDAR3 0x0293 |
#define | CAN4IDMR0 0x0294 |
#define | CAN4IDMR1 0x0295 |
#define | CAN4IDMR2 0x0296 |
#define | CAN4IDMR3 0x0297 |
#define | CAN4IDAR4 0x0298 |
#define | CAN4IDAR5 0x0299 |
#define | CAN4IDAR6 0x029A |
#define | CAN4IDAR7 0x029B |
#define | CAN4IDMR4 0x029C |
#define | CAN4IDMR5 0x029D |
#define | CAN4IDMR6 0x029E |
#define | CAN4IDMR7 0x029F |
#define | CAN4RXFG0 0x02A0 |
#define | CAN4RXFG1 0x02A1 |
#define | CAN4RXFG2 0x02A2 |
#define | CAN4RXFG3 0x02A3 |
#define | CAN4RXFG4 0x02A4 |
#define | CAN4RXFG5 0x02A5 |
#define | CAN4RXFG6 0x02A6 |
#define | CAN4RXFG7 0x02A7 |
#define | CAN4RXFG8 0x02A8 |
#define | CAN4RXFG9 0x02A9 |
#define | CAN4RXFGA 0x02AA |
#define | CAN4RXFGB 0x02AB |
#define | CAN4RXFGC 0x02AC |
#define | CAN4RXFGD 0x02AD |
#define | CAN4RXFGE 0x02AE |
#define | CAN4RXFGF 0x02AF |
#define | CAN4TXFG0 0x02B0 |
#define | CAN4TXFG1 0x02B1 |
#define | CAN4TXFG2 0x02B2 |
#define | CAN4TXFG3 0x02B3 |
#define | CAN4TXFG4 0x02B4 |
#define | CAN4TXFG5 0x02B5 |
#define | CAN4TXFG6 0x02B6 |
#define | CAN4TXFG7 0x02B7 |
#define | CAN4TXFG8 0x02B8 |
#define | CAN4TXFG9 0x02B9 |
#define | CAN4TXFGA 0x02BA |
#define | CAN4TXFGB 0x02BB |
#define | CAN4TXFGC 0x02BC |
#define | CAN4TXFGD 0x02BD |
#define | CAN4TXFGE 0x02BE |
#define | CAN4TXFGF 0x02BF |
#define | CAN0 0x0140 |
#define | CAN1 0x0180 |
#define | CAN2 0x01C0 |
#define | CAN3 0x0200 |
#define | CAN4 0x0280 |
#define | CANCTL0 0X00 |
#define | CANCTL1 0X01 |
#define | CANBTR0 0X02 |
#define | CANBTR1 0X03 |
#define | CANRFLG 0X04 |
#define | CANRIER 0X05 |
#define | CANTFLG 0X06 |
#define | CANTIER 0X07 |
#define | CANTBSEL 0X0A |
#define | CANIDAC 0x0B |
#define | CANIDAR0 0x10 |
#define | CANIDAR1 0x11 |
#define | CANIDAR2 0x12 |
#define | CANIDAR3 0x13 |
#define | CANIDMR0 0x14 |
#define | CANIDMR1 0x15 |
#define | CANIDMR2 0x16 |
#define | CANIDMR3 0x17 |
#define | CANIDAR4 0x18 |
#define | CANIDAR5 0x19 |
#define | CANIDAR6 0x1A |
#define | CANIDAR7 0x1B |
#define | CANIDMR4 0x1C |
#define | CANIDMR5 0x1D |
#define | CANIDMR6 0x1E |
#define | CANIDMR7 0x1F |
#define | CANRCVID 0x20 |
#define | CANRCVDTA 0x24 |
#define | CANRCVLEN 0x2C |
#define | CANTRSID 0x30 |
#define | CANTRSDTA 0x34 |
#define | CANTRSLEN 0x3C |
#define | CANTRSPRI 0x3D |
#define | SCI0 0x00C8 |
#define | SCI1 0x00D0 |
#define | SCIBDH 0x00 |
#define | SCIBDL 0x01 |
#define | SCICR1 0x02 |
#define | SCICR2 0x03 |
#define | SCISR1 0x04 |
#define | SCISR2 0x05 |
#define | SCIDRH 0x06 |
#define | SCIDRL 0x07 |
#define ARMCOP 0x003F | -
#define ATD00CTL1 0x0081 | -
- -
-Definition at line 159 of file ports_def.h. -
#define ATD0CTL0 0x0080 | -
- -
-Definition at line 158 of file ports_def.h. -
#define ATD0CTL2 0x0082 | -
- -
-Definition at line 160 of file ports_def.h. -
#define ATD0CTL3 0x0083 | -
- -
-Definition at line 161 of file ports_def.h. -
#define ATD0CTL4 0x0084 | -
- -
-Definition at line 162 of file ports_def.h. -
#define ATD0CTL5 0x0085 | -
- -
-Definition at line 163 of file ports_def.h. -
#define ATD0DIEN 0x008D | -
- -
-Definition at line 169 of file ports_def.h. -
#define ATD0DR0H 0x0090 | -
- -
-Definition at line 172 of file ports_def.h. -
#define ATD0DR0L 0x0091 | -
- -
-Definition at line 173 of file ports_def.h. -
#define ATD0DR1H 0x0092 | -
- -
-Definition at line 174 of file ports_def.h. -
#define ATD0DR1L 0x0093 | -
- -
-Definition at line 175 of file ports_def.h. -
#define ATD0DR2H 0x0094 | -
- -
-Definition at line 176 of file ports_def.h. -
#define ATD0DR2L 0x0095 | -
- -
-Definition at line 177 of file ports_def.h. -
#define ATD0DR3H 0x0096 | -
- -
-Definition at line 178 of file ports_def.h. -
#define ATD0DR3L 0x0097 | -
- -
-Definition at line 179 of file ports_def.h. -
#define ATD0DR4H 0x0098 | -
- -
-Definition at line 180 of file ports_def.h. -
#define ATD0DR4L 0x0099 | -
- -
-Definition at line 181 of file ports_def.h. -
#define ATD0DR5H 0x009A | -
- -
-Definition at line 182 of file ports_def.h. -
#define ATD0DR5L 0x009B | -
- -
-Definition at line 183 of file ports_def.h. -
#define ATD0DR6H 0x009C | -
- -
-Definition at line 184 of file ports_def.h. -
#define ATD0DR6L 0x009D | -
- -
-Definition at line 185 of file ports_def.h. -
#define ATD0DR7H 0x009E | -
- -
-Definition at line 186 of file ports_def.h. -
#define ATD0DR7L 0x009F | -
- -
-Definition at line 187 of file ports_def.h. -
#define ATD0STAT0 0x0086 | -
- -
-Definition at line 164 of file ports_def.h. -
#define ATD0STAT1 0x0087 | -
- -
-Definition at line 165 of file ports_def.h. -
#define ATD0TEST0 0x0088 | -
- -
-Definition at line 166 of file ports_def.h. -
#define ATD0TEST1 0x0089 | -
- -
-Definition at line 167 of file ports_def.h. -
#define ATD1CTL0 0x0120 | -
- -
-Definition at line 292 of file ports_def.h. -
#define ATD1CTL1 0x0121 | -
- -
-Definition at line 293 of file ports_def.h. -
#define ATD1CTL2 0x0122 | -
- -
-Definition at line 294 of file ports_def.h. -
#define ATD1CTL3 0x0123 | -
- -
-Definition at line 295 of file ports_def.h. -
#define ATD1CTL4 0x0124 | -
- -
-Definition at line 296 of file ports_def.h. -
#define ATD1CTL5 0x0125 | -
- -
-Definition at line 297 of file ports_def.h. -
#define ATD1DR0H 0x0130 | -
- -
-Definition at line 306 of file ports_def.h. -
#define ATD1DR0L 0x0131 | -
- -
-Definition at line 307 of file ports_def.h. -
#define ATD1DR1H 0x0132 | -
- -
-Definition at line 308 of file ports_def.h. -
#define ATD1DR1L 0x0133 | -
- -
-Definition at line 309 of file ports_def.h. -
#define ATD1DR2H 0x0134 | -
- -
-Definition at line 310 of file ports_def.h. -
#define ATD1DR2L 0x0135 | -
- -
-Definition at line 311 of file ports_def.h. -
#define ATD1DR3H 0x0136 | -
- -
-Definition at line 312 of file ports_def.h. -
#define ATD1DR3L 0x0137 | -
- -
-Definition at line 313 of file ports_def.h. -
#define ATD1DR4H 0x0138 | -
- -
-Definition at line 314 of file ports_def.h. -
#define ATD1DR4L 0x0139 | -
- -
-Definition at line 315 of file ports_def.h. -
#define ATD1DR5H 0x013A | -
- -
-Definition at line 316 of file ports_def.h. -
#define ATD1DR5L 0x013B | -
- -
-Definition at line 317 of file ports_def.h. -
#define ATD1DR6H 0x013C | -
- -
-Definition at line 318 of file ports_def.h. -
#define ATD1DR6L 0x013D | -
- -
-Definition at line 319 of file ports_def.h. -
#define ATD1DR7H 0x013E | -
- -
-Definition at line 320 of file ports_def.h. -
#define ATD1DR7L 0x013F | -
- -
-Definition at line 321 of file ports_def.h. -
#define ATD1STAT0 0x0126 | -
- -
-Definition at line 298 of file ports_def.h. -
#define ATD1STAT1 0x0127 | -
- -
-Definition at line 299 of file ports_def.h. -
#define ATD1TEST0 0x0128 | -
- -
-Definition at line 300 of file ports_def.h. -
#define ATD1TEST1 0x0129 | -
- -
-Definition at line 301 of file ports_def.h. -
#define ATDDIEN 0x012D | -
- -
-Definition at line 303 of file ports_def.h. -
#define BKP0H 0x002B | -
- -
-Definition at line 74 of file ports_def.h. -
#define BKP0L 0x002C | -
- -
-Definition at line 75 of file ports_def.h. -
#define BKP0X 0x002A | -
- -
-Definition at line 73 of file ports_def.h. -
#define BKP1H 0x002E | -
- -
-Definition at line 77 of file ports_def.h. -
#define BKP1L 0x002F | -
- -
-Definition at line 78 of file ports_def.h. -
#define BKP1X 0x002D | -
- -
-Definition at line 76 of file ports_def.h. -
#define BKPCT0 0x0028 | -
- -
-Definition at line 71 of file ports_def.h. -
#define BKPCT1 0x0029 | -
- -
-Definition at line 72 of file ports_def.h. -
#define CAN0 0x0140 | -
#define CAN0BTR0 0x0142 | -
- -
-Definition at line 324 of file ports_def.h. -
#define CAN0BTR1 0x0143 | -
- -
-Definition at line 325 of file ports_def.h. -
#define CAN0CTL0 0x0140 | -
- -
-Definition at line 322 of file ports_def.h. -
#define CAN0CTL1 0x0141 | -
- -
-Definition at line 323 of file ports_def.h. -
#define CAN0IDAC 0x014B | -
- -
-Definition at line 333 of file ports_def.h. -
#define CAN0IDAR0 0x0150 | -
- -
-Definition at line 337 of file ports_def.h. -
#define CAN0IDAR1 0x0151 | -
- -
-Definition at line 338 of file ports_def.h. -
#define CAN0IDAR2 0x0152 | -
- -
-Definition at line 339 of file ports_def.h. -
#define CAN0IDAR3 0x0153 | -
- -
-Definition at line 340 of file ports_def.h. -
#define CAN0IDAR4 0x0158 | -
- -
-Definition at line 345 of file ports_def.h. -
#define CAN0IDAR5 0x0159 | -
- -
-Definition at line 346 of file ports_def.h. -
#define CAN0IDAR6 0x015A | -
- -
-Definition at line 347 of file ports_def.h. -
#define CAN0IDAR7 0x015B | -
- -
-Definition at line 348 of file ports_def.h. -
#define CAN0IDMR0 0x0154 | -
- -
-Definition at line 341 of file ports_def.h. -
#define CAN0IDMR1 0x0155 | -
- -
-Definition at line 342 of file ports_def.h. -
#define CAN0IDMR2 0x0156 | -
- -
-Definition at line 343 of file ports_def.h. -
#define CAN0IDMR3 0x0157 | -
- -
-Definition at line 344 of file ports_def.h. -
#define CAN0IDMR4 0x015C | -
- -
-Definition at line 349 of file ports_def.h. -
#define CAN0IDMR5 0x015D | -
- -
-Definition at line 350 of file ports_def.h. -
#define CAN0IDMR6 0x015E | -
- -
-Definition at line 351 of file ports_def.h. -
#define CAN0IDMR7 0x015F | -
- -
-Definition at line 352 of file ports_def.h. -
#define CAN0RFLG 0x0144 | -
- -
-Definition at line 326 of file ports_def.h. -
#define CAN0RIER 0x0145 | -
- -
-Definition at line 327 of file ports_def.h. -
#define CAN0RXERR 0x014E | -
- -
-Definition at line 335 of file ports_def.h. -
#define CAN0RXFG0 0x0160 | -
- -
-Definition at line 353 of file ports_def.h. -
#define CAN0RXFG1 0x0161 | -
- -
-Definition at line 354 of file ports_def.h. -
#define CAN0RXFG2 0x0162 | -
- -
-Definition at line 355 of file ports_def.h. -
#define CAN0RXFG3 0x0163 | -
- -
-Definition at line 356 of file ports_def.h. -
#define CAN0RXFG4 0x0164 | -
- -
-Definition at line 357 of file ports_def.h. -
#define CAN0RXFG5 0x0165 | -
- -
-Definition at line 358 of file ports_def.h. -
#define CAN0RXFG6 0x0166 | -
- -
-Definition at line 359 of file ports_def.h. -
#define CAN0RXFG7 0x0167 | -
- -
-Definition at line 360 of file ports_def.h. -
#define CAN0RXFG8 0x0168 | -
- -
-Definition at line 361 of file ports_def.h. -
#define CAN0RXFG9 0x0169 | -
- -
-Definition at line 362 of file ports_def.h. -
#define CAN0RXFGA 0x016A | -
- -
-Definition at line 363 of file ports_def.h. -
#define CAN0RXFGB 0x016B | -
- -
-Definition at line 364 of file ports_def.h. -
#define CAN0RXFGC 0x016C | -
- -
-Definition at line 365 of file ports_def.h. -
#define CAN0RXFGD 0x016D | -
- -
-Definition at line 366 of file ports_def.h. -
#define CAN0RXFGE 0x016E | -
- -
-Definition at line 367 of file ports_def.h. -
#define CAN0RXFGF 0x016F | -
- -
-Definition at line 368 of file ports_def.h. -
#define CAN0TAAK 0x0149 | -
- -
-Definition at line 331 of file ports_def.h. -
#define CAN0TARQ 0x0148 | -
- -
-Definition at line 330 of file ports_def.h. -
#define CAN0TBSEL 0x014A | -
- -
-Definition at line 332 of file ports_def.h. -
#define CAN0TFLG 0x0146 | -
- -
-Definition at line 328 of file ports_def.h. -
#define CAN0TIER 0x0147 | -
- -
-Definition at line 329 of file ports_def.h. -
#define CAN0TXERR 0x014F | -
- -
-Definition at line 336 of file ports_def.h. -
#define CAN0TXFG0 0x0170 | -
- -
-Definition at line 369 of file ports_def.h. -
#define CAN0TXFG1 0x0171 | -
- -
-Definition at line 370 of file ports_def.h. -
#define CAN0TXFG2 0x0172 | -
- -
-Definition at line 371 of file ports_def.h. -
#define CAN0TXFG3 0x0173 | -
- -
-Definition at line 372 of file ports_def.h. -
#define CAN0TXFG4 0x0174 | -
- -
-Definition at line 373 of file ports_def.h. -
#define CAN0TXFG5 0x0175 | -
- -
-Definition at line 374 of file ports_def.h. -
#define CAN0TXFG6 0x0176 | -
- -
-Definition at line 375 of file ports_def.h. -
#define CAN0TXFG7 0x0177 | -
- -
-Definition at line 376 of file ports_def.h. -
#define CAN0TXFG8 0x0178 | -
- -
-Definition at line 377 of file ports_def.h. -
#define CAN0TXFG9 0x0179 | -
- -
-Definition at line 378 of file ports_def.h. -
#define CAN0TXFGA 0x017A | -
- -
-Definition at line 379 of file ports_def.h. -
#define CAN0TXFGB 0x017B | -
- -
-Definition at line 380 of file ports_def.h. -
#define CAN0TXFGC 0x017C | -
- -
-Definition at line 381 of file ports_def.h. -
#define CAN0TXFGD 0x017D | -
- -
-Definition at line 382 of file ports_def.h. -
#define CAN0TXFGE 0x017E | -
- -
-Definition at line 383 of file ports_def.h. -
#define CAN0TXFGF 0x017F | -
- -
-Definition at line 384 of file ports_def.h. -
#define CAN1 0x0180 | -
#define CAN1BTR0 0x0182 | -
- -
-Definition at line 388 of file ports_def.h. -
#define CAN1BTR1 0x0183 | -
- -
-Definition at line 389 of file ports_def.h. -
#define CAN1CTL0 0x0180 | -
- -
-Definition at line 386 of file ports_def.h. -
#define CAN1CTL1 0x0181 | -
- -
-Definition at line 387 of file ports_def.h. -
#define CAN1IDAC 0x018B | -
- -
-Definition at line 397 of file ports_def.h. -
#define CAN1IDAR0 0x0190 | -
- -
-Definition at line 400 of file ports_def.h. -
#define CAN1IDAR1 0x0191 | -
- -
-Definition at line 401 of file ports_def.h. -
#define CAN1IDAR2 0x0192 | -
- -
-Definition at line 402 of file ports_def.h. -
#define CAN1IDAR3 0x0193 | -
- -
-Definition at line 403 of file ports_def.h. -
#define CAN1IDAR4 0x0198 | -
- -
-Definition at line 408 of file ports_def.h. -
#define CAN1IDAR5 0x0199 | -
- -
-Definition at line 409 of file ports_def.h. -
#define CAN1IDAR6 0x019A | -
- -
-Definition at line 410 of file ports_def.h. -
#define CAN1IDAR7 0x019B | -
- -
-Definition at line 411 of file ports_def.h. -
#define CAN1IDMR0 0x0194 | -
- -
-Definition at line 404 of file ports_def.h. -
#define CAN1IDMR1 0x0195 | -
- -
-Definition at line 405 of file ports_def.h. -
#define CAN1IDMR2 0x0196 | -
- -
-Definition at line 406 of file ports_def.h. -
#define CAN1IDMR3 0x0197 | -
- -
-Definition at line 407 of file ports_def.h. -
#define CAN1IDMR4 0x019C | -
- -
-Definition at line 412 of file ports_def.h. -
#define CAN1IDMR5 0x019D | -
- -
-Definition at line 413 of file ports_def.h. -
#define CAN1IDMR6 0x019E | -
- -
-Definition at line 414 of file ports_def.h. -
#define CAN1IDMR7 0x019F | -
- -
-Definition at line 415 of file ports_def.h. -
#define CAN1RFLG 0x0184 | -
- -
-Definition at line 390 of file ports_def.h. -
#define CAN1RIER 0x0185 | -
- -
-Definition at line 391 of file ports_def.h. -
#define CAN1RXERR 0x018E | -
- -
-Definition at line 398 of file ports_def.h. -
#define CAN1RXFG0 0x01A0 | -
- -
-Definition at line 417 of file ports_def.h. -
#define CAN1RXFG1 0x01A1 | -
- -
-Definition at line 418 of file ports_def.h. -
#define CAN1RXFG2 0x01A2 | -
- -
-Definition at line 419 of file ports_def.h. -
#define CAN1RXFG3 0x01A3 | -
- -
-Definition at line 420 of file ports_def.h. -
#define CAN1RXFG4 0x01A4 | -
- -
-Definition at line 421 of file ports_def.h. -
#define CAN1RXFG5 0x01A5 | -
- -
-Definition at line 422 of file ports_def.h. -
#define CAN1RXFG6 0x01A6 | -
- -
-Definition at line 423 of file ports_def.h. -
#define CAN1RXFG7 0x01A7 | -
- -
-Definition at line 424 of file ports_def.h. -
#define CAN1RXFG8 0x01A8 | -
- -
-Definition at line 425 of file ports_def.h. -
#define CAN1RXFG9 0x01A9 | -
- -
-Definition at line 426 of file ports_def.h. -
#define CAN1RXFGA 0x01AA | -
- -
-Definition at line 427 of file ports_def.h. -
#define CAN1RXFGB 0x01AB | -
- -
-Definition at line 428 of file ports_def.h. -
#define CAN1RXFGC 0x01AC | -
- -
-Definition at line 429 of file ports_def.h. -
#define CAN1RXFGD 0x01AD | -
- -
-Definition at line 430 of file ports_def.h. -
#define CAN1RXFGE 0x01AE | -
- -
-Definition at line 431 of file ports_def.h. -
#define CAN1RXFGF 0x01AF | -
- -
-Definition at line 432 of file ports_def.h. -
#define CAN1TAAK 0x0189 | -
- -
-Definition at line 395 of file ports_def.h. -
#define CAN1TARQ 0x0188 | -
- -
-Definition at line 394 of file ports_def.h. -
#define CAN1TBSEL 0x018A | -
- -
-Definition at line 396 of file ports_def.h. -
#define CAN1TFLG 0x0186 | -
- -
-Definition at line 392 of file ports_def.h. -
#define CAN1TIER 0x0187 | -
- -
-Definition at line 393 of file ports_def.h. -
#define CAN1TXERR 0x018F | -
- -
-Definition at line 399 of file ports_def.h. -
#define CAN1TXFG0 0x01B0 | -
- -
-Definition at line 433 of file ports_def.h. -
#define CAN1TXFG1 0x01B1 | -
- -
-Definition at line 434 of file ports_def.h. -
#define CAN1TXFG2 0x01B2 | -
- -
-Definition at line 435 of file ports_def.h. -
#define CAN1TXFG3 0x01B3 | -
- -
-Definition at line 436 of file ports_def.h. -
#define CAN1TXFG4 0x01B4 | -
- -
-Definition at line 437 of file ports_def.h. -
#define CAN1TXFG5 0x01B5 | -
- -
-Definition at line 438 of file ports_def.h. -
#define CAN1TXFG6 0x01B6 | -
- -
-Definition at line 439 of file ports_def.h. -
#define CAN1TXFG7 0x01B7 | -
- -
-Definition at line 440 of file ports_def.h. -
#define CAN1TXFG8 0x01B8 | -
- -
-Definition at line 441 of file ports_def.h. -
#define CAN1TXFG9 0x01B9 | -
- -
-Definition at line 442 of file ports_def.h. -
#define CAN1TXFGA 0x01BA | -
- -
-Definition at line 443 of file ports_def.h. -
#define CAN1TXFGB 0x01BB | -
- -
-Definition at line 444 of file ports_def.h. -
#define CAN1TXFGC 0x01BC | -
- -
-Definition at line 445 of file ports_def.h. -
#define CAN1TXFGD 0x01BD | -
- -
-Definition at line 446 of file ports_def.h. -
#define CAN1TXFGE 0x01BE | -
- -
-Definition at line 447 of file ports_def.h. -
#define CAN1TXFGF 0x01BF | -
- -
-Definition at line 448 of file ports_def.h. -
#define CAN2 0x01C0 | -
#define CAN2BTR0 0x01C2 | -
- -
-Definition at line 451 of file ports_def.h. -
#define CAN2BTR1 0x01C3 | -
- -
-Definition at line 452 of file ports_def.h. -
#define CAN2CTL0 0x01C0 | -
- -
-Definition at line 449 of file ports_def.h. -
#define CAN2CTL1 0x01C1 | -
- -
-Definition at line 450 of file ports_def.h. -
#define CAN2IDAC 0x01CB | -
- -
-Definition at line 460 of file ports_def.h. -
#define CAN2IDAR0 0x01D0 | -
- -
-Definition at line 464 of file ports_def.h. -
#define CAN2IDAR1 0x01D1 | -
- -
-Definition at line 465 of file ports_def.h. -
#define CAN2IDAR2 0x01D2 | -
- -
-Definition at line 466 of file ports_def.h. -
#define CAN2IDAR3 0x01D3 | -
- -
-Definition at line 467 of file ports_def.h. -
#define CAN2IDAR4 0x01D8 | -
- -
-Definition at line 472 of file ports_def.h. -
#define CAN2IDAR5 0x01D9 | -
- -
-Definition at line 473 of file ports_def.h. -
#define CAN2IDAR6 0x01DA | -
- -
-Definition at line 474 of file ports_def.h. -
#define CAN2IDAR7 0x01DB | -
- -
-Definition at line 475 of file ports_def.h. -
#define CAN2IDMR0 0x01D4 | -
- -
-Definition at line 468 of file ports_def.h. -
#define CAN2IDMR1 0x01D5 | -
- -
-Definition at line 469 of file ports_def.h. -
#define CAN2IDMR2 0x01D6 | -
- -
-Definition at line 470 of file ports_def.h. -
#define CAN2IDMR3 0x01D7 | -
- -
-Definition at line 471 of file ports_def.h. -
#define CAN2IDMR4 0x01DC | -
- -
-Definition at line 476 of file ports_def.h. -
#define CAN2IDMR5 0x01DD | -
- -
-Definition at line 477 of file ports_def.h. -
#define CAN2IDMR6 0x01DE | -
- -
-Definition at line 478 of file ports_def.h. -
#define CAN2IDMR7 0x01DF | -
- -
-Definition at line 479 of file ports_def.h. -
#define CAN2RFLG 0x01C4 | -
- -
-Definition at line 453 of file ports_def.h. -
#define CAN2RIER 0x01C5 | -
- -
-Definition at line 454 of file ports_def.h. -
#define CAN2RXERR 0x01CE | -
- -
-Definition at line 462 of file ports_def.h. -
#define CAN2RXFG0 0x01E0 | -
- -
-Definition at line 480 of file ports_def.h. -
#define CAN2RXFG1 0x01E1 | -
- -
-Definition at line 481 of file ports_def.h. -
#define CAN2RXFG2 0x01E2 | -
- -
-Definition at line 482 of file ports_def.h. -
#define CAN2RXFG3 0x01E3 | -
- -
-Definition at line 483 of file ports_def.h. -
#define CAN2RXFG4 0x01E4 | -
- -
-Definition at line 484 of file ports_def.h. -
#define CAN2RXFG5 0x01E5 | -
- -
-Definition at line 485 of file ports_def.h. -
#define CAN2RXFG6 0x01E6 | -
- -
-Definition at line 486 of file ports_def.h. -
#define CAN2RXFG7 0x01E7 | -
- -
-Definition at line 487 of file ports_def.h. -
#define CAN2RXFG8 0x01E8 | -
- -
-Definition at line 488 of file ports_def.h. -
#define CAN2RXFG9 0x01E9 | -
- -
-Definition at line 489 of file ports_def.h. -
#define CAN2RXFGA 0x01EA | -
- -
-Definition at line 490 of file ports_def.h. -
#define CAN2RXFGB 0x01EB | -
- -
-Definition at line 491 of file ports_def.h. -
#define CAN2RXFGC 0x01EC | -
- -
-Definition at line 492 of file ports_def.h. -
#define CAN2RXFGD 0x01ED | -
- -
-Definition at line 493 of file ports_def.h. -
#define CAN2RXFGE 0x01EE | -
- -
-Definition at line 494 of file ports_def.h. -
#define CAN2RXFGF 0x01EF | -
- -
-Definition at line 495 of file ports_def.h. -
#define CAN2TAAK 0x01C9 | -
- -
-Definition at line 458 of file ports_def.h. -
#define CAN2TARQ 0x01C8 | -
- -
-Definition at line 457 of file ports_def.h. -
#define CAN2TBSEL 0x01CA | -
- -
-Definition at line 459 of file ports_def.h. -
#define CAN2TFLG 0x01C6 | -
- -
-Definition at line 455 of file ports_def.h. -
#define CAN2TIER 0x01C7 | -
- -
-Definition at line 456 of file ports_def.h. -
#define CAN2TXERR 0x01CF | -
- -
-Definition at line 463 of file ports_def.h. -
#define CAN2TXFG0 0x01F0 | -
- -
-Definition at line 496 of file ports_def.h. -
#define CAN2TXFG1 0x01F1 | -
- -
-Definition at line 497 of file ports_def.h. -
#define CAN2TXFG2 0x01F2 | -
- -
-Definition at line 498 of file ports_def.h. -
#define CAN2TXFG3 0x01F3 | -
- -
-Definition at line 499 of file ports_def.h. -
#define CAN2TXFG4 0x01F4 | -
- -
-Definition at line 500 of file ports_def.h. -
#define CAN2TXFG5 0x01F5 | -
- -
-Definition at line 501 of file ports_def.h. -
#define CAN2TXFG6 0x01F6 | -
- -
-Definition at line 502 of file ports_def.h. -
#define CAN2TXFG7 0x01F7 | -
- -
-Definition at line 503 of file ports_def.h. -
#define CAN2TXFG8 0x01F8 | -
- -
-Definition at line 504 of file ports_def.h. -
#define CAN2TXFG9 0x01F9 | -
- -
-Definition at line 505 of file ports_def.h. -
#define CAN2TXFGA 0x01FA | -
- -
-Definition at line 506 of file ports_def.h. -
#define CAN2TXFGB 0x01FB | -
- -
-Definition at line 507 of file ports_def.h. -
#define CAN2TXFGC 0x01FC | -
- -
-Definition at line 508 of file ports_def.h. -
#define CAN2TXFGD 0x01FD | -
- -
-Definition at line 509 of file ports_def.h. -
#define CAN2TXFGE 0x01FE | -
- -
-Definition at line 510 of file ports_def.h. -
#define CAN2TXFGF 0x01FF | -
- -
-Definition at line 511 of file ports_def.h. -
#define CAN3 0x0200 | -
#define CAN3BTR0 0x0202 | -
- -
-Definition at line 515 of file ports_def.h. -
#define CAN3BTR1 0x0203 | -
- -
-Definition at line 516 of file ports_def.h. -
#define CAN3CTL0 0x0200 | -
- -
-Definition at line 513 of file ports_def.h. -
#define CAN3CTL1 0x0201 | -
- -
-Definition at line 514 of file ports_def.h. -
#define CAN3IDAC 0x020B | -
- -
-Definition at line 524 of file ports_def.h. -
#define CAN3IDAR0 0x0210 | -
- -
-Definition at line 528 of file ports_def.h. -
#define CAN3IDAR1 0x0211 | -
- -
-Definition at line 529 of file ports_def.h. -
#define CAN3IDAR2 0x0212 | -
- -
-Definition at line 530 of file ports_def.h. -
#define CAN3IDAR3 0x0213 | -
- -
-Definition at line 531 of file ports_def.h. -
#define CAN3IDAR4 0x0218 | -
- -
-Definition at line 536 of file ports_def.h. -
#define CAN3IDAR5 0x0219 | -
- -
-Definition at line 537 of file ports_def.h. -
#define CAN3IDAR6 0x021A | -
- -
-Definition at line 538 of file ports_def.h. -
#define CAN3IDAR7 0x021B | -
- -
-Definition at line 539 of file ports_def.h. -
#define CAN3IDMR0 0x0214 | -
- -
-Definition at line 532 of file ports_def.h. -
#define CAN3IDMR1 0x0215 | -
- -
-Definition at line 533 of file ports_def.h. -
#define CAN3IDMR2 0x0216 | -
- -
-Definition at line 534 of file ports_def.h. -
#define CAN3IDMR3 0x0217 | -
- -
-Definition at line 535 of file ports_def.h. -
#define CAN3IDMR4 0x021C | -
- -
-Definition at line 540 of file ports_def.h. -
#define CAN3IDMR5 0x021D | -
- -
-Definition at line 541 of file ports_def.h. -
#define CAN3IDMR6 0x021E | -
- -
-Definition at line 542 of file ports_def.h. -
#define CAN3IDMR7 0x021F | -
- -
-Definition at line 543 of file ports_def.h. -
#define CAN3RFLG 0x0204 | -
- -
-Definition at line 517 of file ports_def.h. -
#define CAN3RIER 0x0205 | -
- -
-Definition at line 518 of file ports_def.h. -
#define CAN3RXERR 0x020E | -
- -
-Definition at line 526 of file ports_def.h. -
#define CAN3RXFG0 0x0220 | -
- -
-Definition at line 545 of file ports_def.h. -
#define CAN3RXFG1 0x0221 | -
- -
-Definition at line 546 of file ports_def.h. -
#define CAN3RXFG2 0x0222 | -
- -
-Definition at line 547 of file ports_def.h. -
#define CAN3RXFG3 0x0223 | -
- -
-Definition at line 548 of file ports_def.h. -
#define CAN3RXFG4 0x0224 | -
- -
-Definition at line 549 of file ports_def.h. -
#define CAN3RXFG5 0x0225 | -
- -
-Definition at line 550 of file ports_def.h. -
#define CAN3RXFG6 0x0226 | -
- -
-Definition at line 551 of file ports_def.h. -
#define CAN3RXFG7 0x0227 | -
- -
-Definition at line 552 of file ports_def.h. -
#define CAN3RXFG8 0x0228 | -
- -
-Definition at line 553 of file ports_def.h. -
#define CAN3RXFG9 0x0229 | -
- -
-Definition at line 554 of file ports_def.h. -
#define CAN3RXFGA 0x022A | -
- -
-Definition at line 555 of file ports_def.h. -
#define CAN3RXFGB 0x022B | -
- -
-Definition at line 556 of file ports_def.h. -
#define CAN3RXFGC 0x022C | -
- -
-Definition at line 557 of file ports_def.h. -
#define CAN3RXFGD 0x022D | -
- -
-Definition at line 558 of file ports_def.h. -
#define CAN3RXFGE 0x022E | -
- -
-Definition at line 559 of file ports_def.h. -
#define CAN3RXFGF 0x022F | -
- -
-Definition at line 560 of file ports_def.h. -
#define CAN3TAAK 0x0209 | -
- -
-Definition at line 522 of file ports_def.h. -
#define CAN3TARQ 0x0208 | -
- -
-Definition at line 521 of file ports_def.h. -
#define CAN3TBSEL 0x020A | -
- -
-Definition at line 523 of file ports_def.h. -
#define CAN3TFLG 0x0206 | -
- -
-Definition at line 519 of file ports_def.h. -
#define CAN3TIER 0x0207 | -
- -
-Definition at line 520 of file ports_def.h. -
#define CAN3TXERR 0x020F | -
- -
-Definition at line 527 of file ports_def.h. -
#define CAN3TXFG0 0x0230 | -
- -
-Definition at line 561 of file ports_def.h. -
#define CAN3TXFG1 0x0231 | -
- -
-Definition at line 562 of file ports_def.h. -
#define CAN3TXFG2 0x0232 | -
- -
-Definition at line 563 of file ports_def.h. -
#define CAN3TXFG3 0x0233 | -
- -
-Definition at line 564 of file ports_def.h. -
#define CAN3TXFG4 0x0234 | -
- -
-Definition at line 565 of file ports_def.h. -
#define CAN3TXFG5 0x0235 | -
- -
-Definition at line 566 of file ports_def.h. -
#define CAN3TXFG6 0x0236 | -
- -
-Definition at line 567 of file ports_def.h. -
#define CAN3TXFG7 0x0237 | -
- -
-Definition at line 568 of file ports_def.h. -
#define CAN3TXFG8 0x0238 | -
- -
-Definition at line 569 of file ports_def.h. -
#define CAN3TXFG9 0x0239 | -
- -
-Definition at line 570 of file ports_def.h. -
#define CAN3TXFGA 0x023A | -
- -
-Definition at line 571 of file ports_def.h. -
#define CAN3TXFGB 0x023B | -
- -
-Definition at line 572 of file ports_def.h. -
#define CAN3TXFGC 0x023C | -
- -
-Definition at line 573 of file ports_def.h. -
#define CAN3TXFGD 0x023D | -
- -
-Definition at line 574 of file ports_def.h. -
#define CAN3TXFGE 0x023E | -
- -
-Definition at line 575 of file ports_def.h. -
#define CAN3TXFGF 0x023F | -
- -
-Definition at line 576 of file ports_def.h. -
#define CAN4 0x0280 | -
#define CAN4BTR0 0x0282 | -
- -
-Definition at line 628 of file ports_def.h. -
#define CAN4BTR1 0x0283 | -
- -
-Definition at line 629 of file ports_def.h. -
#define CAN4CTL0 0x0280 | -
- -
-Definition at line 626 of file ports_def.h. -
#define CAN4CTL1 0x0281 | -
- -
-Definition at line 627 of file ports_def.h. -
#define CAN4IDAC 0x028B | -
- -
-Definition at line 637 of file ports_def.h. -
#define CAN4IDAR0 0x0290 | -
- -
-Definition at line 641 of file ports_def.h. -
#define CAN4IDAR1 0x0291 | -
- -
-Definition at line 642 of file ports_def.h. -
#define CAN4IDAR2 0x0292 | -
- -
-Definition at line 643 of file ports_def.h. -
#define CAN4IDAR3 0x0293 | -
- -
-Definition at line 644 of file ports_def.h. -
#define CAN4IDAR4 0x0298 | -
- -
-Definition at line 649 of file ports_def.h. -
#define CAN4IDAR5 0x0299 | -
- -
-Definition at line 650 of file ports_def.h. -
#define CAN4IDAR6 0x029A | -
- -
-Definition at line 651 of file ports_def.h. -
#define CAN4IDAR7 0x029B | -
- -
-Definition at line 652 of file ports_def.h. -
#define CAN4IDMR0 0x0294 | -
- -
-Definition at line 645 of file ports_def.h. -
#define CAN4IDMR1 0x0295 | -
- -
-Definition at line 646 of file ports_def.h. -
#define CAN4IDMR2 0x0296 | -
- -
-Definition at line 647 of file ports_def.h. -
#define CAN4IDMR3 0x0297 | -
- -
-Definition at line 648 of file ports_def.h. -
#define CAN4IDMR4 0x029C | -
- -
-Definition at line 653 of file ports_def.h. -
#define CAN4IDMR5 0x029D | -
- -
-Definition at line 654 of file ports_def.h. -
#define CAN4IDMR6 0x029E | -
- -
-Definition at line 655 of file ports_def.h. -
#define CAN4IDMR7 0x029F | -
- -
-Definition at line 656 of file ports_def.h. -
#define CAN4RFLG 0x0284 | -
- -
-Definition at line 630 of file ports_def.h. -
#define CAN4RIER 0x0285 | -
- -
-Definition at line 631 of file ports_def.h. -
#define CAN4RXERR 0x028E | -
- -
-Definition at line 639 of file ports_def.h. -
#define CAN4RXFG0 0x02A0 | -
- -
-Definition at line 658 of file ports_def.h. -
#define CAN4RXFG1 0x02A1 | -
- -
-Definition at line 659 of file ports_def.h. -
#define CAN4RXFG2 0x02A2 | -
- -
-Definition at line 660 of file ports_def.h. -
#define CAN4RXFG3 0x02A3 | -
- -
-Definition at line 661 of file ports_def.h. -
#define CAN4RXFG4 0x02A4 | -
- -
-Definition at line 662 of file ports_def.h. -
#define CAN4RXFG5 0x02A5 | -
- -
-Definition at line 663 of file ports_def.h. -
#define CAN4RXFG6 0x02A6 | -
- -
-Definition at line 664 of file ports_def.h. -
#define CAN4RXFG7 0x02A7 | -
- -
-Definition at line 665 of file ports_def.h. -
#define CAN4RXFG8 0x02A8 | -
- -
-Definition at line 666 of file ports_def.h. -
#define CAN4RXFG9 0x02A9 | -
- -
-Definition at line 667 of file ports_def.h. -
#define CAN4RXFGA 0x02AA | -
- -
-Definition at line 668 of file ports_def.h. -
#define CAN4RXFGB 0x02AB | -
- -
-Definition at line 669 of file ports_def.h. -
#define CAN4RXFGC 0x02AC | -
- -
-Definition at line 670 of file ports_def.h. -
#define CAN4RXFGD 0x02AD | -
- -
-Definition at line 671 of file ports_def.h. -
#define CAN4RXFGE 0x02AE | -
- -
-Definition at line 672 of file ports_def.h. -
#define CAN4RXFGF 0x02AF | -
- -
-Definition at line 673 of file ports_def.h. -
#define CAN4TAAK 0x0289 | -
- -
-Definition at line 635 of file ports_def.h. -
#define CAN4TARQ 0x0288 | -
- -
-Definition at line 634 of file ports_def.h. -
#define CAN4TBSEL 0x028A | -
- -
-Definition at line 636 of file ports_def.h. -
#define CAN4TFLG 0x0286 | -
- -
-Definition at line 632 of file ports_def.h. -
#define CAN4TIER 0x0287 | -
- -
-Definition at line 633 of file ports_def.h. -
#define CAN4TXERR 0x028F | -
- -
-Definition at line 640 of file ports_def.h. -
#define CAN4TXFG0 0x02B0 | -
- -
-Definition at line 674 of file ports_def.h. -
#define CAN4TXFG1 0x02B1 | -
- -
-Definition at line 675 of file ports_def.h. -
#define CAN4TXFG2 0x02B2 | -
- -
-Definition at line 676 of file ports_def.h. -
#define CAN4TXFG3 0x02B3 | -
- -
-Definition at line 677 of file ports_def.h. -
#define CAN4TXFG4 0x02B4 | -
- -
-Definition at line 678 of file ports_def.h. -
#define CAN4TXFG5 0x02B5 | -
- -
-Definition at line 679 of file ports_def.h. -
#define CAN4TXFG6 0x02B6 | -
- -
-Definition at line 680 of file ports_def.h. -
#define CAN4TXFG7 0x02B7 | -
- -
-Definition at line 681 of file ports_def.h. -
#define CAN4TXFG8 0x02B8 | -
- -
-Definition at line 682 of file ports_def.h. -
#define CAN4TXFG9 0x02B9 | -
- -
-Definition at line 683 of file ports_def.h. -
#define CAN4TXFGA 0x02BA | -
- -
-Definition at line 684 of file ports_def.h. -
#define CAN4TXFGB 0x02BB | -
- -
-Definition at line 685 of file ports_def.h. -
#define CAN4TXFGC 0x02BC | -
- -
-Definition at line 686 of file ports_def.h. -
#define CAN4TXFGD 0x02BD | -
- -
-Definition at line 687 of file ports_def.h. -
#define CAN4TXFGE 0x02BE | -
- -
-Definition at line 688 of file ports_def.h. -
#define CAN4TXFGF 0x02BF | -
- -
-Definition at line 689 of file ports_def.h. -
#define CANBTR0 0X02 | -
#define CANBTR1 0X03 | -
#define CANCTL0 0X00 | -
- -
-Definition at line 704 of file ports_def.h. -
-Referenced by canInit(), canInitMode(), canInitModeQ(), canSleepMode(), canSleepModeQ(), and canSleepWupMode(). -
#define CANCTL1 0X01 | -
- -
-Definition at line 705 of file ports_def.h. -
-Referenced by canEnable(), canInit(), canInitClock(), canTestInitMode(), and canTestSleepMode(). -
#define CANIDAC 0x0B | -
#define CANIDAR0 0x10 | -
- -
-Definition at line 714 of file ports_def.h. -
-Referenced by canAddIdToFilter(), canInit1Filter(), and canInitFilter(). -
#define CANIDAR1 0x11 | -
#define CANIDAR2 0x12 | -
- -
-Definition at line 716 of file ports_def.h. -
-Referenced by canAddIdToFilter(), canInit1Filter(), and canInitFilter(). -
#define CANIDAR3 0x13 | -
#define CANIDAR4 0x18 | -
- -
-Definition at line 722 of file ports_def.h. -
-Referenced by canAddIdToFilter(), canInit1Filter(), and canInitFilter(). -
#define CANIDAR5 0x19 | -
#define CANIDAR6 0x1A | -
- -
-Definition at line 724 of file ports_def.h. -
-Referenced by canAddIdToFilter(), canInit1Filter(), and canInitFilter(). -
#define CANIDAR7 0x1B | -
#define CANIDMR0 0x14 | -
#define CANIDMR1 0x15 | -
#define CANIDMR2 0x16 | -
#define CANIDMR3 0x17 | -
#define CANIDMR4 0x1C | -
#define CANIDMR5 0x1D | -
#define CANIDMR6 0x1E | -
#define CANIDMR7 0x1F | -
#define CANRCVDTA 0x24 | -
- -
-Definition at line 733 of file ports_def.h. -
#define CANRCVID 0x20 | -
- -
-Definition at line 732 of file ports_def.h. -
#define CANRCVLEN 0x2C | -
- -
-Definition at line 734 of file ports_def.h. -
#define CANRFLG 0X04 | -
- -
-Definition at line 708 of file ports_def.h. -
#define CANRIER 0X05 | -
#define CANTBSEL 0X0A | -
#define CANTFLG 0X06 | -
#define CANTIER 0X07 | -
#define CANTRSDTA 0x34 | -
#define CANTRSID 0x30 | -
#define CANTRSLEN 0x3C | -
#define CANTRSPRI 0x3D | -
#define CLKSEL 0x0039 | -
#define COPCTL 0x003C | -
- -
-Definition at line 91 of file ports_def.h. -
#define CRGFLG 0x0037 | -
#define CRGINT 0x0038 | -
- -
-Definition at line 87 of file ports_def.h. -
#define CTCTL 0x003E | -
- -
-Definition at line 93 of file ports_def.h. -
#define CTFLG 0x0036 | -
- -
-Definition at line 85 of file ports_def.h. -
#define DDRA 0x0002 | -
- -
-Definition at line 44 of file ports_def.h. -
#define DDRB 0x0003 | -
#define DDRE 0x0009 | -
- -
-Definition at line 48 of file ports_def.h. -
#define DDRH 0x0262 | -
#define DDRJ 0x026A | -
- -
-Definition at line 619 of file ports_def.h. -
#define DDRK 0x0033 | -
- -
-Definition at line 82 of file ports_def.h. -
#define DDRM 0x0252 | -
- -
-Definition at line 595 of file ports_def.h. -
#define DDRP 0x025A | -
- -
-Definition at line 603 of file ports_def.h. -
#define DDRS 0x024A | -
- -
-Definition at line 587 of file ports_def.h. -
#define DDRT 0x0242 | -
- -
-Definition at line 580 of file ports_def.h. -
#define DLCBARD 0x00EC | -
- -
-Definition at line 259 of file ports_def.h. -
#define DLCBCR1 0x00E8 | -
- -
-Definition at line 255 of file ports_def.h. -
#define DLCBCR2 0x00EA | -
- -
-Definition at line 257 of file ports_def.h. -
#define DLCBDR 0x00EB | -
- -
-Definition at line 258 of file ports_def.h. -
#define DLCBRSR 0x00ED | -
- -
-Definition at line 260 of file ports_def.h. -
#define DLCBSTAT 0x00EF | -
- -
-Definition at line 262 of file ports_def.h. -
#define DLCBSVR 0x00E9 | -
- -
-Definition at line 256 of file ports_def.h. -
#define DLCSCR 0x00EE | -
- -
-Definition at line 261 of file ports_def.h. -
#define DLYCT 0x0069 | -
- -
-Definition at line 136 of file ports_def.h. -
#define EBICTL 0x000E | -
- -
-Definition at line 53 of file ports_def.h. -
#define ECLKDIV 0x0110 | -
- -
-Definition at line 285 of file ports_def.h. -
#define ECMD 0x0116 | -
- -
-Definition at line 290 of file ports_def.h. -
#define ECNFG 0x0113 | -
- -
-Definition at line 287 of file ports_def.h. -
#define EPROT 0x0114 | -
- -
-Definition at line 288 of file ports_def.h. -
#define ESTAT 0x0115 | -
- -
-Definition at line 289 of file ports_def.h. -
#define FCLKDIV 0x0100 | -
- -
-Definition at line 277 of file ports_def.h. -
#define FCMD 0x0106 | -
- -
-Definition at line 283 of file ports_def.h. -
#define FCNFG 0x0103 | -
- -
-Definition at line 280 of file ports_def.h. -
#define FORBYP 0x003D | -
- -
-Definition at line 92 of file ports_def.h. -
#define FPROT 0x0104 | -
- -
-Definition at line 281 of file ports_def.h. -
#define FSEC 0x0101 | -
- -
-Definition at line 278 of file ports_def.h. -
#define FSTAT 0x0105 | -
- -
-Definition at line 282 of file ports_def.h. -
#define HPRIO 0x001F | -
- -
-Definition at line 69 of file ports_def.h. -
#define IBAD 0x00E0 | -
- -
-Definition at line 249 of file ports_def.h. -
#define IBCR 0x00E2 | -
- -
-Definition at line 251 of file ports_def.h. -
#define IBFD 0x00E1 | -
- -
-Definition at line 250 of file ports_def.h. -
#define IBSR 0x00E3 | -
- -
-Definition at line 252 of file ports_def.h. -
#define ICOVW 0x006A | -
- -
-Definition at line 137 of file ports_def.h. -
#define ICPAR 0x0068 | -
- -
-Definition at line 135 of file ports_def.h. -
#define ICSYS 0x006B | -
- -
-Definition at line 138 of file ports_def.h. -
#define IICDR 0x00E4 | -
- -
-Definition at line 253 of file ports_def.h. -
#define INITEE 0x0012 | -
- -
-Definition at line 57 of file ports_def.h. -
#define INITRG 0x0011 | -
- -
-Definition at line 56 of file ports_def.h. -
#define INITRM 0x0010 | -
- -
-Definition at line 55 of file ports_def.h. -
#define INTCR 0x001E | -
- -
-Definition at line 68 of file ports_def.h. -
#define ITCR 0x0015 | -
- -
-Definition at line 60 of file ports_def.h. -
#define ITEST 0x0016 | -
- -
-Definition at line 61 of file ports_def.h. -
#define MCCNTH 0x0076 | -
- -
-Definition at line 148 of file ports_def.h. -
#define MCCNTL 0x0077 | -
- -
-Definition at line 149 of file ports_def.h. -
#define MCCTL 0x0066 | -
- -
-Definition at line 133 of file ports_def.h. -
#define MCFLG 0x0067 | -
- -
-Definition at line 134 of file ports_def.h. -
#define MEMSIZ0 0x001C | -
- -
-Definition at line 66 of file ports_def.h. -
#define MEMSIZ1 0x001D | -
- -
-Definition at line 67 of file ports_def.h. -
#define MISC 0x0013 | -
- -
-Definition at line 58 of file ports_def.h. -
#define MODE 0x000B | -
- -
-Definition at line 50 of file ports_def.h. -
#define MTST0 0x0014 | -
- -
-Definition at line 59 of file ports_def.h. -
#define MTST1 0x0017 | -
- -
-Definition at line 62 of file ports_def.h. -
#define PA0H 0x0075 | -
- -
-Definition at line 147 of file ports_def.h. -
#define PA1H 0x0074 | -
- -
-Definition at line 146 of file ports_def.h. -
#define PA2H 0x0073 | -
- -
-Definition at line 145 of file ports_def.h. -
#define PA3H 0x0072 | -
- -
-Definition at line 144 of file ports_def.h. -
#define PACN0L 0x0065 | -
- -
-Definition at line 132 of file ports_def.h. -
#define PACN1H 0x0064 | -
- -
-Definition at line 131 of file ports_def.h. -
#define PACN2L 0x0063 | -
- -
-Definition at line 130 of file ports_def.h. -
#define PACN3H 0x0062 | -
- -
-Definition at line 129 of file ports_def.h. -
#define PACTL 0x0060 | -
- -
-Definition at line 127 of file ports_def.h. -
#define PAFLG 0x0061 | -
- -
-Definition at line 128 of file ports_def.h. -
#define PARTIDH 0x001A | -
- -
-Definition at line 64 of file ports_def.h. -
#define PARTIDL 0x001B | -
- -
-Definition at line 65 of file ports_def.h. -
#define PBCTL 0x0070 | -
- -
-Definition at line 142 of file ports_def.h. -
#define PBFLG 0x0071 | -
- -
-Definition at line 143 of file ports_def.h. -
#define PEAR 0x000A | -
- -
-Definition at line 49 of file ports_def.h. -
#define PERH 0x0264 | -
#define PERJ 0x026C | -
- -
-Definition at line 621 of file ports_def.h. -
#define PERM 0x0254 | -
- -
-Definition at line 597 of file ports_def.h. -
#define PERP 0x025C | -
- -
-Definition at line 605 of file ports_def.h. -
#define PERS 0x024C | -
- -
-Definition at line 589 of file ports_def.h. -
#define PERT 0x0244 | -
- -
-Definition at line 582 of file ports_def.h. -
#define PIEH 0x0266 | -
- -
-Definition at line 615 of file ports_def.h. -
#define PIEJ 0x026E | -
- -
-Definition at line 623 of file ports_def.h. -
#define PIEP 0x025E | -
- -
-Definition at line 607 of file ports_def.h. -
#define PIFH 0x0267 | -
- -
-Definition at line 616 of file ports_def.h. -
#define PIFJ 0x026F | -
- -
-Definition at line 624 of file ports_def.h. -
#define PIFP 0x025F | -
- -
-Definition at line 608 of file ports_def.h. -
#define PLLCTL 0x003A | -
#define PORTA 0x0000 | -
- -
-Definition at line 42 of file ports_def.h. -
#define PORTAD0 0x008F | -
- -
-Definition at line 171 of file ports_def.h. -
#define PORTAD1 0x012F | -
- -
-Definition at line 305 of file ports_def.h. -
#define PORTB 0x0001 | -
- -
-Definition at line 43 of file ports_def.h. -
-Referenced by gene_SYNC_initialisation(), gene_SYNC_operational(), gene_SYNC_preOperational(), gene_SYNC_stopped(), initPortB(), and initSensor(). -
#define PORTE 0x0008 | -
- -
-Definition at line 47 of file ports_def.h. -
#define PORTK 0x0032 | -
- -
-Definition at line 81 of file ports_def.h. -
#define PPAGE 0x0030 | -
- -
-Definition at line 79 of file ports_def.h. -
#define PPSH 0x0265 | -
#define PPSJ 0x026D | -
- -
-Definition at line 622 of file ports_def.h. -
#define PPSM 0x0255 | -
- -
-Definition at line 598 of file ports_def.h. -
#define PPSP 0x025D | -
- -
-Definition at line 606 of file ports_def.h. -
#define PPSS 0x024D | -
- -
-Definition at line 590 of file ports_def.h. -
#define PPST 0x0245 | -
- -
-Definition at line 583 of file ports_def.h. -
#define PTH 0x0260 | -
#define PTIH 0x0261 | -
- -
-Definition at line 610 of file ports_def.h. -
#define PTIJ 0x0269 | -
- -
-Definition at line 618 of file ports_def.h. -
#define PTIM 0x0251 | -
- -
-Definition at line 594 of file ports_def.h. -
#define PTIP 0x0259 | -
- -
-Definition at line 602 of file ports_def.h. -
#define PTIS 0x0249 | -
- -
-Definition at line 586 of file ports_def.h. -
#define PTIT 0x0241 | -
- -
-Definition at line 579 of file ports_def.h. -
#define PTJ 0x0268 | -
- -
-Definition at line 617 of file ports_def.h. -
#define PTM 0x0250 | -
- -
-Definition at line 593 of file ports_def.h. -
#define PTP 0x0258 | -
- -
-Definition at line 601 of file ports_def.h. -
#define PTS 0x0248 | -
- -
-Definition at line 585 of file ports_def.h. -
#define PTT 0x0240 | -
- -
-Definition at line 578 of file ports_def.h. -
#define PUCR 0x000C | -
- -
-Definition at line 51 of file ports_def.h. -
#define PWMCAE 0x00A4 | -
- -
-Definition at line 192 of file ports_def.h. -
#define PWMCLK 0x00A2 | -
- -
-Definition at line 190 of file ports_def.h. -
#define PWMCNT0 0x00AC | -
- -
-Definition at line 200 of file ports_def.h. -
#define PWMCNT1 0x00AD | -
- -
-Definition at line 201 of file ports_def.h. -
#define PWMCNT2 0x00AE | -
- -
-Definition at line 202 of file ports_def.h. -
#define PWMCNT3 0x00AF | -
- -
-Definition at line 203 of file ports_def.h. -
#define PWMCNT4 0x00B0 | -
- -
-Definition at line 204 of file ports_def.h. -
#define PWMCNT5 0x00B1 | -
- -
-Definition at line 205 of file ports_def.h. -
#define PWMCNT6 0x00B2 | -
- -
-Definition at line 206 of file ports_def.h. -
#define PWMCNT7 0x00B3 | -
- -
-Definition at line 207 of file ports_def.h. -
#define PWMCTL 0x00A5 | -
- -
-Definition at line 193 of file ports_def.h. -
#define PWMDTY0 0x00BC | -
- -
-Definition at line 216 of file ports_def.h. -
#define PWMDTY1 0x00BD | -
- -
-Definition at line 217 of file ports_def.h. -
#define PWMDTY2 0x00BE | -
- -
-Definition at line 218 of file ports_def.h. -
#define PWMDTY3 0x00BF | -
- -
-Definition at line 219 of file ports_def.h. -
#define PWMDTY4 0x00C0 | -
- -
-Definition at line 220 of file ports_def.h. -
#define PWMDTY5 0x00C1 | -
- -
-Definition at line 221 of file ports_def.h. -
#define PWMDTY6 0x00C2 | -
- -
-Definition at line 222 of file ports_def.h. -
#define PWMDTY7 0x00C3 | -
- -
-Definition at line 223 of file ports_def.h. -
#define PWME 0x00A0 | -
- -
-Definition at line 188 of file ports_def.h. -
#define PWMPER0 0x00B4 | -
- -
-Definition at line 208 of file ports_def.h. -
#define PWMPER1 0x00B5 | -
- -
-Definition at line 209 of file ports_def.h. -
#define PWMPER2 0x00B6 | -
- -
-Definition at line 210 of file ports_def.h. -
#define PWMPER3 0x00B7 | -
- -
-Definition at line 211 of file ports_def.h. -
#define PWMPER4 0x00B8 | -
- -
-Definition at line 212 of file ports_def.h. -
#define PWMPER5 0x00B9 | -
- -
-Definition at line 213 of file ports_def.h. -
#define PWMPER6 0x00BA | -
- -
-Definition at line 214 of file ports_def.h. -
#define PWMPER7 0x00BB | -
- -
-Definition at line 215 of file ports_def.h. -
#define PWMPOL 0x00A1 | -
- -
-Definition at line 189 of file ports_def.h. -
#define PWMPRCLK 0x00A3 | -
- -
-Definition at line 191 of file ports_def.h. -
#define PWMPRSC 0x00A7 | -
- -
-Definition at line 195 of file ports_def.h. -
#define PWMSCLA 0x00A8 | -
- -
-Definition at line 196 of file ports_def.h. -
#define PWMSCLB 0x00A9 | -
- -
-Definition at line 197 of file ports_def.h. -
#define PWMSCNTA 0x00AA | -
- -
-Definition at line 198 of file ports_def.h. -
#define PWMSCNTB 0x00AB | -
- -
-Definition at line 199 of file ports_def.h. -
#define PWMSDN 0x00C4 | -
- -
-Definition at line 224 of file ports_def.h. -
#define PWMTST 0x00A6 | -
- -
-Definition at line 194 of file ports_def.h. -
#define RDRH 0x0263 | -
- -
-Definition at line 612 of file ports_def.h. -
#define RDRIV 0x000D | -
- -
-Definition at line 52 of file ports_def.h. -
#define RDRJ 0x026B | -
- -
-Definition at line 620 of file ports_def.h. -
#define RDRM 0x0253 | -
- -
-Definition at line 596 of file ports_def.h. -
#define RDRP 0x025B | -
- -
-Definition at line 604 of file ports_def.h. -
#define RDRS 0x024B | -
- -
-Definition at line 588 of file ports_def.h. -
#define RDRT 0x0243 | -
- -
-Definition at line 581 of file ports_def.h. -
#define REFDV 0x0035 | -
#define RTICTL 0x003B | -
- -
-Definition at line 90 of file ports_def.h. -
#define SC0CR1 0x00CA | -
- -
-Definition at line 228 of file ports_def.h. -
#define SC0SR2 0x00CD | -
- -
-Definition at line 231 of file ports_def.h. -
#define SC1CR1 0x00D2 | -
- -
-Definition at line 236 of file ports_def.h. -
#define SC1SR2 0x00D5 | -
- -
-Definition at line 239 of file ports_def.h. -
#define SCI0 0x00C8 | -
#define SCI0BDH 0x00C8 | -
- -
-Definition at line 226 of file ports_def.h. -
#define SCI0BDL 0x00C9 | -
- -
-Definition at line 227 of file ports_def.h. -
#define SCI0CR2 0x00CB | -
- -
-Definition at line 229 of file ports_def.h. -
#define SCI0DRH 0x00CE | -
- -
-Definition at line 232 of file ports_def.h. -
#define SCI0DRL 0x00CF | -
- -
-Definition at line 233 of file ports_def.h. -
#define SCI0SR1 0x00CC | -
- -
-Definition at line 230 of file ports_def.h. -
#define SCI1 0x00D0 | -
#define SCI1BDH 0x00D0 | -
- -
-Definition at line 234 of file ports_def.h. -
#define SCI1BDL 0x00D1 | -
- -
-Definition at line 235 of file ports_def.h. -
#define SCI1CR2 0x00D3 | -
- -
-Definition at line 237 of file ports_def.h. -
#define SCI1DRH 0x00D6 | -
- -
-Definition at line 240 of file ports_def.h. -
#define SCI1DRL 0x00D7 | -
- -
-Definition at line 241 of file ports_def.h. -
#define SCI1SR1 0x00D4 | -
- -
-Definition at line 238 of file ports_def.h. -
#define SCIBDH 0x00 | -
- -
-Definition at line 747 of file ports_def.h. -
-Referenced by initSCI_0(), and initSCI_1(). -
#define SCIBDL 0x01 | -
- -
-Definition at line 748 of file ports_def.h. -
#define SCICR1 0x02 | -
- -
-Definition at line 749 of file ports_def.h. -
-Referenced by initSCI_0(), and initSCI_1(). -
#define SCICR2 0x03 | -
- -
-Definition at line 750 of file ports_def.h. -
-Referenced by initSCI_0(), and initSCI_1(). -
#define SCIDRH 0x06 | -
- -
-Definition at line 753 of file ports_def.h. -
#define SCIDRL 0x07 | -
#define SCISR1 0x04 | -
#define SCISR2 0x05 | -
- -
-Definition at line 752 of file ports_def.h. -
#define SPI0BR 0x00DA | -
- -
-Definition at line 244 of file ports_def.h. -
#define SPI0CR1 0x00D8 | -
- -
-Definition at line 242 of file ports_def.h. -
#define SPI0CR2 0x00D9 | -
- -
-Definition at line 243 of file ports_def.h. -
#define SPI0DR 0x00DD | -
- -
-Definition at line 247 of file ports_def.h. -
#define SPI0SR 0x00DB | -
- -
-Definition at line 245 of file ports_def.h. -
#define SPI1BR 0x00F2 | -
- -
-Definition at line 265 of file ports_def.h. -
#define SPI1CR1 0x00F0 | -
- -
-Definition at line 263 of file ports_def.h. -
#define SPI1CR2 0x00F1 | -
- -
-Definition at line 264 of file ports_def.h. -
#define SPI1DR 0x00F5 | -
- -
-Definition at line 268 of file ports_def.h. -
#define SPI1SR 0x00F3 | -
- -
-Definition at line 266 of file ports_def.h. -
#define SPI2BR 0x00FA | -
- -
-Definition at line 272 of file ports_def.h. -
#define SPI2CR1 0x00F8 | -
- -
-Definition at line 270 of file ports_def.h. -
#define SPI2CR2 0x00F9 | -
- -
-Definition at line 271 of file ports_def.h. -
#define SPI2DR 0x00FD | -
- -
-Definition at line 275 of file ports_def.h. -
#define SPI2SR 0x00FB | -
- -
-Definition at line 273 of file ports_def.h. -
#define SYNR 0x0034 | -
#define TC0H 0x0050 | -
- -
-Definition at line 111 of file ports_def.h. -
#define TC0HH 0x0078 | -
- -
-Definition at line 150 of file ports_def.h. -
#define TC0HL 0x0079 | -
- -
-Definition at line 151 of file ports_def.h. -
#define TC0L 0x0051 | -
- -
-Definition at line 112 of file ports_def.h. -
#define TC1H 0x0052 | -
- -
-Definition at line 113 of file ports_def.h. -
#define TC1HH 0x007A | -
- -
-Definition at line 152 of file ports_def.h. -
#define TC1HL 0x007B | -
- -
-Definition at line 153 of file ports_def.h. -
#define TC1L 0x0053 | -
- -
-Definition at line 114 of file ports_def.h. -
#define TC2H 0x0054 | -
- -
-Definition at line 115 of file ports_def.h. -
#define TC2HH 0x007C | -
- -
-Definition at line 154 of file ports_def.h. -
#define TC2HL 0x007D | -
- -
-Definition at line 155 of file ports_def.h. -
#define TC2L 0x0055 | -
- -
-Definition at line 116 of file ports_def.h. -
#define TC3H 0x0056 | -
- -
-Definition at line 117 of file ports_def.h. -
#define TC3HH 0x007E | -
- -
-Definition at line 156 of file ports_def.h. -
#define TC3L 0x0057 | -
- -
-Definition at line 118 of file ports_def.h. -
#define TC4H 0x0058 | -
- -
-Definition at line 119 of file ports_def.h. -
-Referenced by __attribute__(), and getElapsedTime(). -
#define TC4L 0x0059 | -
- -
-Definition at line 120 of file ports_def.h. -
#define TC5H 0x005A | -
- -
-Definition at line 121 of file ports_def.h. -
#define TC5L 0x005B | -
- -
-Definition at line 122 of file ports_def.h. -
#define TC6H 0x005C | -
- -
-Definition at line 123 of file ports_def.h. -
#define TC6L 0x005D | -
- -
-Definition at line 124 of file ports_def.h. -
#define TC7H 0x005E | -
- -
-Definition at line 125 of file ports_def.h. -
#define TC7L 0x005F | -
- -
-Definition at line 126 of file ports_def.h. -
#define TCFORC 0x0041 | -
- -
-Definition at line 96 of file ports_def.h. -
#define TCNTH 0x0044 | -
- -
-Definition at line 99 of file ports_def.h. -
-Referenced by get_timer_counter(), and set_timer_counter(). -
#define TCNTL 0x0045 | -
- -
-Definition at line 100 of file ports_def.h. -
#define TCTL1 0x0048 | -
#define TCTL2 0x0049 | -
- -
-Definition at line 104 of file ports_def.h. -
#define TCTL3 0x004A | -
- -
-Definition at line 105 of file ports_def.h. -
#define TCTL4 0x004B | -
- -
-Definition at line 106 of file ports_def.h. -
#define TFLG1 0x004E | -
- -
-Definition at line 109 of file ports_def.h. -
#define TFLG2 0x004F | -
- -
-Definition at line 110 of file ports_def.h. -
#define TIE 0x004C | -
#define TIMTST 0x006D | -
- -
-Definition at line 140 of file ports_def.h. -
#define TIOS 0x0040 | -
#define TOC7D 0x0043 | -
- -
-Definition at line 98 of file ports_def.h. -
#define TOC7M 0x0042 | -
- -
-Definition at line 97 of file ports_def.h. -
#define TSCR1 0x0046 | -
#define TSCR2 0x004D | -
#define TTOV 0x0047 | -
- -
-Definition at line 102 of file ports_def.h. -
#define WOMM 0x0256 | -
- -
-Definition at line 599 of file ports_def.h. -
#define WOMS 0x024E | -
- -
-Definition at line 591 of file ports_def.h. -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 /* -00023 Variables to access to the io_ports -00024 */ -00025 -00026 -00027 #ifndef __PORTS_ACCESS__ -00028 #define __PORTS_ACCESS__ -00029 -00030 /* -00031 By default the address is 0X0000 on HCS12. -00032 But the ports can be remaped. See the file ports.h -00033 */ -00034 -00035 -00036 extern volatile unsigned char _io_ports[]; -00037 -00038 /* To use for a 8 bits access */ -00039 #define IO_PORTS_8(adr) \ -00040 _io_ports[adr] -00041 -00042 /* To use for a 16 bits access */ -00043 /* Example : IO_PORTS_16(CAN0IDAR1)= 0xABCD; -00044 will put AB at @CAN0IDAR1 and CD at @CAN0IDAR1 + 1 -00045 */ -00046 #define IO_PORTS_16(adr) \ -00047 *((unsigned volatile short*) (_io_ports + (adr))) -00048 -00049 #endif -
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Defines | |
#define | IO_PORTS_8(adr) _io_ports[adr] |
#define | IO_PORTS_16(adr) *((unsigned volatile short*) (_io_ports + (adr))) |
Variables | |
volatile unsigned char | _io_ports [] |
#define IO_PORTS_16 | -( | -adr | -- | ) | -*((unsigned volatile short*) (_io_ports + (adr))) | -
- -
-Definition at line 46 of file portsaccess.h. -
-Referenced by __attribute__(), canAddIdToFilter(), getElapsedTime(), initSCI_0(), and initSCI_1(). -
#define IO_PORTS_8 | -( | -adr | -- | ) | -_io_ports[adr] | -
- -
-Definition at line 39 of file portsaccess.h. -
-Referenced by canAddIdToFilter(), canEnable(), canInit(), canInit1Filter(), canInitClock(), canInitFilter(), canInitMode(), canInitModeQ(), canMsgTransmit(), canSetInterrupt(), canSleepMode(), canSleepModeQ(), canSleepWupMode(), canTestInitMode(), canTestSleepMode(), gene_SYNC_initialisation(), gene_SYNC_operational(), gene_SYNC_preOperational(), gene_SYNC_stopped(), initPLL(), initPortB(), initPortH(), initSCI_0(), initSCI_1(), initSensor(), initTimer(), and printSCI_str(). -
-
volatile unsigned char _io_ports[] | -
- -
-Referenced by cop_reset(), get_timer_counter(), and set_timer_counter(). -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 /* -00024 Définition du maping, -00025 qui dépend du contenu du registre INITRG -00026 */ -00027 -00028 -00029 #ifndef __REGBASE__ -00030 #define __REGBASE__ -00031 -00032 -00033 -00034 -00035 -00036 -00037 -00038 #endif __REGBASE__ -
-Go to the source code of this file.
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 /* Regs - Software registers used by GCC -00024 Copyright (C) 2000 Free Software Foundation, Inc. -00025 Written by Stephane Carrez (stcarrez@worldnet.fr) -00026 -00027 This file is free software; you can redistribute it and/or modify it -00028 under the terms of the GNU General Public License as published by the -00029 Free Software Foundation; either version 2, or (at your option) any -00030 later version. -00031 -00032 In addition to the permissions in the GNU General Public License, the -00033 Free Software Foundation gives you unlimited permission to link the -00034 compiled version of this file with other programs, and to distribute -00035 those programs without any restriction coming from the use of this -00036 file. (The General Public License restrictions do apply in other -00037 respects; for example, they cover modification of the file, and -00038 distribution when not linked into another program.) -00039 -00040 This file is distributed in the hope that it will be useful, but -00041 WITHOUT ANY WARRANTY; without even the implied warranty of -00042 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00043 General Public License for more details. -00044 -00045 You should have received a copy of the GNU General Public License -00046 along with this program; see the file COPYING. If not, write to -00047 the Free Software Foundation, 59 Temple Place - Suite 330, -00048 Boston, MA 02111-1307, USA. */ -00049 -00050 #ifndef _M68HC11_REGS_H -00051 #define _M68HC11_REGS_H -00052 -00053 /* Include this file if you want to have access to the soft registers -00054 used by GCC. The soft registers are memory location. They have -00055 special names that cannot conflict with C or C++ variables. -00056 The extern definition below map those special names to -00057 some usable names in C and C++. */ -00058 -00059 extern unsigned short __tmp __asm__("_.tmp"); -00060 extern unsigned short __z __asm__("_.z"); -00061 extern unsigned short __xy __asm__("_.xy"); -00062 extern unsigned short __frame __asm__("_.frame"); -00063 extern unsigned short __d1 __asm__("_.d1"); -00064 extern unsigned short __d2 __asm__("_.d2"); -00065 extern unsigned short __d3 __asm__("_.d3"); -00066 extern unsigned short __d4 __asm__("_.d4"); -00067 extern unsigned short __d5 __asm__("_.d5"); -00068 extern unsigned short __d6 __asm__("_.d6"); -00069 extern unsigned short __d7 __asm__("_.d7"); -00070 extern unsigned short __d8 __asm__("_.d8"); -00071 extern unsigned short __d9 __asm__("_.d9"); -00072 extern unsigned short __d10 __asm__("_.d10"); -00073 extern unsigned short __d11 __asm__("_.d11"); -00074 extern unsigned short __d12 __asm__("_.d12"); -00075 extern unsigned short __d13 __asm__("_.d13"); -00076 extern unsigned short __d14 __asm__("_.d14"); -00077 extern unsigned short __d15 __asm__("_.d15"); -00078 extern unsigned short __d16 __asm__("_.d16"); -00079 extern unsigned short __d17 __asm__("_.d17"); -00080 extern unsigned short __d18 __asm__("_.d18"); -00081 extern unsigned short __d19 __asm__("_.d19"); -00082 extern unsigned short __d20 __asm__("_.d20"); -00083 extern unsigned short __d21 __asm__("_.d21"); -00084 extern unsigned short __d22 __asm__("_.d22"); -00085 extern unsigned short __d23 __asm__("_.d23"); -00086 extern unsigned short __d24 __asm__("_.d24"); -00087 extern unsigned short __d25 __asm__("_.d25"); -00088 extern unsigned short __d26 __asm__("_.d26"); -00089 extern unsigned short __d27 __asm__("_.d27"); -00090 extern unsigned short __d28 __asm__("_.d28"); -00091 extern unsigned short __d29 __asm__("_.d29"); -00092 extern unsigned short __d30 __asm__("_.d30"); -00093 extern unsigned short __d31 __asm__("_.d31"); -00094 extern unsigned short __d32 __asm__("_.d32"); -00095 -00096 #endif -
-Go to the source code of this file.
Functions | |
unsigned short __tmp | __asm__ ("_.tmp") |
unsigned short __z | __asm__ ("_.z") |
unsigned short __xy | __asm__ ("_.xy") |
unsigned short __frame | __asm__ ("_.frame") |
unsigned short __d1 | __asm__ ("_.d1") |
unsigned short __d2 | __asm__ ("_.d2") |
unsigned short __d3 | __asm__ ("_.d3") |
unsigned short __d4 | __asm__ ("_.d4") |
unsigned short __d5 | __asm__ ("_.d5") |
unsigned short __d6 | __asm__ ("_.d6") |
unsigned short __d7 | __asm__ ("_.d7") |
unsigned short __d8 | __asm__ ("_.d8") |
unsigned short __d9 | __asm__ ("_.d9") |
unsigned short __d10 | __asm__ ("_.d10") |
unsigned short __d11 | __asm__ ("_.d11") |
unsigned short __d12 | __asm__ ("_.d12") |
unsigned short __d13 | __asm__ ("_.d13") |
unsigned short __d14 | __asm__ ("_.d14") |
unsigned short __d15 | __asm__ ("_.d15") |
unsigned short __d16 | __asm__ ("_.d16") |
unsigned short __d17 | __asm__ ("_.d17") |
unsigned short __d18 | __asm__ ("_.d18") |
unsigned short __d19 | __asm__ ("_.d19") |
unsigned short __d20 | __asm__ ("_.d20") |
unsigned short __d21 | __asm__ ("_.d21") |
unsigned short __d22 | __asm__ ("_.d22") |
unsigned short __d23 | __asm__ ("_.d23") |
unsigned short __d24 | __asm__ ("_.d24") |
unsigned short __d25 | __asm__ ("_.d25") |
unsigned short __d26 | __asm__ ("_.d26") |
unsigned short __d27 | __asm__ ("_.d27") |
unsigned short __d28 | __asm__ ("_.d28") |
unsigned short __d29 | __asm__ ("_.d29") |
unsigned short __d30 | __asm__ ("_.d30") |
unsigned short __d31 | __asm__ ("_.d31") |
unsigned short __d32 | __asm__ ("_.d32") |
unsigned short __d32 __asm__ | -( | -"_.d32" | -- | ) | -- |
- -
unsigned short __d31 __asm__ | -( | -"_.d31" | -- | ) | -- |
- -
unsigned short __d30 __asm__ | -( | -"_.d30" | -- | ) | -- |
- -
unsigned short __d29 __asm__ | -( | -"_.d29" | -- | ) | -- |
- -
unsigned short __d28 __asm__ | -( | -"_.d28" | -- | ) | -- |
- -
unsigned short __d27 __asm__ | -( | -"_.d27" | -- | ) | -- |
- -
unsigned short __d26 __asm__ | -( | -"_.d26" | -- | ) | -- |
- -
unsigned short __d25 __asm__ | -( | -"_.d25" | -- | ) | -- |
- -
unsigned short __d24 __asm__ | -( | -"_.d24" | -- | ) | -- |
- -
unsigned short __d23 __asm__ | -( | -"_.d23" | -- | ) | -- |
- -
unsigned short __d22 __asm__ | -( | -"_.d22" | -- | ) | -- |
- -
unsigned short __d21 __asm__ | -( | -"_.d21" | -- | ) | -- |
- -
unsigned short __d20 __asm__ | -( | -"_.d20" | -- | ) | -- |
- -
unsigned short __d19 __asm__ | -( | -"_.d19" | -- | ) | -- |
- -
unsigned short __d18 __asm__ | -( | -"_.d18" | -- | ) | -- |
- -
unsigned short __d17 __asm__ | -( | -"_.d17" | -- | ) | -- |
- -
unsigned short __d16 __asm__ | -( | -"_.d16" | -- | ) | -- |
- -
unsigned short __d15 __asm__ | -( | -"_.d15" | -- | ) | -- |
- -
unsigned short __d14 __asm__ | -( | -"_.d14" | -- | ) | -- |
- -
unsigned short __d13 __asm__ | -( | -"_.d13" | -- | ) | -- |
- -
unsigned short __d12 __asm__ | -( | -"_.d12" | -- | ) | -- |
- -
unsigned short __d11 __asm__ | -( | -"_.d11" | -- | ) | -- |
- -
unsigned short __d10 __asm__ | -( | -"_.d10" | -- | ) | -- |
- -
unsigned short __d9 __asm__ | -( | -"_.d9" | -- | ) | -- |
- -
unsigned short __d8 __asm__ | -( | -"_.d8" | -- | ) | -- |
- -
unsigned short __d7 __asm__ | -( | -"_.d7" | -- | ) | -- |
- -
unsigned short __d6 __asm__ | -( | -"_.d6" | -- | ) | -- |
- -
unsigned short __d5 __asm__ | -( | -"_.d5" | -- | ) | -- |
- -
unsigned short __d4 __asm__ | -( | -"_.d4" | -- | ) | -- |
- -
unsigned short __d3 __asm__ | -( | -"_.d3" | -- | ) | -- |
- -
unsigned short __d2 __asm__ | -( | -"_.d2" | -- | ) | -- |
- -
unsigned short __d1 __asm__ | -( | -"_.d1" | -- | ) | -- |
- -
unsigned short __frame __asm__ | -( | -"_.frame" | -- | ) | -- |
- -
unsigned short __xy __asm__ | -( | -"_.xy" | -- | ) | -- |
- -
unsigned short __z __asm__ | -( | -"_.z" | -- | ) | -- |
- -
unsigned short __tmp __asm__ | -( | -"_.tmp" | -- | ) | -- |
-
00001 //{{NO_DEPENDENCIES}} -00002 // Microsoft Visual C++ generated include file. -00003 // Used by CanFestival-3.rc -00004 -00005 // Next default values for new objects -00006 // -00007 #ifdef APSTUDIO_INVOKED -00008 #ifndef APSTUDIO_READONLY_SYMBOLS -00009 #define _APS_NEXT_RESOURCE_VALUE 101 -00010 #define _APS_NEXT_COMMAND_VALUE 40001 -00011 #define _APS_NEXT_CONTROL_VALUE 1001 -00012 #define _APS_NEXT_SYMED_VALUE 101 -00013 #endif -00014 #endif -
-Go to the source code of this file.
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00032 /* #define DEBUG_WAR_CONSOLE_ON */ -00033 /* #define DEBUG_ERR_CONSOLE_ON */ -00034 -00035 #include "objacces.h" -00036 #include "sdo.h" -00037 #include "canfestival.h" -00038 -00039 /* Uncomment if your compiler does not support inline functions */ -00040 #define NO_INLINE -00041 -00042 #ifdef NO_INLINE -00043 #define INLINE -00044 #else -00045 #define INLINE inline -00046 #endif -00047 -00048 /*Internals prototypes*/ -00049 -00065 INLINE UNS8 _writeNetworkDict (CO_Data* d, UNS8 nodeId, UNS16 index, -00066 UNS8 subIndex, UNS8 count, UNS8 dataType, void *data, SDOCallback_t Callback, UNS8 endianize); -00067 -00080 INLINE UNS8 _readNetworkDict (CO_Data* d, UNS8 nodeId, UNS16 index, UNS8 subIndex, -00081 UNS8 dataType, SDOCallback_t Callback); -00082 -00083 -00084 /***************************************************************************/ -00085 /* SDO (un)packing macros */ -00086 -00089 #define getSDOcs(byte) (byte >> 5) -00090 -00093 #define getSDOn2(byte) ((byte >> 2) & 3) -00094 -00097 #define getSDOn3(byte) ((byte >> 1) & 7) -00098 -00101 #define getSDOe(byte) ((byte >> 1) & 1) -00102 -00105 #define getSDOs(byte) (byte & 1) -00106 -00109 #define getSDOc(byte) (byte & 1) -00110 -00113 #define getSDOt(byte) ((byte >> 4) & 1) -00114 -00117 #define getSDOindex(byte1, byte2) ((byte2 << 8) | (byte1)) -00118 -00121 #define getSDOsubIndex(byte3) (byte3) -00122 -00129 void SDOTimeoutAlarm(CO_Data* d, UNS32 id) -00130 { -00131 MSG_ERR(0x1A01, "SDO timeout. SDO response not received.", 0); -00132 MSG_WAR(0x2A02, "server node : ", d->transfers[id].nodeId); -00133 MSG_WAR(0x2A02, " index : ", d->transfers[id].index); -00134 MSG_WAR(0x2A02, " subIndex : ", d->transfers[id].subIndex); -00135 /* Reset timer handler */ -00136 d->transfers[id].timer = TIMER_NONE; -00137 /*Set aborted state*/ -00138 d->transfers[id].state = SDO_ABORTED_INTERNAL; -00139 /* Sending a SDO abort */ -00140 sendSDOabort(d, d->transfers[id].whoami, -00141 d->transfers[id].index, d->transfers[id].subIndex, SDOABT_TIMED_OUT); -00142 d->transfers[id].abortCode = SDOABT_TIMED_OUT; -00143 /* Call the user function to inform of the problem.*/ -00144 if(d->transfers[id].Callback) -00145 /*If ther is a callback, it is responsible to close SDO transfer (client)*/ -00146 (*d->transfers[id].Callback)(d,d->transfers[id].nodeId); -00147 else if(d->transfers[id].whoami == SDO_SERVER) -00148 /*Else, if server, reset the line*/ -00149 resetSDOline(d, (UNS8)id); -00150 } -00151 -00152 #define StopSDO_TIMER(id) \ -00153 MSG_WAR(0x3A05, "StopSDO_TIMER for line : ", line);\ -00154 d->transfers[id].timer = DelAlarm(d->transfers[id].timer); -00155 -00156 #define StartSDO_TIMER(id) \ -00157 MSG_WAR(0x3A06, "StartSDO_TIMER for line : ", line);\ -00158 d->transfers[id].timer = SetAlarm(d,id,&SDOTimeoutAlarm,MS_TO_TIMEVAL(SDO_TIMEOUT_MS),0); -00159 -00160 #define RestartSDO_TIMER(id) \ -00161 MSG_WAR(0x3A07, "restartSDO_TIMER for line : ", line);\ -00162 if(d->transfers[id].timer != TIMER_NONE) { StopSDO_TIMER(id) StartSDO_TIMER(id) } -00163 -00169 void resetSDO (CO_Data* d) -00170 { -00171 UNS8 j; -00172 -00173 /* transfer structure initialization */ -00174 for (j = 0 ; j < SDO_MAX_SIMULTANEOUS_TRANSFERTS ; j++) -00175 resetSDOline(d, j); -00176 } -00177 -00186 UNS32 SDOlineToObjdict (CO_Data* d, UNS8 line) -00187 { -00188 UNS8 size; -00189 UNS32 errorCode; -00190 MSG_WAR(0x3A08, "Enter in SDOlineToObjdict ", line); -00191 size = (UNS8)d->transfers[line].count; -00192 errorCode = setODentry(d, d->transfers[line].index, d->transfers[line].subIndex, -00193 (void *) d->transfers[line].data, &size, 1); -00194 if (errorCode != OD_SUCCESSFUL) -00195 return errorCode; -00196 MSG_WAR(0x3A08, "exit of SDOlineToObjdict ", line); -00197 return 0; -00198 -00199 } -00200 -00209 UNS32 objdictToSDOline (CO_Data* d, UNS8 line) -00210 { -00211 UNS8 size = 0; -00212 UNS8 dataType; -00213 UNS32 errorCode; -00214 -00215 MSG_WAR(0x3A05, "objdict->line index : ", d->transfers[line].index); -00216 MSG_WAR(0x3A06, " subIndex : ", d->transfers[line].subIndex); -00217 -00218 errorCode = getODentry(d, d->transfers[line].index, -00219 d->transfers[line].subIndex, -00220 (void *)d->transfers[line].data, -00221 &size, &dataType, 0); -00222 -00223 if (errorCode != OD_SUCCESSFUL) -00224 return errorCode; -00225 -00226 d->transfers[line].count = size; -00227 d->transfers[line].offset = 0; -00228 #if 0 -00229 /*Me laisser a, please ! (FD)*/ -00230 { -00231 UNS8 i; -00232 for (i = 0 ; i < 10 ; i++) { -00233 MSG_WAR(i, "data= ", d->transfers[line].data[i]); -00234 } -00235 } -00236 #endif -00237 return 0; -00238 } -00239 -00250 UNS8 lineToSDO (CO_Data* d, UNS8 line, UNS8 nbBytes, UNS8* data) { -00251 UNS8 i; -00252 UNS8 offset; -00253 -00254 if ((d->transfers[line].offset + nbBytes) > SDO_MAX_LENGTH_TRANSFERT) { -00255 MSG_ERR(0x1A10,"SDO Size of data too large. Exceed SDO_MAX_LENGTH_TRANSFERT", nbBytes); -00256 return 0xFF; -00257 } -00258 if ((d->transfers[line].offset + nbBytes) > d->transfers[line].count) { -00259 MSG_ERR(0x1A11,"SDO Size of data too large. Exceed count", nbBytes); -00260 return 0xFF; -00261 } -00262 offset = (UNS8)d->transfers[line].offset; -00263 for (i = 0 ; i < nbBytes ; i++) -00264 * (data + i) = d->transfers[line].data[offset + i]; -00265 d->transfers[line].offset = d->transfers[line].offset + nbBytes; -00266 return 0; -00267 } -00268 -00279 UNS8 SDOtoLine (CO_Data* d, UNS8 line, UNS8 nbBytes, UNS8* data) -00280 { -00281 UNS8 i; -00282 UNS8 offset; -00283 -00284 if ((d->transfers[line].offset + nbBytes) > SDO_MAX_LENGTH_TRANSFERT) { -00285 MSG_ERR(0x1A15,"SDO Size of data too large. Exceed SDO_MAX_LENGTH_TRANSFERT", nbBytes); -00286 return 0xFF; -00287 } -00288 offset = (UNS8)d->transfers[line].offset; -00289 for (i = 0 ; i < nbBytes ; i++) -00290 d->transfers[line].data[offset + i] = * (data + i); -00291 d->transfers[line].offset = d->transfers[line].offset + nbBytes; -00292 return 0; -00293 } -00294 -00307 UNS8 failedSDO (CO_Data* d, UNS8 nodeId, UNS8 whoami, UNS16 index, -00308 UNS8 subIndex, UNS32 abortCode) -00309 { -00310 UNS8 err; -00311 UNS8 line; -00312 err = getSDOlineOnUse( d, nodeId, whoami, &line ); -00313 if (!err) /* If a line on use have been found.*/ -00314 MSG_WAR(0x3A20, "FailedSDO : line found : ", line); -00315 if ((! err) && (whoami == SDO_SERVER)) { -00316 resetSDOline( d, line ); -00317 MSG_WAR(0x3A21, "FailedSDO : line released : ", line); -00318 } -00319 if ((! err) && (whoami == SDO_CLIENT)) { -00320 StopSDO_TIMER(line); -00321 d->transfers[line].state = SDO_ABORTED_INTERNAL; -00322 } -00323 MSG_WAR(0x3A22, "Sending SDO abort ", 0); -00324 err = sendSDOabort(d, whoami, index, subIndex, abortCode); -00325 if (err) { -00326 MSG_WAR(0x3A23, "Unable to send the SDO abort", 0); -00327 return 0xFF; -00328 } -00329 return 0; -00330 } -00331 -00338 void resetSDOline ( CO_Data* d, UNS8 line ) -00339 { -00340 UNS8 i; -00341 MSG_WAR(0x3A25, "reset SDO line nb : ", line); -00342 initSDOline(d, line, 0, 0, 0, SDO_RESET); -00343 for (i = 0 ; i < SDO_MAX_LENGTH_TRANSFERT ; i++) -00344 d->transfers[line].data[i] = 0; -00345 } -00346 -00359 UNS8 initSDOline (CO_Data* d, UNS8 line, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 state) -00360 { -00361 MSG_WAR(0x3A25, "init SDO line nb : ", line); -00362 if (state == SDO_DOWNLOAD_IN_PROGRESS || state == SDO_UPLOAD_IN_PROGRESS){ -00363 StartSDO_TIMER(line) -00364 }else{ -00365 StopSDO_TIMER(line) -00366 } -00367 d->transfers[line].nodeId = nodeId; -00368 d->transfers[line].index = index; -00369 d->transfers[line].subIndex = subIndex; -00370 d->transfers[line].state = state; -00371 d->transfers[line].toggle = 0; -00372 d->transfers[line].count = 0; -00373 d->transfers[line].offset = 0; -00374 d->transfers[line].dataType = 0; -00375 d->transfers[line].Callback = NULL; -00376 return 0; -00377 } -00378 -00388 UNS8 getSDOfreeLine ( CO_Data* d, UNS8 whoami, UNS8 *line ) -00389 { -00390 -00391 UNS8 i; -00392 -00393 for (i = 0 ; i < SDO_MAX_SIMULTANEOUS_TRANSFERTS ; i++){ -00394 if ( d->transfers[i].state == SDO_RESET ) { -00395 *line = i; -00396 d->transfers[i].whoami = whoami; -00397 return 0; -00398 } /* end if */ -00399 } /* end for */ -00400 MSG_ERR(0x1A25, "Too many SDO in progress. Aborted.", i); -00401 return 0xFF; -00402 } -00403 -00414 UNS8 getSDOlineOnUse (CO_Data* d, UNS8 nodeId, UNS8 whoami, UNS8 *line) -00415 { -00416 -00417 UNS8 i; -00418 -00419 for (i = 0 ; i < SDO_MAX_SIMULTANEOUS_TRANSFERTS ; i++){ -00420 if ( (d->transfers[i].state != SDO_RESET) && -00421 (d->transfers[i].nodeId == nodeId) && -00422 (d->transfers[i].whoami == whoami) ) { -00423 *line = i; -00424 return 0; -00425 } -00426 } -00427 return 0xFF; -00428 } -00429 -00439 UNS8 closeSDOtransfer (CO_Data* d, UNS8 nodeId, UNS8 whoami) -00440 { -00441 UNS8 err; -00442 UNS8 line; -00443 err = getSDOlineOnUse(d, nodeId, whoami, &line); -00444 if (err) { -00445 MSG_WAR(0x2A30, "No SDO communication to close for node : ", nodeId); -00446 return 0xFF; -00447 } -00448 resetSDOline(d, line); -00449 return 0; -00450 } -00451 -00461 UNS8 getSDOlineRestBytes (CO_Data* d, UNS8 line, UNS8 * nbBytes) -00462 { -00463 if (d->transfers[line].count == 0) /* if received initiate SDO protocol with e=0 and s=0 */ -00464 * nbBytes = 0; -00465 else -00466 * nbBytes = (UNS8)d->transfers[line].count - (UNS8)d->transfers[line].offset; -00467 return 0; -00468 } -00469 -00479 UNS8 setSDOlineRestBytes (CO_Data* d, UNS8 line, UNS8 nbBytes) -00480 { -00481 if (nbBytes > SDO_MAX_LENGTH_TRANSFERT) { -00482 MSG_ERR(0x1A35,"SDO Size of data too large. Exceed SDO_MAX_LENGTH_TRANSFERT", nbBytes); -00483 return 0xFF; -00484 } -00485 d->transfers[line].count = nbBytes; -00486 return 0; -00487 } -00488 -00498 UNS8 sendSDO (CO_Data* d, UNS8 whoami, s_SDO sdo) -00499 { -00500 UNS16 offset; -00501 UNS16 lastIndex; -00502 UNS8 found = 0; -00503 Message m; -00504 UNS8 i; -00505 UNS32 * pwCobId = NULL; -00506 UNS32 * pwNodeId = NULL; -00507 -00508 MSG_WAR(0x3A38, "sendSDO",0); -00509 if( !((d->nodeState == Operational) || (d->nodeState == Pre_operational ))) { -00510 MSG_WAR(0x2A39, "unable to send the SDO (not in op or pre-op mode", d->nodeState); -00511 return 0xFF; -00512 } -00513 -00514 /*get the server->client cobid*/ -00515 if ( whoami == SDO_SERVER ) {/*case server. Easy because today only one server SDO is authorized in CanFestival*/ -00516 offset = d->firstIndex->SDO_SVR; -00517 if (offset == 0) { -00518 MSG_ERR(0x1A42, "SendSDO : No SDO server found", 0); -00519 return 0xFF; -00520 } -00521 pwCobId = (UNS32*) d->objdict[offset].pSubindex[2].pObject; -00522 MSG_WAR(0x3A41, "I am server. cobId : ", *pwCobId); -00523 } -00524 else { /*case client*/ -00525 /* Get the client->server cobid.*/ -00526 UNS16 sdoNum = 0; -00527 offset = d->firstIndex->SDO_CLT; -00528 lastIndex = d->lastIndex->SDO_CLT; -00529 if (offset == 0) { -00530 MSG_ERR(0x1A42, "SendSDO : No SDO client index found", 0); -00531 return 0xFF; -00532 } -00533 /* First, have to find at the index where is defined the communication with the server node */ -00534 while (offset <= lastIndex){ -00535 MSG_WAR(0x3A43,"Reading index : ", 0x1280 + sdoNum); -00536 if (d->objdict[offset].bSubCount <= 3) { -00537 MSG_ERR(0x1A28, "Subindex 3 not found at index ", 0x1280 + sdoNum); -00538 return 0xFF; -00539 } -00540 pwNodeId = (UNS32*) d->objdict[offset].pSubindex[3].pObject; -00541 MSG_WAR(0x3A44, "Found nodeId server = ", *pwNodeId); -00542 if(*pwNodeId == sdo.nodeId) { -00543 found = 1; -00544 break; -00545 } -00546 offset ++; -00547 sdoNum ++; -00548 } -00549 if (! found){ -00550 MSG_WAR (0x2A45, "No SDO client corresponds to the mesage to send to node ", sdo.nodeId); -00551 return 0xFF; -00552 } -00553 /* Second, read the cobid client->server */ -00554 pwCobId = (UNS32*) d->objdict[offset].pSubindex[1].pObject; -00555 } -00556 /* message copy for sending */ -00557 m.cob_id.w = *pwCobId; -00558 m.rtr = NOT_A_REQUEST; -00559 /* the length of SDO must be 8 */ -00560 m.len = 8; -00561 for (i = 0 ; i < 8 ; i++) { -00562 m.data[i] = sdo.body.data[i]; -00563 } -00564 return canSend(d->canHandle,&m); -00565 } -00566 -00578 UNS8 sendSDOabort (CO_Data* d, UNS8 whoami, UNS16 index, UNS8 subIndex, UNS32 abortCode) -00579 { -00580 s_SDO sdo; -00581 UNS8 ret; -00582 MSG_WAR(0x2A50,"Sending SDO abort ", abortCode); -00583 sdo.nodeId = *d->bDeviceNodeId; -00584 sdo.body.data[0] = 0x80; -00585 /* Index */ -00586 sdo.body.data[1] = index & 0xFF; /* LSB */ -00587 sdo.body.data[2] = (index >> 8) & 0xFF; /* MSB */ -00588 /* Subindex */ -00589 sdo.body.data[3] = subIndex; -00590 /* Data */ -00591 sdo.body.data[4] = (UNS8)(abortCode & 0xFF); -00592 sdo.body.data[5] = (UNS8)((abortCode >> 8) & 0xFF); -00593 sdo.body.data[6] = (UNS8)((abortCode >> 16) & 0xFF); -00594 sdo.body.data[7] = (UNS8)((abortCode >> 24) & 0xFF); -00595 ret = sendSDO(d, whoami, sdo); -00596 -00597 return ret; -00598 } -00599 -00608 UNS8 proceedSDO (CO_Data* d, Message *m) -00609 { -00610 UNS8 err; -00611 UNS8 line; -00612 UNS8 nbBytes; /* received or to be transmited. */ -00613 UNS8 nodeId = 0; /* The node from which the SDO is received */ -00614 UNS32 nodeId_32; /* node id in 32 bits, for temporary use */ -00615 UNS32 *pNodeId = NULL; -00616 UNS8 whoami = SDO_UNKNOWN; /* SDO_SERVER or SDO_CLIENT.*/ -00617 UNS32 errorCode; /* while reading or writing in the local object dictionary.*/ -00618 s_SDO sdo; /* SDO to transmit */ -00619 UNS16 index; -00620 UNS8 subIndex; -00621 UNS32 abortCode; -00622 UNS8 i,j; -00623 UNS32 * pCobId = NULL; -00624 UNS16 offset; -00625 UNS16 lastIndex; -00626 -00627 MSG_WAR(0x3A60, "proceedSDO ", 0); -00628 whoami = SDO_UNKNOWN; -00629 /* Looking for the cobId in the object dictionary. */ -00630 /* Am-I a server ? */ -00631 offset = d->firstIndex->SDO_SVR; -00632 lastIndex = d->lastIndex->SDO_SVR; -00633 j = 0; -00634 if(offset) while (offset <= lastIndex) { -00635 if (d->objdict[offset].bSubCount <= 1) { -00636 MSG_ERR(0x1A61, "Subindex 1 not found at index ", 0x1200 + j); -00637 return 0xFF; -00638 } -00639 pCobId = (UNS32*) d->objdict[offset].pSubindex[1].pObject; -00640 if ( *pCobId == (*m).cob_id.w ) { -00641 whoami = SDO_SERVER; -00642 MSG_WAR(0x3A62, "proceedSDO. I am server. index : ", 0x1200 + j); -00643 /* In case of server, the node id of the client may be unknown. So we put the index minus offset */ -00644 /* 0x1200 where the cobid received is defined. */ -00645 nodeId = j; -00646 break; -00647 } -00648 j++; -00649 offset++; -00650 } /* end while */ -00651 if (whoami == SDO_UNKNOWN) { -00652 /* Am-I client ? */ -00653 offset = d->firstIndex->SDO_CLT; -00654 lastIndex = d->lastIndex->SDO_CLT; -00655 j = 0; -00656 if(offset) while (offset <= lastIndex) { -00657 if (d->objdict[offset].bSubCount <= 3) { -00658 MSG_ERR(0x1A63, "Subindex 3 not found at index ", 0x1280 + j); -00659 return 0xFF; -00660 } -00661 /* a) Looking for the cobid received. */ -00662 pCobId = (UNS32*) d->objdict[offset].pSubindex[2].pObject; -00663 if (*pCobId == (*m).cob_id.w ) { -00664 /* b) cobid found, so reading the node id of the server. */ -00665 pNodeId = (UNS32*) d->objdict[offset].pSubindex[3].pObject; -00666 whoami = SDO_CLIENT; -00667 nodeId_32 = *pNodeId; -00668 nodeId = (UNS8)nodeId_32; -00669 MSG_WAR(0x3A64, "proceedSDO. I am server. index : ", 0x1280 + j); -00670 MSG_WAR(0x3A65, " Server nodeId : ", nodeId); -00671 break; -00672 } -00673 j++; -00674 offset++; -00675 } /* end while */ -00676 } -00677 if (whoami == SDO_UNKNOWN) { -00678 return 0xFF;/* This SDO was not for us ! */ -00679 } -00680 -00681 /* Test if the size of the SDO is ok */ -00682 if ( (*m).len != 8) { -00683 MSG_ERR(0x1A67, "Error size SDO. CobId : ", (*m).cob_id.w); -00684 failedSDO(d, nodeId, whoami, 0, 0, SDOABT_GENERAL_ERROR); -00685 return 0xFF; -00686 } -00687 -00688 if (whoami == SDO_CLIENT) { -00689 MSG_WAR(0x3A68, "I am CLIENT. Received SDO from nodeId : ", nodeId); -00690 } -00691 else { -00692 MSG_WAR(0x3A69, "I am SERVER. Received SDO cobId : ", (*m).cob_id.w); -00693 } -00694 -00695 /* Testing the command specifier */ -00696 /* Allowed : cs = 0, 1, 2, 3, 4. (= all except those for block tranfert). */ -00697 /* cs = other : Not allowed -> abort. */ -00698 switch (getSDOcs(m->data[0])) { -00699 -00700 case 0: -00701 /* I am SERVER */ -00702 if (whoami == SDO_SERVER) { -00703 /* Receiving a download segment data. */ -00704 /* A SDO transfert should have been yet initiated. */ -00705 err = getSDOlineOnUse( d, nodeId, whoami, &line ); -00706 if (!err) -00707 err = d->transfers[line].state != SDO_DOWNLOAD_IN_PROGRESS; -00708 if (err) { -00709 MSG_ERR(0x1A70, "SDO error : Received download segment for unstarted trans. index 0x1200 + ", -00710 nodeId); -00711 failedSDO(d, nodeId, whoami, 0, 0, SDOABT_LOCAL_CTRL_ERROR); -00712 return 0xFF; -00713 } -00714 /* Reset the wathdog */ -00715 RestartSDO_TIMER(line) -00716 MSG_WAR(0x3A71, "Received SDO download segment defined at index 0x1200 + ", nodeId); -00717 index = d->transfers[line].index; -00718 subIndex = d->transfers[line].subIndex; -00719 /* Toggle test. */ -00720 if (d->transfers[line].toggle != getSDOt(m->data[0])) { -00721 MSG_ERR(0x1A72, "SDO error : Toggle error : ", getSDOt(m->data[0])); -00722 failedSDO(d, nodeId, whoami, index, subIndex, SDOABT_TOGGLE_NOT_ALTERNED); -00723 return 0xFF; -00724 } -00725 /* Nb of data to be downloaded */ -00726 nbBytes = 7 - getSDOn3(m->data[0]); -00727 /* Store the data in the transfert structure. */ -00728 err = SDOtoLine(d, line, nbBytes, (*m).data + 1); -00729 if (err) { -00730 failedSDO(d, nodeId, whoami, index, subIndex, SDOABT_GENERAL_ERROR); -00731 return 0xFF; -00732 } -00733 /* Sending the SDO response, CS = 1 */ -00734 sdo.nodeId = *d->bDeviceNodeId; /* The node id of the server, (here it is the sender). */ -00735 sdo.body.data[0] = (1 << 5) | (d->transfers[line].toggle << 4); -00736 for (i = 1 ; i < 8 ; i++) -00737 sdo.body.data[i] = 0; -00738 MSG_WAR(0x3A73, "SDO. Send response to download request defined at index 0x1200 + ", nodeId); -00739 sendSDO(d, whoami, sdo); -00740 /* Inverting the toggle for the next segment. */ -00741 d->transfers[line].toggle = ! d->transfers[line].toggle & 1; -00742 /* If it was the last segment, */ -00743 if (getSDOc(m->data[0])) { -00744 /* Transfering line data to object dictionary. */ -00745 /* The code does not use the "d" of initiate frame. So it is safe if e=s=0 */ -00746 errorCode = SDOlineToObjdict(d, line); -00747 if (errorCode) { -00748 MSG_ERR(0x1A54, "SDO error : Unable to copy the data in the object dictionary", 0); -00749 failedSDO(d, nodeId, whoami, index, subIndex, errorCode); -00750 return 0xFF; -00751 } -00752 /* Release of the line */ -00753 resetSDOline(d, line); -00754 MSG_WAR(0x3A74, "SDO. End of download defined at index 0x1200 + ", nodeId); -00755 } -00756 } /* end if SERVER */ -00757 else { /* if CLIENT */ -00758 /* I am CLIENT */ -00759 /* It is a request for a previous upload segment. We should find a line opened for this.*/ -00760 err = getSDOlineOnUse( d, nodeId, whoami, &line); -00761 if (!err) -00762 err = d->transfers[line].state != SDO_UPLOAD_IN_PROGRESS; -00763 if (err) { -00764 MSG_ERR(0x1A75, "SDO error : Received segment response for unknown trans. from nodeId", nodeId); -00765 failedSDO(d, nodeId, whoami, 0, 0, SDOABT_LOCAL_CTRL_ERROR); -00766 return 0xFF; -00767 } -00768 /* Reset the wathdog */ -00769 RestartSDO_TIMER(line) -00770 index = d->transfers[line].index; -00771 subIndex = d->transfers[line].subIndex; -00772 /* test of the toggle; */ -00773 if (d->transfers[line].toggle != getSDOt(m->data[0])) { -00774 MSG_ERR(0x1A76, "SDO error : Received segment response Toggle error. from nodeId", nodeId); -00775 failedSDO(d, nodeId, whoami, index, subIndex, SDOABT_TOGGLE_NOT_ALTERNED); -00776 return 0xFF; -00777 } -00778 /* nb of data to be uploaded */ -00779 nbBytes = 7 - getSDOn3(m->data[0]); -00780 /* Storing the data in the line structure. */ -00781 err = SDOtoLine(d, line, nbBytes, (*m).data + 1); -00782 if (err) { -00783 failedSDO(d, nodeId, whoami, index, subIndex, SDOABT_GENERAL_ERROR); -00784 return 0xFF; -00785 } -00786 /* Inverting the toggle for the next segment. */ -00787 d->transfers[line].toggle = ! d->transfers[line].toggle & 1; -00788 /* If it was the last segment,*/ -00789 if ( getSDOc(m->data[0])) { -00790 /* Put in state finished */ -00791 /* The code is safe for the case e=s=0 in initiate frame. */ -00792 StopSDO_TIMER(line) -00793 d->transfers[line].state = SDO_FINISHED; -00794 if(d->transfers[line].Callback) (*d->transfers[line].Callback)(d,nodeId); -00795 -00796 MSG_WAR(0x3A77, "SDO. End of upload from node : ", nodeId); -00797 } -00798 else { /* more segments to receive */ -00799 /* Sending the request for the next segment. */ -00800 sdo.nodeId = nodeId; -00801 sdo.body.data[0] = (3 << 5) | (d->transfers[line].toggle << 4); -00802 for (i = 1 ; i < 8 ; i++) -00803 sdo.body.data[i] = 0; -00804 sendSDO(d, whoami, sdo); -00805 MSG_WAR(0x3A78, "SDO send upload segment request to nodeId", nodeId); -00806 } -00807 } /* End if CLIENT */ -00808 break; -00809 -00810 case 1: -00811 /* I am SERVER */ -00812 /* Receive of an initiate download */ -00813 if (whoami == SDO_SERVER) { -00814 index = getSDOindex(m->data[1],m->data[2]); -00815 subIndex = getSDOsubIndex(m->data[3]); -00816 MSG_WAR(0x3A79, "Received SDO Initiate Download (to store data) defined at index 0x1200 + ", -00817 nodeId); -00818 MSG_WAR(0x3A80, "Writing at index : ", index); -00819 MSG_WAR(0x3A80, "Writing at subIndex : ", subIndex); -00820 -00821 /* Search if a SDO transfert have been yet initiated */ -00822 err = getSDOlineOnUse( d, nodeId, whoami, &line ); -00823 if (! err) { -00824 MSG_ERR(0x1A81, "SDO error : Transmission yet started.", 0); -00825 failedSDO(d, nodeId, whoami, index, subIndex, SDOABT_LOCAL_CTRL_ERROR); -00826 return 0xFF; -00827 } -00828 /* No line on use. Great ! */ -00829 /* Try to open a new line. */ -00830 err = getSDOfreeLine( d, whoami, &line ); -00831 if (err) { -00832 MSG_ERR(0x1A82, "SDO error : No line free, too many SDO in progress. Aborted.", 0); -00833 failedSDO(d, nodeId, whoami, index, subIndex, SDOABT_LOCAL_CTRL_ERROR); -00834 return 0xFF; -00835 } -00836 initSDOline(d, line, nodeId, index, subIndex, SDO_DOWNLOAD_IN_PROGRESS); -00837 -00838 if (getSDOe(m->data[0])) { /* If SDO expedited */ -00839 /* nb of data to be downloaded */ -00840 nbBytes = 4 - getSDOn2(m->data[0]); -00841 /* Storing the data in the line structure. */ -00842 d->transfers[line].count = nbBytes; -00843 err = SDOtoLine(d, line, nbBytes, (*m).data + 4); -00844 -00845 if (err) { -00846 failedSDO(d, nodeId, whoami, index, subIndex, SDOABT_GENERAL_ERROR); -00847 return 0xFF; -00848 } -00849 -00850 /* SDO expedited -> transfert finished. Data can be stored in the dictionary. */ -00851 /*The line will be reseted when it is downloading in the dictionary. */ -00852 MSG_WAR(0x3A83, "SDO Initiate Download is an expedited transfert. Finished.: ", nodeId); -00853 /* Transfering line data to object dictionary. */ -00854 errorCode = SDOlineToObjdict(d, line); -00855 if (errorCode) { -00856 MSG_ERR(0x1A84, "SDO error : Unable to copy the data in the object dictionary", 0); -00857 failedSDO(d, nodeId, whoami, index, subIndex, errorCode); -00858 return 0xFF; -00859 } -00860 /* Release of the line. */ -00861 resetSDOline(d, line); -00862 } -00863 else {/* So, if it is not an expedited transfert */ -00864 if (getSDOs(m->data[0])) { -00865 /* TODO : if e and s = 0, not reading m->data[4] but put nbBytes = 0 */ -00866 nbBytes = m->data[4]; /* Transfert limited to 255 bytes. */ -00867 err = setSDOlineRestBytes(d, nodeId, nbBytes); -00868 if (err) { -00869 failedSDO(d, nodeId, whoami, index, subIndex, SDOABT_GENERAL_ERROR); -00870 return 0xFF; -00871 } -00872 } -00873 } -00874 /*Sending a SDO, cs=3*/ -00875 sdo.nodeId = *d->bDeviceNodeId; /* The node id of the server, (here it is the sender).*/ -00876 sdo.body.data[0] = 3 << 5; -00877 sdo.body.data[1] = index & 0xFF; /* LSB */ -00878 sdo.body.data[2] = (index >> 8) & 0xFF; /* MSB */ -00879 sdo.body.data[3] = subIndex; -00880 for (i = 4 ; i < 8 ; i++) -00881 sdo.body.data[i] = 0; -00882 sendSDO(d, whoami, sdo); -00883 } /* end if I am SERVER */ -00884 else { -00885 /* I am CLIENT */ -00886 /* It is a response for a previous download segment. We should find a line opened for this. */ -00887 err = getSDOlineOnUse( d, nodeId, whoami, &line); -00888 if (!err) -00889 err = d->transfers[line].state != SDO_DOWNLOAD_IN_PROGRESS; -00890 if (err) { -00891 MSG_ERR(0x1A85, "SDO error : Received segment response for unknown trans. from nodeId", nodeId); -00892 failedSDO(d, nodeId, whoami, 0, 0, SDOABT_LOCAL_CTRL_ERROR); -00893 return 0xFF; -00894 } -00895 /* Reset the wathdog */ -00896 RestartSDO_TIMER(line) -00897 index = d->transfers[line].index; -00898 subIndex = d->transfers[line].subIndex; -00899 /* test of the toggle; */ -00900 if (d->transfers[line].toggle != getSDOt(m->data[0])) { -00901 MSG_ERR(0x1A86, "SDO error : Received segment response Toggle error. from nodeId", nodeId); -00902 failedSDO(d, nodeId, whoami, index, subIndex, SDOABT_TOGGLE_NOT_ALTERNED); -00903 return 0xFF; -00904 } -00905 -00906 /* End transmission or downloading next segment. We need to know if it will be the last one. */ -00907 getSDOlineRestBytes(d, line, &nbBytes); -00908 if (nbBytes == 0) { -00909 MSG_WAR(0x3A87, "SDO End download. segment response received. OK. from nodeId", nodeId); -00910 StopSDO_TIMER(line) -00911 d->transfers[line].state = SDO_FINISHED; -00912 if(d->transfers[line].Callback) (*d->transfers[line].Callback)(d,nodeId); -00913 return 0x00; -00914 } -00915 /* At least one transfer to send. */ -00916 if (nbBytes > 7) { -00917 /* several segments to download.*/ -00918 /* code to send the next segment. (cs = 0; c = 0) */ -00919 d->transfers[line].toggle = ! d->transfers[line].toggle & 1; -00920 sdo.nodeId = nodeId; /* The server node Id; */ -00921 sdo.body.data[0] = (d->transfers[line].toggle << 4); -00922 err = lineToSDO(d, line, 7, sdo.body.data + 1); -00923 if (err) { -00924 failedSDO(d, nodeId, whoami, index, subIndex, SDOABT_GENERAL_ERROR); -00925 return 0xFF; -00926 } -00927 } -00928 else { -00929 /* Last segment. */ -00930 /* code to send the last segment. (cs = 0; c = 1)*/ -00931 d->transfers[line].toggle = ! d->transfers[line].toggle & 1; -00932 sdo.nodeId = nodeId; /* The server node Id; */ -00933 sdo.body.data[0] = (d->transfers[line].toggle << 4) | ((7 - nbBytes) << 1) | 1; -00934 err = lineToSDO(d, line, nbBytes, sdo.body.data + 1); -00935 if (err) { -00936 failedSDO(d, nodeId, whoami, index, subIndex, SDOABT_GENERAL_ERROR); -00937 return 0xFF; -00938 } -00939 for (i = nbBytes + 1 ; i < 8 ; i++) -00940 sdo.body.data[i] = 0; -00941 } -00942 MSG_WAR(0x3A88, "SDO sending download segment to nodeId", nodeId); -00943 sendSDO(d, whoami, sdo); -00944 } /* end if I am a CLIENT */ -00945 break; -00946 -00947 case 2: -00948 /* I am SERVER */ -00949 /* Receive of an initiate upload.*/ -00950 if (whoami == SDO_SERVER) { -00951 index = getSDOindex(m->data[1],m->data[2]); -00952 subIndex = getSDOsubIndex(m->data[3]); -00953 MSG_WAR(0x3A89, "Received SDO Initiate upload (to send data) defined at index 0x1200 + ", -00954 nodeId); -00955 MSG_WAR(0x3A90, "Reading at index : ", index); -00956 MSG_WAR(0x3A91, "Reading at subIndex : ", subIndex); -00957 /* Search if a SDO transfert have been yet initiated*/ -00958 err = getSDOlineOnUse( d, nodeId, whoami, &line ); -00959 if (! err) { -00960 MSG_ERR(0x1A92, "SDO error : Transmission yet started at line : ", line); -00961 MSG_WAR(0x3A93, "nodeId = ", nodeId); -00962 failedSDO(d, nodeId, whoami, index, subIndex, SDOABT_LOCAL_CTRL_ERROR); -00963 return 0xFF; -00964 } -00965 /* No line on use. Great !*/ -00966 /* Try to open a new line.*/ -00967 err = getSDOfreeLine( d, whoami, &line ); -00968 if (err) { -00969 MSG_ERR(0x1A71, "SDO error : No line free, too many SDO in progress. Aborted.", 0); -00970 failedSDO(d, nodeId, whoami, index, subIndex, SDOABT_LOCAL_CTRL_ERROR); -00971 return 0xFF; -00972 } -00973 initSDOline(d, line, nodeId, index, subIndex, SDO_UPLOAD_IN_PROGRESS); -00974 /* Transfer data from dictionary to the line structure. */ -00975 errorCode = objdictToSDOline(d, line); -00976 -00977 if (errorCode) { -00978 MSG_ERR(0x1A94, "SDO error : Unable to copy the data from object dictionary. Err code : ", -00979 errorCode); -00980 failedSDO(d, nodeId, whoami, index, subIndex, errorCode); -00981 return 0xFF; -00982 } -00983 /* Preparing the response.*/ -00984 getSDOlineRestBytes(d, line, &nbBytes); /* Nb bytes to transfer ? */ -00985 sdo.nodeId = nodeId; /* The server node Id; */ -00986 if (nbBytes > 4) { -00987 /* normal transfert. (segmented). */ -00988 /* code to send the initiate upload response. (cs = 2) */ -00989 sdo.body.data[0] = (2 << 5) | 1; -00990 sdo.body.data[1] = index & 0xFF; /* LSB */ -00991 sdo.body.data[2] = (index >> 8) & 0xFF; /* MSB */ -00992 sdo.body.data[3] = subIndex; -00993 sdo.body.data[4] = nbBytes; /* Limitation of canfestival2 : Max tranfert is 256 bytes.*/ -00994 /* It takes too much memory to upgrate to 2^32 because the size of data is also coded */ -00995 /* in the object dictionary, at every index and subindex. */ -00996 for (i = 5 ; i < 8 ; i++) -00997 sdo.body.data[i] = 0; -00998 MSG_WAR(0x3A95, "SDO. Sending normal upload initiate response defined at index 0x1200 + ", nodeId); -00999 sendSDO(d, whoami, sdo); -01000 } -01001 else { -01002 /* Expedited upload. (cs = 2 ; e = 1) */ -01003 sdo.body.data[0] = (2 << 5) | ((4 - nbBytes) << 2) | 3; -01004 sdo.body.data[1] = index & 0xFF; /* LSB */ -01005 sdo.body.data[2] = (index >> 8) & 0xFF; /* MSB */ -01006 sdo.body.data[3] = subIndex; -01007 err = lineToSDO(d, line, nbBytes, sdo.body.data + 4); -01008 if (err) { -01009 failedSDO(d, nodeId, whoami, index, subIndex, SDOABT_GENERAL_ERROR); -01010 return 0xFF; -01011 } -01012 for (i = 4 + nbBytes ; i < 8 ; i++) -01013 sdo.body.data[i] = 0; -01014 MSG_WAR(0x3A96, "SDO. Sending expedited upload initiate response defined at index 0x1200 + ", -01015 nodeId); -01016 sendSDO(d, whoami, sdo); -01017 /* Release the line.*/ -01018 resetSDOline(d, line); -01019 } -01020 } /* end if I am SERVER*/ -01021 else { -01022 /* I am CLIENT */ -01023 /* It is the response for the previous initiate upload request.*/ -01024 /* We should find a line opened for this. */ -01025 err = getSDOlineOnUse( d, nodeId, whoami, &line); -01026 if (!err) -01027 err = d->transfers[line].state != SDO_UPLOAD_IN_PROGRESS; -01028 if (err) { -01029 MSG_ERR(0x1A97, "SDO error : Received response for unknown upload request from nodeId", nodeId); -01030 failedSDO(d, nodeId, whoami, 0, 0, SDOABT_LOCAL_CTRL_ERROR); -01031 return 0xFF; -01032 } -01033 /* Reset the wathdog */ -01034 RestartSDO_TIMER(line) -01035 index = d->transfers[line].index; -01036 subIndex = d->transfers[line].subIndex; -01037 -01038 if (getSDOe(m->data[0])) { /* If SDO expedited */ -01039 /* nb of data to be uploaded */ -01040 nbBytes = 4 - getSDOn2(m->data[0]); -01041 /* Storing the data in the line structure. */ -01042 err = SDOtoLine(d, line, nbBytes, (*m).data + 4); -01043 if (err) { -01044 failedSDO(d, nodeId, whoami, index, subIndex, SDOABT_GENERAL_ERROR); -01045 return 0xFF; -01046 } -01047 /* SDO expedited -> transfert finished. data are available via getReadResultNetworkDict(). */ -01048 MSG_WAR(0x3A98, "SDO expedited upload finished. Response received from node : ", nodeId); -01049 StopSDO_TIMER(line) -01050 d->transfers[line].count = nbBytes; -01051 d->transfers[line].state = SDO_FINISHED; -01052 if(d->transfers[line].Callback) (*d->transfers[line].Callback)(d,nodeId); -01053 return 0; -01054 } -01055 else { /* So, if it is not an expedited transfert */ -01056 /* Storing the nb of data to receive. */ -01057 if (getSDOs(m->data[0])) { -01058 nbBytes = m->data[4]; /* Remember the limitation to 255 bytes to transfert */ -01059 err = setSDOlineRestBytes(d, line, nbBytes); -01060 if (err) { -01061 failedSDO(d, nodeId, whoami, index, subIndex, SDOABT_GENERAL_ERROR); -01062 return 0xFF; -01063 } -01064 } -01065 /* Requesting next segment. (cs = 3) */ -01066 sdo.nodeId = nodeId; -01067 sdo.body.data[0] = 3 << 5; -01068 for (i = 1 ; i < 8 ; i++) -01069 sdo.body.data[i] = 0; -01070 MSG_WAR(0x3A99, "SDO. Sending upload segment request to node : ", nodeId); -01071 sendSDO(d, whoami, sdo); -01072 } -01073 } /* End if CLIENT */ -01074 break; -01075 -01076 case 3: -01077 /* I am SERVER */ -01078 if (whoami == SDO_SERVER) { -01079 /* Receiving a upload segment. */ -01080 /* A SDO transfert should have been yet initiated. */ -01081 err = getSDOlineOnUse( d, nodeId, whoami, &line ); -01082 if (!err) -01083 err = d->transfers[line].state != SDO_UPLOAD_IN_PROGRESS; -01084 if (err) { -01085 MSG_ERR(0x1AA0, "SDO error : Received upload segment for unstarted trans. index 0x1200 + ", -01086 nodeId); -01087 failedSDO(d, nodeId, whoami, 0, 0, SDOABT_LOCAL_CTRL_ERROR); -01088 return 0xFF; -01089 } -01090 /* Reset the wathdog */ -01091 RestartSDO_TIMER(line) -01092 MSG_WAR(0x3AA1, "Received SDO upload segment defined at index 0x1200 + ", nodeId); -01093 index = d->transfers[line].index; -01094 subIndex = d->transfers[line].subIndex; -01095 /* Toggle test.*/ -01096 if (d->transfers[line].toggle != getSDOt(m->data[0])) { -01097 MSG_ERR(0x1AA2, "SDO error : Toggle error : ", getSDOt(m->data[0])); -01098 failedSDO(d, nodeId, whoami, index, subIndex, SDOABT_TOGGLE_NOT_ALTERNED); -01099 return 0xFF; -01100 } -01101 /* Uploading next segment. We need to know if it will be the last one. */ -01102 getSDOlineRestBytes(d, line, &nbBytes); -01103 if (nbBytes > 7) { -01104 /* The segment to transfer is not the last one.*/ -01105 /* code to send the next segment. (cs = 0; c = 0) */ -01106 sdo.nodeId = nodeId; /* The server node Id; */ -01107 sdo.body.data[0] = (d->transfers[line].toggle << 4); -01108 err = lineToSDO(d, line, 7, sdo.body.data + 1); -01109 if (err) { -01110 failedSDO(d, nodeId, whoami, index, subIndex, SDOABT_GENERAL_ERROR); -01111 return 0xFF; -01112 } -01113 /* Inverting the toggle for the next tranfert. */ -01114 d->transfers[line].toggle = ! d->transfers[line].toggle & 1; -01115 MSG_WAR(0x3AA3, "SDO. Sending upload segment defined at index 0x1200 + ", nodeId); -01116 sendSDO(d, whoami, sdo); -01117 } -01118 else { -01119 /* Last segment. */ -01120 /* code to send the last segment. (cs = 0; c = 1) */ -01121 sdo.nodeId = nodeId; -01122 sdo.body.data[0] = (d->transfers[line].toggle << 4) | ((7 - nbBytes) << 1) | 1; -01123 err = lineToSDO(d, line, nbBytes, sdo.body.data + 1); -01124 if (err) { -01125 failedSDO(d, nodeId, whoami, index, subIndex, SDOABT_GENERAL_ERROR); -01126 return 0xFF; -01127 } -01128 for (i = nbBytes + 1 ; i < 8 ; i++) -01129 sdo.body.data[i] = 0; -01130 MSG_WAR(0x3AA4, "SDO. Sending last upload segment defined at index 0x1200 + ", nodeId); -01131 sendSDO(d, whoami, sdo); -01132 /* Release the line */ -01133 resetSDOline(d, line); -01134 } -01135 } /* end if SERVER*/ -01136 else { -01137 /* I am CLIENT */ -01138 /* It is the response for the previous initiate download request. */ -01139 /* We should find a line opened for this. */ -01140 err = getSDOlineOnUse( d, nodeId, whoami, &line); -01141 if (!err) -01142 err = d->transfers[line].state != SDO_DOWNLOAD_IN_PROGRESS; -01143 if (err) { -01144 MSG_ERR(0x1AA5, "SDO error : Received response for unknown download request from nodeId", nodeId); -01145 failedSDO(d, nodeId, whoami, 0, 0, SDOABT_LOCAL_CTRL_ERROR); -01146 return 0xFF; -01147 } -01148 /* Reset the watchdog */ -01149 RestartSDO_TIMER(line) -01150 index = d->transfers[line].index; -01151 subIndex = d->transfers[line].subIndex; -01152 /* End transmission or requesting next segment. */ -01153 getSDOlineRestBytes(d, line, &nbBytes); -01154 if (nbBytes == 0) { -01155 MSG_WAR(0x3AA6, "SDO End download expedited. Response received. from nodeId", nodeId); -01156 StopSDO_TIMER(line) -01157 d->transfers[line].state = SDO_FINISHED; -01158 if(d->transfers[line].Callback) (*d->transfers[line].Callback)(d,nodeId); -01159 return 0x00; -01160 } -01161 if (nbBytes > 7) { -01162 /* more than one request to send */ -01163 /* code to send the next segment. (cs = 0; c = 0) */ -01164 sdo.nodeId = nodeId; -01165 sdo.body.data[0] = (d->transfers[line].toggle << 4); -01166 err = lineToSDO(d, line, 7, sdo.body.data + 1); -01167 if (err) { -01168 failedSDO(d, nodeId, whoami, index, subIndex, SDOABT_GENERAL_ERROR); -01169 return 0xFF; -01170 } -01171 } -01172 else { -01173 /* Last segment.*/ -01174 /* code to send the last segment. (cs = 0; c = 1) */ -01175 sdo.nodeId = nodeId; /* The server node Id; */ -01176 sdo.body.data[0] = (d->transfers[line].toggle << 4) | ((7 - nbBytes) << 1) | 1; -01177 err = lineToSDO(d, line, nbBytes, sdo.body.data + 1); -01178 if (err) { -01179 failedSDO(d, nodeId, whoami, index, subIndex, SDOABT_GENERAL_ERROR); -01180 return 0xFF; -01181 } -01182 for (i = nbBytes + 1 ; i < 8 ; i++) -01183 sdo.body.data[i] = 0; -01184 } -01185 MSG_WAR(0x3AA7, "SDO sending download segment to nodeId", nodeId); -01186 sendSDO(d, whoami, sdo); -01187 -01188 } /* end if I am a CLIENT */ -01189 break; -01190 -01191 case 4: -01192 abortCode = (*m).data[3] | -01193 ((UNS32)m->data[5] << 8) | -01194 ((UNS32)m->data[6] << 16) | -01195 ((UNS32)m->data[7] << 24); -01196 /* Received SDO abort. */ -01197 /* Looking for the line concerned. */ -01198 if (whoami == SDO_SERVER) { -01199 err = getSDOlineOnUse( d, nodeId, whoami, &line ); -01200 if (!err) { -01201 resetSDOline( d, line ); -01202 MSG_WAR(0x3AA8, "SD0. Received SDO abort. Line released. Code : ", abortCode); -01203 } -01204 else -01205 MSG_WAR(0x3AA9, "SD0. Received SDO abort. No line found. Code : ", abortCode); -01206 /* Tips : The end user has no way to know that the server node has received an abort SDO. */ -01207 /* Its is ok, I think.*/ -01208 } -01209 else { /* If I am CLIENT */ -01210 err = getSDOlineOnUse( d, nodeId, whoami, &line ); -01211 if (!err) { -01212 /* The line *must* be released by the core program. */ -01213 StopSDO_TIMER(line) -01214 d->transfers[line].state = SDO_ABORTED_RCV; -01215 d->transfers[line].abortCode = abortCode; -01216 MSG_WAR(0x3AB0, "SD0. Received SDO abort. Line state ABORTED. Code : ", abortCode); -01217 if(d->transfers[line].Callback) (*d->transfers[line].Callback)(d,nodeId); -01218 } -01219 else -01220 MSG_WAR(0x3AB1, "SD0. Received SDO abort. No line found. Code : ", abortCode); -01221 } -01222 break; -01223 default: -01224 /* Error : Unknown cs */ -01225 MSG_ERR(0x1AB2, "SDO. Received unknown command specifier : ", getSDOcs(m->data[0])); -01226 return 0xFF; -01227 -01228 } /* End switch */ -01229 return 0; -01230 } -01231 -01247 INLINE UNS8 _writeNetworkDict (CO_Data* d, UNS8 nodeId, UNS16 index, -01248 UNS8 subIndex, UNS8 count, UNS8 dataType, void *data, SDOCallback_t Callback, UNS8 endianize) -01249 { -01250 UNS8 err; -01251 UNS8 SDOfound = 0; -01252 UNS8 line; -01253 s_SDO sdo; /* SDO to transmit */ -01254 UNS8 i, j; -01255 UNS16 lastIndex; -01256 UNS16 offset; -01257 UNS32 *pNodeIdServer; -01258 UNS32 nodeIdServer; -01259 -01260 MSG_WAR(0x3AC0, "Send SDO to write in the dictionary of node : ", nodeId); -01261 MSG_WAR(0x3AC1, " At index : ", index); -01262 MSG_WAR(0x3AC2, " subIndex : ", subIndex); -01263 MSG_WAR(0x3AC3, " nb bytes : ", count); -01264 -01265 /* Verify that there is no SDO communication yet. */ -01266 err = getSDOlineOnUse(d, nodeId, SDO_CLIENT, &line); -01267 if (!err) { -01268 MSG_ERR(0x1AC4, "SDO error : Communication yet established. with node : ", nodeId); -01269 return 0xFF; -01270 } -01271 /* Taking the line ... */ -01272 err = getSDOfreeLine( d, SDO_CLIENT, &line ); -01273 if (err) { -01274 MSG_ERR(0x1AC5, "SDO error : No line free, too many SDO in progress. Aborted for node : ", nodeId); -01275 return (0xFF); -01276 } -01277 /* Check which SDO to use to communicate with the node */ -01278 offset = d->firstIndex->SDO_CLT; -01279 lastIndex = d->lastIndex->SDO_CLT; -01280 if (offset == 0) { -01281 MSG_ERR(0x1AC6, "writeNetworkDict : No SDO client index found", 0); -01282 return 0xFF; -01283 } -01284 i = 0; -01285 while (offset <= lastIndex) { -01286 if (d->objdict[offset].bSubCount <= 3) { -01287 MSG_ERR(0x1AC8, "Subindex 3 not found at index ", 0x1280 + i); -01288 return 0xFF; -01289 } -01290 /* looking for the nodeId server */ -01291 pNodeIdServer = (UNS32*) d->objdict[offset].pSubindex[3].pObject; -01292 nodeIdServer = *pNodeIdServer; -01293 MSG_WAR(0x1AD2, "index : ", 0x1280 + i); -01294 MSG_WAR(0x1AD3, "nodeIdServer : ", nodeIdServer); -01295 -01296 if(nodeIdServer == (UNS32)nodeId) { -01297 SDOfound = 1; -01298 break; -01299 } -01300 offset++; -01301 i++; -01302 } /* end while */ -01303 if (!SDOfound) { -01304 MSG_ERR(0x1AC9, "SDO. Error. No client found to communicate with node : ", nodeId); -01305 return 0xFF; -01306 } -01307 MSG_WAR(0x3AD0," SDO client defined at index : ", 0x1280 + i); -01308 initSDOline(d, line, nodeId, index, subIndex, SDO_DOWNLOAD_IN_PROGRESS); -01309 d->transfers[line].count = count; -01310 d->transfers[line].dataType = dataType; -01311 -01312 /* Copy data to transfers structure. */ -01313 for (j = 0 ; j < count ; j++) { -01314 # ifdef CANOPEN_BIG_ENDIAN -01315 if (dataType == 0 && endianize) -01316 d->transfers[line].data[count - 1 - j] = ((char *)data)[j]; -01317 else /* String of bytes. */ -01318 d->transfers[line].data[j] = ((char *)data)[j]; -01319 # else -01320 d->transfers[line].data[j] = ((char *)data)[j]; -01321 # endif -01322 } -01323 /* Send the SDO to the server. Initiate download, cs=1. */ -01324 sdo.nodeId = nodeId; -01325 if (count <= 4) { /* Expedited transfert */ -01326 sdo.body.data[0] = (1 << 5) | ((4 - count) << 2) | 3; -01327 for (i = 4 ; i < 8 ; i++) -01328 sdo.body.data[i] = d->transfers[line].data[i - 4]; -01329 d->transfers[line].offset = count; -01330 } -01331 else { -01332 sdo.body.data[0] = (1 << 5) | 1; -01333 sdo.body.data[4] = count; /* nb of byte to transmit. Max = 255. (canfestival2 limitation). */ -01334 for (i = 5 ; i < 8 ; i++) -01335 sdo.body.data[i] = 0; -01336 } -01337 sdo.body.data[1] = index & 0xFF; /* LSB */ -01338 sdo.body.data[2] = (index >> 8) & 0xFF; /* MSB */ -01339 sdo.body.data[3] = subIndex; -01340 -01341 d->transfers[line].Callback = Callback; -01342 -01343 err = sendSDO(d, SDO_CLIENT, sdo); -01344 if (err) { -01345 MSG_ERR(0x1AD1, "SDO. Error while sending SDO to node : ", nodeId); -01346 /* release the line */ -01347 resetSDOline(d, line); -01348 return 0xFF; -01349 } -01350 -01351 -01352 return 0; -01353 } -01354 -01368 UNS8 writeNetworkDict (CO_Data* d, UNS8 nodeId, UNS16 index, -01369 UNS8 subIndex, UNS8 count, UNS8 dataType, void *data) -01370 { -01371 return _writeNetworkDict (d, nodeId, index, subIndex, count, dataType, data, NULL, 1); -01372 } -01373 -01388 UNS8 writeNetworkDictCallBack (CO_Data* d, UNS8 nodeId, UNS16 index, -01389 UNS8 subIndex, UNS8 count, UNS8 dataType, void *data, SDOCallback_t Callback) -01390 { -01391 return _writeNetworkDict (d, nodeId, index, subIndex, count, dataType, data, Callback, 1); -01392 } -01393 -01406 INLINE UNS8 _readNetworkDict (CO_Data* d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 dataType, SDOCallback_t Callback) -01407 { -01408 UNS8 err; -01409 UNS8 SDOfound = 0; -01410 UNS8 i; -01411 UNS8 line; -01412 s_SDO sdo; /* SDO to transmit */ -01413 UNS32 *pNodeIdServer; -01414 UNS32 nodeIdServer; -01415 UNS16 offset; -01416 UNS16 lastIndex; -01417 MSG_WAR(0x3AD5, "Send SDO to read in the dictionary of node : ", nodeId); -01418 MSG_WAR(0x3AD6, " At index : ", index); -01419 MSG_WAR(0x3AD7, " subIndex : ", subIndex); -01420 -01421 -01422 /* Verify that there is no SDO communication yet. */ -01423 err = getSDOlineOnUse(d, nodeId, SDO_CLIENT, &line); -01424 if (!err) { -01425 MSG_ERR(0x1AD8, "SDO error : Communication yet established. with node : ", nodeId); -01426 return 0xFF; -01427 } -01428 /* Taking the line ... */ -01429 err = getSDOfreeLine( d, SDO_CLIENT, &line ); -01430 if (err) { -01431 MSG_ERR(0x1AD9, "SDO error : No line free, too many SDO in progress. Aborted for node : ", nodeId); -01432 return (0xFF); -01433 } -01434 else -01435 MSG_WAR(0x3AE0, "Transmission on line : ", line); -01436 -01437 /* Check which SDO to use to communicate with the node */ -01438 offset = d->firstIndex->SDO_CLT; -01439 lastIndex = d->lastIndex->SDO_CLT; -01440 if (offset == 0) { -01441 MSG_ERR(0x1AE1, "writeNetworkDict : No SDO client index found", 0); -01442 return 0xFF; -01443 } -01444 i = 0; -01445 while (offset <= lastIndex) { -01446 if (d->objdict[offset].bSubCount <= 3) { -01447 MSG_ERR(0x1AE2, "Subindex 3 not found at index ", 0x1280 + i); -01448 return 0xFF; -01449 } -01450 /* looking for the nodeId server */ -01451 pNodeIdServer = (UNS32*) d->objdict[offset].pSubindex[3].pObject; -01452 nodeIdServer = *pNodeIdServer; -01453 -01454 if(nodeIdServer == (UNS32)nodeId) { -01455 SDOfound = 1; -01456 break; -01457 } -01458 offset++; -01459 i++; -01460 } /* end while */ -01461 if (!SDOfound) { -01462 MSG_ERR(0x1AE3, "SDO. Error. No client found to communicate with node : ", nodeId); -01463 return 0xFF; -01464 } -01465 MSG_WAR(0x3AE4," SDO client defined at index : ", 0x1280 + i); -01466 initSDOline(d, line, nodeId, index, subIndex, SDO_UPLOAD_IN_PROGRESS); -01467 getSDOlineOnUse(d, nodeId, SDO_CLIENT, &line); -01468 sdo.nodeId = nodeId; -01469 /* Send the SDO to the server. Initiate upload, cs=2. */ -01470 d->transfers[line].dataType = dataType; -01471 sdo.body.data[0] = (2 << 5); -01472 sdo.body.data[1] = index & 0xFF; /* LSB */ -01473 sdo.body.data[2] = (index >> 8) & 0xFF; /* MSB */ -01474 sdo.body.data[3] = subIndex; -01475 for (i = 4 ; i < 8 ; i++) -01476 sdo.body.data[i] = 0; -01477 d->transfers[line].Callback = Callback; -01478 err = sendSDO(d, SDO_CLIENT, sdo); -01479 if (err) { -01480 MSG_ERR(0x1AE5, "SDO. Error while sending SDO to node : ", nodeId); -01481 /* release the line */ -01482 resetSDOline(d, line); -01483 return 0xFF; -01484 } -01485 return 0; -01486 } -01487 -01499 UNS8 readNetworkDict (CO_Data* d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 dataType) -01500 { -01501 return _readNetworkDict (d, nodeId, index, subIndex, dataType, NULL); -01502 } -01503 -01516 UNS8 readNetworkDictCallback (CO_Data* d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 dataType, SDOCallback_t Callback) -01517 { -01518 return _readNetworkDict (d, nodeId, index, subIndex, dataType, Callback); -01519 } -01520 -01532 UNS8 getReadResultNetworkDict (CO_Data* d, UNS8 nodeId, void* data, UNS8 *size, -01533 UNS32 * abortCode) -01534 { -01535 UNS8 i; -01536 UNS8 err; -01537 UNS8 line; -01538 * size = 0; -01539 -01540 /* Looking for the line tranfert. */ -01541 err = getSDOlineOnUse(d, nodeId, SDO_CLIENT, &line); -01542 if (err) { -01543 MSG_ERR(0x1AF0, "SDO error : No line found for communication with node : ", nodeId); -01544 return SDO_ABORTED_INTERNAL; -01545 } -01546 if (d->transfers[line].state != SDO_FINISHED) -01547 return d->transfers[line].state; -01548 -01549 /* Transfert is finished. Put the value in the data. */ -01550 * size = (UNS8)d->transfers[line].count; -01551 for ( i = 0 ; i < *size ; i++) { -01552 # ifdef CANOPEN_BIG_ENDIAN -01553 if (d->transfers[line].dataType != visible_string) -01554 ( (char *) data)[*size - 1 - i] = d->transfers[line].data[i]; -01555 else /* String of bytes. */ -01556 ( (char *) data)[i] = d->transfers[line].data[i]; -01557 # else -01558 ( (char *) data)[i] = d->transfers[line].data[i]; -01559 # endif -01560 } -01561 return SDO_FINISHED; -01562 } -01563 -01573 UNS8 getWriteResultNetworkDict (CO_Data* d, UNS8 nodeId, UNS32 * abortCode) -01574 { -01575 UNS8 line = 0; -01576 UNS8 err; -01577 -01578 * abortCode = 0; -01579 /* Looking for the line tranfert. */ -01580 err = getSDOlineOnUse(d, nodeId, SDO_CLIENT, &line); -01581 if (err) { -01582 MSG_ERR(0x1AF1, "SDO error : No line found for communication with node : ", nodeId); -01583 return SDO_ABORTED_INTERNAL; -01584 } -01585 * abortCode = d->transfers[line].abortCode; -01586 return d->transfers[line].state; -01587 } -
#include "objacces.h"
#include "sdo.h"
#include "canfestival.h"
-Include dependency graph for sdo.c:
-Go to the source code of this file.
Defines | |
#define | NO_INLINE |
#define | INLINE |
#define | getSDOcs(byte) (byte >> 5) |
#define | getSDOn2(byte) ((byte >> 2) & 3) |
#define | getSDOn3(byte) ((byte >> 1) & 7) |
#define | getSDOe(byte) ((byte >> 1) & 1) |
#define | getSDOs(byte) (byte & 1) |
#define | getSDOc(byte) (byte & 1) |
#define | getSDOt(byte) ((byte >> 4) & 1) |
#define | getSDOindex(byte1, byte2) ((byte2 << 8) | (byte1)) |
#define | getSDOsubIndex(byte3) (byte3) |
#define | StopSDO_TIMER(id) |
#define | StartSDO_TIMER(id) |
#define | RestartSDO_TIMER(id) |
Functions | |
INLINE UNS8 | _writeNetworkDict (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 count, UNS8 dataType, void *data, SDOCallback_t Callback, UNS8 endianize) |
INLINE UNS8 | _readNetworkDict (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 dataType, SDOCallback_t Callback) |
void | SDOTimeoutAlarm (CO_Data *d, UNS32 id) |
void | resetSDO (CO_Data *d) |
UNS32 | SDOlineToObjdict (CO_Data *d, UNS8 line) |
UNS32 | objdictToSDOline (CO_Data *d, UNS8 line) |
UNS8 | lineToSDO (CO_Data *d, UNS8 line, UNS8 nbBytes, UNS8 *data) |
UNS8 | SDOtoLine (CO_Data *d, UNS8 line, UNS8 nbBytes, UNS8 *data) |
UNS8 | failedSDO (CO_Data *d, UNS8 nodeId, UNS8 whoami, UNS16 index, UNS8 subIndex, UNS32 abortCode) |
void | resetSDOline (CO_Data *d, UNS8 line) |
UNS8 | initSDOline (CO_Data *d, UNS8 line, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 state) |
UNS8 | getSDOfreeLine (CO_Data *d, UNS8 whoami, UNS8 *line) |
UNS8 | getSDOlineOnUse (CO_Data *d, UNS8 nodeId, UNS8 whoami, UNS8 *line) |
UNS8 | closeSDOtransfer (CO_Data *d, UNS8 nodeId, UNS8 whoami) |
UNS8 | getSDOlineRestBytes (CO_Data *d, UNS8 line, UNS8 *nbBytes) |
UNS8 | setSDOlineRestBytes (CO_Data *d, UNS8 line, UNS8 nbBytes) |
UNS8 | sendSDO (CO_Data *d, UNS8 whoami, s_SDO sdo) |
UNS8 | sendSDOabort (CO_Data *d, UNS8 whoami, UNS16 index, UNS8 subIndex, UNS32 abortCode) |
UNS8 | proceedSDO (CO_Data *d, Message *m) |
UNS8 | writeNetworkDict (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 count, UNS8 dataType, void *data) |
UNS8 | writeNetworkDictCallBack (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 count, UNS8 dataType, void *data, SDOCallback_t Callback) |
UNS8 | readNetworkDict (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 dataType) |
UNS8 | readNetworkDictCallback (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 dataType, SDOCallback_t Callback) |
UNS8 | getReadResultNetworkDict (CO_Data *d, UNS8 nodeId, void *data, UNS8 *size, UNS32 *abortCode) |
UNS8 | getWriteResultNetworkDict (CO_Data *d, UNS8 nodeId, UNS32 *abortCode) |
-Definition in file sdo.c.
#define getSDOc | -( | -byte | -- | ) | -(byte & 1) | -
-Returns the indicator of end transmission from the first byte of the SDO -
-Definition at line 109 of file sdo.c. -
-Referenced by proceedSDO(). -
#define getSDOcs | -( | -byte | -- | ) | -(byte >> 5) | -
-Returns the command specifier (cs, ccs, scs) from the first byte of the SDO -
-Definition at line 89 of file sdo.c. -
-Referenced by proceedSDO(). -
#define getSDOe | -( | -byte | -- | ) | -((byte >> 1) & 1) | -
-Returns the transfer type from the first byte of the SDO -
-Definition at line 101 of file sdo.c. -
-Referenced by proceedSDO(). -
#define getSDOindex | -( | -byte1, | |||
- | - | byte2 | -- | ) | -((byte2 << 8) | (byte1)) | -
-Returns the index from the bytes 1 and 2 of the SDO -
-Definition at line 117 of file sdo.c. -
-Referenced by proceedSDO(). -
#define getSDOn2 | -( | -byte | -- | ) | -((byte >> 2) & 3) | -
-Returns the number of bytes without data from the first byte of the SDO. Coded in 2 bits -
-Definition at line 93 of file sdo.c. -
-Referenced by proceedSDO(). -
#define getSDOn3 | -( | -byte | -- | ) | -((byte >> 1) & 7) | -
-Returns the number of bytes without data from the first byte of the SDO. Coded in 3 bits -
-Definition at line 97 of file sdo.c. -
-Referenced by proceedSDO(). -
#define getSDOs | -( | -byte | -- | ) | -(byte & 1) | -
-Returns the size indicator from the first byte of the SDO -
-Definition at line 105 of file sdo.c. -
-Referenced by proceedSDO(). -
#define getSDOsubIndex | -( | -byte3 | -- | ) | -(byte3) | -
-Returns the subIndex from the byte 3 of the SDO -
-Definition at line 121 of file sdo.c. -
-Referenced by proceedSDO(). -
#define getSDOt | -( | -byte | -- | ) | -((byte >> 4) & 1) | -
-Returns the toggle from the first byte of the SDO -
-Definition at line 113 of file sdo.c. -
-Referenced by proceedSDO(). -
#define RestartSDO_TIMER | -( | -id | -- | ) | -- |
-Value:
MSG_WAR(0x3A07, "restartSDO_TIMER for line : ", line);\ -if(d->transfers[id].timer != TIMER_NONE) { StopSDO_TIMER(id) StartSDO_TIMER(id) } -
-Definition at line 160 of file sdo.c. -
-Referenced by proceedSDO(). -
#define StartSDO_TIMER | -( | -id | -- | ) | -- |
-Value:
MSG_WAR(0x3A06, "StartSDO_TIMER for line : ", line);\ -d->transfers[id].timer = SetAlarm(d,id,&SDOTimeoutAlarm,MS_TO_TIMEVAL(SDO_TIMEOUT_MS),0); -
-Definition at line 156 of file sdo.c. -
-Referenced by initSDOline(). -
#define StopSDO_TIMER | -( | -id | -- | ) | -- |
-Value:
MSG_WAR(0x3A05, "StopSDO_TIMER for line : ", line);\ -d->transfers[id].timer = DelAlarm(d->transfers[id].timer); -
-Definition at line 152 of file sdo.c. -
-Referenced by failedSDO(), initSDOline(), and proceedSDO(). -
-
INLINE UNS8 _readNetworkDict | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId, | -|
- | - | UNS16 | -index, | -|
- | - | UNS8 | -subIndex, | -|
- | - | UNS8 | -dataType, | -|
- | - | SDOCallback_t | -Callback | - |
- | ) | -- |
-
d | ||
nodeId | ||
index | ||
subIndex | ||
dataType | ||
Callback |
-Definition at line 1406 of file sdo.c. -
-References struct_s_SDO::body, td_indextable::bSubCount, struct_s_transfer::Callback, struct_s_timer_entry::d, BODY::data, struct_s_transfer::dataType, struct_CO_Data::firstIndex, getSDOfreeLine(), getSDOlineOnUse(), initSDOline(), struct_CO_Data::lastIndex, MSG_ERR, MSG_WAR, struct_s_SDO::nodeId, struct_CO_Data::objdict, td_subindex::pObject, td_indextable::pSubindex, resetSDOline(), SDO_CLIENT, s_quick_index::SDO_CLT, SDO_UPLOAD_IN_PROGRESS, sendSDO(), struct_CO_Data::transfers, UNS16, UNS32, and UNS8. -
-Referenced by readNetworkDict(), and readNetworkDictCallback(). -
-Here is the call graph for this function:
INLINE UNS8 _writeNetworkDict | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId, | -|
- | - | UNS16 | -index, | -|
- | - | UNS8 | -subIndex, | -|
- | - | UNS8 | -count, | -|
- | - | UNS8 | -dataType, | -|
- | - | void * | -data, | -|
- | - | SDOCallback_t | -Callback, | -|
- | - | UNS8 | -endianize | - |
- | ) | -- |
-Called by writeNetworkDict
-
d | ||
nodeId | ||
index | ||
subIndex | ||
count | ||
dataType | ||
data | ||
Callback | ||
endianize |
UNS8 closeSDOtransfer | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId, | -|
- | - | UNS8 | -whoami | - |
- | ) | -- |
-
d | ||
nodeId | ||
whoami |
-Definition at line 439 of file sdo.c. -
-References struct_s_timer_entry::d, getSDOlineOnUse(), MSG_WAR, resetSDOline(), and UNS8. -
-Referenced by ReadSDO(), and TestMaster_post_TPDO(). -
-Here is the call graph for this function:
UNS8 failedSDO | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId, | -|
- | - | UNS8 | -whoami, | -|
- | - | UNS16 | -index, | -|
- | - | UNS8 | -subIndex, | -|
- | - | UNS32 | -abortCode | - |
- | ) | -- |
-
d | ||
nodeId | ||
whoami | ||
index | ||
subIndex | ||
abortCode |
-Definition at line 307 of file sdo.c. -
-References struct_s_timer_entry::d, getSDOlineOnUse(), MSG_WAR, resetSDOline(), SDO_ABORTED_INTERNAL, SDO_CLIENT, SDO_SERVER, sendSDOabort(), struct_s_transfer::state, StopSDO_TIMER, struct_CO_Data::transfers, and UNS8. -
-Referenced by proceedSDO(). -
-Here is the call graph for this function:
UNS8 getReadResultNetworkDict | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId, | -|
- | - | void * | -data, | -|
- | - | UNS8 * | -size, | -|
- | - | UNS32 * | -abortCode | - |
- | ) | -- |
-
d | ||
nodeId | ||
data | ||
size | ||
abortCode |
-Definition at line 1532 of file sdo.c. -
-References CANOPEN_BIG_ENDIAN, struct_s_transfer::count, struct_s_timer_entry::d, struct_s_transfer::data, struct_s_transfer::dataType, getSDOlineOnUse(), MSG_ERR, SDO_ABORTED_INTERNAL, SDO_CLIENT, SDO_FINISHED, struct_s_transfer::state, struct_CO_Data::transfers, UNS8, and visible_string. -
-Referenced by ReadSDO(), and TestMaster_post_TPDO(). -
-Here is the call graph for this function:
UNS8 getSDOfreeLine | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -whoami, | -|
- | - | UNS8 * | -line | - |
- | ) | -- |
-
d | ||
whoami | ||
line |
-Definition at line 388 of file sdo.c. -
-References struct_s_timer_entry::d, SDO_MAX_SIMULTANEOUS_TRANSFERTS, SDO_RESET, struct_s_transfer::state, struct_CO_Data::transfers, UNS8, and struct_s_transfer::whoami. -
-Referenced by _readNetworkDict(), _writeNetworkDict(), and proceedSDO(). -
UNS8 getSDOlineOnUse | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId, | -|
- | - | UNS8 | -whoami, | -|
- | - | UNS8 * | -line | - |
- | ) | -- |
-
d | ||
nodeId | ||
whoami | ||
line |
-Definition at line 414 of file sdo.c. -
-References struct_s_timer_entry::d, struct_s_transfer::nodeId, SDO_MAX_SIMULTANEOUS_TRANSFERTS, SDO_RESET, struct_s_transfer::state, struct_CO_Data::transfers, UNS8, and struct_s_transfer::whoami. -
-Referenced by _readNetworkDict(), _writeNetworkDict(), closeSDOtransfer(), failedSDO(), getReadResultNetworkDict(), getWriteResultNetworkDict(), and proceedSDO(). -
UNS8 getSDOlineRestBytes | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -line, | -|
- | - | UNS8 * | -nbBytes | - |
- | ) | -- |
-
d | ||
line | ||
nbBytes |
-Definition at line 461 of file sdo.c. -
-References struct_s_transfer::count, struct_s_timer_entry::d, struct_s_transfer::offset, struct_CO_Data::transfers, and UNS8. -
-Referenced by proceedSDO(). -
UNS8 getWriteResultNetworkDict | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId, | -|
- | - | UNS32 * | -abortCode | - |
- | ) | -- |
-
d | ||
nodeId | ||
abortCode |
-Definition at line 1573 of file sdo.c. -
-References struct_s_transfer::abortCode, struct_s_timer_entry::d, getSDOlineOnUse(), MSG_ERR, SDO_ABORTED_INTERNAL, SDO_CLIENT, struct_s_transfer::state, struct_CO_Data::transfers, and UNS8. -
-Here is the call graph for this function:
UNS8 initSDOline | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -line, | -|
- | - | UNS8 | -nodeId, | -|
- | - | UNS16 | -index, | -|
- | - | UNS8 | -subIndex, | -|
- | - | UNS8 | -state | - |
- | ) | -- |
-
d | ||
line | ||
nodeId | ||
index | ||
subIndex | ||
state |
-Definition at line 359 of file sdo.c. -
-References struct_s_transfer::Callback, struct_s_transfer::count, struct_s_timer_entry::d, struct_s_transfer::dataType, struct_s_transfer::index, MSG_WAR, struct_s_transfer::nodeId, struct_s_transfer::offset, SDO_DOWNLOAD_IN_PROGRESS, SDO_UPLOAD_IN_PROGRESS, StartSDO_TIMER, struct_s_transfer::state, StopSDO_TIMER, struct_s_transfer::subIndex, struct_s_transfer::toggle, and struct_CO_Data::transfers. -
-Referenced by _readNetworkDict(), _writeNetworkDict(), proceedSDO(), and resetSDOline(). -
UNS8 lineToSDO | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -line, | -|
- | - | UNS8 | -nbBytes, | -|
- | - | UNS8 * | -data | - |
- | ) | -- |
-
d | ||
line | ||
nbBytes | ||
data |
-Definition at line 250 of file sdo.c. -
-References struct_s_transfer::count, struct_s_timer_entry::d, struct_s_transfer::data, MSG_ERR, struct_s_transfer::offset, SDO_MAX_LENGTH_TRANSFERT, struct_CO_Data::transfers, and UNS8. -
-Referenced by proceedSDO(). -
UNS32 objdictToSDOline | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -line | - |
- | ) | -- |
-
d | ||
line |
-Definition at line 209 of file sdo.c. -
-References struct_s_transfer::count, struct_s_timer_entry::d, struct_s_transfer::data, getODentry(), struct_s_transfer::index, MSG_WAR, OD_SUCCESSFUL, struct_s_transfer::offset, struct_s_transfer::subIndex, struct_CO_Data::transfers, UNS32, and UNS8. -
-Referenced by proceedSDO(). -
-Here is the call graph for this function:
-
d | ||
m |
-The server node Id;
-The server node Id; -
-Definition at line 608 of file sdo.c. -
-References struct_s_transfer::abortCode, struct_CO_Data::bDeviceNodeId, struct_s_SDO::body, td_indextable::bSubCount, struct_s_transfer::Callback, struct_s_transfer::count, struct_s_timer_entry::d, Message::data, BODY::data, failedSDO(), struct_CO_Data::firstIndex, getSDOc, getSDOcs, getSDOe, getSDOfreeLine(), getSDOindex, getSDOlineOnUse(), getSDOlineRestBytes(), getSDOn2, getSDOn3, getSDOs, getSDOsubIndex, getSDOt, struct_s_transfer::index, initSDOline(), struct_CO_Data::lastIndex, lineToSDO(), MSG_ERR, MSG_WAR, struct_s_SDO::nodeId, struct_CO_Data::objdict, objdictToSDOline(), td_subindex::pObject, td_indextable::pSubindex, resetSDOline(), RestartSDO_TIMER, SDO_ABORTED_RCV, SDO_CLIENT, s_quick_index::SDO_CLT, SDO_DOWNLOAD_IN_PROGRESS, SDO_FINISHED, SDO_SERVER, s_quick_index::SDO_SVR, SDO_UNKNOWN, SDO_UPLOAD_IN_PROGRESS, SDOABT_GENERAL_ERROR, SDOABT_LOCAL_CTRL_ERROR, SDOABT_TOGGLE_NOT_ALTERNED, SDOlineToObjdict(), SDOtoLine(), sendSDO(), setSDOlineRestBytes(), struct_s_transfer::state, StopSDO_TIMER, struct_s_transfer::subIndex, struct_s_transfer::toggle, struct_CO_Data::transfers, UNS16, UNS32, and UNS8. -
-Referenced by canDispatch(). -
-Here is the call graph for this function:
UNS8 readNetworkDict | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId, | -|
- | - | UNS16 | -index, | -|
- | - | UNS8 | -subIndex, | -|
- | - | UNS8 | -dataType | - |
- | ) | -- |
-
d | ||
nodeId | ||
index | ||
subIndex | ||
dataType |
-Definition at line 1499 of file sdo.c. -
-References _readNetworkDict(), and struct_s_timer_entry::d. -
-Referenced by ReadSDO(), and TestMaster_post_TPDO(). -
-Here is the call graph for this function:
UNS8 readNetworkDictCallback | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId, | -|
- | - | UNS16 | -index, | -|
- | - | UNS8 | -subIndex, | -|
- | - | UNS8 | -dataType, | -|
- | - | SDOCallback_t | -Callback | - |
- | ) | -- |
-
d | ||
nodeId | ||
index | ||
subIndex | ||
dataType | ||
Callback |
-Definition at line 1516 of file sdo.c. -
-References _readNetworkDict(), and struct_s_timer_entry::d. -
-Here is the call graph for this function:
void resetSDO | -( | -CO_Data * | -d | -) | -- |
-Reset all sdo buffers
-
d |
-Definition at line 169 of file sdo.c. -
-References struct_s_timer_entry::d, resetSDOline(), SDO_MAX_SIMULTANEOUS_TRANSFERTS, and UNS8. -
-Referenced by switchCommunicationState(). -
-Here is the call graph for this function:
void resetSDOline | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -line | - |
- | ) | -- |
-
d | ||
line |
-Definition at line 338 of file sdo.c. -
-References struct_s_timer_entry::d, struct_s_transfer::data, initSDOline(), MSG_WAR, SDO_MAX_LENGTH_TRANSFERT, SDO_RESET, struct_CO_Data::transfers, and UNS8. -
-Referenced by _readNetworkDict(), _writeNetworkDict(), closeSDOtransfer(), failedSDO(), proceedSDO(), resetSDO(), and SDOTimeoutAlarm(). -
-Here is the call graph for this function:
UNS32 SDOlineToObjdict | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -line | - |
- | ) | -- |
-
d | ||
line |
-Definition at line 186 of file sdo.c. -
-References struct_s_transfer::count, struct_s_timer_entry::d, struct_s_transfer::data, struct_s_transfer::index, MSG_WAR, OD_SUCCESSFUL, setODentry(), struct_s_transfer::subIndex, struct_CO_Data::transfers, UNS32, and UNS8. -
-Referenced by proceedSDO(). -
-Here is the call graph for this function:
void SDOTimeoutAlarm | -( | -CO_Data * | -d, | -|
- | - | UNS32 | -id | - |
- | ) | -- |
-
d | ||
id |
-Definition at line 129 of file sdo.c. -
-References struct_s_transfer::abortCode, struct_s_transfer::Callback, struct_s_timer_entry::d, struct_s_transfer::index, MSG_ERR, MSG_WAR, struct_s_transfer::nodeId, resetSDOline(), SDO_ABORTED_INTERNAL, SDO_SERVER, SDOABT_TIMED_OUT, sendSDOabort(), struct_s_transfer::state, struct_s_transfer::subIndex, struct_s_transfer::timer, struct_CO_Data::transfers, UNS8, and struct_s_transfer::whoami. -
-Here is the call graph for this function:
UNS8 SDOtoLine | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -line, | -|
- | - | UNS8 | -nbBytes, | -|
- | - | UNS8 * | -data | - |
- | ) | -- |
-
d | ||
line | ||
nbBytes | ||
data |
-Definition at line 279 of file sdo.c. -
-References struct_s_timer_entry::d, struct_s_transfer::data, MSG_ERR, struct_s_transfer::offset, SDO_MAX_LENGTH_TRANSFERT, struct_CO_Data::transfers, and UNS8. -
-Referenced by proceedSDO(). -
UNS8 sendSDO | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -whoami, | -|
- | - | s_SDO | -sdo | - |
- | ) | -- |
-
d | ||
whoami | ||
sdo |
-Definition at line 498 of file sdo.c. -
-References struct_s_SDO::body, td_indextable::bSubCount, struct_CO_Data::canHandle, canSend(), Message::cob_id, struct_s_timer_entry::d, Message::data, BODY::data, struct_CO_Data::firstIndex, struct_CO_Data::lastIndex, Message::len, MSG_ERR, MSG_WAR, struct_s_SDO::nodeId, struct_CO_Data::nodeState, NOT_A_REQUEST, struct_CO_Data::objdict, Operational, td_subindex::pObject, Pre_operational, td_indextable::pSubindex, Message::rtr, s_quick_index::SDO_CLT, SDO_SERVER, s_quick_index::SDO_SVR, UNS16, UNS32, UNS8, and SHORT_CAN::w. -
-Referenced by _readNetworkDict(), _writeNetworkDict(), proceedSDO(), and sendSDOabort(). -
-Here is the call graph for this function:
UNS8 sendSDOabort | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -whoami, | -|
- | - | UNS16 | -index, | -|
- | - | UNS8 | -subIndex, | -|
- | - | UNS32 | -abortCode | - |
- | ) | -- |
-
d | ||
whoami | ||
index | ||
subIndex | ||
abortCode |
-Definition at line 578 of file sdo.c. -
-References struct_CO_Data::bDeviceNodeId, struct_s_SDO::body, struct_s_timer_entry::d, BODY::data, MSG_WAR, struct_s_SDO::nodeId, sendSDO(), and UNS8. -
-Referenced by failedSDO(), and SDOTimeoutAlarm(). -
-Here is the call graph for this function:
UNS8 setSDOlineRestBytes | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -line, | -|
- | - | UNS8 | -nbBytes | - |
- | ) | -- |
-
d | ||
line | ||
nbBytes |
-Definition at line 479 of file sdo.c. -
-References struct_s_transfer::count, struct_s_timer_entry::d, MSG_ERR, SDO_MAX_LENGTH_TRANSFERT, and struct_CO_Data::transfers. -
-Referenced by proceedSDO(). -
UNS8 writeNetworkDict | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId, | -|
- | - | UNS16 | -index, | -|
- | - | UNS8 | -subIndex, | -|
- | - | UNS8 | -count, | -|
- | - | UNS8 | -dataType, | -|
- | - | void * | -data | - |
- | ) | -- |
-
d | ||
nodeId | ||
index | ||
subIndex | ||
count | ||
dataType | ||
data |
-Definition at line 1368 of file sdo.c. -
-References _writeNetworkDict(), and struct_s_timer_entry::d. -
-Here is the call graph for this function:
UNS8 writeNetworkDictCallBack | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId, | -|
- | - | UNS16 | -index, | -|
- | - | UNS8 | -subIndex, | -|
- | - | UNS8 | -count, | -|
- | - | UNS8 | -dataType, | -|
- | - | void * | -data, | -|
- | - | SDOCallback_t | -Callback | - |
- | ) | -- |
-
d | ||
nodeId | ||
index | ||
subIndex | ||
count | ||
dataType | ||
data | ||
Callback |
-Definition at line 1388 of file sdo.c. -
-References _writeNetworkDict(), and struct_s_timer_entry::d. -
-Referenced by TestMaster_post_TPDO(). -
-Here is the call graph for this function:
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #ifndef __sdo_h__ -00024 #define __sdo_h__ -00025 -00026 struct struct_s_transfer; -00027 -00028 #include "timer.h" -00029 -00030 typedef void (*SDOCallback_t)(CO_Data* d, UNS8 nodeId); -00031 -00032 /* The Transfer structure -00033 Used to store the different segments of -00034 - a SDO received before writing in the dictionary -00035 - the reading of the dictionary to put on a SDO to transmit -00036 */ -00037 -00038 struct struct_s_transfer { -00039 UNS8 nodeId; /*own ID if server, or node ID of the server if client */ -00040 -00041 UNS8 whoami; /* Takes the values SDO_CLIENT or SDO_SERVER */ -00042 UNS8 state; /* state of the transmission : Takes the values SDO_... */ -00043 UNS8 toggle; -00044 UNS32 abortCode; /* Sent or received */ -00045 /* index and subindex of the dictionary where to store */ -00046 /* (for a received SDO) or to read (for a transmit SDO) */ -00047 UNS16 index; -00048 UNS8 subIndex; -00049 UNS32 count; /* Number of data received or to be sent. */ -00050 UNS32 offset; /* stack pointer of data[] -00051 * Used only to tranfer part of a line to or from a SDO. -00052 * offset is always pointing on the next free cell of data[]. -00053 * WARNING s_transfer.data is subject to ENDIANISATION -00054 * (with respect to CANOPEN_BIG_ENDIAN) -00055 */ -00056 UNS8 data [SDO_MAX_LENGTH_TRANSFERT]; -00057 UNS8 dataType; /* Defined in objdictdef.h Value is visible_string -00058 * if it is a string, any other value if it is not a string, -00059 * like 0. In fact, it is used only if client. -00060 */ -00061 TIMER_HANDLE timer; /* Time counter to implement a timeout in milliseconds. -00062 * It is automatically incremented whenever -00063 * the line state is in SDO_DOWNLOAD_IN_PROGRESS or -00064 * SDO_UPLOAD_IN_PROGRESS, and reseted to 0 -00065 * when the response SDO have been received. -00066 */ -00067 SDOCallback_t Callback; /* The user callback func to be called at SDO transaction end */ -00068 }; -00069 typedef struct struct_s_transfer s_transfer; -00070 -00071 -00072 #include "data.h" -00073 -00074 /* The 8 bytes data of the SDO */ -00075 struct BODY{ -00076 UNS8 data[8]; -00077 }; -00078 -00079 /* The SDO structure ...*/ -00080 struct struct_s_SDO { -00081 UNS8 nodeId; /*in any case, Node ID of the server (case sender or receiver).*/ -00082 struct BODY body; -00083 }; -00084 -00085 -00086 typedef struct struct_s_SDO s_SDO; -00087 -00091 void SDOTimeoutAlarm(CO_Data* d, UNS32 id); -00092 -00095 void resetSDO (CO_Data* d); -00096 -00097 -00101 UNS32 SDOlineToObjdict (CO_Data* d, UNS8 line); -00102 -00106 UNS32 objdictToSDOline (CO_Data* d, UNS8 line); -00107 -00111 UNS8 lineToSDO (CO_Data* d, UNS8 line, UNS8 nbBytes, UNS8 * data); -00112 -00116 UNS8 SDOtoLine (CO_Data* d, UNS8 line, UNS8 nbBytes, UNS8 * data); -00117 -00126 UNS8 failedSDO (CO_Data* d, UNS8 nodeId, UNS8 whoami, UNS16 index, -00127 UNS8 subIndex, UNS32 abortCode); -00128 -00132 void resetSDOline (CO_Data* d, UNS8 line); -00133 -00137 UNS8 initSDOline (CO_Data* d, UNS8 line, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 state); -00138 -00147 UNS8 getSDOfreeLine (CO_Data* d, UNS8 whoami, UNS8 *line); -00148 -00156 UNS8 getSDOlineOnUse (CO_Data* d, UNS8 nodeId, UNS8 whoami, UNS8 *line); -00157 -00162 UNS8 closeSDOtransfer (CO_Data* d, UNS8 nodeId, UNS8 whoami); -00163 -00168 UNS8 getSDOlineRestBytes (CO_Data* d, UNS8 line, UNS8 * nbBytes); -00169 -00174 UNS8 setSDOlineRestBytes (CO_Data* d, UNS8 line, UNS8 nbBytes); -00175 -00182 UNS8 sendSDO (CO_Data* d, UNS8 whoami, s_SDO sdo); -00183 -00191 UNS8 sendSDOabort (CO_Data* d, UNS8 whoami, UNS16 index, UNS8 subIndex, UNS32 abortCode); -00192 -00200 UNS8 proceedSDO (CO_Data* d, Message *m); -00201 -00210 UNS8 writeNetworkDict (CO_Data* d, UNS8 nodeId, UNS16 index, -00211 UNS8 subIndex, UNS8 count, UNS8 dataType, void *data); -00216 UNS8 writeNetworkDictCallBack (CO_Data* d, UNS8 nodeId, UNS16 index, -00217 UNS8 subIndex, UNS8 count, UNS8 dataType, void *data, SDOCallback_t Callback); -00225 UNS8 readNetworkDict (CO_Data* d, UNS8 nodeId, UNS16 index, -00226 UNS8 subIndex, UNS8 dataType); -00227 -00232 UNS8 readNetworkDictCallback (CO_Data* d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 dataType, SDOCallback_t Callback); -00233 -00249 UNS8 getReadResultNetworkDict (CO_Data* d, UNS8 nodeId, void* data, -00250 UNS8 *size, UNS32 * abortCode); -00251 -00268 UNS8 getWriteResultNetworkDict (CO_Data* d, UNS8 nodeId, UNS32 * abortCode); -00269 -00270 -00271 -00272 -00273 #endif -
#include "timer.h"
#include "data.h"
-Include dependency graph for sdo.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Data Structures | |
struct | struct_s_transfer |
struct | BODY |
struct | struct_s_SDO |
Typedefs | |
typedef void(*) | SDOCallback_t (CO_Data *d, UNS8 nodeId) |
typedef struct_s_transfer | s_transfer |
typedef struct_s_SDO | s_SDO |
Functions | |
void | SDOTimeoutAlarm (CO_Data *d, UNS32 id) |
void | resetSDO (CO_Data *d) |
UNS32 | SDOlineToObjdict (CO_Data *d, UNS8 line) |
UNS32 | objdictToSDOline (CO_Data *d, UNS8 line) |
UNS8 | lineToSDO (CO_Data *d, UNS8 line, UNS8 nbBytes, UNS8 *data) |
UNS8 | SDOtoLine (CO_Data *d, UNS8 line, UNS8 nbBytes, UNS8 *data) |
UNS8 | failedSDO (CO_Data *d, UNS8 nodeId, UNS8 whoami, UNS16 index, UNS8 subIndex, UNS32 abortCode) |
void | resetSDOline (CO_Data *d, UNS8 line) |
UNS8 | initSDOline (CO_Data *d, UNS8 line, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 state) |
UNS8 | getSDOfreeLine (CO_Data *d, UNS8 whoami, UNS8 *line) |
UNS8 | getSDOlineOnUse (CO_Data *d, UNS8 nodeId, UNS8 whoami, UNS8 *line) |
UNS8 | closeSDOtransfer (CO_Data *d, UNS8 nodeId, UNS8 whoami) |
UNS8 | getSDOlineRestBytes (CO_Data *d, UNS8 line, UNS8 *nbBytes) |
UNS8 | setSDOlineRestBytes (CO_Data *d, UNS8 line, UNS8 nbBytes) |
UNS8 | sendSDO (CO_Data *d, UNS8 whoami, s_SDO sdo) |
UNS8 | sendSDOabort (CO_Data *d, UNS8 whoami, UNS16 index, UNS8 subIndex, UNS32 abortCode) |
UNS8 | proceedSDO (CO_Data *d, Message *m) |
UNS8 | writeNetworkDict (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 count, UNS8 dataType, void *data) |
UNS8 | writeNetworkDictCallBack (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 count, UNS8 dataType, void *data, SDOCallback_t Callback) |
UNS8 | readNetworkDict (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 dataType) |
UNS8 | readNetworkDictCallback (CO_Data *d, UNS8 nodeId, UNS16 index, UNS8 subIndex, UNS8 dataType, SDOCallback_t Callback) |
UNS8 | getReadResultNetworkDict (CO_Data *d, UNS8 nodeId, void *data, UNS8 *size, UNS32 *abortCode) |
UNS8 | getWriteResultNetworkDict (CO_Data *d, UNS8 nodeId, UNS32 *abortCode) |
typedef struct struct_s_SDO s_SDO | -
typedef struct struct_s_transfer s_transfer | -
typedef void(*) SDOCallback_t(CO_Data *d, UNS8 nodeId) | -
-
UNS8 closeSDOtransfer | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId, | -|
- | - | UNS8 | -whoami | - |
- | ) | -- |
-
d | ||
nodeId | ||
whoami |
-Definition at line 439 of file sdo.c. -
-References struct_s_timer_entry::d, getSDOlineOnUse(), MSG_WAR, resetSDOline(), and UNS8. -
-Referenced by ReadSDO(), and TestMaster_post_TPDO(). -
-Here is the call graph for this function:
UNS8 failedSDO | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId, | -|
- | - | UNS8 | -whoami, | -|
- | - | UNS16 | -index, | -|
- | - | UNS8 | -subIndex, | -|
- | - | UNS32 | -abortCode | - |
- | ) | -- |
-
d | ||
nodeId | ||
whoami | ||
index | ||
subIndex | ||
abortCode |
-Definition at line 307 of file sdo.c. -
-References struct_s_timer_entry::d, getSDOlineOnUse(), MSG_WAR, resetSDOline(), SDO_ABORTED_INTERNAL, SDO_CLIENT, SDO_SERVER, sendSDOabort(), struct_s_transfer::state, StopSDO_TIMER, struct_CO_Data::transfers, and UNS8. -
-Referenced by proceedSDO(). -
-Here is the call graph for this function:
UNS8 getReadResultNetworkDict | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId, | -|
- | - | void * | -data, | -|
- | - | UNS8 * | -size, | -|
- | - | UNS32 * | -abortCode | - |
- | ) | -- |
-
d | ||
nodeId | ||
data | ||
size | ||
abortCode |
-Definition at line 1532 of file sdo.c. -
-References CANOPEN_BIG_ENDIAN, struct_s_transfer::count, struct_s_timer_entry::d, struct_s_transfer::data, struct_s_transfer::dataType, getSDOlineOnUse(), MSG_ERR, SDO_ABORTED_INTERNAL, SDO_CLIENT, SDO_FINISHED, struct_s_transfer::state, struct_CO_Data::transfers, UNS8, and visible_string. -
-Referenced by ReadSDO(), and TestMaster_post_TPDO(). -
-Here is the call graph for this function:
UNS8 getSDOfreeLine | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -whoami, | -|
- | - | UNS8 * | -line | - |
- | ) | -- |
-
d | ||
whoami | ||
line |
-Definition at line 388 of file sdo.c. -
-References struct_s_timer_entry::d, SDO_MAX_SIMULTANEOUS_TRANSFERTS, SDO_RESET, struct_s_transfer::state, struct_CO_Data::transfers, UNS8, and struct_s_transfer::whoami. -
-Referenced by _readNetworkDict(), _writeNetworkDict(), and proceedSDO(). -
UNS8 getSDOlineOnUse | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId, | -|
- | - | UNS8 | -whoami, | -|
- | - | UNS8 * | -line | - |
- | ) | -- |
-
d | ||
nodeId | ||
whoami | ||
line |
-Definition at line 414 of file sdo.c. -
-References struct_s_timer_entry::d, struct_s_transfer::nodeId, SDO_MAX_SIMULTANEOUS_TRANSFERTS, SDO_RESET, struct_s_transfer::state, struct_CO_Data::transfers, UNS8, and struct_s_transfer::whoami. -
-Referenced by _readNetworkDict(), _writeNetworkDict(), closeSDOtransfer(), failedSDO(), getReadResultNetworkDict(), getWriteResultNetworkDict(), and proceedSDO(). -
UNS8 getSDOlineRestBytes | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -line, | -|
- | - | UNS8 * | -nbBytes | - |
- | ) | -- |
-
d | ||
line | ||
nbBytes |
-Definition at line 461 of file sdo.c. -
-References struct_s_transfer::count, struct_s_timer_entry::d, struct_s_transfer::offset, struct_CO_Data::transfers, and UNS8. -
-Referenced by proceedSDO(). -
UNS8 getWriteResultNetworkDict | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId, | -|
- | - | UNS32 * | -abortCode | - |
- | ) | -- |
-
d | ||
nodeId | ||
abortCode |
-Definition at line 1573 of file sdo.c. -
-References struct_s_transfer::abortCode, struct_s_timer_entry::d, getSDOlineOnUse(), MSG_ERR, SDO_ABORTED_INTERNAL, SDO_CLIENT, struct_s_transfer::state, struct_CO_Data::transfers, and UNS8. -
-Here is the call graph for this function:
UNS8 initSDOline | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -line, | -|
- | - | UNS8 | -nodeId, | -|
- | - | UNS16 | -index, | -|
- | - | UNS8 | -subIndex, | -|
- | - | UNS8 | -state | - |
- | ) | -- |
-
d | ||
line | ||
nodeId | ||
index | ||
subIndex | ||
state |
-Definition at line 359 of file sdo.c. -
-References struct_s_transfer::Callback, struct_s_transfer::count, struct_s_timer_entry::d, struct_s_transfer::dataType, struct_s_transfer::index, MSG_WAR, struct_s_transfer::nodeId, struct_s_transfer::offset, SDO_DOWNLOAD_IN_PROGRESS, SDO_UPLOAD_IN_PROGRESS, StartSDO_TIMER, struct_s_transfer::state, StopSDO_TIMER, struct_s_transfer::subIndex, struct_s_transfer::toggle, and struct_CO_Data::transfers. -
-Referenced by _readNetworkDict(), _writeNetworkDict(), proceedSDO(), and resetSDOline(). -
UNS8 lineToSDO | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -line, | -|
- | - | UNS8 | -nbBytes, | -|
- | - | UNS8 * | -data | - |
- | ) | -- |
-
d | ||
line | ||
nbBytes | ||
data |
-Definition at line 250 of file sdo.c. -
-References struct_s_transfer::count, struct_s_timer_entry::d, struct_s_transfer::data, MSG_ERR, struct_s_transfer::offset, SDO_MAX_LENGTH_TRANSFERT, struct_CO_Data::transfers, and UNS8. -
-Referenced by proceedSDO(). -
UNS32 objdictToSDOline | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -line | - |
- | ) | -- |
-
d | ||
line |
-Definition at line 209 of file sdo.c. -
-References struct_s_transfer::count, struct_s_timer_entry::d, struct_s_transfer::data, getODentry(), struct_s_transfer::index, MSG_WAR, OD_SUCCESSFUL, struct_s_transfer::offset, struct_s_transfer::subIndex, struct_CO_Data::transfers, UNS32, and UNS8. -
-Referenced by proceedSDO(). -
-Here is the call graph for this function:
-
d | ||
m |
-The server node Id;
-The server node Id; -
-Definition at line 608 of file sdo.c. -
-References struct_s_transfer::abortCode, struct_CO_Data::bDeviceNodeId, struct_s_SDO::body, td_indextable::bSubCount, struct_s_transfer::Callback, struct_s_transfer::count, struct_s_timer_entry::d, BODY::data, Message::data, failedSDO(), struct_CO_Data::firstIndex, getSDOc, getSDOcs, getSDOe, getSDOfreeLine(), getSDOindex, getSDOlineOnUse(), getSDOlineRestBytes(), getSDOn2, getSDOn3, getSDOs, getSDOsubIndex, getSDOt, struct_s_transfer::index, initSDOline(), struct_CO_Data::lastIndex, lineToSDO(), MSG_ERR, MSG_WAR, struct_s_SDO::nodeId, struct_CO_Data::objdict, objdictToSDOline(), td_subindex::pObject, td_indextable::pSubindex, resetSDOline(), RestartSDO_TIMER, SDO_ABORTED_RCV, SDO_CLIENT, s_quick_index::SDO_CLT, SDO_DOWNLOAD_IN_PROGRESS, SDO_FINISHED, SDO_SERVER, s_quick_index::SDO_SVR, SDO_UNKNOWN, SDO_UPLOAD_IN_PROGRESS, SDOABT_GENERAL_ERROR, SDOABT_LOCAL_CTRL_ERROR, SDOABT_TOGGLE_NOT_ALTERNED, SDOlineToObjdict(), SDOtoLine(), sendSDO(), setSDOlineRestBytes(), struct_s_transfer::state, StopSDO_TIMER, struct_s_transfer::subIndex, struct_s_transfer::toggle, struct_CO_Data::transfers, UNS16, UNS32, and UNS8. -
-Referenced by canDispatch(). -
-Here is the call graph for this function:
UNS8 readNetworkDict | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId, | -|
- | - | UNS16 | -index, | -|
- | - | UNS8 | -subIndex, | -|
- | - | UNS8 | -dataType | - |
- | ) | -- |
-
d | ||
nodeId | ||
index | ||
subIndex | ||
dataType |
-Definition at line 1499 of file sdo.c. -
-References _readNetworkDict(), and struct_s_timer_entry::d. -
-Referenced by ReadSDO(), and TestMaster_post_TPDO(). -
-Here is the call graph for this function:
UNS8 readNetworkDictCallback | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId, | -|
- | - | UNS16 | -index, | -|
- | - | UNS8 | -subIndex, | -|
- | - | UNS8 | -dataType, | -|
- | - | SDOCallback_t | -Callback | - |
- | ) | -- |
-
d | ||
nodeId | ||
index | ||
subIndex | ||
dataType | ||
Callback |
-Definition at line 1516 of file sdo.c. -
-References _readNetworkDict(), and struct_s_timer_entry::d. -
-Here is the call graph for this function:
void resetSDO | -( | -CO_Data * | -d | -) | -- |
-Reset all sdo buffers
-
d |
-Definition at line 169 of file sdo.c. -
-References struct_s_timer_entry::d, resetSDOline(), SDO_MAX_SIMULTANEOUS_TRANSFERTS, and UNS8. -
-Referenced by switchCommunicationState(). -
-Here is the call graph for this function:
void resetSDOline | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -line | - |
- | ) | -- |
-
d | ||
line |
-Definition at line 338 of file sdo.c. -
-References struct_s_timer_entry::d, struct_s_transfer::data, initSDOline(), MSG_WAR, SDO_MAX_LENGTH_TRANSFERT, SDO_RESET, struct_CO_Data::transfers, and UNS8. -
-Referenced by _readNetworkDict(), _writeNetworkDict(), closeSDOtransfer(), failedSDO(), proceedSDO(), resetSDO(), and SDOTimeoutAlarm(). -
-Here is the call graph for this function:
UNS32 SDOlineToObjdict | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -line | - |
- | ) | -- |
-
d | ||
line |
-Definition at line 186 of file sdo.c. -
-References struct_s_transfer::count, struct_s_timer_entry::d, struct_s_transfer::data, struct_s_transfer::index, MSG_WAR, OD_SUCCESSFUL, setODentry(), struct_s_transfer::subIndex, struct_CO_Data::transfers, UNS32, and UNS8. -
-Referenced by proceedSDO(). -
-Here is the call graph for this function:
void SDOTimeoutAlarm | -( | -CO_Data * | -d, | -|
- | - | UNS32 | -id | - |
- | ) | -- |
-
d | ||
id |
-Definition at line 129 of file sdo.c. -
-References struct_s_transfer::abortCode, struct_s_transfer::Callback, struct_s_timer_entry::d, struct_s_transfer::index, MSG_ERR, MSG_WAR, struct_s_transfer::nodeId, resetSDOline(), SDO_ABORTED_INTERNAL, SDO_SERVER, SDOABT_TIMED_OUT, sendSDOabort(), struct_s_transfer::state, struct_s_transfer::subIndex, struct_s_transfer::timer, struct_CO_Data::transfers, UNS8, and struct_s_transfer::whoami. -
-Here is the call graph for this function:
UNS8 SDOtoLine | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -line, | -|
- | - | UNS8 | -nbBytes, | -|
- | - | UNS8 * | -data | - |
- | ) | -- |
-
d | ||
line | ||
nbBytes | ||
data |
-Definition at line 279 of file sdo.c. -
-References struct_s_timer_entry::d, struct_s_transfer::data, MSG_ERR, struct_s_transfer::offset, SDO_MAX_LENGTH_TRANSFERT, struct_CO_Data::transfers, and UNS8. -
-Referenced by proceedSDO(). -
UNS8 sendSDO | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -whoami, | -|
- | - | s_SDO | -sdo | - |
- | ) | -- |
-
d | ||
whoami | ||
sdo |
-Definition at line 498 of file sdo.c. -
-References struct_s_SDO::body, td_indextable::bSubCount, struct_CO_Data::canHandle, canSend(), Message::cob_id, struct_s_timer_entry::d, BODY::data, Message::data, struct_CO_Data::firstIndex, struct_CO_Data::lastIndex, Message::len, MSG_ERR, MSG_WAR, struct_s_SDO::nodeId, struct_CO_Data::nodeState, NOT_A_REQUEST, struct_CO_Data::objdict, Operational, td_subindex::pObject, Pre_operational, td_indextable::pSubindex, Message::rtr, s_quick_index::SDO_CLT, SDO_SERVER, s_quick_index::SDO_SVR, UNS16, UNS32, UNS8, and SHORT_CAN::w. -
-Referenced by _readNetworkDict(), _writeNetworkDict(), proceedSDO(), and sendSDOabort(). -
-Here is the call graph for this function:
UNS8 sendSDOabort | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -whoami, | -|
- | - | UNS16 | -index, | -|
- | - | UNS8 | -subIndex, | -|
- | - | UNS32 | -abortCode | - |
- | ) | -- |
-
d | ||
whoami | ||
index | ||
subIndex | ||
abortCode |
-Definition at line 578 of file sdo.c. -
-References struct_CO_Data::bDeviceNodeId, struct_s_SDO::body, struct_s_timer_entry::d, BODY::data, MSG_WAR, struct_s_SDO::nodeId, sendSDO(), and UNS8. -
-Referenced by failedSDO(), and SDOTimeoutAlarm(). -
-Here is the call graph for this function:
UNS8 setSDOlineRestBytes | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -line, | -|
- | - | UNS8 | -nbBytes | - |
- | ) | -- |
-
d | ||
line | ||
nbBytes |
-Definition at line 479 of file sdo.c. -
-References struct_s_transfer::count, struct_s_timer_entry::d, MSG_ERR, SDO_MAX_LENGTH_TRANSFERT, and struct_CO_Data::transfers. -
-Referenced by proceedSDO(). -
UNS8 writeNetworkDict | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId, | -|
- | - | UNS16 | -index, | -|
- | - | UNS8 | -subIndex, | -|
- | - | UNS8 | -count, | -|
- | - | UNS8 | -dataType, | -|
- | - | void * | -data | - |
- | ) | -- |
-
d | ||
nodeId | ||
index | ||
subIndex | ||
count | ||
dataType | ||
data |
-Definition at line 1368 of file sdo.c. -
-References _writeNetworkDict(), and struct_s_timer_entry::d. -
-Here is the call graph for this function:
UNS8 writeNetworkDictCallBack | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId, | -|
- | - | UNS16 | -index, | -|
- | - | UNS8 | -subIndex, | -|
- | - | UNS8 | -count, | -|
- | - | UNS8 | -dataType, | -|
- | - | void * | -data, | -|
- | - | SDOCallback_t | -Callback | - |
- | ) | -- |
-
d | ||
nodeId | ||
index | ||
subIndex | ||
count | ||
dataType | ||
data | ||
Callback |
-Definition at line 1388 of file sdo.c. -
-References _writeNetworkDict(), and struct_s_timer_entry::d. -
-Referenced by TestMaster_post_TPDO(). -
-Here is the call graph for this function:
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00032 #include "states.h" -00033 #include "def.h" -00034 #include "dcf.h" -00035 #include "nmtSlave.h" -00036 -00044 void switchCommunicationState(CO_Data* d, -00045 s_state_communication *newCommunicationState); -00046 -00054 e_nodeState getState(CO_Data* d) -00055 { -00056 return d->nodeState; -00057 } -00058 -00065 void canDispatch(CO_Data* d, Message *m) -00066 { -00067 switch(m->cob_id.w >> 7) -00068 { -00069 case SYNC: -00070 if(d->CurrentCommunicationState.csSYNC) -00071 proceedSYNC(d,m); -00072 break; -00073 /* case TIME_STAMP: */ -00074 case PDO1tx: -00075 case PDO1rx: -00076 case PDO2tx: -00077 case PDO2rx: -00078 case PDO3tx: -00079 case PDO3rx: -00080 case PDO4tx: -00081 case PDO4rx: -00082 if (d->CurrentCommunicationState.csPDO) -00083 proceedPDO(d,m); -00084 break; -00085 case SDOtx: -00086 case SDOrx: -00087 if (d->CurrentCommunicationState.csSDO) -00088 proceedSDO(d,m); -00089 break; -00090 case NODE_GUARD: -00091 if (d->CurrentCommunicationState.csHeartbeat) -00092 proceedNODE_GUARD(d,m); -00093 break; -00094 case NMT: -00095 if (*(d->iam_a_slave)) -00096 { -00097 proceedNMTstateChange(d,m); -00098 } -00099 } -00100 } -00101 -00102 #define StartOrStop(CommType, FuncStart, FuncStop) \ -00103 if(newCommunicationState->CommType && !d->CurrentCommunicationState.CommType){\ -00104 MSG_WAR(0x9999,#FuncStart, 9999);\ -00105 d->CurrentCommunicationState.CommType = 1;\ -00106 FuncStart;\ -00107 }else if(!newCommunicationState->CommType && d->CurrentCommunicationState.CommType){\ -00108 MSG_WAR(0x9999,#FuncStop, 9999);\ -00109 d->CurrentCommunicationState.CommType = 0;\ -00110 FuncStop;\ -00111 } -00112 #define None -00113 -00120 void switchCommunicationState(CO_Data* d, s_state_communication *newCommunicationState) -00121 { -00122 StartOrStop(csSDO, None, resetSDO(d)) -00123 StartOrStop(csSYNC, startSYNC(d), stopSYNC(d)) -00124 StartOrStop(csHeartbeat, heartbeatInit(d), heartbeatStop(d)) -00125 /* StartOrStop(Emergency,,) */ -00126 StartOrStop(csPDO, PDOInit(d), PDOStop(d)) -00127 StartOrStop(csBoot_Up, None, slaveSendBootUp(d)) -00128 } -00129 -00138 UNS8 setState(CO_Data* d, e_nodeState newState) -00139 { -00140 UNS16 wIndex = 0x1F22; -00141 const indextable *ptrTable; -00142 ODCallback_t *Callback; -00143 UNS32 errorCode; -00144 while(newState != d->nodeState){ -00145 switch( newState ){ -00146 case Initialisation: -00147 { -00148 s_state_communication newCommunicationState = {1, 0, 0, 0, 0, 0}; -00149 /* This will force a second loop for the state switch */ -00150 d->nodeState = Initialisation; -00151 newState = Pre_operational; -00152 switchCommunicationState(d, &newCommunicationState); -00153 /* call user app related state func. */ -00154 (*d->initialisation)(); -00155 -00156 } -00157 break; -00158 -00159 case Pre_operational: -00160 { -00161 -00162 s_state_communication newCommunicationState = {0, 1, 1, 1, 1, 0}; -00163 d->nodeState = Pre_operational; -00164 newState = Pre_operational; -00165 switchCommunicationState(d, &newCommunicationState); -00166 if (!(*(d->iam_a_slave))) -00167 { -00168 ptrTable =(*d->scanIndexOD)(wIndex, &errorCode, &Callback); -00169 -00170 if (errorCode != OD_SUCCESSFUL) -00171 { -00172 (*d->preOperational)(); -00173 } -00174 else -00175 { -00176 UNS32 res; -00177 res = decompo_dcf(d,0x01); -00178 } -00179 } -00180 else -00181 { -00182 (*d->preOperational)(); -00183 } -00184 } -00185 break; -00186 -00187 case Operational: -00188 if(d->nodeState == Initialisation) return 0xFF; -00189 { -00190 s_state_communication newCommunicationState = {0, 1, 1, 1, 1, 1}; -00191 d->nodeState = Operational; -00192 newState = Operational; -00193 switchCommunicationState(d, &newCommunicationState); -00194 (*d->operational)(); -00195 } -00196 break; -00197 -00198 case Stopped: -00199 if(d->nodeState == Initialisation) return 0xFF; -00200 { -00201 s_state_communication newCommunicationState = {0, 0, 0, 0, 1, 0}; -00202 d->nodeState = Stopped; -00203 newState = Stopped; -00204 switchCommunicationState(d, &newCommunicationState); -00205 (*d->stopped)(); -00206 } -00207 break; -00208 -00209 default: -00210 return 0xFF; -00211 }/* end switch case */ -00212 -00213 } -00214 return 0; -00215 } -00216 -00224 UNS8 getNodeId(CO_Data* d) -00225 { -00226 return *d->bDeviceNodeId; -00227 } -00228 -00235 void setNodeId(CO_Data* d, UNS8 nodeId) -00236 { -00237 UNS16 offset = d->firstIndex->SDO_SVR; -00238 if(offset){ -00239 /* cob_id_client = 0x600 + nodeId; */ -00240 *(UNS32*)d->objdict[offset].pSubindex[1].pObject = 0x600 + nodeId; -00241 /* cob_id_server = 0x580 + nodeId; */ -00242 *(UNS32*)d->objdict[offset].pSubindex[2].pObject = 0x580 + nodeId; -00243 /* node Id client. As we do not know the value, we put the node Id Server */ -00244 /* *(UNS8*)d->objdict[offset].pSubindex[3].pObject = nodeId; */ -00245 } -00246 -00247 /* -00248 Initialize the server(s) SDO parameters -00249 Remember that only one SDO server is allowed, defined at index 0x1200 -00250 -00251 Initialize the client(s) SDO parameters -00252 Nothing to initialize (no default values required by the DS 401) -00253 Initialize the receive PDO communication parameters. Only for 0x1400 to 0x1403 -00254 */ -00255 { -00256 UNS8 i = 0; -00257 UNS16 offset = d->firstIndex->PDO_RCV; -00258 UNS16 lastIndex = d->lastIndex->PDO_RCV; -00259 UNS32 cobID[] = {0x200, 0x300, 0x400, 0x500}; -00260 if( offset ) while( (offset <= lastIndex) && (i < 4)) { -00261 if(*(UNS32*)d->objdict[offset].pSubindex[1].pObject == cobID[i] + *d->bDeviceNodeId) -00262 *(UNS32*)d->objdict[offset].pSubindex[1].pObject = cobID[i] + nodeId; -00263 i ++; -00264 offset ++; -00265 } -00266 } -00267 /* ** Initialize the transmit PDO communication parameters. Only for 0x1800 to 0x1803 */ -00268 { -00269 UNS8 i = 0; -00270 UNS16 offset = d->firstIndex->PDO_TRS; -00271 UNS16 lastIndex = d->lastIndex->PDO_TRS; -00272 UNS32 cobID[] = {0x180, 0x280, 0x380, 0x480}; -00273 i = 0; -00274 if( offset ) while ((offset <= lastIndex) && (i < 4)) { -00275 if(*(UNS32*)d->objdict[offset].pSubindex[1].pObject == cobID[i] + *d->bDeviceNodeId) -00276 *(UNS32*)d->objdict[offset].pSubindex[1].pObject = cobID[i] + nodeId; -00277 i ++; -00278 offset ++; -00279 } -00280 } -00281 /* bDeviceNodeId is defined in the object dictionary. */ -00282 *d->bDeviceNodeId = nodeId; -00283 } -00284 -00285 void _initialisation(){} -00286 void _preOperational(){} -00287 void _operational(){} -00288 void _stopped(){} -
#include "states.h"
#include "def.h"
#include "dcf.h"
#include "nmtSlave.h"
-Include dependency graph for states.c:
-Go to the source code of this file.
Defines | |
#define | StartOrStop(CommType, FuncStart, FuncStop) |
#define | None |
Functions | |
void | switchCommunicationState (CO_Data *d, s_state_communication *newCommunicationState) |
e_nodeState | getState (CO_Data *d) |
void | canDispatch (CO_Data *d, Message *m) |
UNS8 | setState (CO_Data *d, e_nodeState newState) |
UNS8 | getNodeId (CO_Data *d) |
void | setNodeId (CO_Data *d, UNS8 nodeId) |
void | _initialisation () |
void | _preOperational () |
void | _operational () |
void | _stopped () |
-Definition in file states.c.
#define None | -
#define StartOrStop | -( | -CommType, | |||
- | - | FuncStart, | |||
- | - | FuncStop | -- | ) | -- |
-Value:
if(newCommunicationState->CommType && !d->CurrentCommunicationState.CommType){\ - MSG_WAR(0x9999,#FuncStart, 9999);\ - d->CurrentCommunicationState.CommType = 1;\ - FuncStart;\ - }else if(!newCommunicationState->CommType && d->CurrentCommunicationState.CommType){\ - MSG_WAR(0x9999,#FuncStop, 9999);\ - d->CurrentCommunicationState.CommType = 0;\ - FuncStop;\ - } -
-Definition at line 102 of file states.c. -
-Referenced by switchCommunicationState(). -
-
void _initialisation | -( | -void | -- | ) | -- |
void _operational | -( | -void | -- | ) | -- |
void _preOperational | -( | -void | -- | ) | -- |
void _stopped | -( | -void | -- | ) | -- |
-
d | ||
m |
-Definition at line 65 of file states.c. -
-References Message::cob_id, s_state_communication::csHeartbeat, s_state_communication::csPDO, s_state_communication::csSDO, s_state_communication::csSYNC, struct_CO_Data::CurrentCommunicationState, struct_s_timer_entry::d, struct_CO_Data::iam_a_slave, NMT, NODE_GUARD, PDO1rx, PDO1tx, PDO2rx, PDO2tx, PDO3rx, PDO3tx, PDO4rx, PDO4tx, proceedNMTstateChange(), proceedNODE_GUARD(), proceedPDO(), proceedSDO(), proceedSYNC(), SDOrx, SDOtx, SYNC, and SHORT_CAN::w. -
-Referenced by canReceiveLoop(), and main(). -
-Here is the call graph for this function:
UNS8 getNodeId | -( | -CO_Data * | -d | -) | -- |
-
d |
-Definition at line 224 of file states.c. -
-References struct_CO_Data::bDeviceNodeId, and struct_s_timer_entry::d. -
-Referenced by initSensor(). -
e_nodeState getState | -( | -CO_Data * | -d | -) | -- |
-
d |
-Definition at line 54 of file states.c. -
-References struct_s_timer_entry::d, and struct_CO_Data::nodeState. -
void setNodeId | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId | - |
- | ) | -- |
-
d | ||
nodeId |
-Definition at line 235 of file states.c. -
-References struct_CO_Data::bDeviceNodeId, struct_s_timer_entry::d, struct_CO_Data::firstIndex, struct_CO_Data::lastIndex, struct_CO_Data::objdict, s_quick_index::PDO_RCV, s_quick_index::PDO_TRS, td_subindex::pObject, td_indextable::pSubindex, s_quick_index::SDO_SVR, UNS16, UNS32, and UNS8. -
-Referenced by InitNodes(), initSensor(), and main(). -
UNS8 setState | -( | -CO_Data * | -d, | -|
- | - | e_nodeState | -newState | - |
- | ) | -- |
-
d | ||
newState |
-Definition at line 138 of file states.c. -
-References struct_s_timer_entry::d, decompo_dcf(), struct_CO_Data::iam_a_slave, Initialisation, struct_CO_Data::initialisation, struct_CO_Data::nodeState, OD_SUCCESSFUL, Operational, struct_CO_Data::operational, Pre_operational, struct_CO_Data::preOperational, ptrTable, struct_CO_Data::scanIndexOD, Stopped, struct_CO_Data::stopped, switchCommunicationState(), UNS16, and UNS32. -
-Referenced by InitNodes(), main(), and proceedNMTstateChange(). -
-Here is the call graph for this function:
void switchCommunicationState | -( | -CO_Data * | -d, | -|
- | - | s_state_communication * | -newCommunicationState | - |
- | ) | -- |
-
d | ||
newCommunicationState |
-Definition at line 120 of file states.c. -
-References struct_s_timer_entry::d, heartbeatInit(), heartbeatStop(), None, PDOInit(), PDOStop(), resetSDO(), slaveSendBootUp(), StartOrStop, startSYNC(), and stopSYNC(). -
-Referenced by setState(). -
-Here is the call graph for this function:
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #ifndef __states_h__ -00024 #define __states_h__ -00025 -00026 #include <applicfg.h> -00027 -00028 /* The nodes states -00029 * ----------------- -00030 * values are choosen so, that they can be sent directly -00031 * for heartbeat messages... -00032 * Must be coded on 7 bits only -00033 * */ -00034 /* Should not be modified */ -00035 enum enum_nodeState { -00036 Initialisation = 0x00, -00037 Disconnected = 0x01, -00038 Connecting = 0x02, -00039 Preparing = 0x02, -00040 Stopped = 0x04, -00041 Operational = 0x05, -00042 Pre_operational = 0x7F, -00043 Unknown_state = 0x0F -00044 }; -00045 -00046 typedef enum enum_nodeState e_nodeState; -00047 -00048 typedef struct -00049 { -00050 UNS8 csBoot_Up; -00051 UNS8 csSDO; -00052 UNS8 csEmergency; -00053 UNS8 csSYNC; -00054 UNS8 csHeartbeat; -00055 UNS8 csPDO; -00056 } s_state_communication; -00057 -00061 typedef void (*initialisation_t)(void); -00062 typedef void (*preOperational_t)(void); -00063 typedef void (*operational_t)(void); -00064 typedef void (*stopped_t)(void); -00065 -00066 void _initialisation(void); -00067 void _preOperational(void); -00068 void _operational(void); -00069 void _stopped(void); -00070 -00071 #include "data.h" -00072 -00073 /************************* prototypes ******************************/ -00074 -00077 void canDispatch(CO_Data* d, Message *m); -00078 -00081 e_nodeState getState (CO_Data* d); -00082 -00085 UNS8 setState (CO_Data* d, e_nodeState newState); -00086 -00089 UNS8 getNodeId (CO_Data* d); -00090 -00093 void setNodeId (CO_Data* d, UNS8 nodeId); -00094 -00098 /* void initResetMode (CO_Data* d); */ -00099 -00100 -00104 void initPreOperationalMode (CO_Data* d); -00105 -00106 #endif -
#include <applicfg.h>
#include "data.h"
-Include dependency graph for states.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Data Structures | |
struct | s_state_communication |
Typedefs | |
typedef enum enum_nodeState | e_nodeState |
typedef void(*) | initialisation_t (void) |
typedef void(*) | preOperational_t (void) |
typedef void(*) | operational_t (void) |
typedef void(*) | stopped_t (void) |
Enumerations | |
enum | enum_nodeState { - Initialisation = 0x00, -Disconnected = 0x01, -Connecting = 0x02, -Preparing = 0x02, - - Stopped = 0x04, -Operational = 0x05, -Pre_operational = 0x7F, -Unknown_state = 0x0F - - } |
Functions | |
void | _initialisation (void) |
void | _preOperational (void) |
void | _operational (void) |
void | _stopped (void) |
void | canDispatch (CO_Data *d, Message *m) |
e_nodeState | getState (CO_Data *d) |
UNS8 | setState (CO_Data *d, e_nodeState newState) |
UNS8 | getNodeId (CO_Data *d) |
void | setNodeId (CO_Data *d, UNS8 nodeId) |
void | initPreOperationalMode (CO_Data *d) |
typedef enum enum_nodeState e_nodeState | -
typedef void(*) initialisation_t(void) | -
typedef void(*) operational_t(void) | -
typedef void(*) preOperational_t(void) | -
typedef void(*) stopped_t(void) | -
-
enum enum_nodeState | -
-
void _initialisation | -( | -void | -- | ) | -- |
void _operational | -( | -void | -- | ) | -- |
void _preOperational | -( | -void | -- | ) | -- |
void _stopped | -( | -void | -- | ) | -- |
-
d | ||
m |
-Definition at line 65 of file states.c. -
-References Message::cob_id, s_state_communication::csHeartbeat, s_state_communication::csPDO, s_state_communication::csSDO, s_state_communication::csSYNC, struct_CO_Data::CurrentCommunicationState, struct_s_timer_entry::d, struct_CO_Data::iam_a_slave, NMT, NODE_GUARD, PDO1rx, PDO1tx, PDO2rx, PDO2tx, PDO3rx, PDO3tx, PDO4rx, PDO4tx, proceedNMTstateChange(), proceedNODE_GUARD(), proceedPDO(), proceedSDO(), proceedSYNC(), SDOrx, SDOtx, SYNC, and SHORT_CAN::w. -
-Referenced by canReceiveLoop(), and main(). -
-Here is the call graph for this function:
UNS8 getNodeId | -( | -CO_Data * | -d | -) | -- |
-
d |
-Definition at line 224 of file states.c. -
-References struct_CO_Data::bDeviceNodeId, and struct_s_timer_entry::d. -
-Referenced by initSensor(). -
e_nodeState getState | -( | -CO_Data * | -d | -) | -- |
-
d |
-Definition at line 54 of file states.c. -
-References struct_s_timer_entry::d, and struct_CO_Data::nodeState. -
void initPreOperationalMode | -( | -CO_Data * | -d | -) | -- |
-Some stuff to do when the node enter in pre-operational mode -
void setNodeId | -( | -CO_Data * | -d, | -|
- | - | UNS8 | -nodeId | - |
- | ) | -- |
-
d | ||
nodeId |
-Definition at line 235 of file states.c. -
-References struct_CO_Data::bDeviceNodeId, struct_s_timer_entry::d, struct_CO_Data::firstIndex, struct_CO_Data::lastIndex, struct_CO_Data::objdict, s_quick_index::PDO_RCV, s_quick_index::PDO_TRS, td_subindex::pObject, td_indextable::pSubindex, s_quick_index::SDO_SVR, UNS16, UNS32, and UNS8. -
-Referenced by InitNodes(), initSensor(), and main(). -
UNS8 setState | -( | -CO_Data * | -d, | -|
- | - | e_nodeState | -newState | - |
- | ) | -- |
-
d | ||
newState |
-Definition at line 138 of file states.c. -
-References struct_s_timer_entry::d, decompo_dcf(), struct_CO_Data::iam_a_slave, struct_CO_Data::initialisation, Initialisation, struct_CO_Data::nodeState, OD_SUCCESSFUL, struct_CO_Data::operational, Operational, Pre_operational, struct_CO_Data::preOperational, ptrTable, struct_CO_Data::scanIndexOD, struct_CO_Data::stopped, Stopped, switchCommunicationState(), UNS16, and UNS32. -
-Referenced by InitNodes(), main(), and proceedNMTstateChange(). -
-Here is the call graph for this function:
-
#include <sdo.h>
--
Data Fields | |
UNS8 | data [8] |
- -
-Definition at line 75 of file sdo.h.
UNS8 BODY::data[8] | -
- -
-Definition at line 76 of file sdo.h. -
-Referenced by _readNetworkDict(), _writeNetworkDict(), proceedSDO(), sendSDO(), and sendSDOabort(). -
-
Data Fields | |
char | used |
int | pipe [2] |
- -
-Definition at line 35 of file can_virtual.c.
char CANPipe::used | -
int CANPipe::pipe[2] | -
- -
-Definition at line 37 of file can_virtual.c. -
-
Data Fields | |
char | used |
CAN_HANDLE | fd |
TASK_HANDLE | receiveTask |
CO_Data * | d |
- -
-Definition at line 51 of file unix.c.
char CANPort::used | -
CAN_HANDLE CANPort::fd | -
TASK_HANDLE CANPort::receiveTask | -
CO_Data* CANPort::d | -
-
#include <can.h>
--Collaboration diagram for Message:
Data Fields | |
SHORT_CAN | cob_id |
UNS8 | rtr |
UNS8 | len |
UNS8 | data [8] |
- -
-Definition at line 41 of file can.h.
SHORT_CAN Message::cob_id | -
- -
-Definition at line 42 of file can.h. -
-Referenced by _sendPDOevent(), buildPDO(), canDispatch(), canMsgTransmit(), canReceive_driver(), canSend_driver(), f_can_receive(), can_uvccm_win32::get_can_data(), masterSendNMTnodeguard(), masterSendNMTstateChange(), PDOEventTimerAlarm(), PDOStop(), print_message(), proceedNODE_GUARD(), proceedPDO(), ProducerHearbeatAlarm(), sendSDO(), sendSYNC(), can_uvccm_win32::set_can_data(), and slaveSendBootUp(). -
UNS8 Message::rtr | -
- -
-Definition at line 43 of file can.h. -
-Referenced by buildPDO(), canMsgTransmit(), canReceive_driver(), canSend_driver(), f_can_receive(), can_uvccm_win32::get_can_data(), masterSendNMTnodeguard(), masterSendNMTstateChange(), print_message(), proceedNODE_GUARD(), ProducerHearbeatAlarm(), sendSDO(), sendSYNC(), can_uvccm_win32::set_can_data(), and slaveSendBootUp(). -
UNS8 Message::len | -
- -
-Definition at line 45 of file can.h. -
-Referenced by _sendPDOevent(), buildPDO(), canMsgTransmit(), canReceive_driver(), canSend_driver(), f_can_receive(), can_uvccm_win32::get_can_data(), masterSendNMTnodeguard(), masterSendNMTstateChange(), print_message(), proceedNODE_GUARD(), ProducerHearbeatAlarm(), sendSDO(), sendSYNC(), can_uvccm_win32::set_can_data(), and slaveSendBootUp(). -
UNS8 Message::data[8] | -
- -
-Definition at line 46 of file can.h. -
-Referenced by _sendPDOevent(), buildPDO(), canMsgTransmit(), canReceive_driver(), canSend_driver(), f_can_receive(), can_uvccm_win32::get_can_data(), masterSendNMTstateChange(), print_message(), proceedNODE_GUARD(), proceedPDO(), proceedSDO(), ProducerHearbeatAlarm(), sendSDO(), can_uvccm_win32::set_can_data(), and slaveSendBootUp(). -
-
#include <can.h>
--
Data Fields | |
UNS32 | w |
- -
-Definition at line 35 of file can.h.
UNS32 SHORT_CAN::w | -
- -
-Definition at line 36 of file can.h. -
-Referenced by _sendPDOevent(), buildPDO(), canDispatch(), canMsgTransmit(), canReceive_driver(), canSend_driver(), f_can_receive(), can_uvccm_win32::get_can_data(), masterSendNMTnodeguard(), masterSendNMTstateChange(), PDOEventTimerAlarm(), PDOStop(), print_message(), proceedNODE_GUARD(), proceedPDO(), ProducerHearbeatAlarm(), sendSDO(), sendSYNC(), can_uvccm_win32::set_can_data(), and slaveSendBootUp(). -
-
#include <candriver.h>
--
Data Fields | |
UNS8 | idam |
UNS8 | canidar0 |
UNS8 | canidmr0 |
UNS8 | canidar1 |
UNS8 | canidmr1 |
UNS8 | canidar2 |
UNS8 | canidmr2 |
UNS8 | canidar3 |
UNS8 | canidmr3 |
UNS8 | canidar4 |
UNS8 | canidmr4 |
UNS8 | canidar5 |
UNS8 | canidmr5 |
UNS8 | canidar6 |
UNS8 | canidmr6 |
UNS8 | canidar7 |
UNS8 | canidmr7 |
- -
-Definition at line 111 of file candriver.h.
UNS8 canBusFilterInit::idam | -
UNS8 canBusFilterInit::canidar0 | -
UNS8 canBusFilterInit::canidmr0 | -
UNS8 canBusFilterInit::canidar1 | -
UNS8 canBusFilterInit::canidmr1 | -
UNS8 canBusFilterInit::canidar2 | -
UNS8 canBusFilterInit::canidmr2 | -
UNS8 canBusFilterInit::canidar3 | -
UNS8 canBusFilterInit::canidmr3 | -
UNS8 canBusFilterInit::canidar4 | -
UNS8 canBusFilterInit::canidmr4 | -
UNS8 canBusFilterInit::canidar5 | -
UNS8 canBusFilterInit::canidmr5 | -
UNS8 canBusFilterInit::canidar6 | -
UNS8 canBusFilterInit::canidmr6 | -
UNS8 canBusFilterInit::canidar7 | -
UNS8 canBusFilterInit::canidmr7 | -
-
#include <candriver.h>
--Collaboration diagram for canBusInit:
Data Fields | |
UNS8 | cswai |
UNS8 | time |
UNS8 | cane |
UNS8 | clksrc |
UNS8 | loopb |
UNS8 | listen |
UNS8 | wupm |
canBusTime | clk |
canBusFilterInit | fi |
- -
-Definition at line 153 of file candriver.h.
UNS8 canBusInit::cswai | -
UNS8 canBusInit::time | -
UNS8 canBusInit::cane | -
UNS8 canBusInit::clksrc | -
- -
-Definition at line 157 of file candriver.h. -
UNS8 canBusInit::loopb | -
UNS8 canBusInit::listen | -
UNS8 canBusInit::wupm | -
canBusTime canBusInit::clk | -
- -
-Definition at line 162 of file candriver.h. -
-Referenced by canInit(), and initSensor(). -
canBusFilterInit canBusInit::fi | -
-
#include <candriver.h>
--
Data Fields | |
UNS8 | clksrc |
UNS8 | brp |
UNS8 | sjw |
UNS8 | samp |
UNS8 | tseg2 |
UNS8 | tseg1 |
- -
-Definition at line 99 of file candriver.h.
UNS8 canBusTime::clksrc | -
UNS8 canBusTime::brp | -
UNS8 canBusTime::sjw | -
UNS8 canBusTime::samp | -
UNS8 canBusTime::tseg2 | -
UNS8 canBusTime::tseg1 | -
-
#include <lincan.h>
--
Data Fields | |
long | flags |
long | baudrate |
long | sjw |
long | sample_pt |
-The structure is used to configure new set of parameters into CAN controller chip. If default value of some field should be preserved, fill field by value -1. -
- -
-Definition at line 49 of file lincan.h.
long can_baudparams_t::flags | -
long can_baudparams_t::baudrate | -
long can_baudparams_t::sjw | -
long can_baudparams_t::sample_pt | -
-
#include <canmsg.h>
--
Data Fields | |
int | flags |
int | queid |
int | cob |
canmsg_id_t | id |
canmsg_id_t | mask |
-Header: canmsg.h -
- -
-Definition at line 105 of file canmsg.h.
int canfilt_t::flags | -
int canfilt_t::queid | -
int canfilt_t::cob | -
canmsg_id_t canfilt_t::id | -
canmsg_id_t canfilt_t::mask | -
-
#include <canmsg.h>
--
Data Fields | |
int | flags |
int | cob |
canmsg_id_t | id |
canmsg_tstamp_t | timestamp |
unsigned short | length |
unsigned char | data [CAN_MSG_LENGTH] |
-Header: canmsg.h -
- -
-Definition at line 59 of file canmsg.h.
int canmsg_t::flags | -
- -
-Definition at line 60 of file canmsg.h. -
-Referenced by canReceive_driver(), and canSend_driver(). -
int canmsg_t::cob | -
canmsg_id_t canmsg_t::id | -
- -
-Definition at line 62 of file canmsg.h. -
-Referenced by canReceive_driver(), and canSend_driver(). -
canmsg_tstamp_t canmsg_t::timestamp | -
unsigned short canmsg_t::length | -
- -
-Definition at line 64 of file canmsg.h. -
-Referenced by canReceive_driver(), and canSend_driver(). -
unsigned char canmsg_t::data[CAN_MSG_LENGTH] | -
- -
-Definition at line 65 of file canmsg.h. -
-Referenced by canReceive_driver(), and canSend_driver(). -
-
Data Fields | |
CO_Data * | d |
HANDLE | receive_thread |
void * | inst |
volatile bool | continue_receive_thread |
- -
-Definition at line 109 of file drivers_win32.cpp.
CO_Data* driver_data::d | -
- -
-Definition at line 111 of file drivers_win32.cpp. -
-Referenced by canOpen(), and canReceiveLoop(). -
HANDLE driver_data::receive_thread | -
- -
-Definition at line 112 of file drivers_win32.cpp. -
-Referenced by canClose(), and canOpen(). -
void* driver_data::inst | -
- -
-Definition at line 113 of file drivers_win32.cpp. -
-Referenced by canClose(), canOpen(), canReceive(), and canSend(). -
volatile bool driver_data::continue_receive_thread | -
- -
-Definition at line 114 of file drivers_win32.cpp. -
-Referenced by canClose(), canOpen(), and canReceiveLoop(). -
-
#include <getopt.h>
--
Data Fields | |
char * | name |
int | has_arg |
int * | flag |
int | val |
char * | name |
int * | flag |
- -
-Definition at line 103 of file getopt.h.
char* option::name | -
int option::has_arg | -
int* option::flag | -
int option::val | -
char* option::name | -
int* option::flag | -
-
#include <objdictdef.h>
--
Data Fields | |
UNS16 | SDO_SVR |
UNS16 | SDO_CLT |
UNS16 | PDO_RCV |
UNS16 | PDO_RCV_MAP |
UNS16 | PDO_TRS |
UNS16 | PDO_TRS_MAP |
- -
-Definition at line 103 of file objdictdef.h.
UNS16 s_quick_index::SDO_SVR | -
- -
-Definition at line 104 of file objdictdef.h. -
-Referenced by proceedSDO(), sendSDO(), and setNodeId(). -
UNS16 s_quick_index::SDO_CLT | -
- -
-Definition at line 105 of file objdictdef.h. -
-Referenced by _readNetworkDict(), _writeNetworkDict(), proceedSDO(), and sendSDO(). -
UNS16 s_quick_index::PDO_RCV | -
- -
-Definition at line 106 of file objdictdef.h. -
-Referenced by proceedPDO(), sendPDOrequest(), and setNodeId(). -
UNS16 s_quick_index::PDO_RCV_MAP | -
UNS16 s_quick_index::PDO_TRS | -
- -
-Definition at line 108 of file objdictdef.h. -
-Referenced by _sendPDOevent(), buildPDO(), PDOInit(), PDOStop(), proceedPDO(), setNodeId(), and TPDO_Communication_Parameter_Callback(). -
UNS16 s_quick_index::PDO_TRS_MAP | -
- -
-Definition at line 109 of file objdictdef.h. -
-Referenced by _sendPDOevent(), and buildPDO(). -
-
#include <states.h>
--
Data Fields | |
UNS8 | csBoot_Up |
UNS8 | csSDO |
UNS8 | csEmergency |
UNS8 | csSYNC |
UNS8 | csHeartbeat |
UNS8 | csPDO |
- -
-Definition at line 48 of file states.h.
UNS8 s_state_communication::csBoot_Up | -
UNS8 s_state_communication::csSDO | -
UNS8 s_state_communication::csEmergency | -
UNS8 s_state_communication::csSYNC | -
UNS8 s_state_communication::csHeartbeat | -
UNS8 s_state_communication::csPDO | -
- -
-Definition at line 55 of file states.h. -
-Referenced by canDispatch(), proceedSYNC(), and TPDO_Communication_Parameter_Callback(). -
-
#include <data.h>
--Collaboration diagram for struct_CO_Data:
- -
-Definition at line 45 of file data.h.
UNS8* struct_CO_Data::bDeviceNodeId | -
- -
-Definition at line 47 of file data.h. -
-Referenced by getNodeId(), proceedNMTstateChange(), proceedNODE_GUARD(), proceedSDO(), ProducerHearbeatAlarm(), sendSDOabort(), setNodeId(), and slaveSendBootUp(). -
const indextable* struct_CO_Data::objdict | -
- -
-Definition at line 48 of file data.h. -
-Referenced by _readNetworkDict(), _sendPDOevent(), _writeNetworkDict(), buildPDO(), proceedPDO(), proceedSDO(), sendPDOrequest(), sendSDO(), setNodeId(), and TPDO_Communication_Parameter_Callback(). -
s_PDO_status* struct_CO_Data::PDO_status | -
- -
-Definition at line 49 of file data.h. -
-Referenced by _sendPDOevent(), PDOEventTimerAlarm(), PDOInhibitTimerAlarm(), PDOStop(), proceedPDO(), and TPDO_Communication_Parameter_Callback(). -
quick_index* struct_CO_Data::firstIndex | -
- -
-Definition at line 50 of file data.h. -
-Referenced by _readNetworkDict(), _sendPDOevent(), _writeNetworkDict(), buildPDO(), PDOInit(), PDOStop(), proceedPDO(), proceedSDO(), sendPDOrequest(), sendSDO(), setNodeId(), and TPDO_Communication_Parameter_Callback(). -
quick_index* struct_CO_Data::lastIndex | -
- -
-Definition at line 51 of file data.h. -
-Referenced by _readNetworkDict(), _sendPDOevent(), _writeNetworkDict(), PDOInit(), PDOStop(), proceedPDO(), proceedSDO(), sendPDOrequest(), sendSDO(), and setNodeId(). -
UNS16* struct_CO_Data::ObjdictSize | -
const UNS8* struct_CO_Data::iam_a_slave | -
valueRangeTest_t struct_CO_Data::valueRangeTest | -
s_transfer struct_CO_Data::transfers[SDO_MAX_SIMULTANEOUS_TRANSFERTS] | -
- -
-Definition at line 57 of file data.h. -
-Referenced by _readNetworkDict(), _writeNetworkDict(), failedSDO(), getReadResultNetworkDict(), getSDOfreeLine(), getSDOlineOnUse(), getSDOlineRestBytes(), getWriteResultNetworkDict(), initSDOline(), lineToSDO(), objdictToSDOline(), proceedSDO(), resetSDOline(), SDOlineToObjdict(), SDOTimeoutAlarm(), SDOtoLine(), and setSDOlineRestBytes(). -
e_nodeState struct_CO_Data::nodeState | -
- -
-Definition at line 61 of file data.h. -
-Referenced by getState(), proceedNMTstateChange(), proceedNODE_GUARD(), ProducerHearbeatAlarm(), sendSDO(), and setState(). -
- -
-Definition at line 62 of file data.h. -
-Referenced by canDispatch(), proceedSYNC(), and TPDO_Communication_Parameter_Callback(). -
initialisation_t struct_CO_Data::initialisation | -
preOperational_t struct_CO_Data::preOperational | -
- -
-Definition at line 64 of file data.h. -
-Referenced by decompo_dcf(), main(), and setState(). -
operational_t struct_CO_Data::operational | -
stopped_t struct_CO_Data::stopped | -
UNS8* struct_CO_Data::ConsumerHeartbeatCount | -
- -
-Definition at line 69 of file data.h. -
-Referenced by heartbeatInit(), heartbeatStop(), and proceedNODE_GUARD(). -
UNS32* struct_CO_Data::ConsumerHeartbeatEntries | -
- -
-Definition at line 70 of file data.h. -
-Referenced by ConsumerHearbeatAlarm(), heartbeatInit(), and proceedNODE_GUARD(). -
TIMER_HANDLE* struct_CO_Data::ConsumerHeartBeatTimers | -
- -
-Definition at line 71 of file data.h. -
-Referenced by heartbeatInit(), heartbeatStop(), and proceedNODE_GUARD(). -
UNS16* struct_CO_Data::ProducerHeartBeatTime | -
- -
-Definition at line 72 of file data.h. -
-Referenced by heartbeatInit(), and ProducerHearbeatAlarm(). -
TIMER_HANDLE struct_CO_Data::ProducerHeartBeatTimer | -
- -
-Definition at line 73 of file data.h. -
-Referenced by heartbeatInit(), heartbeatStop(), and ProducerHearbeatAlarm(). -
heartbeatError_t struct_CO_Data::heartbeatError | -
- -
-Definition at line 74 of file data.h. -
-Referenced by ConsumerHearbeatAlarm(), and main(). -
e_nodeState struct_CO_Data::NMTable[NMT_MAX_NODE_ID] | -
- -
-Definition at line 75 of file data.h. -
-Referenced by GetChangeStateResults(), getNodeState(), masterRequestNodeState(), and proceedNODE_GUARD(). -
TIMER_HANDLE struct_CO_Data::syncTimer | -
UNS32* struct_CO_Data::COB_ID_Sync | -
UNS32* struct_CO_Data::Sync_Cycle_Period | -
post_sync_t struct_CO_Data::post_sync | -
post_TPDO_t struct_CO_Data::post_TPDO | -
UNS8 struct_CO_Data::toggle | -
- -
-Definition at line 86 of file data.h. -
-Referenced by heartbeatInit(), and proceedNODE_GUARD(). -
CAN_HANDLE struct_CO_Data::canHandle | -
- -
-Definition at line 87 of file data.h. -
-Referenced by _sendPDOevent(), canClose(), canOpen(), masterSendNMTnodeguard(), masterSendNMTstateChange(), proceedNODE_GUARD(), proceedPDO(), ProducerHearbeatAlarm(), sendPDOrequest(), sendSDO(), sendSYNC(), and slaveSendBootUp(). -
scanIndexOD_t struct_CO_Data::scanIndexOD | -
- -
-Definition at line 88 of file data.h. -
-Referenced by _getODentry(), _setODentry(), decompo_dcf(), scanIndexOD(), and setState(). -
storeODSubIndex_t struct_CO_Data::storeODSubIndex | -
UNS8* struct_CO_Data::dcf_cursor | -
UNS32 struct_CO_Data::dcf_count_targets | -
-
#include <can_driver.h>
--
Data Fields | |
char * | busname |
char * | baudrate |
- -
-Definition at line 33 of file can_driver.h.
char* struct_s_BOARD::busname | -
- -
-Definition at line 34 of file can_driver.h. -
-Referenced by canOpen(), canOpen_driver(), and main(). -
char* struct_s_BOARD::baudrate | -
- -
-Definition at line 35 of file can_driver.h. -
-Referenced by can_uvccm_win32::can_uvccm_win32(), canInit(), canOpen(), canOpen_driver(), InitNodes(), and main(). -
-
#include <pdo.h>
--Collaboration diagram for struct_s_PDO_status:
Data Fields | |
UNS8 | transmit_type_parameter |
TIMER_HANDLE | event_timer |
TIMER_HANDLE | inhibit_timer |
Message | last_message |
- -
-Definition at line 40 of file pdo.h.
UNS8 struct_s_PDO_status::transmit_type_parameter | -
- -
-Definition at line 41 of file pdo.h. -
-Referenced by _sendPDOevent(), PDOInhibitTimerAlarm(), PDOStop(), proceedPDO(), and TPDO_Communication_Parameter_Callback(). -
TIMER_HANDLE struct_s_PDO_status::event_timer | -
- -
-Definition at line 42 of file pdo.h. -
-Referenced by PDOEventTimerAlarm(), PDOStop(), proceedPDO(), and TPDO_Communication_Parameter_Callback(). -
TIMER_HANDLE struct_s_PDO_status::inhibit_timer | -
- -
-Definition at line 43 of file pdo.h. -
-Referenced by PDOInhibitTimerAlarm(), PDOStop(), proceedPDO(), and TPDO_Communication_Parameter_Callback(). -
Message struct_s_PDO_status::last_message | -
- -
-Definition at line 44 of file pdo.h. -
-Referenced by _sendPDOevent(), PDOEventTimerAlarm(), PDOStop(), and proceedPDO(). -
-
#include <sdo.h>
--Collaboration diagram for struct_s_SDO:
Data Fields | |
UNS8 | nodeId |
BODY | body |
- -
-Definition at line 80 of file sdo.h.
UNS8 struct_s_SDO::nodeId | -
- -
-Definition at line 81 of file sdo.h. -
-Referenced by _readNetworkDict(), _writeNetworkDict(), proceedSDO(), sendSDO(), and sendSDOabort(). -
struct BODY struct_s_SDO::body | -
- -
-Definition at line 82 of file sdo.h. -
-Referenced by _readNetworkDict(), _writeNetworkDict(), proceedSDO(), sendSDO(), and sendSDOabort(). -
-
#include <timer.h>
--Collaboration diagram for struct_s_timer_entry:
Data Fields | |
UNS8 | state |
CO_Data * | d |
TimerCallback_t | callback |
UNS32 | id |
TIMEVAL | val |
TIMEVAL | interval |
- -
-Definition at line 43 of file timer.h.
UNS8 struct_s_timer_entry::state | -
CO_Data* struct_s_timer_entry::d | -
- -
-Definition at line 45 of file timer.h. -
-Referenced by _getODentry(), _readNetworkDict(), _sendPDOevent(), _setODentry(), _writeNetworkDict(), buildPDO(), canDispatch(), closeSDOtransfer(), ConsumerHearbeatAlarm(), decompo_dcf(), failedSDO(), getNodeId(), getNodeState(), getODentry(), getReadResultNetworkDict(), getSDOfreeLine(), getSDOlineOnUse(), getSDOlineRestBytes(), getState(), getWriteResultNetworkDict(), heartbeatInit(), heartbeatStop(), initSDOline(), lineToSDO(), masterRequestNodeState(), masterSendNMTnodeguard(), masterSendNMTstateChange(), objdictToSDOline(), OnCOB_ID_SyncUpdate(), OnHeartbeatProducerUpdate(), PDOEventTimerAlarm(), PDOInhibitTimerAlarm(), PDOInit(), PDOStop(), proceedNMTstateChange(), proceedNODE_GUARD(), proceedPDO(), proceedSDO(), proceedSYNC(), ProducerHearbeatAlarm(), readLocalDict(), readNetworkDict(), readNetworkDictCallback(), RegisterSetODentryCallBack(), resetSDO(), resetSDOline(), scanIndexOD(), SDOlineToObjdict(), SDOTimeoutAlarm(), SDOtoLine(), sendPDOevent(), sendPDOrequest(), sendSDO(), sendSDOabort(), sendSYNC(), SetAlarm(), setNodeId(), setODentry(), setSDOlineRestBytes(), setState(), slaveSendBootUp(), startSYNC(), stopSYNC(), switchCommunicationState(), SyncAlarm(), TPDO_Communication_Parameter_Callback(), writeLocalDict(), writeNetworkDict(), and writeNetworkDictCallBack(). -
TimerCallback_t struct_s_timer_entry::callback | -
UNS32 struct_s_timer_entry::id | -
TIMEVAL struct_s_timer_entry::val | -
TIMEVAL struct_s_timer_entry::interval | -
-
#include <sdo.h>
--
Data Fields | |
UNS8 | nodeId |
UNS8 | whoami |
UNS8 | state |
UNS8 | toggle |
UNS32 | abortCode |
UNS16 | index |
UNS8 | subIndex |
UNS32 | count |
UNS32 | offset |
UNS8 | data [SDO_MAX_LENGTH_TRANSFERT] |
UNS8 | dataType |
TIMER_HANDLE | timer |
SDOCallback_t | Callback |
- -
-Definition at line 38 of file sdo.h.
UNS8 struct_s_transfer::nodeId | -
- -
-Definition at line 39 of file sdo.h. -
-Referenced by getSDOlineOnUse(), initSDOline(), and SDOTimeoutAlarm(). -
UNS8 struct_s_transfer::whoami | -
- -
-Definition at line 41 of file sdo.h. -
-Referenced by getSDOfreeLine(), getSDOlineOnUse(), and SDOTimeoutAlarm(). -
UNS8 struct_s_transfer::state | -
- -
-Definition at line 42 of file sdo.h. -
-Referenced by failedSDO(), getReadResultNetworkDict(), getSDOfreeLine(), getSDOlineOnUse(), getWriteResultNetworkDict(), initSDOline(), proceedSDO(), and SDOTimeoutAlarm(). -
UNS8 struct_s_transfer::toggle | -
UNS32 struct_s_transfer::abortCode | -
- -
-Definition at line 44 of file sdo.h. -
-Referenced by getWriteResultNetworkDict(), proceedSDO(), and SDOTimeoutAlarm(). -
UNS16 struct_s_transfer::index | -
- -
-Definition at line 47 of file sdo.h. -
-Referenced by initSDOline(), objdictToSDOline(), proceedSDO(), SDOlineToObjdict(), and SDOTimeoutAlarm(). -
UNS8 struct_s_transfer::subIndex | -
- -
-Definition at line 48 of file sdo.h. -
-Referenced by initSDOline(), objdictToSDOline(), proceedSDO(), SDOlineToObjdict(), and SDOTimeoutAlarm(). -
UNS32 struct_s_transfer::count | -
- -
-Definition at line 49 of file sdo.h. -
-Referenced by _writeNetworkDict(), getReadResultNetworkDict(), getSDOlineRestBytes(), initSDOline(), lineToSDO(), objdictToSDOline(), proceedSDO(), SDOlineToObjdict(), and setSDOlineRestBytes(). -
UNS32 struct_s_transfer::offset | -
- -
-Definition at line 50 of file sdo.h. -
-Referenced by _writeNetworkDict(), getSDOlineRestBytes(), initSDOline(), lineToSDO(), objdictToSDOline(), and SDOtoLine(). -
UNS8 struct_s_transfer::data[SDO_MAX_LENGTH_TRANSFERT] | -
- -
-Definition at line 56 of file sdo.h. -
-Referenced by _writeNetworkDict(), getReadResultNetworkDict(), lineToSDO(), objdictToSDOline(), resetSDOline(), SDOlineToObjdict(), and SDOtoLine(). -
UNS8 struct_s_transfer::dataType | -
- -
-Definition at line 57 of file sdo.h. -
-Referenced by _readNetworkDict(), _writeNetworkDict(), getReadResultNetworkDict(), and initSDOline(). -
TIMER_HANDLE struct_s_transfer::timer | -
SDOCallback_t struct_s_transfer::Callback | -
- -
-Definition at line 67 of file sdo.h. -
-Referenced by _readNetworkDict(), _writeNetworkDict(), initSDOline(), proceedSDO(), and SDOTimeoutAlarm(). -
-
#include <candriver.h>
--
Data Fields | |
UNS8 | w |
UNS8 | r |
- -
-Definition at line 67 of file candriver.h.
UNS8 t_pointerStack::w | -
- -
-Definition at line 68 of file candriver.h. -
UNS8 t_pointerStack::r | -
-
#include <objdictdef.h>
--Collaboration diagram for td_indextable:
Data Fields | |
subindex * | pSubindex |
UNS8 | bSubCount |
UNS16 | index |
- -
-Definition at line 93 of file objdictdef.h.
subindex* td_indextable::pSubindex | -
- -
-Definition at line 95 of file objdictdef.h. -
-Referenced by _getODentry(), _readNetworkDict(), _sendPDOevent(), _setODentry(), _writeNetworkDict(), buildPDO(), decompo_dcf(), proceedPDO(), proceedSDO(), sendPDOrequest(), sendSDO(), setNodeId(), and TPDO_Communication_Parameter_Callback(). -
UNS8 td_indextable::bSubCount | -
- -
-Definition at line 96 of file objdictdef.h. -
-Referenced by _getODentry(), _readNetworkDict(), _setODentry(), _writeNetworkDict(), proceedSDO(), and sendSDO(). -
UNS16 td_indextable::index | -
-
#include <objdictdef.h>
--
Data Fields | |
UNS8 | bAccessType |
UNS8 | bDataType |
UNS8 | size |
void * | pObject |
- -
-Definition at line 83 of file objdictdef.h.
UNS8 td_subindex::bAccessType | -
- -
-Definition at line 85 of file objdictdef.h. -
-Referenced by _getODentry(), and _setODentry(). -
UNS8 td_subindex::bDataType | -
- -
-Definition at line 86 of file objdictdef.h. -
-Referenced by _getODentry(), and _setODentry(). -
UNS8 td_subindex::size | -
- -
-Definition at line 87 of file objdictdef.h. -
-Referenced by _getODentry(), _setODentry(), and decompo_dcf(). -
void* td_subindex::pObject | -
- -
-Definition at line 88 of file objdictdef.h. -
-Referenced by _getODentry(), _readNetworkDict(), _sendPDOevent(), _setODentry(), _writeNetworkDict(), buildPDO(), decompo_dcf(), proceedPDO(), proceedSDO(), sendPDOrequest(), sendSDO(), setNodeId(), and TPDO_Communication_Parameter_Callback(). -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00033 #include "data.h" -00034 #include "sync.h" -00035 #include "canfestival.h" -00036 -00037 /* Prototypes for internals functions */ -00038 -00045 void SyncAlarm(CO_Data* d, UNS32 id); -00046 UNS32 OnCOB_ID_SyncUpdate(CO_Data* d, const indextable * unsused_indextable, -00047 UNS8 unsused_bSubindex); -00048 -00055 void SyncAlarm(CO_Data* d, UNS32 id) -00056 { -00057 sendSYNC(d, *d->COB_ID_Sync & 0x1FFFFFFF) ; -00058 } -00059 -00069 UNS32 OnCOB_ID_SyncUpdate(CO_Data* d, const indextable * unsused_indextable, UNS8 unsused_bSubindex) -00070 { -00071 startSYNC(d); -00072 return 0; -00073 } -00074 -00080 void startSYNC(CO_Data* d) -00081 { -00082 RegisterSetODentryCallBack(d, 0x1005, 0, &OnCOB_ID_SyncUpdate); -00083 RegisterSetODentryCallBack(d, 0x1006, 0, &OnCOB_ID_SyncUpdate); -00084 -00085 if(d->syncTimer != TIMER_NONE){ -00086 stopSYNC(d); -00087 } -00088 -00089 if(*d->COB_ID_Sync & 0x40000000 && *d->Sync_Cycle_Period) -00090 { -00091 d->syncTimer = SetAlarm( -00092 d, -00093 0 /*No id needed*/, -00094 &SyncAlarm, -00095 US_TO_TIMEVAL(*d->Sync_Cycle_Period), -00096 US_TO_TIMEVAL(*d->Sync_Cycle_Period)); -00097 } -00098 } -00099 -00105 void stopSYNC(CO_Data* d) -00106 { -00107 d->syncTimer = DelAlarm(d->syncTimer); -00108 } -00109 -00118 UNS8 sendSYNC(CO_Data* d, UNS32 cob_id) -00119 { -00120 Message m; -00121 UNS8 resultat ; -00122 -00123 MSG_WAR(0x3001, "sendSYNC ", 0); -00124 -00125 m.cob_id.w = cob_id ; -00126 m.rtr = NOT_A_REQUEST; -00127 m.len = 0; -00128 resultat = canSend(d->canHandle,&m) ; -00129 proceedSYNC(d, &m) ; -00130 return resultat ; -00131 } -00132 -00141 UNS8 proceedSYNC(CO_Data* d, Message *m) -00142 { -00143 -00144 UNS8 res; -00145 -00146 MSG_WAR(0x3002, "SYNC received. Proceed. ", 0); -00147 -00148 (*d->post_sync)(); -00149 -00150 /* only operational state allows PDO transmission */ -00151 if(! d->CurrentCommunicationState.csPDO) -00152 return 0; -00153 -00154 res = _sendPDOevent(d, 1 /*isSyncEvent*/ ); -00155 -00156 /*Call user app callback*/ -00157 (*d->post_TPDO)(); -00158 -00159 return res; -00160 -00161 } -00162 -00163 -00164 void _post_sync(){} -00165 void _post_TPDO(){} -
#include "data.h"
#include "sync.h"
#include "canfestival.h"
-Include dependency graph for sync.c:
-Go to the source code of this file.
Functions | |
void | SyncAlarm (CO_Data *d, UNS32 id) |
UNS32 | OnCOB_ID_SyncUpdate (CO_Data *d, const indextable *unsused_indextable, UNS8 unsused_bSubindex) |
void | startSYNC (CO_Data *d) |
void | stopSYNC (CO_Data *d) |
UNS8 | sendSYNC (CO_Data *d, UNS32 cob_id) |
UNS8 | proceedSYNC (CO_Data *d, Message *m) |
void | _post_sync () |
void | _post_TPDO () |
-Definition in file sync.c.
void _post_sync | -( | -void | -- | ) | -- |
void _post_TPDO | -( | -void | -- | ) | -- |
UNS32 OnCOB_ID_SyncUpdate | -( | -CO_Data * | -d, | -|
- | - | const indextable * | -unsused_indextable, | -|
- | - | UNS8 | -unsused_bSubindex | - |
- | ) | -- |
-This is called when Index 0x1005 is updated.
-
d | ||
unsused_indextable | ||
unsused_bSubindex |
-Definition at line 69 of file sync.c. -
-References struct_s_timer_entry::d, and startSYNC(). -
-Referenced by startSYNC(). -
-Here is the call graph for this function:
-
d | ||
m |
-Definition at line 141 of file sync.c. -
-References _sendPDOevent(), s_state_communication::csPDO, struct_CO_Data::CurrentCommunicationState, struct_s_timer_entry::d, MSG_WAR, struct_CO_Data::post_sync, struct_CO_Data::post_TPDO, and UNS8. -
-Referenced by canDispatch(), and sendSYNC(). -
-Here is the call graph for this function:
UNS8 sendSYNC | -( | -CO_Data * | -d, | -|
- | - | UNS32 | -cob_id | - |
- | ) | -- |
-
d | ||
cob_id |
-Definition at line 118 of file sync.c. -
-References struct_CO_Data::canHandle, canSend(), Message::cob_id, struct_s_timer_entry::d, Message::len, MSG_WAR, NOT_A_REQUEST, proceedSYNC(), Message::rtr, UNS8, and SHORT_CAN::w. -
-Referenced by SyncAlarm(). -
-Here is the call graph for this function:
void startSYNC | -( | -CO_Data * | -d | -) | -- |
-
d |
-Definition at line 80 of file sync.c. -
-References struct_CO_Data::COB_ID_Sync, struct_s_timer_entry::d, OnCOB_ID_SyncUpdate(), RegisterSetODentryCallBack(), SetAlarm(), stopSYNC(), struct_CO_Data::Sync_Cycle_Period, SyncAlarm(), struct_CO_Data::syncTimer, and US_TO_TIMEVAL. -
-Referenced by OnCOB_ID_SyncUpdate(), and switchCommunicationState(). -
-Here is the call graph for this function:
void stopSYNC | -( | -CO_Data * | -d | -) | -- |
-
d |
-Definition at line 105 of file sync.c. -
-References struct_s_timer_entry::d, DelAlarm(), and struct_CO_Data::syncTimer. -
-Referenced by startSYNC(), and switchCommunicationState(). -
-Here is the call graph for this function:
void SyncAlarm | -( | -CO_Data * | -d, | -|
- | - | UNS32 | -id | - |
- | ) | -- |
-
d | ||
id |
-Definition at line 55 of file sync.c. -
-References struct_CO_Data::COB_ID_Sync, struct_s_timer_entry::d, and sendSYNC(). -
-Referenced by startSYNC(). -
-Here is the call graph for this function:
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #ifndef __SYNC_h__ -00024 #define __SYNC_h__ -00025 -00026 void startSYNC(CO_Data* d); -00027 -00028 void stopSYNC(CO_Data* d); -00029 -00030 typedef void (*post_sync_t)(void); -00031 void _post_sync(void); -00032 -00033 typedef void (*post_TPDO_t)(void); -00034 void _post_TPDO(void); -00035 -00040 UNS8 sendSYNC (CO_Data* d, UNS32 cob_id); -00041 -00048 UNS8 proceedSYNC (CO_Data* d, Message * m); -00049 -00050 #endif -
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Typedefs | |
typedef void(*) | post_sync_t (void) |
typedef void(*) | post_TPDO_t (void) |
Functions | |
void | startSYNC (CO_Data *d) |
void | stopSYNC (CO_Data *d) |
void | _post_sync (void) |
void | _post_TPDO (void) |
UNS8 | sendSYNC (CO_Data *d, UNS32 cob_id) |
UNS8 | proceedSYNC (CO_Data *d, Message *m) |
typedef void(*) post_sync_t(void) | -
typedef void(*) post_TPDO_t(void) | -
-
void _post_sync | -( | -void | -- | ) | -- |
void _post_TPDO | -( | -void | -- | ) | -- |
-
d | ||
m |
-Definition at line 141 of file sync.c. -
-References _sendPDOevent(), s_state_communication::csPDO, struct_CO_Data::CurrentCommunicationState, struct_s_timer_entry::d, MSG_WAR, struct_CO_Data::post_sync, struct_CO_Data::post_TPDO, and UNS8. -
-Referenced by canDispatch(), and sendSYNC(). -
-Here is the call graph for this function:
UNS8 sendSYNC | -( | -CO_Data * | -d, | -|
- | - | UNS32 | -cob_id | - |
- | ) | -- |
-
d | ||
cob_id |
-Definition at line 118 of file sync.c. -
-References struct_CO_Data::canHandle, canSend(), Message::cob_id, struct_s_timer_entry::d, Message::len, MSG_WAR, NOT_A_REQUEST, proceedSYNC(), Message::rtr, UNS8, and SHORT_CAN::w. -
-Referenced by SyncAlarm(). -
-Here is the call graph for this function:
void startSYNC | -( | -CO_Data * | -d | -) | -- |
-
d |
-Definition at line 80 of file sync.c. -
-References struct_CO_Data::COB_ID_Sync, struct_s_timer_entry::d, OnCOB_ID_SyncUpdate(), RegisterSetODentryCallBack(), SetAlarm(), stopSYNC(), struct_CO_Data::Sync_Cycle_Period, SyncAlarm(), struct_CO_Data::syncTimer, and US_TO_TIMEVAL. -
-Referenced by OnCOB_ID_SyncUpdate(), and switchCommunicationState(). -
-Here is the call graph for this function:
void stopSYNC | -( | -CO_Data * | -d | -) | -- |
-
d |
-Definition at line 105 of file sync.c. -
-References struct_s_timer_entry::d, DelAlarm(), and struct_CO_Data::syncTimer. -
-Referenced by startSYNC(), and switchCommunicationState(). -
-Here is the call graph for this function:
-
00001 #ifndef __sysdep_h__ -00002 #define __sysdep_h__ -00003 -00004 #include "config.h" -00005 -00006 #ifdef CANOPEN_BIG_ENDIAN -00007 -00008 /* Warning: the argument must not update pointers, e.g. *p++ */ -00009 -00010 #define UNS16_LE(v) ((((UNS16)(v) & 0xff00) >> 8) | \ -00011 (((UNS16)(v) & 0x00ff) << 8)) -00012 -00013 #define UNS32_LE(v) ((((UNS32)(v) & 0xff000000) >> 24) | \ -00014 (((UNS32)(v) & 0x00ff0000) >> 8) | \ -00015 (((UNS32)(v) & 0x0000ff00) << 8) | \ -00016 (((UNS32)(v) & 0x000000ff) << 24)) -00017 -00018 #else -00019 -00020 #define UNS16_LE(v) (v) -00021 -00022 #define UNS32_LE(v) (v) -00023 -00024 #endif -00025 -00026 #endif /* __sysdep_h__ */ -00027 -
#include "config.h"
-Include dependency graph for sysdep.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Defines | |
#define | UNS16_LE(v) (v) |
#define | UNS32_LE(v) (v) |
#define UNS16_LE | -( | -v | -- | ) | -(v) | -
#define UNS32_LE | -( | -v | -- | ) | -(v) | -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00032 /* #define DEBUG_WAR_CONSOLE_ON */ -00033 /* #define DEBUG_ERR_CONSOLE_ON */ -00034 -00035 #include <applicfg.h> -00036 #include "timer.h" -00037 -00038 /* --------- The timer table --------- */ -00039 s_timer_entry timers[MAX_NB_TIMER] = {{TIMER_FREE, NULL, NULL, 0, 0, 0},}; -00040 -00041 TIMEVAL total_sleep_time = TIMEVAL_MAX; -00042 TIMER_HANDLE last_timer_raw = -1; -00043 -00044 #define min_val(a,b) ((a<b)?a:b) -00045 -00057 TIMER_HANDLE SetAlarm(CO_Data* d, UNS32 id, TimerCallback_t callback, TIMEVAL value, TIMEVAL period) -00058 { -00059 /*printf("SetAlarm(UNS32 id=%d, TimerCallback_t callback=%x, TIMEVAL value=%d, TIMEVAL period=%d)\n", id, callback, value, period); */ -00060 TIMER_HANDLE i; -00061 TIMER_HANDLE row_number = TIMER_NONE; -00062 -00063 /* in order to decide new timer setting we have to run over all timer rows */ -00064 for(i=0; i <= last_timer_raw + 1 && i < MAX_NB_TIMER; i++) -00065 { -00066 s_timer_entry *row = (timers+i); -00067 -00068 if (callback && /* if something to store */ -00069 row->state == TIMER_FREE) /* and empty row */ -00070 { /* just store */ -00071 row->callback = callback; -00072 row->d = d; -00073 row->id = id; -00074 row->val = value; -00075 row->interval = period; -00076 row->state = TIMER_ARMED; -00077 row_number = i; -00078 break; -00079 } -00080 } -00081 -00082 if (row_number != TIMER_NONE) /* if successfull **/ -00083 { -00084 TIMEVAL real_timer_value; -00085 TIMEVAL elapsed_time; -00086 -00087 if (row_number == last_timer_raw + 1) last_timer_raw++; -00088 -00089 /* set next wakeup alarm if new entry is sooner than others, or if it is alone */ -00090 real_timer_value = min_val(value, TIMEVAL_MAX); -00091 elapsed_time = getElapsedTime(); -00092 -00093 /*printf("elapsed_time=%d real_timer_value=%d total_sleep_time=%d\n", elapsed_time, real_timer_value, total_sleep_time); */ -00094 if (total_sleep_time > elapsed_time && total_sleep_time - elapsed_time > real_timer_value) -00095 { -00096 total_sleep_time = elapsed_time + real_timer_value; -00097 setTimer(real_timer_value); -00098 } -00099 /*printf("SetAlarm() return %d\n", row_number); */ -00100 return row_number; -00101 } -00102 return TIMER_NONE; -00103 } -00104 -00112 TIMER_HANDLE DelAlarm(TIMER_HANDLE handle) -00113 { -00114 /* Quick and dirty. system timer will continue to be trigged, but no action will be preformed. */ -00115 MSG_WAR(0x3320, "DelAlarm. handle = ", handle); -00116 if(handle != TIMER_NONE) -00117 { -00118 if(handle == last_timer_raw) -00119 last_timer_raw--; -00120 timers[handle].state = TIMER_FREE; -00121 } -00122 else { -00123 } -00124 return TIMER_NONE; -00125 } -00126 -00131 void TimeDispatch() -00132 { -00133 TIMER_HANDLE i; -00134 TIMEVAL next_wakeup = TIMEVAL_MAX; /* used to compute when should normaly occur next wakeup */ -00135 /* First run : change timer state depending on time */ -00136 /* Get time since timer signal */ -00137 TIMEVAL overrun = getElapsedTime(); -00138 -00139 TIMEVAL real_total_sleep_time = total_sleep_time + overrun; -00140 /*printf("total_sleep_time %d + overrun %d\n", total_sleep_time , overrun); */ -00141 -00142 for(i=0; i <= last_timer_raw; i++) -00143 { -00144 s_timer_entry *row = (timers+i); -00145 -00146 if (row->state & TIMER_ARMED) /* if row is active */ -00147 { -00148 if (row->val <= real_total_sleep_time) /* to be trigged */ -00149 { -00150 /*printf("row->val(%d) <= (%d)real_total_sleep_time\n", row->val, real_total_sleep_time); */ -00151 if (!row->interval) /* if simply outdated */ -00152 { -00153 row->state = TIMER_TRIG; /* ask for trig */ -00154 } -00155 else /* or period have expired */ -00156 { -00157 /* set val as interval, with overrun correction */ -00158 row->val = row->interval - (overrun % row->interval); -00159 row->state = TIMER_TRIG_PERIOD; /* ask for trig, periodic */ -00160 /* Check if this new timer value is the soonest */ -00161 next_wakeup = min_val(row->val,next_wakeup); -00162 } -00163 } -00164 else -00165 { -00166 /* Each armed timer value in decremented. */ -00167 row->val -= real_total_sleep_time; -00168 -00169 /* Check if this new timer value is the soonest */ -00170 next_wakeup = min_val(row->val,next_wakeup); -00171 } -00172 } -00173 } -00174 -00175 /* Remember how much time we should sleep. */ -00176 total_sleep_time = next_wakeup; -00177 -00178 /* Set timer to soonest occurence */ -00179 setTimer(next_wakeup); -00180 -00181 /* Then trig them or not. */ -00182 for(i=0; i<=last_timer_raw; i++) -00183 { -00184 s_timer_entry *row = (timers+i); -00185 -00186 if (row->state & TIMER_TRIG) -00187 { -00188 row->state &= ~TIMER_TRIG; /* reset trig state (will be free if not periodic) */ -00189 if(row->callback) -00190 (*row->callback)(row->d, row->id); /* trig ! */ -00191 } -00192 } -00193 } -00194 -
#include <applicfg.h>
#include "timer.h"
-Include dependency graph for timer.c:
-Go to the source code of this file.
Defines | |
#define | min_val(a, b) ((a<b)?a:b) |
Functions | |
TIMER_HANDLE | SetAlarm (CO_Data *d, UNS32 id, TimerCallback_t callback, TIMEVAL value, TIMEVAL period) |
TIMER_HANDLE | DelAlarm (TIMER_HANDLE handle) |
void | TimeDispatch () |
Variables | |
s_timer_entry | timers [MAX_NB_TIMER] = {{TIMER_FREE, NULL, NULL, 0, 0, 0},} |
TIMEVAL | total_sleep_time = TIMEVAL_MAX |
TIMER_HANDLE | last_timer_raw = -1 |
-Definition in file timer.c.
#define min_val | -( | -a, | |||
- | - | b | -- | ) | -((a<b)?a:b) | -
-
TIMER_HANDLE DelAlarm | -( | -TIMER_HANDLE | -handle | -) | -- |
------ Use this to remove an alarm ----
-
handle |
-Definition at line 112 of file timer.c. -
-References last_timer_raw, MSG_WAR, struct_s_timer_entry::state, and timers. -
-Referenced by _sendPDOevent(), heartbeatStop(), PDOStop(), proceedNODE_GUARD(), proceedPDO(), ProducerHearbeatAlarm(), stopSYNC(), and TPDO_Communication_Parameter_Callback(). -
TIMER_HANDLE SetAlarm | -( | -CO_Data * | -d, | -|
- | - | UNS32 | -id, | -|
- | - | TimerCallback_t | -callback, | -|
- | - | TIMEVAL | -value, | -|
- | - | TIMEVAL | -period | - |
- | ) | -- |
-------- Use this to declare a new alarm ------
-
d | ||
id | ||
callback | ||
value | ||
period |
-Definition at line 57 of file timer.c. -
-References struct_s_timer_entry::d, last_timer_raw, MAX_NB_TIMER, TIMER_HANDLE, and timers. -
-Referenced by _sendPDOevent(), heartbeatInit(), proceedNODE_GUARD(), startSYNC(), and StartTimerLoop(). -
void TimeDispatch | -( | -void | -- | ) | -- |
------- TimeDispatch is called on each timer expiration ---- -
-Definition at line 131 of file timer.c. -
-References getElapsedTime(), last_timer_raw, min_val, TIMER_HANDLE, timers, TIMEVAL, TIMEVAL_MAX, and total_sleep_time. -
-Referenced by class_timers::timer_loop_thread_proc(), timer_notify(), and timerloop_task_proc(). -
-Here is the call graph for this function:
-
TIMER_HANDLE last_timer_raw = -1 | -
- -
-Definition at line 42 of file timer.c. -
-Referenced by DelAlarm(), SetAlarm(), and TimeDispatch(). -
s_timer_entry timers[MAX_NB_TIMER] = {{TIMER_FREE, NULL, NULL, 0, 0, 0},} | -
- -
-Definition at line 39 of file timer.c. -
-Referenced by DelAlarm(), SetAlarm(), and TimeDispatch(). -
TIMEVAL total_sleep_time = TIMEVAL_MAX | -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #ifndef __timer_h__ -00024 #define __timer_h__ -00025 -00026 #include <timerscfg.h> -00027 #include <applicfg.h> -00028 -00029 #define TIMER_HANDLE INTEGER16 -00030 -00031 #include "data.h" -00032 -00033 /* --------- types and constants definitions --------- */ -00034 #define TIMER_FREE 0 -00035 #define TIMER_ARMED 1 -00036 #define TIMER_TRIG 2 -00037 #define TIMER_TRIG_PERIOD 3 -00038 -00039 #define TIMER_NONE -1 -00040 -00041 typedef void (*TimerCallback_t)(CO_Data* d, UNS32 id); -00042 -00043 struct struct_s_timer_entry { -00044 UNS8 state; -00045 CO_Data* d; -00046 TimerCallback_t callback; /* The callback func. */ -00047 UNS32 id; /* The callback func. */ -00048 TIMEVAL val; -00049 TIMEVAL interval; /* Periodicity */ -00050 }; -00051 -00052 typedef struct struct_s_timer_entry s_timer_entry; -00053 -00054 /* --------- prototypes --------- */ -00055 /*#define SetAlarm(d, id, callback, value, period) printf("%s, %d, SetAlarm(%s, %s, %s, %s, %s)\n",__FILE__, __LINE__, #d, #id, #callback, #value, #period); _SetAlarm(d, id, callback, value, period)*/ -00056 TIMER_HANDLE SetAlarm(CO_Data* d, UNS32 id, TimerCallback_t callback, TIMEVAL value, TIMEVAL period); -00057 TIMER_HANDLE DelAlarm(TIMER_HANDLE handle); -00058 void TimeDispatch(void); -00059 -00060 /* --------- to be defined in user app ---------*/ -00061 void setTimer(TIMEVAL value); -00062 TIMEVAL getElapsedTime(void); -00063 -00064 #endif /* #define __timer_h__ */ -
#include <timerscfg.h>
#include <applicfg.h>
#include "data.h"
-Include dependency graph for timer.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Data Structures | |
struct | struct_s_timer_entry |
Defines | |
#define | TIMER_HANDLE INTEGER16 |
Typedefs | |
typedef void(*) | TimerCallback_t (CO_Data *d, UNS32 id) |
typedef struct_s_timer_entry | s_timer_entry |
Functions | |
TIMER_HANDLE | SetAlarm (CO_Data *d, UNS32 id, TimerCallback_t callback, TIMEVAL value, TIMEVAL period) |
TIMER_HANDLE | DelAlarm (TIMER_HANDLE handle) |
void | TimeDispatch (void) |
void | setTimer (TIMEVAL value) |
TIMEVAL | getElapsedTime (void) |
#define TIMER_HANDLE INTEGER16 | -
-
typedef struct struct_s_timer_entry s_timer_entry | -
typedef void(*) TimerCallback_t(CO_Data *d, UNS32 id) | -
-
TIMER_HANDLE DelAlarm | -( | -TIMER_HANDLE | -handle | -) | -- |
------ Use this to remove an alarm ----
-
handle |
-Definition at line 112 of file timer.c. -
-References last_timer_raw, MSG_WAR, struct_s_timer_entry::state, and timers. -
-Referenced by _sendPDOevent(), heartbeatStop(), PDOStop(), proceedNODE_GUARD(), proceedPDO(), ProducerHearbeatAlarm(), stopSYNC(), and TPDO_Communication_Parameter_Callback(). -
TIMEVAL getElapsedTime | -( | -void | -- | ) | -- |
- -
-Definition at line 66 of file canOpenDriver.c. -
-References class_timers::get_elapsed_time(), IO_PORTS_16, and TC4H. -
-Here is the call graph for this function:
TIMER_HANDLE SetAlarm | -( | -CO_Data * | -d, | -|
- | - | UNS32 | -id, | -|
- | - | TimerCallback_t | -callback, | -|
- | - | TIMEVAL | -value, | -|
- | - | TIMEVAL | -period | - |
- | ) | -- |
-------- Use this to declare a new alarm ------
-
d | ||
id | ||
callback | ||
value | ||
period |
-Definition at line 57 of file timer.c. -
-References struct_s_timer_entry::d, last_timer_raw, MAX_NB_TIMER, TIMER_HANDLE, and timers. -
-Referenced by _sendPDOevent(), heartbeatInit(), proceedNODE_GUARD(), startSYNC(), and StartTimerLoop(). -
void setTimer | -( | -TIMEVAL | -value | -) | -- |
- -
-Definition at line 83 of file timers_unix.c. -
-References maxval, class_timers::set_timer(), and timer. -
-Here is the call graph for this function:
void TimeDispatch | -( | -void | -- | ) | -- |
------- TimeDispatch is called on each timer expiration ---- -
-Definition at line 131 of file timer.c. -
-References getElapsedTime(), last_timer_raw, min_val, TIMER_HANDLE, timers, TIMEVAL, TIMEVAL_MAX, and total_sleep_time. -
-Referenced by class_timers::timer_loop_thread_proc(), timer_notify(), and timerloop_task_proc(). -
-Here is the call graph for this function:
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #ifndef __timer_driver_h__ -00024 #define __timer_driver_h__ -00025 -00026 #include "timerscfg.h" -00027 #include "timer.h" -00028 /*void initTimer();*/ -00029 -00030 // For use from CAN driver -00031 void EnterMutex(void); -00032 void LeaveMutex(void); -00033 void WaitReceiveTaskEnd(TASK_HANDLE); -00034 -00035 // For use from application -00036 void StartTimerLoop(TimerCallback_t init_callback); -00037 void StopTimerLoop(void); -00038 void CreateReceiveTask(CAN_PORT , TASK_HANDLE* , void* ); -00039 -00040 #endif -
#include "timerscfg.h"
#include "timer.h"
-Include dependency graph for timers_driver.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Functions | |
void | EnterMutex (void) |
void | LeaveMutex (void) |
void | WaitReceiveTaskEnd (TASK_HANDLE) |
void | StartTimerLoop (TimerCallback_t init_callback) |
void | StopTimerLoop (void) |
void | CreateReceiveTask (CAN_PORT, TASK_HANDLE *, void *) |
void CreateReceiveTask | -( | -CAN_PORT | -, | -|
- | - | TASK_HANDLE * | -, | -|
- | - | void * | -- | |
- | ) | -- |
- -
-Definition at line 71 of file timers_unix.c. -
void EnterMutex | -( | -void | -- | ) | -- |
- -
-Definition at line 20 of file timers_unix.c. -
-References CanFestival_mutex, and ccritical_section::enter(). -
-Here is the call graph for this function:
void LeaveMutex | -( | -void | -- | ) | -- |
- -
-Definition at line 25 of file timers_unix.c. -
-References CanFestival_mutex, and ccritical_section::leave(). -
-Here is the call graph for this function:
void StartTimerLoop | -( | -TimerCallback_t | -init_callback | -) | -- |
- -
-Definition at line 62 of file timers_unix.c. -
-References EnterMutex(), initTimer(), LeaveMutex(), class_timers::resume_timer_thread(), SetAlarm(), class_timers::start_timer_thread(), and TIMEVAL. -
-Here is the call graph for this function:
void StopTimerLoop | -( | -void | -- | ) | -- |
- -
-Definition at line 55 of file timers_unix.c. -
-References EnterMutex(), LeaveMutex(), class_timers::stop_timer_thread(), and timer. -
-Here is the call graph for this function:
void WaitReceiveTaskEnd | -( | -TASK_HANDLE | -- | ) | -- |
- -
-Definition at line 76 of file timers_unix.c. -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #ifndef __TIMERSCFG_H__ -00024 #define __TIMERSCFG_H__ -00025 -00026 #include <pthread.h> -00027 -00028 /* Time unit : us */ -00029 /* Time resolution : 64bit (~584942 years) */ -00030 #define TIMEVAL unsigned long long -00031 #define TIMEVAL_MAX ~(TIMEVAL)0 -00032 #define MS_TO_TIMEVAL(ms) ms*1000 -00033 #define US_TO_TIMEVAL(us) us -00034 -00035 #define TASK_HANDLE pthread_t -00036 -00037 #endif -
#include <pthread.h>
-Include dependency graph for timerscfg.h:
-Go to the source code of this file.
Defines | |
#define | TIMEVAL unsigned long long |
#define | TIMEVAL_MAX ~(TIMEVAL)0 |
#define | MS_TO_TIMEVAL(ms) ms*1000 |
#define | US_TO_TIMEVAL(us) us |
#define | TASK_HANDLE pthread_t |
#define MS_TO_TIMEVAL | -( | -ms | -- | ) | -ms*1000 | -
- -
-Definition at line 32 of file timerscfg.h. -
#define TASK_HANDLE pthread_t | -
- -
-Definition at line 35 of file timerscfg.h. -
#define TIMEVAL unsigned long long | -
- -
-Definition at line 30 of file timerscfg.h. -
#define TIMEVAL_MAX ~(TIMEVAL)0 | -
- -
-Definition at line 31 of file timerscfg.h. -
#define US_TO_TIMEVAL | -( | -us | -- | ) | -us | -
- -
-Definition at line 33 of file timerscfg.h. -
-
00001 #include <stdlib.h> -00002 -00003 #include <sys/time.h> -00004 #include <pthread.h> -00005 #include <signal.h> -00006 -00007 #include "applicfg.h" -00008 #include "timer.h" -00009 -00010 pthread_mutex_t CanFestival_mutex = PTHREAD_MUTEX_INITIALIZER; -00011 -00012 TASK_HANDLE TimerLoopThread; -00013 -00014 TIMEVAL last_time_set = TIMEVAL_MAX; -00015 -00016 struct timeval last_sig; -00017 -00018 timer_t timer; -00019 -00020 void EnterMutex(void) -00021 { -00022 pthread_mutex_lock(&CanFestival_mutex); -00023 } -00024 -00025 void LeaveMutex(void) -00026 { -00027 pthread_mutex_unlock(&CanFestival_mutex); -00028 } -00029 -00030 void timer_notify(sigval_t val) -00031 { -00032 gettimeofday(&last_sig,NULL); -00033 EnterMutex(); -00034 TimeDispatch(); -00035 LeaveMutex(); -00036 // printf("getCurrentTime() return=%u\n", p.tv_usec); -00037 } -00038 -00039 void initTimer(void) -00040 { -00041 struct sigevent sigev; -00042 -00043 // Take first absolute time ref. -00044 gettimeofday(&last_sig,NULL); -00045 -00046 memset (&sigev, 0, sizeof (struct sigevent)); -00047 sigev.sigev_value.sival_int = 0; -00048 sigev.sigev_notify = SIGEV_THREAD; -00049 sigev.sigev_notify_attributes = NULL; -00050 sigev.sigev_notify_function = timer_notify; -00051 -00052 timer_create (CLOCK_REALTIME, &sigev, &timer); -00053 } -00054 -00055 void StopTimerLoop(void) -00056 { -00057 EnterMutex(); -00058 timer_delete (timer); -00059 LeaveMutex(); -00060 } -00061 -00062 void StartTimerLoop(TimerCallback_t init_callback) -00063 { -00064 initTimer(); -00065 EnterMutex(); -00066 // At first, TimeDispatch will call init_callback. -00067 SetAlarm(NULL, 0, init_callback, 0, 0); -00068 LeaveMutex(); -00069 } -00070 -00071 void CreateReceiveTask(CAN_PORT port, TASK_HANDLE* Thread, void* ReceiveLoopPtr) -00072 { -00073 pthread_create(Thread, NULL, ReceiveLoopPtr, (void*)port); -00074 } -00075 -00076 void WaitReceiveTaskEnd(TASK_HANDLE Thread) -00077 { -00078 pthread_kill(Thread, SIGTERM); -00079 pthread_join(Thread, NULL); -00080 } -00081 -00082 #define maxval(a,b) ((a>b)?a:b) -00083 void setTimer(TIMEVAL value) -00084 { -00085 // printf("setTimer(TIMEVAL value=%d)\n", value); -00086 // TIMEVAL is us whereas setitimer wants ns... -00087 long tv_nsec = 1000 * (maxval(value,1)%1000000); -00088 time_t tv_sec = value/1000000; -00089 struct itimerspec timerValues; -00090 timerValues.it_value.tv_sec = tv_sec; -00091 timerValues.it_value.tv_nsec = tv_nsec; -00092 timerValues.it_interval.tv_sec = 0; -00093 timerValues.it_interval.tv_nsec = 0; -00094 -00095 timer_settime (timer, 0, &timerValues, NULL); -00096 } -00097 -00098 TIMEVAL getElapsedTime(void) -00099 { -00100 struct timeval p; -00101 gettimeofday(&p,NULL); -00102 // printf("getCurrentTime() return=%u\n", p.tv_usec); -00103 return (p.tv_sec - last_sig.tv_sec)* 1000000 + p.tv_usec - last_sig.tv_usec; -00104 } -
#include <stdlib.h>
#include <sys/time.h>
#include <pthread.h>
#include <signal.h>
#include "applicfg.h"
#include "timer.h"
-Include dependency graph for timers_unix.c:
-Go to the source code of this file.
Defines | |
#define | maxval(a, b) ((a>b)?a:b) |
Functions | |
void | EnterMutex (void) |
void | LeaveMutex (void) |
void | timer_notify (sigval_t val) |
void | initTimer (void) |
void | StopTimerLoop (void) |
void | StartTimerLoop (TimerCallback_t init_callback) |
void | CreateReceiveTask (CAN_PORT port, TASK_HANDLE *Thread, void *ReceiveLoopPtr) |
void | WaitReceiveTaskEnd (TASK_HANDLE Thread) |
void | setTimer (TIMEVAL value) |
TIMEVAL | getElapsedTime (void) |
Variables | |
pthread_mutex_t | CanFestival_mutex = PTHREAD_MUTEX_INITIALIZER |
TASK_HANDLE | TimerLoopThread |
TIMEVAL | last_time_set = TIMEVAL_MAX |
timeval | last_sig |
timer_t | timer |
#define maxval | -( | -a, | |||
- | - | b | -- | ) | -((a>b)?a:b) | -
-
void CreateReceiveTask | -( | -CAN_PORT | -port, | -|
- | - | TASK_HANDLE * | -Thread, | -|
- | - | void * | -ReceiveLoopPtr | - |
- | ) | -- |
void EnterMutex | -( | -void | -- | ) | -- |
- -
-Definition at line 20 of file timers_unix.c. -
-Referenced by canClose(), canOpen(), canReceiveLoop(), canSend(), StartTimerLoop(), StopTimerLoop(), class_timers::timer_loop_thread_proc(), timer_notify(), and timerloop_task_proc(). -
TIMEVAL getElapsedTime | -( | -void | -- | ) | -- |
void initTimer | -( | -void | -- | ) | -- |
- -
-Definition at line 39 of file timers_unix.c. -
-References IO_PORTS_8, last_sig, lock(), TCTL1, TIE, timer, timer_notify(), TIOS, TSCR1, TSCR2, and unlock(). -
-Here is the call graph for this function:
void LeaveMutex | -( | -void | -- | ) | -- |
- -
-Definition at line 25 of file timers_unix.c. -
-Referenced by canClose(), canOpen(), canReceiveLoop(), canSend(), StartTimerLoop(), StopTimerLoop(), class_timers::timer_loop_thread_proc(), timer_notify(), and timerloop_task_proc(). -
void setTimer | -( | -TIMEVAL | -value | -) | -- |
- -
-Definition at line 83 of file timers_unix.c. -
void StartTimerLoop | -( | -TimerCallback_t | -init_callback | -) | -- |
void StopTimerLoop | -( | -void | -- | ) | -- |
void timer_notify | -( | -sigval_t | -val | -) | -- |
- -
-Definition at line 30 of file timers_unix.c. -
-References EnterMutex(), last_sig, LeaveMutex(), and TimeDispatch(). -
-Referenced by initTimer(). -
-Here is the call graph for this function:
void WaitReceiveTaskEnd | -( | -TASK_HANDLE | -Thread | -) | -- |
-
pthread_mutex_t CanFestival_mutex = PTHREAD_MUTEX_INITIALIZER | -
- -
-Definition at line 10 of file timers_unix.c. -
-Referenced by EnterMutex(), and LeaveMutex(). -
struct timeval last_sig | -
- -
-Definition at line 16 of file timers_unix.c. -
-Referenced by getElapsedTime(), initTimer(), and timer_notify(). -
TIMEVAL last_time_set = TIMEVAL_MAX | -
- -
-Definition at line 14 of file timers_unix.c. -
timer_t timer | -
- -
-Definition at line 18 of file timers_unix.c. -
-Referenced by initTimer(), setTimer(), and StopTimerLoop(). -
TASK_HANDLE TimerLoopThread | -
- -
-Definition at line 12 of file timers_unix.c. -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 Copyright (C) Win32 Port Leonid Tochinski -00006 -00007 See COPYING file for copyrights details. -00008 -00009 This library is free software; you can redistribute it and/or -00010 modify it under the terms of the GNU Lesser General Public -00011 License as published by the Free Software Foundation; either -00012 version 2.1 of the License, or (at your option) any later version. -00013 -00014 This library is distributed in the hope that it will be useful, -00015 but WITHOUT ANY WARRANTY; without even the implied warranty of -00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00017 Lesser General Public License for more details. -00018 -00019 You should have received a copy of the GNU Lesser General Public -00020 License along with this library; if not, write to the Free Software -00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00022 */ -00023 -00024 -00025 -00026 #include <windows.h> -00027 #include <stdlib.h> -00028 -00029 extern "C" -00030 { -00031 #include "applicfg.h" -00032 #include "can_driver.h" -00033 #include "timer.h" -00034 #include "timers_driver.h" -00035 }; -00036 -00037 // --------------- Synchronization Object Implementation --------------- -00038 class ccritical_section -00039 { -00040 public: -00041 ccritical_section() -00042 { -00043 ::InitializeCriticalSection(&m_cs); -00044 } -00045 ~ccritical_section() -00046 { -00047 ::DeleteCriticalSection(&m_cs); -00048 } -00049 void enter() -00050 { -00051 ::EnterCriticalSection(&m_cs); -00052 } -00053 void leave() -00054 { -00055 ::LeaveCriticalSection(&m_cs); -00056 } -00057 private: -00058 CRITICAL_SECTION m_cs; -00059 }; -00060 -00061 static ccritical_section g_cs; -00062 -00063 -00064 void EnterMutex(void) -00065 { -00066 g_cs.enter(); -00067 } -00068 -00069 void LeaveMutex(void) -00070 { -00071 g_cs.leave(); -00072 } -00073 // --------------- Synchronization Object Implementation --------------- -00074 -00075 -00076 // --------------- CAN Receive Thread Implementation --------------- -00077 -00078 void CreateReceiveTask(CAN_HANDLE fd0, TASK_HANDLE* Thread, void* ReceiveLoopPtr) -00079 { -00080 unsigned long thread_id = 0; -00081 *Thread = ::CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ReceiveLoopPtr, fd0, 0, &thread_id); -00082 } -00083 -00084 void WaitReceiveTaskEnd(TASK_HANDLE Thread) -00085 { -00086 ::WaitForSingleObject(Thread, INFINITE); -00087 ::CloseHandle(Thread); -00088 //*Thread = NULL; -00089 } -00090 // --------------- CAN Receive Thread Implementation --------------- -00091 -00092 -00093 // --------------- Timer Thread Implementation --------------- -00094 class class_timers -00095 { -00096 public: -00097 class_timers(); -00098 ~class_timers(); -00099 void start_timer_thread(); -00100 void resume_timer_thread(); -00101 void stop_timer_thread(); -00102 void set_timer(TIMEVAL value); -00103 TIMEVAL get_elapsed_time(); -00104 private: -00105 TIMEVAL get_timer() const; -00106 static DWORD WINAPI timer_loop_thread_proc(void* arg); -00107 private: -00108 TIMEVAL m_last_occured_alarm_time; -00109 volatile TIMEVAL m_last_alarm_set_time; -00110 HANDLE m_timer_thread; -00111 volatile bool m_continue_timer_loop; -00112 bool m_use_hi_res_timer; -00113 double m_counts_per_usec; -00114 }; -00115 -00116 class_timers::class_timers() : m_last_occured_alarm_time(TIMEVAL_MAX), -00117 m_last_alarm_set_time(TIMEVAL_MAX), -00118 m_timer_thread(0), -00119 m_continue_timer_loop(false), -00120 m_use_hi_res_timer(false), -00121 m_counts_per_usec(0.) -00122 { -00123 // initialize hi resolution timer -00124 LARGE_INTEGER counts_per_sec = {0, 0}; -00125 if (::QueryPerformanceFrequency(&counts_per_sec) && counts_per_sec.QuadPart > 0) -00126 { -00127 m_use_hi_res_timer = true; -00128 m_counts_per_usec = counts_per_sec.QuadPart / 1000000.; -00129 } -00130 m_use_hi_res_timer = true; -00131 } -00132 -00133 class_timers::~class_timers() -00134 { -00135 stop_timer_thread(); -00136 } -00137 -00138 // time is in micro seconds -00139 TIMEVAL class_timers::get_timer() const -00140 { -00141 if (m_use_hi_res_timer) -00142 { -00143 LARGE_INTEGER performance_count = {0, 0}; -00144 ::QueryPerformanceCounter(&performance_count); -00145 return (TIMEVAL)(performance_count.QuadPart / m_counts_per_usec); -00146 } -00147 // hi-res timer is unavailable -00148 return 1000 * ::GetTickCount(); -00149 } -00150 -00151 DWORD WINAPI class_timers::timer_loop_thread_proc(void* arg) -00152 { -00153 class_timers* This = reinterpret_cast<class_timers*>(arg); -00154 while (This->m_continue_timer_loop) -00155 { -00156 TIMEVAL cur_time = This->get_timer(); -00157 if (cur_time >= This->m_last_alarm_set_time) -00158 { -00159 This->m_last_occured_alarm_time = cur_time; -00160 This->m_last_alarm_set_time = TIMEVAL_MAX; -00161 EnterMutex(); -00162 TimeDispatch(); -00163 LeaveMutex(); -00164 } -00165 else -00166 { -00167 ::Sleep(1); -00168 } -00169 } -00170 return 0; -00171 } -00172 -00173 void class_timers::start_timer_thread() -00174 { -00175 if (m_timer_thread == 0) -00176 { -00177 unsigned long thread_id = 0; -00178 m_timer_thread = ::CreateThread(NULL, 0, &timer_loop_thread_proc, this, CREATE_SUSPENDED, &thread_id); -00179 m_last_alarm_set_time = TIMEVAL_MAX; -00180 m_last_occured_alarm_time = get_timer(); -00181 } -00182 } -00183 -00184 void class_timers::resume_timer_thread() -00185 { -00186 if (m_timer_thread) -00187 { -00188 m_continue_timer_loop = true; -00189 ::ResumeThread(m_timer_thread); -00190 } -00191 } -00192 -00193 void class_timers::stop_timer_thread() -00194 { -00195 if (m_timer_thread) -00196 { -00197 m_continue_timer_loop = false; -00198 ::WaitForSingleObject(m_timer_thread, INFINITE); -00199 ::CloseHandle(m_timer_thread); -00200 m_timer_thread = 0; -00201 } -00202 } -00203 -00204 void class_timers::set_timer(TIMEVAL value) -00205 { -00206 m_last_alarm_set_time = (value == TIMEVAL_MAX) ? TIMEVAL_MAX : get_timer() + value; -00207 } -00208 -00209 // elapsed time since last occured alarm -00210 TIMEVAL class_timers::get_elapsed_time() -00211 { -00212 return get_timer() - m_last_occured_alarm_time; -00213 } -00214 -00215 // ---------------------------------------------------------- -00216 -00217 static class_timers s_timers; -00218 -00219 void StartTimerLoop(TimerCallback_t init_callback) -00220 { -00221 s_timers.start_timer_thread(); -00222 // At first, TimeDispatch will call init_callback. -00223 if (init_callback != NULL) -00224 SetAlarm(NULL, 0, init_callback, (TIMEVAL)0, (TIMEVAL)0); -00225 s_timers.resume_timer_thread(); -00226 } -00227 -00228 void StopTimerLoop(void) -00229 { -00230 s_timers.stop_timer_thread(); -00231 } -00232 -00233 void setTimer(TIMEVAL value) -00234 { -00235 s_timers.set_timer(value); -00236 } -00237 -00238 TIMEVAL getElapsedTime(void) -00239 { -00240 return s_timers.get_elapsed_time(); -00241 } -
#include <windows.h>
#include <stdlib.h>
#include "applicfg.h"
#include "can_driver.h"
#include "timer.h"
#include "timers_driver.h"
-Include dependency graph for timers_win32.cpp:
-Go to the source code of this file.
Data Structures | |
class | ccritical_section |
class | class_timers |
Functions | |
void | EnterMutex (void) |
void | LeaveMutex (void) |
void | CreateReceiveTask (CAN_HANDLE fd0, TASK_HANDLE *Thread, void *ReceiveLoopPtr) |
void | WaitReceiveTaskEnd (TASK_HANDLE Thread) |
void | StartTimerLoop (TimerCallback_t init_callback) |
void | StopTimerLoop (void) |
void | setTimer (TIMEVAL value) |
TIMEVAL | getElapsedTime (void) |
void CreateReceiveTask | -( | -CAN_HANDLE | -fd0, | -|
- | - | TASK_HANDLE * | -Thread, | -|
- | - | void * | -ReceiveLoopPtr | - |
- | ) | -- |
- -
-Definition at line 78 of file timers_win32.cpp. -
void EnterMutex | -( | -void | -- | ) | -- |
- -
-Definition at line 64 of file timers_win32.cpp. -
-References CanFestival_mutex, and ccritical_section::enter(). -
-Here is the call graph for this function:
TIMEVAL getElapsedTime | -( | -void | -- | ) | -- |
- -
-Definition at line 238 of file timers_win32.cpp. -
-References class_timers::get_elapsed_time(), IO_PORTS_16, and TC4H. -
-Here is the call graph for this function:
void LeaveMutex | -( | -void | -- | ) | -- |
- -
-Definition at line 69 of file timers_win32.cpp. -
-References CanFestival_mutex, and ccritical_section::leave(). -
-Here is the call graph for this function:
void setTimer | -( | -TIMEVAL | -value | -) | -- |
- -
-Definition at line 233 of file timers_win32.cpp. -
-References maxval, class_timers::set_timer(), and timer. -
-Here is the call graph for this function:
void StartTimerLoop | -( | -TimerCallback_t | -init_callback | -) | -- |
- -
-Definition at line 219 of file timers_win32.cpp. -
-References EnterMutex(), initTimer(), LeaveMutex(), class_timers::resume_timer_thread(), SetAlarm(), class_timers::start_timer_thread(), and TIMEVAL. -
-Here is the call graph for this function:
void StopTimerLoop | -( | -void | -- | ) | -- |
- -
-Definition at line 228 of file timers_win32.cpp. -
-References EnterMutex(), LeaveMutex(), class_timers::stop_timer_thread(), and timer. -
-Here is the call graph for this function:
void WaitReceiveTaskEnd | -( | -TASK_HANDLE | -Thread | -) | -- |
- -
-Definition at line 84 of file timers_win32.cpp. -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #ifndef __TIMERSCFG_H__ -00024 #define __TIMERSCFG_H__ -00025 -00026 #include <native/task.h> -00027 #include <native/timer.h> -00028 #include <native/mutex.h> -00029 #include <native/alarm.h> -00030 -00031 // Time unit : ns -00032 // Time resolution : 64bit (~584 years) -00033 #define TIMEVAL RTIME -00034 #define TIMEVAL_MAX ~(RTIME)0 -00035 #define MS_TO_TIMEVAL(ms) (RTIME)ms*1000000 -00036 #define US_TO_TIMEVAL(us) (RTIME)us*1000 -00037 -00038 #define TASK_HANDLE RT_TASK -00039 -00040 #endif -
#include <native/task.h>
#include <native/timer.h>
#include <native/mutex.h>
#include <native/alarm.h>
-Include dependency graph for timerscfg.h:
-Go to the source code of this file.
Defines | |
#define | TIMEVAL RTIME |
#define | TIMEVAL_MAX ~(RTIME)0 |
#define | MS_TO_TIMEVAL(ms) (RTIME)ms*1000000 |
#define | US_TO_TIMEVAL(us) (RTIME)us*1000 |
#define | TASK_HANDLE RT_TASK |
#define MS_TO_TIMEVAL | -( | -ms | -- | ) | -(RTIME)ms*1000000 | -
- -
-Definition at line 35 of file timerscfg.h. -
#define TASK_HANDLE RT_TASK | -
- -
-Definition at line 38 of file timerscfg.h. -
#define TIMEVAL RTIME | -
- -
-Definition at line 33 of file timerscfg.h. -
#define TIMEVAL_MAX ~(RTIME)0 | -
- -
-Definition at line 34 of file timerscfg.h. -
#define US_TO_TIMEVAL | -( | -us | -- | ) | -(RTIME)us*1000 | -
- -
-Definition at line 36 of file timerscfg.h. -
-
00001 #include <stdlib.h> -00002 #include <unistd.h> -00003 #include <sys/mman.h> -00004 -00005 #include <native/task.h> -00006 #include <native/timer.h> -00007 #include <native/mutex.h> -00008 #include <native/alarm.h> -00009 -00010 #include "applicfg.h" -00011 #include "can_driver.h" -00012 #include "timer.h" -00013 -00014 #define TIMERLOOP_TASK_CREATED 1 -00015 -00016 RT_MUTEX CanFestival_mutex; -00017 RT_TASK timerloop_task; -00018 RTIME last_time_read; -00019 RTIME last_occured_alarm; -00020 RTIME last_alarm_set; -00021 -00022 char stop_timer=0; -00023 -00024 void cleanup_all(void) -00025 { -00026 rt_task_delete(&timerloop_task); -00027 } -00028 void StopTimerLoop(void) -00029 { -00030 stop_timer = 1; -00031 rt_task_unblock(&timerloop_task); -00032 } -00033 -00034 -00035 void EnterMutex(void) -00036 { -00037 rt_mutex_lock(&CanFestival_mutex, TM_INFINITE); -00038 } -00039 -00040 void LeaveMutex(void) -00041 { -00042 rt_mutex_unlock(&CanFestival_mutex); -00043 } -00044 -00045 void timerloop_task_proc(void *arg) -00046 { -00047 int ret; -00048 do{ -00049 do{ -00050 last_occured_alarm = last_alarm_set; -00051 EnterMutex(); -00052 TimeDispatch(); -00053 LeaveMutex(); -00054 while ((ret = rt_task_sleep_until(last_alarm_set)) == -EINTR); -00055 }while (ret == 0); -00056 }while (!stop_timer); -00057 printf("End of TimerLoop, code %d\n",ret); -00058 } -00059 -00060 void StartTimerLoop(TimerCallback_t init_callback) -00061 { -00062 int ret; -00063 stop_timer = 0; -00064 char taskname[32]; -00065 snprintf(taskname, sizeof(taskname), "timerloop-%d", getpid()); -00066 -00067 mlockall(MCL_CURRENT | MCL_FUTURE); -00068 -00069 //create timerloop_task -00070 ret = rt_task_create(&timerloop_task, taskname, 0, 50, 0); -00071 if (ret) { -00072 printf("Failed to create timerloop_task, code %d\n",errno); -00073 return; -00074 } -00075 -00076 getElapsedTime(); -00077 last_alarm_set = last_time_read; -00078 last_occured_alarm = last_alarm_set; -00079 SetAlarm(NULL, 0, init_callback, 0, 0); -00080 // start timerloop_task -00081 ret = rt_task_start(&timerloop_task,&timerloop_task_proc,NULL); -00082 if (ret) { -00083 printf("Failed to start timerloop_task, code %d\n",errno); -00084 goto error; -00085 } -00086 -00087 return; -00088 -00089 error: -00090 cleanup_all(); -00091 } -00092 -00093 void CreateReceiveTask(CAN_PORT fd0, TASK_HANDLE *ReceiveLoop_task, void* ReceiveLoop_task_proc) -00094 { -00095 int ret; -00096 static int id = 0; -00097 char taskname[32]; -00098 snprintf(taskname, sizeof(taskname), "canloop%d-%d", id, getpid()); -00099 id++; -00100 -00101 mlockall(MCL_CURRENT | MCL_FUTURE); -00102 -00103 //create timerloop_task -00104 ret = rt_task_create(ReceiveLoop_task,taskname,0,50,0); -00105 if (ret) { -00106 printf("Failed to create ReceiveLoop_task number %d, code %d\n", id, errno); -00107 return; -00108 } -00109 // start timerloop_task -00110 ret = rt_task_start(ReceiveLoop_task,ReceiveLoop_task_proc,(void*)fd0); -00111 if (ret) { -00112 printf("Failed to start ReceiveLoop_task number %d, code %d\n", id, errno); -00113 return; -00114 } -00115 } -00116 -00117 void WaitReceiveTaskEnd(TASK_HANDLE *Thread) -00118 { -00119 rt_task_delete(Thread); -00120 } -00121 -00122 void setTimer(TIMEVAL value) -00123 { -00124 last_alarm_set = (value == TIMEVAL_MAX) ? TIMEVAL_MAX : last_time_read + value; -00125 rt_task_unblock(&timerloop_task); -00126 } -00127 -00128 TIMEVAL getElapsedTime(void) -00129 { -00130 last_time_read = rt_timer_ticks2ns(rt_timer_read()); -00131 return last_time_read - last_occured_alarm; -00132 } -
#include <stdlib.h>
#include <unistd.h>
#include <sys/mman.h>
#include <native/task.h>
#include <native/timer.h>
#include <native/mutex.h>
#include <native/alarm.h>
#include "applicfg.h"
#include "can_driver.h"
#include "timer.h"
-Include dependency graph for timers_xeno.c:
-Go to the source code of this file.
Defines | |
#define | TIMERLOOP_TASK_CREATED 1 |
Functions | |
void | cleanup_all (void) |
void | StopTimerLoop (void) |
void | EnterMutex (void) |
void | LeaveMutex (void) |
void | timerloop_task_proc (void *arg) |
void | StartTimerLoop (TimerCallback_t init_callback) |
void | CreateReceiveTask (CAN_PORT fd0, TASK_HANDLE *ReceiveLoop_task, void *ReceiveLoop_task_proc) |
void | WaitReceiveTaskEnd (TASK_HANDLE *Thread) |
void | setTimer (TIMEVAL value) |
TIMEVAL | getElapsedTime (void) |
Variables | |
RT_MUTEX | CanFestival_mutex |
RT_TASK | timerloop_task |
RTIME | last_time_read |
RTIME | last_occured_alarm |
RTIME | last_alarm_set |
char | stop_timer = 0 |
#define TIMERLOOP_TASK_CREATED 1 | -
- -
-Definition at line 14 of file timers_xeno.c. -
-
void cleanup_all | -( | -void | -- | ) | -- |
- -
-Definition at line 24 of file timers_xeno.c. -
-References timerloop_task. -
-Referenced by StartTimerLoop(). -
void CreateReceiveTask | -( | -CAN_PORT | -fd0, | -|
- | - | TASK_HANDLE * | -ReceiveLoop_task, | -|
- | - | void * | -ReceiveLoop_task_proc | - |
- | ) | -- |
- -
-Definition at line 93 of file timers_xeno.c. -
void EnterMutex | -( | -void | -- | ) | -- |
TIMEVAL getElapsedTime | -( | -void | -- | ) | -- |
- -
-Definition at line 128 of file timers_xeno.c. -
-References last_occured_alarm, and last_time_read. -
void LeaveMutex | -( | -void | -- | ) | -- |
void setTimer | -( | -TIMEVAL | -value | -) | -- |
- -
-Definition at line 122 of file timers_xeno.c. -
-References last_alarm_set, last_time_read, timerloop_task, and TIMEVAL_MAX. -
void StartTimerLoop | -( | -TimerCallback_t | -init_callback | -) | -- |
- -
-Definition at line 60 of file timers_xeno.c. -
-References cleanup_all(), getElapsedTime(), last_alarm_set, last_occured_alarm, last_time_read, SetAlarm(), stop_timer, timerloop_task, and timerloop_task_proc(). -
-Here is the call graph for this function:
void StopTimerLoop | -( | -void | -- | ) | -- |
- -
-Definition at line 28 of file timers_xeno.c. -
-References stop_timer, and timerloop_task. -
void timerloop_task_proc | -( | -void * | -arg | -) | -- |
- -
-Definition at line 45 of file timers_xeno.c. -
-References EnterMutex(), last_alarm_set, last_occured_alarm, LeaveMutex(), stop_timer, and TimeDispatch(). -
-Referenced by StartTimerLoop(). -
-Here is the call graph for this function:
void WaitReceiveTaskEnd | -( | -TASK_HANDLE * | -Thread | -) | -- |
- -
-Definition at line 117 of file timers_xeno.c. -
-
RT_MUTEX CanFestival_mutex | -
- -
-Definition at line 16 of file timers_xeno.c. -
RTIME last_alarm_set | -
- -
-Definition at line 20 of file timers_xeno.c. -
-Referenced by setTimer(), StartTimerLoop(), and timerloop_task_proc(). -
RTIME last_occured_alarm | -
- -
-Definition at line 19 of file timers_xeno.c. -
-Referenced by getElapsedTime(), StartTimerLoop(), and timerloop_task_proc(). -
RTIME last_time_read | -
- -
-Definition at line 18 of file timers_xeno.c. -
-Referenced by getElapsedTime(), setTimer(), and StartTimerLoop(). -
char stop_timer = 0 | -
- -
-Definition at line 22 of file timers_xeno.c. -
-Referenced by StartTimerLoop(), StopTimerLoop(), and timerloop_task_proc(). -
RT_TASK timerloop_task | -
- -
-Definition at line 17 of file timers_xeno.c. -
-Referenced by cleanup_all(), setTimer(), StartTimerLoop(), and StopTimerLoop(). -
-
drivers/can_lincan/can_lincan.c
- - -drivers/can_peak_linux/can_peak_linux.c
-drivers/can_peak_win32/can_peak_win32.c
-drivers/can_socket/can_socket.c
-drivers/can_uvccm_win32/can_uvccm_win32.cpp
-drivers/can_virtual/can_virtual.c
- - -drivers/timers_unix/timers_unix.c
-drivers/timers_xeno/timers_xeno.c
- -drivers/win32/drivers_win32.cpp
-drivers/win32/timers_win32.cpp
-examples/gene_SYNC_HCS12/appli.c
-examples/gene_SYNC_HCS12/objdict.c
-examples/gene_SYNC_HCS12/objdict.h
-examples/TestMasterMicroMod/getopt.c
-examples/TestMasterMicroMod/getopt.h
-examples/TestMasterMicroMod/TestMaster.c
-examples/TestMasterMicroMod/TestMaster.h
-examples/TestMasterMicroMod/TestMasterMicroMod.c
-examples/TestMasterMicroMod/TestMasterMicroMod.h
-examples/TestMasterSlave/getopt.c
-examples/TestMasterSlave/getopt.h
-examples/TestMasterSlave/Master.c
-examples/TestMasterSlave/Master.h
-examples/TestMasterSlave/Slave.c
-examples/TestMasterSlave/Slave.h
-examples/TestMasterSlave/TestMaster.c
-examples/TestMasterSlave/TestMaster.h
-examples/TestMasterSlave/TestMasterSlave.c
-examples/TestMasterSlave/TestMasterSlave.h
-examples/TestMasterSlave/TestSlave.c
-examples/TestMasterSlave/TestSlave.h
- -examples/win32test/win32test.c
-examples/win32test/win32test.h
- - - - - - - - - - - - - - - - - - - - - - - - -include/hcs12/asm-m68hc12/ports.h
-include/hcs12/asm-m68hc12/ports_def.h
-include/hcs12/asm-m68hc12/portsaccess.h
-include/hcs12/asm-m68hc12/regs.h
-include/hcs12/board/arch/exit.h
-include/hcs12/board/arch/interrupts.h
-include/hcs12/board/arch/param.h
-include/timers_unix/timerscfg.h
- - - - - - - - - - - - - - - - - - -00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #ifndef __APPLICFG_LINUX__ -00024 #define __APPLICFG_LINUX__ -00025 -00026 #include <string.h> -00027 #include <stdio.h> -00028 #include <sys/types.h> -00029 -00030 /* Define the architecture : little_endian or big_endian -00031 ----------------------------------------------------- -00032 Test : -00033 UNS32 v = 0x1234ABCD; -00034 char *data = &v; -00035 -00036 Result for a little_endian architecture : -00037 data[0] = 0xCD; -00038 data[1] = 0xAB; -00039 data[2] = 0x34; -00040 data[3] = 0x12; -00041 -00042 Result for a big_endian architecture : -00043 data[0] = 0x12; -00044 data[1] = 0x34; -00045 data[2] = 0xAB; -00046 data[3] = 0xCD; -00047 */ -00048 -00049 /* Integers */ -00050 #define INTEGER8 int8_t -00051 #define INTEGER16 int16_t -00052 #define INTEGER24 int32_t -00053 #define INTEGER32 int32_t -00054 #define INTEGER40 int64_t -00055 #define INTEGER48 int64_t -00056 #define INTEGER56 int64_t -00057 #define INTEGER64 int64_t -00058 -00059 /* Unsigned integers */ -00060 #define UNS8 u_int8_t -00061 #define UNS16 u_int16_t -00062 #define UNS32 u_int32_t -00063 #define UNS24 u_int32_t -00064 #define UNS40 u_int64_t -00065 #define UNS48 u_int64_t -00066 #define UNS56 u_int64_t -00067 #define UNS64 u_int64_t -00068 -00069 /* Reals */ -00070 #define REAL32 float -00071 #define REAL64 double -00072 -00073 /* Definition of error and warning macros */ -00074 /* -------------------------------------- */ -00075 #if defined DEBUG_ERR_CONSOLE_ON || defined DEBUG_WAR_CONSOLE_ON -00076 #include <stdio.h> -00077 #endif -00078 -00079 /* Definition of MSG_ERR */ -00080 /* --------------------- */ -00081 #ifdef DEBUG_ERR_CONSOLE_ON -00082 # define MSG_ERR(num, str, val) \ -00083 printf("%s,%d : 0X%x %s 0X%x \n",__FILE__, __LINE__,num, str, val); -00084 #else -00085 # define MSG_ERR(num, str, val) -00086 #endif -00087 -00088 /* Definition of MSG_WAR */ -00089 /* --------------------- */ -00090 #ifdef DEBUG_WAR_CONSOLE_ON -00091 # define MSG_WAR(num, str, val) \ -00092 printf("%s,%d : 0X%x %s 0X%x \n",__FILE__, __LINE__,num, str, val); -00093 #else -00094 # define MSG_WAR(num, str, val) -00095 #endif -00096 -00097 typedef void* CAN_HANDLE; -00098 -00099 typedef void* CAN_PORT; -00100 -00101 #endif -
#include <string.h>
#include <stdio.h>
#include <sys/types.h>
-Include dependency graph for applicfg.h:
-Go to the source code of this file.
Defines | |
#define | INTEGER8 int8_t |
#define | INTEGER16 int16_t |
#define | INTEGER24 int32_t |
#define | INTEGER32 int32_t |
#define | INTEGER40 int64_t |
#define | INTEGER48 int64_t |
#define | INTEGER56 int64_t |
#define | INTEGER64 int64_t |
#define | UNS8 u_int8_t |
#define | UNS16 u_int16_t |
#define | UNS32 u_int32_t |
#define | UNS24 u_int32_t |
#define | UNS40 u_int64_t |
#define | UNS48 u_int64_t |
#define | UNS56 u_int64_t |
#define | UNS64 u_int64_t |
#define | REAL32 float |
#define | REAL64 double |
#define | MSG_ERR(num, str, val) |
#define | MSG_WAR(num, str, val) |
Typedefs | |
typedef void * | CAN_HANDLE |
typedef void * | CAN_PORT |
#define INTEGER16 int16_t | -
- -
-Definition at line 51 of file applicfg.h. -
#define INTEGER24 int32_t | -
- -
-Definition at line 52 of file applicfg.h. -
#define INTEGER32 int32_t | -
- -
-Definition at line 53 of file applicfg.h. -
#define INTEGER40 int64_t | -
- -
-Definition at line 54 of file applicfg.h. -
#define INTEGER48 int64_t | -
- -
-Definition at line 55 of file applicfg.h. -
#define INTEGER56 int64_t | -
- -
-Definition at line 56 of file applicfg.h. -
#define INTEGER64 int64_t | -
- -
-Definition at line 57 of file applicfg.h. -
#define INTEGER8 int8_t | -
- -
-Definition at line 50 of file applicfg.h. -
#define MSG_ERR | -( | -num, | |||
- | - | str, | |||
- | - | val | -- | ) | -- |
- -
-Definition at line 85 of file applicfg.h. -
#define MSG_WAR | -( | -num, | |||
- | - | str, | |||
- | - | val | -- | ) | -- |
- -
-Definition at line 94 of file applicfg.h. -
#define REAL32 float | -
- -
-Definition at line 70 of file applicfg.h. -
#define REAL64 double | -
- -
-Definition at line 71 of file applicfg.h. -
#define UNS16 u_int16_t | -
- -
-Definition at line 61 of file applicfg.h. -
#define UNS24 u_int32_t | -
- -
-Definition at line 63 of file applicfg.h. -
#define UNS32 u_int32_t | -
- -
-Definition at line 62 of file applicfg.h. -
#define UNS40 u_int64_t | -
- -
-Definition at line 64 of file applicfg.h. -
#define UNS48 u_int64_t | -
- -
-Definition at line 65 of file applicfg.h. -
#define UNS56 u_int64_t | -
- -
-Definition at line 66 of file applicfg.h. -
#define UNS64 u_int64_t | -
- -
-Definition at line 67 of file applicfg.h. -
#define UNS8 u_int8_t | -
- -
-Definition at line 60 of file applicfg.h. -
-
typedef void* CAN_HANDLE | -
- -
-Definition at line 97 of file applicfg.h. -
typedef void* CAN_PORT | -
- -
-Definition at line 99 of file applicfg.h. -
-
00001 #ifndef UNIX_H_ -00002 #define UNIX_H_ -00003 -00004 #include "timerscfg.h" -00005 #include "can_driver.h" -00006 #include "data.h" -00007 #include "timers_driver.h" -00008 #ifdef WIN32 -00009 #include <windows.h> -00010 typedef HINSTANCE LIB_HANDLE; -00011 #else -00012 #include <dlfcn.h> -00013 typedef void* LIB_HANDLE; -00014 #endif -00015 -00016 UNS8 UnLoadCanDriver(LIB_HANDLE handle); -00017 LIB_HANDLE LoadCanDriver(char* driver_name); -00018 UNS8 canSend(CAN_PORT port, Message *m); -00019 CAN_PORT canOpen(s_BOARD *board, CO_Data * d); -00020 int canClose(CO_Data * d); -00021 -00022 #endif /*UNIX_H_*/ -
#include "timerscfg.h"
#include "can_driver.h"
#include "data.h"
#include "timers_driver.h"
#include <dlfcn.h>
-Include dependency graph for canfestival.h:
-Go to the source code of this file.
Typedefs | |
typedef void * | LIB_HANDLE |
Functions | |
UNS8 | UnLoadCanDriver (LIB_HANDLE handle) |
LIB_HANDLE | LoadCanDriver (char *driver_name) |
UNS8 | canSend (CAN_PORT port, Message *m) |
CAN_PORT | canOpen (s_BOARD *board, CO_Data *d) |
int | canClose (CO_Data *d) |
typedef void* LIB_HANDLE | -
- -
-Definition at line 13 of file canfestival.h. -
-
int canClose | -( | -CO_Data * | -d | -) | -- |
LIB_HANDLE LoadCanDriver | -( | -char * | -driver_name | -) | -- |
UNS8 UnLoadCanDriver | -( | -LIB_HANDLE | -handle | -) | -- |
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 #include <unistd.h> -00023 #include <stdio.h> -00024 #include <stdlib.h> -00025 -00026 #ifndef NOT_USE_DYNAMIC_LOADING -00027 #define DLL_CALL(funcname) (* funcname##_driver) -00028 #define FCT_PTR_INIT =NULL -00029 -00030 #define DLSYM(name)\ -00031 *(void **) (&name##_driver) = dlsym(handle, #name"_driver");\ -00032 if ((error = dlerror()) != NULL) {\ -00033 fprintf (stderr, "%s\n", error);\ -00034 UnLoadCanDriver(handle);\ -00035 return NULL;\ -00036 } -00037 -00038 #else /*NOT_USE_DYNAMIC_LOADING*/ -00039 -00040 /*Function call is direct*/ -00041 #define DLL_CALL(funcname) funcname##_driver -00042 -00043 #endif /*NOT_USE_DYNAMIC_LOADING*/ -00044 -00045 #include "data.h" -00046 #include "canfestival.h" -00047 #include "timers_driver.h" -00048 -00049 #define MAX_NB_CAN_PORTS 16 -00050 -00051 typedef struct { -00052 char used; -00053 CAN_HANDLE fd; -00054 TASK_HANDLE receiveTask; -00055 CO_Data* d; -00056 } CANPort; -00057 -00058 #include "can_driver.h" -00059 -00060 /*Declares the funtion pointers for dll binding or simple protos*/ -00061 /*UNS8 DLL_CALL(canReceive)(CAN_HANDLE, Message *); -00062 UNS8 DLL_CALL(canSend)(CAN_HANDLE, Message *); -00063 CAN_HANDLE DLL_CALL(canOpen)(s_BOARD *); -00064 int DLL_CALL(canClose)(CAN_HANDLE); -00065 */ -00066 CANPort canports[MAX_NB_CAN_PORTS] = {{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,}}; -00067 -00068 #ifndef NOT_USE_DYNAMIC_LOADING -00069 -00070 /*UnLoads the dll*/ -00071 UNS8 UnLoadCanDriver(LIB_HANDLE handle) -00072 { -00073 if(handle!=NULL) -00074 { -00075 dlclose(handle); -00076 -00077 handle=NULL; -00078 return 0; -00079 } -00080 return -1; -00081 } -00082 -00083 /*Loads the dll and get funcs ptr*/ -00084 LIB_HANDLE LoadCanDriver(char* driver_name) -00085 { -00086 LIB_HANDLE handle = NULL; -00087 char *error; -00088 -00089 -00090 if(handle==NULL) -00091 { -00092 handle = dlopen(driver_name, RTLD_LAZY); -00093 } -00094 -00095 if (!handle) { -00096 fprintf (stderr, "%s\n", dlerror()); -00097 return NULL; -00098 } -00099 -00100 /*Get function ptr*/ -00101 DLSYM(canReceive) -00102 DLSYM(canSend) -00103 DLSYM(canOpen) -00104 DLSYM(canClose) -00105 -00106 return handle; -00107 } -00108 -00109 #endif -00110 -00111 -00112 -00113 /*Not needed -- canReceiveLoop calls _canReceive directly *//* -00114 UNS8 canReceive(CAN_PORT port, Message *m) -00115 { -00116 return DLL_CALL(canReceive)(port->fd, Message *m); -00117 } -00118 */ -00119 -00120 UNS8 canSend(CAN_PORT port, Message *m) -00121 { -00122 if(port){ -00123 UNS8 res; -00124 //LeaveMutex(); -00125 res = DLL_CALL(canSend)(((CANPort*)port)->fd, m); -00126 //EnterMutex(); -00127 return res; -00128 } -00129 return -1; -00130 } -00131 -00132 void canReceiveLoop(CAN_PORT port) -00133 { -00134 Message m; -00135 -00136 while (1) { -00137 if (DLL_CALL(canReceive)(((CANPort*)port)->fd, &m) != 0) -00138 break; -00139 -00140 EnterMutex(); -00141 canDispatch(((CANPort*)port)->d, &m); -00142 LeaveMutex(); -00143 } -00144 } -00145 CAN_PORT canOpen(s_BOARD *board, CO_Data * d) -00146 { -00147 int i; -00148 for(i=0; i < MAX_NB_CAN_PORTS; i++) -00149 { -00150 if(!canports[i].used) -00151 break; -00152 } -00153 -00154 #ifndef NOT_USE_DYNAMIC_LOADING -00155 if (&DLL_CALL(canOpen)==NULL) { -00156 fprintf(stderr,"CanOpen : Can Driver dll not loaded\n"); -00157 return NULL; -00158 } -00159 #endif -00160 CAN_HANDLE fd0 = DLL_CALL(canOpen)(board); -00161 if(fd0){ -00162 canports[i].used = 1; -00163 canports[i].fd = fd0; -00164 canports[i].d = d; -00165 -00166 CreateReceiveTask(&(canports[i]), &canports[i].receiveTask, &canReceiveLoop); -00167 -00168 EnterMutex(); -00169 d->canHandle = (CAN_PORT)&canports[i]; -00170 LeaveMutex(); -00171 return (CAN_PORT)&canports[i]; -00172 }else{ -00173 fprintf(stderr,"CanOpen : Cannot open board {busname='%s',baudrate='%s'}\n",board->busname, board->baudrate); -00174 return NULL; -00175 } -00176 } -00177 -00178 int canClose(CO_Data * d) -00179 { -00180 EnterMutex(); -00181 ((CANPort*)d->canHandle)->used = 0; -00182 CANPort* tmp = (CANPort*)d->canHandle; -00183 d->canHandle = NULL; -00184 LeaveMutex(); -00185 -00186 int res = DLL_CALL(canClose)(tmp->fd); -00187 -00188 WaitReceiveTaskEnd(tmp->receiveTask); -00189 return res; -00190 } -
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include "data.h"
#include "canfestival.h"
#include "timers_driver.h"
#include "can_driver.h"
-Include dependency graph for unix.c:
-Go to the source code of this file.
Data Structures | |
struct | CANPort |
Defines | |
#define | DLL_CALL(funcname) (* funcname##_driver) |
#define | FCT_PTR_INIT =NULL |
#define | DLSYM(name) |
#define | MAX_NB_CAN_PORTS 16 |
Functions | |
UNS8 | UnLoadCanDriver (LIB_HANDLE handle) |
LIB_HANDLE | LoadCanDriver (char *driver_name) |
UNS8 | canSend (CAN_PORT port, Message *m) |
void | canReceiveLoop (CAN_PORT port) |
CAN_PORT | canOpen (s_BOARD *board, CO_Data *d) |
int | canClose (CO_Data *d) |
Variables | |
CANPort | canports [MAX_NB_CAN_PORTS] = {{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,}} |
#define DLL_CALL | -( | -funcname | -- | ) | -(* funcname##_driver) | -
- -
-Definition at line 27 of file unix.c. -
-Referenced by canClose(), canOpen(), canReceiveLoop(), and canSend(). -
#define DLSYM | -( | -name | -- | ) | -- |
-Value:
*(void **) (&name##_driver) = dlsym(handle, #name"_driver");\ - if ((error = dlerror()) != NULL) {\ - fprintf (stderr, "%s\n", error);\ - UnLoadCanDriver(handle);\ - return NULL;\ - } -
-Definition at line 30 of file unix.c. -
-Referenced by LoadCanDriver(). -
#define MAX_NB_CAN_PORTS 16 | -
-
int canClose | -( | -CO_Data * | -d | -) | -- |
- -
-Definition at line 178 of file unix.c. -
-Referenced by canClose(), LoadCanDriver(), and main(). -
- -
-Definition at line 145 of file unix.c. -
-Referenced by canOpen(), LoadCanDriver(), and main(). -
void canReceiveLoop | -( | -CAN_PORT | -port | -) | -- |
- -
-Definition at line 132 of file unix.c. -
-References canDispatch(), canReceive(), DLL_CALL, EnterMutex(), and LeaveMutex(). -
-Referenced by canOpen(). -
-Here is the call graph for this function:
LIB_HANDLE LoadCanDriver | -( | -char * | -driver_name | -) | -- |
UNS8 UnLoadCanDriver | -( | -LIB_HANDLE | -handle | -) | -- |
-
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 -00006 See COPYING file for copyrights details. -00007 -00008 This library is free software; you can redistribute it and/or -00009 modify it under the terms of the GNU Lesser General Public -00010 License as published by the Free Software Foundation; either -00011 version 2.1 of the License, or (at your option) any later version. -00012 -00013 This library is distributed in the hope that it will be useful, -00014 but WITHOUT ANY WARRANTY; without even the implied warranty of -00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00016 Lesser General Public License for more details. -00017 -00018 You should have received a copy of the GNU Lesser General Public -00019 License along with this library; if not, write to the Free Software -00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00021 */ -00022 -00023 #ifndef __APPLICFG_WIN32__ -00024 #define __APPLICFG_WIN32__ -00025 -00026 #include <windows.h> -00027 #include <string.h> -00028 #include <stdio.h> -00029 -00030 // Define the architecture : little_endian or big_endian -00031 // ----------------------------------------------------- -00032 // Test : -00033 // UNS32 v = 0x1234ABCD; -00034 // char *data = &v; -00035 // -00036 // Result for a little_endian architecture : -00037 // data[0] = 0xCD; -00038 // data[1] = 0xAB; -00039 // data[2] = 0x34; -00040 // data[3] = 0x12; -00041 // -00042 // Result for a big_endian architecture : -00043 // data[0] = 0x12; -00044 // data[1] = 0x34; -00045 // data[2] = 0xAB; -00046 // data[3] = 0xCD; -00047 -00048 // Integers -00049 #define INTEGER8 char -00050 #define INTEGER16 short -00051 #define INTEGER24 long -00052 #define INTEGER32 long -00053 #define INTEGER40 long long -00054 #define INTEGER48 long long -00055 #define INTEGER56 long long -00056 #define INTEGER64 long long -00057 -00058 // Unsigned integers -00059 #define UNS8 unsigned char -00060 #define UNS16 unsigned short -00061 #define UNS32 unsigned long -00062 #define UNS24 unsigned long -00063 #define UNS40 unsigned long long -00064 #define UNS48 unsigned long long -00065 #define UNS56 unsigned long long -00066 #define UNS64 unsigned long long -00067 -00068 // Reals -00069 #define REAL32 float -00070 #define REAL64 double -00071 -00072 // Custom integer types sizes -00073 #define sizeof_INTEGER24 3 -00074 #define sizeof_INTEGER40 5 -00075 #define sizeof_INTEGER48 6 -00076 #define sizeof_INTEGER56 7 -00077 -00078 #define sizeof_UNS24 3 -00079 #define sizeof_UNS40 5 -00080 #define sizeof_UNS48 6 -00081 #define sizeof_UNS56 7 -00082 -00083 // Non integral integers conversion macros -00084 #define INT24_2_32(a) (a <= 0x7FFFFF ? a : a|0xFF000000) -00085 #define INT40_2_64(a) (a <= 0x0000007FFFFFFFFF ? a : a|0xFFFFFF0000000000) -00086 #define INT48_2_64(a) (a <= 0x00007FFFFFFFFFFF ? a : a|0xFFFF000000000000) -00087 #define INT56_2_64(a) (a <= 0x007FFFFFFFFFFFFF ? a : a|0xFF00000000000000) -00088 -00089 #define INT32_2_24(a) (a&0x00FFFFFF) -00090 #define INT64_2_40(a) (a&0x000000FFFFFFFFFF) -00091 #define INT64_2_48(a) (a&0x0000FFFFFFFFFFFF) -00092 #define INT64_2_56(a) (a&0x00FFFFFFFFFFFFFF) -00093 -00095 // -------------------------------------- -00096 -00097 #ifdef UNICODE -00098 #define CANFESTIVAL_DEBUG_MSG(num, str, val)\ -00099 {wchar_t msg[300];\ -00100 unsigned long value = val;\ -00101 swprintf(msg,L"%s(%d) : 0x%X %s 0x%X\n",__FILE__, __LINE__,num, str, value);\ -00102 OutputDebugString(msg);} -00103 #else -00104 #define CANFESTIVAL_DEBUG_MSG(num, str, val)\ -00105 {char msg[300];\ -00106 unsigned long value = val;\ -00107 sprintf(msg,"%s(%d) : 0x%X %s 0x%X\n",__FILE__, __LINE__,num, str, value);\ -00108 OutputDebugString(msg);} -00109 #endif -00110 -00112 // --------------------- -00113 #ifdef DEBUG_WAR_CONSOLE_ON -00114 #define MSG_WAR(num, str, val) CANFESTIVAL_DEBUG_MSG(num, str, val) -00115 #else -00116 # define MSG_WAR(num, str, val) -00117 #endif -00118 -00120 // --------------------- -00121 #ifdef DEBUG_ERR_CONSOLE_ON -00122 # define MSG_ERR(num, str, val) CANFESTIVAL_DEBUG_MSG(num, str, val) -00123 #else -00124 # define MSG_ERR(num, str, val) -00125 #endif -00126 -00127 -00128 -00129 typedef void* CAN_HANDLE; -00130 -00131 typedef void* CAN_PORT; -00132 -00133 #endif // __APPLICFG_WIN32__ -
#include <windows.h>
#include <string.h>
#include <stdio.h>
-Include dependency graph for applicfg.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Defines | |
#define | INTEGER8 char |
#define | INTEGER16 short |
#define | INTEGER24 long |
#define | INTEGER32 long |
#define | INTEGER40 long long |
#define | INTEGER48 long long |
#define | INTEGER56 long long |
#define | INTEGER64 long long |
#define | UNS8 unsigned char |
#define | UNS16 unsigned short |
#define | UNS32 unsigned long |
#define | UNS24 unsigned long |
#define | UNS40 unsigned long long |
#define | UNS48 unsigned long long |
#define | UNS56 unsigned long long |
#define | UNS64 unsigned long long |
#define | REAL32 float |
#define | REAL64 double |
#define | sizeof_INTEGER24 3 |
#define | sizeof_INTEGER40 5 |
#define | sizeof_INTEGER48 6 |
#define | sizeof_INTEGER56 7 |
#define | sizeof_UNS24 3 |
#define | sizeof_UNS40 5 |
#define | sizeof_UNS48 6 |
#define | sizeof_UNS56 7 |
#define | INT24_2_32(a) (a <= 0x7FFFFF ? a : a|0xFF000000) |
#define | INT40_2_64(a) (a <= 0x0000007FFFFFFFFF ? a : a|0xFFFFFF0000000000) |
#define | INT48_2_64(a) (a <= 0x00007FFFFFFFFFFF ? a : a|0xFFFF000000000000) |
#define | INT56_2_64(a) (a <= 0x007FFFFFFFFFFFFF ? a : a|0xFF00000000000000) |
#define | INT32_2_24(a) (a&0x00FFFFFF) |
#define | INT64_2_40(a) (a&0x000000FFFFFFFFFF) |
#define | INT64_2_48(a) (a&0x0000FFFFFFFFFFFF) |
#define | INT64_2_56(a) (a&0x00FFFFFFFFFFFFFF) |
#define | CANFESTIVAL_DEBUG_MSG(num, str, val) |
Definition of error and warning macros. | |
#define | MSG_WAR(num, str, val) |
Definition of MSG_WAR. | |
#define | MSG_ERR(num, str, val) |
Definition of MSG_ERR. | |
Typedefs | |
typedef void * | CAN_HANDLE |
typedef void * | CAN_PORT |
#define CANFESTIVAL_DEBUG_MSG | -( | -num, | |||
- | - | str, | |||
- | - | val | -- | ) | -- |
-Value:
{char msg[300];\ - unsigned long value = val;\ - sprintf(msg,"%s(%d) : 0x%X %s 0x%X\n",__FILE__, __LINE__,num, str, value);\ - OutputDebugString(msg);} -
- -
-Definition at line 104 of file applicfg.h. -
#define INT24_2_32 | -( | -a | -- | ) | -(a <= 0x7FFFFF ? a : a|0xFF000000) | -
- -
-Definition at line 84 of file applicfg.h. -
#define INT32_2_24 | -( | -a | -- | ) | -(a&0x00FFFFFF) | -
- -
-Definition at line 89 of file applicfg.h. -
#define INT40_2_64 | -( | -a | -- | ) | -(a <= 0x0000007FFFFFFFFF ? a : a|0xFFFFFF0000000000) | -
- -
-Definition at line 85 of file applicfg.h. -
#define INT48_2_64 | -( | -a | -- | ) | -(a <= 0x00007FFFFFFFFFFF ? a : a|0xFFFF000000000000) | -
- -
-Definition at line 86 of file applicfg.h. -
#define INT56_2_64 | -( | -a | -- | ) | -(a <= 0x007FFFFFFFFFFFFF ? a : a|0xFF00000000000000) | -
- -
-Definition at line 87 of file applicfg.h. -
#define INT64_2_40 | -( | -a | -- | ) | -(a&0x000000FFFFFFFFFF) | -
- -
-Definition at line 90 of file applicfg.h. -
#define INT64_2_48 | -( | -a | -- | ) | -(a&0x0000FFFFFFFFFFFF) | -
- -
-Definition at line 91 of file applicfg.h. -
#define INT64_2_56 | -( | -a | -- | ) | -(a&0x00FFFFFFFFFFFFFF) | -
- -
-Definition at line 92 of file applicfg.h. -
#define INTEGER16 short | -
- -
-Definition at line 50 of file applicfg.h. -
#define INTEGER24 long | -
- -
-Definition at line 51 of file applicfg.h. -
#define INTEGER32 long | -
- -
-Definition at line 52 of file applicfg.h. -
#define INTEGER40 long long | -
- -
-Definition at line 53 of file applicfg.h. -
#define INTEGER48 long long | -
- -
-Definition at line 54 of file applicfg.h. -
#define INTEGER56 long long | -
- -
-Definition at line 55 of file applicfg.h. -
#define INTEGER64 long long | -
- -
-Definition at line 56 of file applicfg.h. -
#define INTEGER8 char | -
- -
-Definition at line 49 of file applicfg.h. -
#define MSG_ERR | -( | -num, | |||
- | - | str, | |||
- | - | val | -- | ) | -- |
#define MSG_WAR | -( | -num, | |||
- | - | str, | |||
- | - | val | -- | ) | -- |
#define REAL32 float | -
- -
-Definition at line 69 of file applicfg.h. -
#define REAL64 double | -
- -
-Definition at line 70 of file applicfg.h. -
#define sizeof_INTEGER24 3 | -
- -
-Definition at line 73 of file applicfg.h. -
#define sizeof_INTEGER40 5 | -
- -
-Definition at line 74 of file applicfg.h. -
#define sizeof_INTEGER48 6 | -
- -
-Definition at line 75 of file applicfg.h. -
#define sizeof_INTEGER56 7 | -
- -
-Definition at line 76 of file applicfg.h. -
#define sizeof_UNS24 3 | -
- -
-Definition at line 78 of file applicfg.h. -
#define sizeof_UNS40 5 | -
- -
-Definition at line 79 of file applicfg.h. -
#define sizeof_UNS48 6 | -
- -
-Definition at line 80 of file applicfg.h. -
#define sizeof_UNS56 7 | -
- -
-Definition at line 81 of file applicfg.h. -
#define UNS16 unsigned short | -
- -
-Definition at line 60 of file applicfg.h. -
#define UNS24 unsigned long | -
- -
-Definition at line 62 of file applicfg.h. -
#define UNS32 unsigned long | -
- -
-Definition at line 61 of file applicfg.h. -
#define UNS40 unsigned long long | -
- -
-Definition at line 63 of file applicfg.h. -
#define UNS48 unsigned long long | -
- -
-Definition at line 64 of file applicfg.h. -
#define UNS56 unsigned long long | -
- -
-Definition at line 65 of file applicfg.h. -
#define UNS64 unsigned long long | -
- -
-Definition at line 66 of file applicfg.h. -
#define UNS8 unsigned char | -
- -
-Definition at line 59 of file applicfg.h. -
-
typedef void* CAN_HANDLE | -
- -
-Definition at line 129 of file applicfg.h. -
typedef void* CAN_PORT | -
- -
-Definition at line 131 of file applicfg.h. -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 Win32 Port Leonid Tochinski -00006 -00007 See COPYING file for copyrights details. -00008 -00009 This library is free software; you can redistribute it and/or -00010 modify it under the terms of the GNU Lesser General Public -00011 License as published by the Free Software Foundation; either -00012 version 2.1 of the License, or (at your option) any later version. -00013 -00014 This library is distributed in the hope that it will be useful, -00015 but WITHOUT ANY WARRANTY; without even the implied warranty of -00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00017 Lesser General Public License for more details. -00018 -00019 You should have received a copy of the GNU Lesser General Public -00020 License along with this library; if not, write to the Free Software -00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00022 */ -00023 #ifndef CANFESTIVAL_H_ -00024 #define CANFESTIVAL_H_ -00025 -00026 #include "timerscfg.h" -00027 #include "can_driver.h" -00028 #include "data.h" -00029 -00030 #include <windows.h> -00031 typedef HINSTANCE LIB_HANDLE; -00032 -00033 UNS8 UnLoadCanDriver(LIB_HANDLE handle); -00034 LIB_HANDLE LoadCanDriver(char* driver_name); -00035 UNS8 canSend(CAN_PORT port, Message *m); -00036 CAN_PORT canOpen(s_BOARD *board, CO_Data * d); -00037 int canClose(CO_Data * d); -00038 -00039 #endif /*CANFESTIVAL_H_*/ -
#include "timerscfg.h"
#include "can_driver.h"
#include "data.h"
#include <windows.h>
-Include dependency graph for canfestival.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Typedefs | |
typedef HINSTANCE | LIB_HANDLE |
Functions | |
UNS8 | UnLoadCanDriver (LIB_HANDLE handle) |
LIB_HANDLE | LoadCanDriver (char *driver_name) |
UNS8 | canSend (CAN_PORT port, Message *m) |
CAN_PORT | canOpen (s_BOARD *board, CO_Data *d) |
int | canClose (CO_Data *d) |
typedef HINSTANCE LIB_HANDLE | -
- -
-Definition at line 31 of file canfestival.h. -
-
int canClose | -( | -CO_Data * | -d | -) | -- |
- -
-Definition at line 178 of file unix.c. -
-References canClose(), struct_CO_Data::canHandle, driver_data::continue_receive_thread, DLL_CALL, EnterMutex(), CANPort::fd, driver_data::inst, LeaveMutex(), driver_procs::m_canClose, driver_data::receive_thread, CANPort::receiveTask, s_driver_procs, and WaitReceiveTaskEnd(). -
-Here is the call graph for this function:
- -
-Definition at line 145 of file unix.c. -
-References struct_s_BOARD::baudrate, struct_s_BOARD::busname, struct_CO_Data::canHandle, canOpen(), canports, canReceiveLoop(), driver_data::continue_receive_thread, CreateReceiveTask(), driver_data::d, CANPort::d, DLL_CALL, EnterMutex(), CANPort::fd, driver_data::inst, LeaveMutex(), driver_procs::m_canOpen, MAX_NB_CAN_PORTS, driver_data::receive_thread, s_driver_procs, and CANPort::used. -
-Here is the call graph for this function:
- -
-Definition at line 120 of file unix.c. -
-References canSend(), DLL_CALL, EnterMutex(), driver_data::inst, LeaveMutex(), driver_procs::m_canSend, s_driver_procs, and UNS8. -
-Here is the call graph for this function:
LIB_HANDLE LoadCanDriver | -( | -char * | -driver_name | -) | -- |
- -
-Definition at line 84 of file unix.c. -
-References canClose(), canOpen(), canReceive(), canSend(), DLSYM, driver_procs::load_canfestival_driver(), and s_driver_procs. -
-Here is the call graph for this function:
UNS8 UnLoadCanDriver | -( | -LIB_HANDLE | -handle | -) | -- |
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 See COPYING file for copyrights details. -00006 -00007 This library is free software; you can redistribute it and/or -00008 modify it under the terms of the GNU Lesser General Public -00009 License as published by the Free Software Foundation; either -00010 version 2.1 of the License, or (at your option) any later version. -00011 -00012 This library is distributed in the hope that it will be useful, -00013 but WITHOUT ANY WARRANTY; without even the implied warranty of -00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00015 Lesser General Public License for more details. -00016 -00017 You should have received a copy of the GNU Lesser General Public -00018 License along with this library; if not, write to the Free Software -00019 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00020 */ -00021 -00022 #ifndef _CONFIG_H_ -00023 #define _CONFIG_H_ -00024 -00025 #define MAX_CAN_BUS_ID 1 -00026 #define SDO_MAX_LENGTH_TRANSFERT 32 -00027 #define SDO_MAX_SIMULTANEOUS_TRANSFERTS 4 -00028 #define NMT_MAX_NODE_ID 128 -00029 #define SDO_TIMEOUT_MS 3000 -00030 #define MAX_NB_TIMER 32 -00031 // CANOPEN_BIG_ENDIAN is not defined -00032 -00033 #define US_TO_TIMEVAL_FACTOR 1 -00034 -00035 #define REPEAT_SDO_MAX_SIMULTANEOUS_TRANSFERTS_TIMES(repeat)\ -00036 repeat repeat repeat repeat -00037 #define REPEAT_NMT_MAX_NODE_ID_TIMES(repeat)\ -00038 repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat -00039 -00040 #endif /* _CONFIG_H_ */ -
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Defines | |
#define | MAX_CAN_BUS_ID 1 |
#define | SDO_MAX_LENGTH_TRANSFERT 32 |
#define | SDO_MAX_SIMULTANEOUS_TRANSFERTS 4 |
#define | NMT_MAX_NODE_ID 128 |
#define | SDO_TIMEOUT_MS 3000 |
#define | MAX_NB_TIMER 32 |
#define | US_TO_TIMEVAL_FACTOR 1 |
#define | REPEAT_SDO_MAX_SIMULTANEOUS_TRANSFERTS_TIMES(repeat) repeat repeat repeat repeat |
#define | REPEAT_NMT_MAX_NODE_ID_TIMES(repeat) repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat |
#define REPEAT_NMT_MAX_NODE_ID_TIMES | -( | -repeat | -- | ) | -repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat repeat | -
#define REPEAT_SDO_MAX_SIMULTANEOUS_TRANSFERTS_TIMES | -( | -repeat | -- | ) | -repeat repeat repeat repeat | -
#define SDO_MAX_LENGTH_TRANSFERT 32 | -
#define SDO_MAX_SIMULTANEOUS_TRANSFERTS 4 | -
-
00001 /* -00002 This file is part of CanFestival, a library implementing CanOpen Stack. -00003 -00004 Copyright (C): Edouard TISSERANT and Francis DUPIN -00005 Win32 port by Leonid Tochinski -00006 -00007 See COPYING file for copyrights details. -00008 -00009 This library is free software; you can redistribute it and/or -00010 modify it under the terms of the GNU Lesser General Public -00011 License as published by the Free Software Foundation; either -00012 version 2.1 of the License, or (at your option) any later version. -00013 -00014 This library is distributed in the hope that it will be useful, -00015 but WITHOUT ANY WARRANTY; without even the implied warranty of -00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -00017 Lesser General Public License for more details. -00018 -00019 You should have received a copy of the GNU Lesser General Public -00020 License along with this library; if not, write to the Free Software -00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -00022 */ -00023 -00024 #ifndef __TIMERSCFG_H__ -00025 #define __TIMERSCFG_H__ -00026 -00027 #include <windows.h> -00028 -00029 // Time unit : us -00030 // Time resolution : 64bit (~584942 years) -00031 #define TIMEVAL unsigned long long -00032 #define TIMEVAL_MAX ~(TIMEVAL)0 -00033 #define MS_TO_TIMEVAL(ms) ms*1000 -00034 #define US_TO_TIMEVAL(us) us -00035 -00036 #define TASK_HANDLE HANDLE -00037 -00038 #endif -
#include <windows.h>
-Include dependency graph for timerscfg.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Defines | |
#define | TIMEVAL unsigned long long |
#define | TIMEVAL_MAX ~(TIMEVAL)0 |
#define | MS_TO_TIMEVAL(ms) ms*1000 |
#define | US_TO_TIMEVAL(us) us |
#define | TASK_HANDLE HANDLE |
#define MS_TO_TIMEVAL | -( | -ms | -- | ) | -ms*1000 | -
- -
-Definition at line 33 of file timerscfg.h. -
#define TASK_HANDLE HANDLE | -
- -
-Definition at line 36 of file timerscfg.h. -
#define TIMEVAL unsigned long long | -
- -
-Definition at line 31 of file timerscfg.h. -
#define TIMEVAL_MAX ~(TIMEVAL)0 | -
- -
-Definition at line 32 of file timerscfg.h. -
#define US_TO_TIMEVAL | -( | -us | -- | ) | -us | -
- -
-Definition at line 34 of file timerscfg.h. -
-
00001 -00002 /* File generated by gen_cfile.py. Should not be modified. */ -00003 -00004 #include "win32test.h" -00005 -00006 /**************************************************************************/ -00007 /* Declaration of the mapped variables */ -00008 /**************************************************************************/ -00009 -00010 /**************************************************************************/ -00011 /* Declaration of the value range types */ -00012 /**************************************************************************/ -00013 -00014 UNS32 win32test_valueRangeTest (UNS8 typeValue, void * value) -00015 { -00016 switch (typeValue) { -00017 } -00018 return 0; -00019 } -00020 -00021 /**************************************************************************/ -00022 /* The node id */ -00023 /**************************************************************************/ -00024 /* node_id default value.*/ -00025 UNS8 win32test_bDeviceNodeId = 0x01; -00026 -00027 /**************************************************************************/ -00028 /* Array of message processing information */ -00029 -00030 const UNS8 win32test_iam_a_slave = 0; -00031 -00032 TIMER_HANDLE win32test_heartBeatTimers[1]; -00033 -00034 /* -00035 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -00036 -00037 OBJECT DICTIONARY -00038 -00039 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -00040 */ -00041 -00042 /* index 0x1000 : Device Type. */ -00043 UNS32 win32test_obj1000 = 0x12D; /* 301 */ -00044 subindex win32test_Index1000[] = -00045 { -00046 { RO, uint32, sizeof (UNS32), (void*)&win32test_obj1000 } -00047 }; -00048 -00049 /* index 0x1001 : Error Register. */ -00050 UNS8 win32test_obj1001 = 0x0; /* 0 */ -00051 subindex win32test_Index1001[] = -00052 { -00053 { RO, uint8, sizeof (UNS8), (void*)&win32test_obj1001 } -00054 }; -00055 -00056 /* index 0x1005 : SYNC COB ID. */ -00057 UNS32 win32test_obj1005 = 0x0; /* 0 */ -00058 ODCallback_t win32test_Index1005_callbacks[] = -00059 { -00060 NULL, -00061 }; -00062 subindex win32test_Index1005[] = -00063 { -00064 { RW, uint32, sizeof (UNS32), (void*)&win32test_obj1005 } -00065 }; -00066 -00067 /* index 0x1006 : Communication / Cycle Period */ -00068 UNS32 win32test_obj1006 = 0x0; /* 0 */ -00069 -00070 /* index 0x1016 : Consumer Heartbeat Time */ -00071 UNS8 win32test_highestSubIndex_obj1016 = 0; -00072 UNS32 win32test_obj1016[]={0}; -00073 -00074 /* index 0x1017 : Producer Heartbeat Time */ -00075 UNS16 win32test_obj1017 = 0x0; /* 0 */ -00076 -00077 /* index 0x1018 : Identity. */ -00078 UNS8 win32test_highestSubIndex_obj1018 = 4; /* number of subindex - 1*/ -00079 UNS32 win32test_obj1018_Vendor_ID = 0x0; /* 0 */ -00080 UNS32 win32test_obj1018_Product_Code = 0x0; /* 0 */ -00081 UNS32 win32test_obj1018_Revision_Number = 0x0; /* 0 */ -00082 UNS32 win32test_obj1018_Serial_Number = 0x0; /* 0 */ -00083 subindex win32test_Index1018[] = -00084 { -00085 { RO, uint8, sizeof (UNS8), (void*)&win32test_highestSubIndex_obj1018 }, -00086 { RO, uint32, sizeof (UNS32), (void*)&win32test_obj1018_Vendor_ID }, -00087 { RO, uint32, sizeof (UNS32), (void*)&win32test_obj1018_Product_Code }, -00088 { RO, uint32, sizeof (UNS32), (void*)&win32test_obj1018_Revision_Number }, -00089 { RO, uint32, sizeof (UNS32), (void*)&win32test_obj1018_Serial_Number } -00090 }; -00091 -00092 /* index 0x1280 : Client SDO 1 Parameter. */ -00093 UNS8 win32test_highestSubIndex_obj1280 = 3; /* number of subindex - 1*/ -00094 UNS32 win32test_obj1280_COB_ID_Client_to_Server_Transmit_SDO = 0x0; /* 0 */ -00095 UNS32 win32test_obj1280_COB_ID_Server_to_Client_Receive_SDO = 0x0; /* 0 */ -00096 UNS32 win32test_obj1280_Node_ID_of_the_SDO_Server = 0x0; /* 0 */ -00097 subindex win32test_Index1280[] = -00098 { -00099 { RO, uint8, sizeof (UNS8), (void*)&win32test_highestSubIndex_obj1280 }, -00100 { RW, uint32, sizeof (UNS32), (void*)&win32test_obj1280_COB_ID_Client_to_Server_Transmit_SDO }, -00101 { RW, uint32, sizeof (UNS32), (void*)&win32test_obj1280_COB_ID_Server_to_Client_Receive_SDO }, -00102 { RW, uint32, sizeof (UNS32), (void*)&win32test_obj1280_Node_ID_of_the_SDO_Server } -00103 }; -00104 -00105 const indextable win32test_objdict[] = -00106 { -00107 { (subindex*)win32test_Index1000,sizeof(win32test_Index1000)/sizeof(win32test_Index1000[0]), 0x1000}, -00108 { (subindex*)win32test_Index1001,sizeof(win32test_Index1001)/sizeof(win32test_Index1001[0]), 0x1001}, -00109 { (subindex*)win32test_Index1005,sizeof(win32test_Index1005)/sizeof(win32test_Index1005[0]), 0x1005}, -00110 { (subindex*)win32test_Index1018,sizeof(win32test_Index1018)/sizeof(win32test_Index1018[0]), 0x1018}, -00111 { (subindex*)win32test_Index1280,sizeof(win32test_Index1280)/sizeof(win32test_Index1280[0]), 0x1280}, -00112 }; -00113 -00114 const indextable * win32test_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks) -00115 { -00116 int i; -00117 *callbacks = NULL; -00118 switch(wIndex){ -00119 case 0x1000: i = 0;break; -00120 case 0x1001: i = 1;break; -00121 case 0x1005: i = 2;*callbacks = win32test_Index1005_callbacks; break; -00122 case 0x1018: i = 3;break; -00123 case 0x1280: i = 4;break; -00124 default: -00125 *errorCode = OD_NO_SUCH_OBJECT; -00126 return NULL; -00127 } -00128 *errorCode = OD_SUCCESSFUL; -00129 return &win32test_objdict[i]; -00130 } -00131 -00132 /* To count at which received SYNC a PDO must be sent. -00133 * Even if no pdoTransmit are defined, at least one entry is computed -00134 * for compilations issues. -00135 */ -00136 UNS8 win32test_count_sync[1] = {0,}; -00137 -00138 quick_index win32test_firstIndex = { -00139 0, /* SDO_SVR */ -00140 4, /* SDO_CLT */ -00141 0, /* PDO_RCV */ -00142 0, /* PDO_RCV_MAP */ -00143 0, /* PDO_TRS */ -00144 0 /* PDO_TRS_MAP */ -00145 }; -00146 -00147 quick_index win32test_lastIndex = { -00148 0, /* SDO_SVR */ -00149 4, /* SDO_CLT */ -00150 0, /* PDO_RCV */ -00151 0, /* PDO_RCV_MAP */ -00152 0, /* PDO_TRS */ -00153 0 /* PDO_TRS_MAP */ -00154 }; -00155 -00156 UNS16 win32test_ObjdictSize = sizeof(win32test_objdict)/sizeof(win32test_objdict[0]); -00157 -00158 CO_Data win32test_Data = CANOPEN_NODE_DATA_INITIALIZER(win32test); -00159 -
#include "win32test.h"
-Include dependency graph for win32test.c:
-Go to the source code of this file.
const indextable* win32test_scanIndexOD | -( | -UNS16 | -wIndex, | -|
- | - | UNS32 * | -errorCode, | -|
- | - | ODCallback_t ** | -callbacks | - |
- | ) | -- |
- -
-Definition at line 114 of file win32test.c. -
-References OD_NO_SUCH_OBJECT, OD_SUCCESSFUL, win32test_Index1005_callbacks, and win32test_objdict. -
UNS32 win32test_valueRangeTest | -( | -UNS8 | -typeValue, | -|
- | - | void * | -value | - |
- | ) | -- |
- -
-Definition at line 14 of file win32test.c. -
-
UNS8 win32test_bDeviceNodeId = 0x01 | -
- -
-Definition at line 25 of file win32test.c. -
UNS8 win32test_count_sync[1] = {0,} | -
- -
-Definition at line 136 of file win32test.c. -
CO_Data win32test_Data = CANOPEN_NODE_DATA_INITIALIZER(win32test) | -
- -
-Definition at line 158 of file win32test.c. -
-Referenced by GetChangeStateResults(), main(), and ReadSDO(). -
quick_index win32test_firstIndex | -
-Initial value:
{ - 0, - 4, - 0, - 0, - 0, - 0 -} -
-Definition at line 138 of file win32test.c. -
TIMER_HANDLE win32test_heartBeatTimers[1] | -
- -
-Definition at line 32 of file win32test.c. -
UNS8 win32test_highestSubIndex_obj1016 = 0 | -
- -
-Definition at line 71 of file win32test.c. -
UNS8 win32test_highestSubIndex_obj1018 = 4 | -
- -
-Definition at line 78 of file win32test.c. -
UNS8 win32test_highestSubIndex_obj1280 = 3 | -
- -
-Definition at line 93 of file win32test.c. -
const UNS8 win32test_iam_a_slave = 0 | -
- -
-Definition at line 30 of file win32test.c. -
subindex win32test_Index1000[] | -
-Initial value:
- { - { RO, uint32, sizeof (UNS32), (void*)&win32test_obj1000 } - } -
-Definition at line 44 of file win32test.c. -
subindex win32test_Index1001[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&win32test_obj1001 } - } -
-Definition at line 51 of file win32test.c. -
subindex win32test_Index1005[] | -
-Initial value:
- { - { RW, uint32, sizeof (UNS32), (void*)&win32test_obj1005 } - } -
-Definition at line 62 of file win32test.c. -
ODCallback_t win32test_Index1005_callbacks[] | -
-Initial value:
- { - NULL, - } -
-Definition at line 58 of file win32test.c. -
-Referenced by win32test_scanIndexOD(). -
subindex win32test_Index1018[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&win32test_highestSubIndex_obj1018 }, - { RO, uint32, sizeof (UNS32), (void*)&win32test_obj1018_Vendor_ID }, - { RO, uint32, sizeof (UNS32), (void*)&win32test_obj1018_Product_Code }, - { RO, uint32, sizeof (UNS32), (void*)&win32test_obj1018_Revision_Number }, - { RO, uint32, sizeof (UNS32), (void*)&win32test_obj1018_Serial_Number } - } -
-Definition at line 83 of file win32test.c. -
subindex win32test_Index1280[] | -
-Initial value:
- { - { RO, uint8, sizeof (UNS8), (void*)&win32test_highestSubIndex_obj1280 }, - { RW, uint32, sizeof (UNS32), (void*)&win32test_obj1280_COB_ID_Client_to_Server_Transmit_SDO }, - { RW, uint32, sizeof (UNS32), (void*)&win32test_obj1280_COB_ID_Server_to_Client_Receive_SDO }, - { RW, uint32, sizeof (UNS32), (void*)&win32test_obj1280_Node_ID_of_the_SDO_Server } - } -
-Definition at line 97 of file win32test.c. -
quick_index win32test_lastIndex | -
-Initial value:
{ - 0, - 4, - 0, - 0, - 0, - 0 -} -
-Definition at line 147 of file win32test.c. -
UNS32 win32test_obj1000 = 0x12D | -
- -
-Definition at line 43 of file win32test.c. -
UNS8 win32test_obj1001 = 0x0 | -
- -
-Definition at line 50 of file win32test.c. -
UNS32 win32test_obj1005 = 0x0 | -
- -
-Definition at line 57 of file win32test.c. -
UNS32 win32test_obj1006 = 0x0 | -
- -
-Definition at line 68 of file win32test.c. -
UNS32 win32test_obj1016[] = {0} | -
- -
-Definition at line 72 of file win32test.c. -
UNS16 win32test_obj1017 = 0x0 | -
- -
-Definition at line 75 of file win32test.c. -
UNS32 win32test_obj1018_Product_Code = 0x0 | -
- -
-Definition at line 80 of file win32test.c. -
UNS32 win32test_obj1018_Revision_Number = 0x0 | -
- -
-Definition at line 81 of file win32test.c. -
UNS32 win32test_obj1018_Serial_Number = 0x0 | -
- -
-Definition at line 82 of file win32test.c. -
UNS32 win32test_obj1018_Vendor_ID = 0x0 | -
- -
-Definition at line 79 of file win32test.c. -
UNS32 win32test_obj1280_COB_ID_Client_to_Server_Transmit_SDO = 0x0 | -
- -
-Definition at line 94 of file win32test.c. -
UNS32 win32test_obj1280_COB_ID_Server_to_Client_Receive_SDO = 0x0 | -
- -
-Definition at line 95 of file win32test.c. -
UNS32 win32test_obj1280_Node_ID_of_the_SDO_Server = 0x0 | -
- -
-Definition at line 96 of file win32test.c. -
const indextable win32test_objdict[] | -
-Initial value:
-{ - { (subindex*)win32test_Index1000,sizeof(win32test_Index1000)/sizeof(win32test_Index1000[0]), 0x1000}, - { (subindex*)win32test_Index1001,sizeof(win32test_Index1001)/sizeof(win32test_Index1001[0]), 0x1001}, - { (subindex*)win32test_Index1005,sizeof(win32test_Index1005)/sizeof(win32test_Index1005[0]), 0x1005}, - { (subindex*)win32test_Index1018,sizeof(win32test_Index1018)/sizeof(win32test_Index1018[0]), 0x1018}, - { (subindex*)win32test_Index1280,sizeof(win32test_Index1280)/sizeof(win32test_Index1280[0]), 0x1280}, -} -
-Definition at line 105 of file win32test.c. -
-Referenced by win32test_scanIndexOD(). -
UNS16 win32test_ObjdictSize = sizeof(win32test_objdict)/sizeof(win32test_objdict[0]) | -
- -
-Definition at line 156 of file win32test.c. -
-
00001 -00002 /* File generated by gen_cfile.py. Should not be modified. */ -00003 -00004 #include "data.h" -00005 -00006 /* Prototypes of function provided by object dictionnary */ -00007 UNS32 win32test_valueRangeTest (UNS8 typeValue, void * value); -00008 const indextable * win32test_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks); -00009 -00010 /* prototypes of function to be filled by app. */ -00011 void win32test_heartbeatError(UNS8); -00012 -00013 UNS8 win32test_canSend(Message *); -00014 -00015 void win32test_initialisation(void); -00016 void win32test_preOperational(void); -00017 void win32test_operational(void); -00018 void win32test_stopped(void); -00019 -00020 void win32test_post_sync(void); -00021 void win32test_post_TPDO(void); -00022 -00023 /* Master node data struct */ -00024 extern CO_Data win32test_Data; -00025 -
#include "data.h"
-Include dependency graph for win32test.h:
-This graph shows which files directly or indirectly include this file:
-Go to the source code of this file.
Functions | |
UNS32 | win32test_valueRangeTest (UNS8 typeValue, void *value) |
const indextable * | win32test_scanIndexOD (UNS16 wIndex, UNS32 *errorCode, ODCallback_t **callbacks) |
void | win32test_heartbeatError (UNS8) |
UNS8 | win32test_canSend (Message *) |
void | win32test_initialisation (void) |
void | win32test_preOperational (void) |
void | win32test_operational (void) |
void | win32test_stopped (void) |
void | win32test_post_sync (void) |
void | win32test_post_TPDO (void) |
Variables | |
CO_Data | win32test_Data |
UNS8 win32test_canSend | -( | -Message * | -- | ) | -- |
- -
void win32test_heartbeatError | -( | -UNS8 | -- | ) | -- |
- -
void win32test_initialisation | -( | -void | -- | ) | -- |
- -
void win32test_operational | -( | -void | -- | ) | -- |
- -
void win32test_post_sync | -( | -void | -- | ) | -- |
- -
void win32test_post_TPDO | -( | -void | -- | ) | -- |
- -
void win32test_preOperational | -( | -void | -- | ) | -- |
- -
const indextable* win32test_scanIndexOD | -( | -UNS16 | -wIndex, | -|
- | - | UNS32 * | -errorCode, | -|
- | - | ODCallback_t ** | -callbacks | - |
- | ) | -- |
- -
-Definition at line 114 of file win32test.c. -
-References OD_NO_SUCH_OBJECT, OD_SUCCESSFUL, win32test_Index1005_callbacks, and win32test_objdict. -
void win32test_stopped | -( | -void | -- | ) | -- |
- -
UNS32 win32test_valueRangeTest | -( | -UNS8 | -typeValue, | -|
- | - | void * | -value | - |
- | ) | -- |
- -
-Definition at line 14 of file win32test.c. -
-
CO_Data win32test_Data | -
- -
-Definition at line 158 of file win32test.c. -
-Referenced by GetChangeStateResults(), main(), and ReadSDO(). -
-