00001
00002
00003
00004 #include "TestSlave.h"
00005
00006
00007
00008
00009 UNS8 SlaveMap1 = 0x0;
00010 UNS8 SlaveMap2 = 0x0;
00011 UNS8 SlaveMap3 = 0x0;
00012 UNS8 SlaveMap4 = 0x0;
00013 UNS8 SlaveMap5 = 0x0;
00014 UNS8 SlaveMap6 = 0x0;
00015 UNS8 SlaveMap7 = 0x0;
00016 UNS8 SlaveMap8 = 0x0;
00017 UNS8 SlaveMap9 = 0x0;
00018 UNS32 SlaveMap10 = 0x0;
00019 UNS16 SlaveMap11 = 0x0;
00020
00021
00022
00023
00024
00025 UNS32 TestSlave_valueRangeTest (UNS8 typeValue, void * value)
00026 {
00027 switch (typeValue) {
00028 }
00029 return 0;
00030 }
00031
00032
00033
00034
00035
00036 UNS8 TestSlave_bDeviceNodeId = 0x00;
00037
00038
00039
00040
00041 const UNS8 TestSlave_iam_a_slave = 1;
00042
00043 TIMER_HANDLE TestSlave_heartBeatTimers[1];
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 UNS32 TestSlave_obj1000 = 0x12D;
00055 subindex TestSlave_Index1000[] =
00056 {
00057 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1000 }
00058 };
00059
00060
00061 UNS8 TestSlave_obj1001 = 0x0;
00062 subindex TestSlave_Index1001[] =
00063 {
00064 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_obj1001 }
00065 };
00066
00067
00068 UNS32 TestSlave_obj1005 = 0x80;
00069 ODCallback_t TestSlave_Index1005_callbacks[] =
00070 {
00071 NULL,
00072 };
00073 subindex TestSlave_Index1005[] =
00074 {
00075 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1005 }
00076 };
00077
00078
00079 UNS32 TestSlave_obj1006 = 0x0;
00080 ODCallback_t TestSlave_Index1006_callbacks[] =
00081 {
00082 NULL,
00083 };
00084 subindex TestSlave_Index1006[] =
00085 {
00086 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1006 }
00087 };
00088
00089
00090 UNS8 TestSlave_highestSubIndex_obj1010 = 4;
00091 UNS32 TestSlave_obj1010_Save_All_Parameters = 0x0;
00092 UNS32 TestSlave_obj1010_Save_Communication_Parameters = 0x0;
00093 UNS32 TestSlave_obj1010_Save_Application_Parameters = 0x0;
00094 UNS32 TestSlave_obj1010_Save_Manufacturer_Parameters = 0x0;
00095 ODCallback_t TestSlave_Index1010_callbacks[] =
00096 {
00097 NULL,
00098 NULL,
00099 NULL,
00100 NULL,
00101 NULL,
00102 };
00103 subindex TestSlave_Index1010[] =
00104 {
00105 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1010 },
00106 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_All_Parameters },
00107 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_Communication_Parameters },
00108 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_Application_Parameters },
00109 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_Manufacturer_Parameters }
00110 };
00111
00112
00113 UNS8 TestSlave_highestSubIndex_obj1011 = 4;
00114 UNS32 TestSlave_obj1011_Restore_All_Default_Parameters = 0x0;
00115 UNS32 TestSlave_obj1011_Restore_Communication_Default_Parameters = 0x0;
00116 UNS32 TestSlave_obj1011_Restore_Application_Default_Parameters = 0x0;
00117 UNS32 TestSlave_obj1011_Restore_Manufacturer_Default_Parameters = 0x0;
00118 ODCallback_t TestSlave_Index1011_callbacks[] =
00119 {
00120 NULL,
00121 NULL,
00122 NULL,
00123 NULL,
00124 NULL,
00125 };
00126 subindex TestSlave_Index1011[] =
00127 {
00128 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1011 },
00129 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_All_Default_Parameters },
00130 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_Communication_Default_Parameters },
00131 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_Application_Default_Parameters },
00132 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_Manufacturer_Default_Parameters }
00133 };
00134
00135
00136 UNS8 TestSlave_highestSubIndex_obj1016 = 0;
00137 UNS32 TestSlave_obj1016[]={0};
00138
00139
00140 UNS16 TestSlave_obj1017 = 0x0;
00141 ODCallback_t TestSlave_Index1017_callbacks[] =
00142 {
00143 NULL,
00144 };
00145 subindex TestSlave_Index1017[] =
00146 {
00147 { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1017 }
00148 };
00149
00150
00151 UNS8 TestSlave_highestSubIndex_obj1018 = 4;
00152 UNS32 TestSlave_obj1018_Vendor_ID = 0x0;
00153 UNS32 TestSlave_obj1018_Product_Code = 0x0;
00154 UNS32 TestSlave_obj1018_Revision_Number = 0x0;
00155 UNS32 TestSlave_obj1018_Serial_Number = 0x0;
00156 subindex TestSlave_Index1018[] =
00157 {
00158 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1018 },
00159 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Vendor_ID },
00160 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Product_Code },
00161 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Revision_Number },
00162 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Serial_Number }
00163 };
00164
00165
00166 UNS8 TestSlave_highestSubIndex_obj1200 = 2;
00167 UNS32 TestSlave_obj1200_COB_ID_Client_to_Server_Receive_SDO = 0x601;
00168 UNS32 TestSlave_obj1200_COB_ID_Server_to_Client_Transmit_SDO = 0x581;
00169 subindex TestSlave_Index1200[] =
00170 {
00171 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1200 },
00172 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1200_COB_ID_Client_to_Server_Receive_SDO },
00173 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1200_COB_ID_Server_to_Client_Transmit_SDO }
00174 };
00175
00176
00177 UNS8 TestSlave_highestSubIndex_obj1800 = 5;
00178 UNS32 TestSlave_obj1800_COB_ID_used_by_PDO = 0x182;
00179 UNS8 TestSlave_obj1800_Transmission_Type = 0x0;
00180 UNS16 TestSlave_obj1800_Inhibit_Time = 0x0;
00181 UNS8 TestSlave_obj1800_Compatibility_Entry = 0x0;
00182 UNS16 TestSlave_obj1800_Event_Timer = 0x0;
00183 subindex TestSlave_Index1800[] =
00184 {
00185 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1800 },
00186 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1800_COB_ID_used_by_PDO },
00187 { RW|TO_BE_SAVE, uint8, sizeof (UNS8), (void*)&TestSlave_obj1800_Transmission_Type },
00188 { RW|TO_BE_SAVE, uint16, sizeof (UNS16), (void*)&TestSlave_obj1800_Inhibit_Time },
00189 { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1800_Compatibility_Entry },
00190 { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1800_Event_Timer }
00191 };
00192
00193
00194 UNS8 TestSlave_highestSubIndex_obj1801 = 5;
00195 UNS32 TestSlave_obj1801_COB_ID_used_by_PDO = 0x0;
00196 UNS8 TestSlave_obj1801_Transmission_Type = 0x0;
00197 UNS16 TestSlave_obj1801_Inhibit_Time = 0x0;
00198 UNS8 TestSlave_obj1801_Compatibility_Entry = 0x0;
00199 UNS16 TestSlave_obj1801_Event_Timer = 0x0;
00200 subindex TestSlave_Index1801[] =
00201 {
00202 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1801 },
00203 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1801_COB_ID_used_by_PDO },
00204 { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1801_Transmission_Type },
00205 { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1801_Inhibit_Time },
00206 { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1801_Compatibility_Entry },
00207 { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1801_Event_Timer }
00208 };
00209
00210
00211 UNS8 TestSlave_highestSubIndex_obj1A00 = 10;
00212 UNS32 TestSlave_obj1A00[] =
00213 {
00214 0x20000001,
00215 0x20010001,
00216 0x20020001,
00217 0x20030001,
00218 0x20040001,
00219 0x20050001,
00220 0x20060001,
00221 0x20070001,
00222 0x20080008,
00223 0x20090020
00224 };
00225 subindex TestSlave_Index1A00[] =
00226 {
00227 { RW, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1A00 },
00228 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[0] },
00229 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[1] },
00230 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[2] },
00231 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[3] },
00232 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[4] },
00233 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[5] },
00234 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[6] },
00235 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[7] },
00236 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[8] },
00237 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[9] }
00238 };
00239
00240
00241 UNS8 TestSlave_highestSubIndex_obj1A01 = 1;
00242 UNS32 TestSlave_obj1A01[] =
00243 {
00244 0x200A0010
00245 };
00246 subindex TestSlave_Index1A01[] =
00247 {
00248 { RW, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1A01 },
00249 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A01[0] }
00250 };
00251
00252
00253 subindex TestSlave_Index2000[] =
00254 {
00255 { RW, boolean, sizeof (UNS8), (void*)&SlaveMap1 }
00256 };
00257
00258
00259 subindex TestSlave_Index2001[] =
00260 {
00261 { RW, boolean, sizeof (UNS8), (void*)&SlaveMap2 }
00262 };
00263
00264
00265 subindex TestSlave_Index2002[] =
00266 {
00267 { RW, boolean, sizeof (UNS8), (void*)&SlaveMap3 }
00268 };
00269
00270
00271 subindex TestSlave_Index2003[] =
00272 {
00273 { RW, boolean, sizeof (UNS8), (void*)&SlaveMap4 }
00274 };
00275
00276
00277 subindex TestSlave_Index2004[] =
00278 {
00279 { RW, boolean, sizeof (UNS8), (void*)&SlaveMap5 }
00280 };
00281
00282
00283 subindex TestSlave_Index2005[] =
00284 {
00285 { RW, boolean, sizeof (UNS8), (void*)&SlaveMap6 }
00286 };
00287
00288
00289 subindex TestSlave_Index2006[] =
00290 {
00291 { RW, boolean, sizeof (UNS8), (void*)&SlaveMap7 }
00292 };
00293
00294
00295 subindex TestSlave_Index2007[] =
00296 {
00297 { RW, boolean, sizeof (UNS8), (void*)&SlaveMap8 }
00298 };
00299
00300
00301 subindex TestSlave_Index2008[] =
00302 {
00303 { RW, uint8, sizeof (UNS8), (void*)&SlaveMap9 }
00304 };
00305
00306
00307 subindex TestSlave_Index2009[] =
00308 {
00309 { RW, uint32, sizeof (UNS32), (void*)&SlaveMap10 }
00310 };
00311
00312
00313 subindex TestSlave_Index200A[] =
00314 {
00315 { RW, uint16, sizeof (UNS16), (void*)&SlaveMap11 }
00316 };
00317
00318 const indextable TestSlave_objdict[] =
00319 {
00320 { (subindex*)TestSlave_Index1000,sizeof(TestSlave_Index1000)/sizeof(TestSlave_Index1000[0]), 0x1000},
00321 { (subindex*)TestSlave_Index1001,sizeof(TestSlave_Index1001)/sizeof(TestSlave_Index1001[0]), 0x1001},
00322 { (subindex*)TestSlave_Index1005,sizeof(TestSlave_Index1005)/sizeof(TestSlave_Index1005[0]), 0x1005},
00323 { (subindex*)TestSlave_Index1006,sizeof(TestSlave_Index1006)/sizeof(TestSlave_Index1006[0]), 0x1006},
00324 { (subindex*)TestSlave_Index1010,sizeof(TestSlave_Index1010)/sizeof(TestSlave_Index1010[0]), 0x1010},
00325 { (subindex*)TestSlave_Index1011,sizeof(TestSlave_Index1011)/sizeof(TestSlave_Index1011[0]), 0x1011},
00326 { (subindex*)TestSlave_Index1017,sizeof(TestSlave_Index1017)/sizeof(TestSlave_Index1017[0]), 0x1017},
00327 { (subindex*)TestSlave_Index1018,sizeof(TestSlave_Index1018)/sizeof(TestSlave_Index1018[0]), 0x1018},
00328 { (subindex*)TestSlave_Index1200,sizeof(TestSlave_Index1200)/sizeof(TestSlave_Index1200[0]), 0x1200},
00329 { (subindex*)TestSlave_Index1800,sizeof(TestSlave_Index1800)/sizeof(TestSlave_Index1800[0]), 0x1800},
00330 { (subindex*)TestSlave_Index1801,sizeof(TestSlave_Index1801)/sizeof(TestSlave_Index1801[0]), 0x1801},
00331 { (subindex*)TestSlave_Index1A00,sizeof(TestSlave_Index1A00)/sizeof(TestSlave_Index1A00[0]), 0x1A00},
00332 { (subindex*)TestSlave_Index1A01,sizeof(TestSlave_Index1A01)/sizeof(TestSlave_Index1A01[0]), 0x1A01},
00333 { (subindex*)TestSlave_Index2000,sizeof(TestSlave_Index2000)/sizeof(TestSlave_Index2000[0]), 0x2000},
00334 { (subindex*)TestSlave_Index2001,sizeof(TestSlave_Index2001)/sizeof(TestSlave_Index2001[0]), 0x2001},
00335 { (subindex*)TestSlave_Index2002,sizeof(TestSlave_Index2002)/sizeof(TestSlave_Index2002[0]), 0x2002},
00336 { (subindex*)TestSlave_Index2003,sizeof(TestSlave_Index2003)/sizeof(TestSlave_Index2003[0]), 0x2003},
00337 { (subindex*)TestSlave_Index2004,sizeof(TestSlave_Index2004)/sizeof(TestSlave_Index2004[0]), 0x2004},
00338 { (subindex*)TestSlave_Index2005,sizeof(TestSlave_Index2005)/sizeof(TestSlave_Index2005[0]), 0x2005},
00339 { (subindex*)TestSlave_Index2006,sizeof(TestSlave_Index2006)/sizeof(TestSlave_Index2006[0]), 0x2006},
00340 { (subindex*)TestSlave_Index2007,sizeof(TestSlave_Index2007)/sizeof(TestSlave_Index2007[0]), 0x2007},
00341 { (subindex*)TestSlave_Index2008,sizeof(TestSlave_Index2008)/sizeof(TestSlave_Index2008[0]), 0x2008},
00342 { (subindex*)TestSlave_Index2009,sizeof(TestSlave_Index2009)/sizeof(TestSlave_Index2009[0]), 0x2009},
00343 { (subindex*)TestSlave_Index200A,sizeof(TestSlave_Index200A)/sizeof(TestSlave_Index200A[0]), 0x200A},
00344 };
00345
00346 const indextable * TestSlave_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks)
00347 {
00348 int i;
00349 *callbacks = NULL;
00350 switch(wIndex){
00351 case 0x1000: i = 0;break;
00352 case 0x1001: i = 1;break;
00353 case 0x1005: i = 2;*callbacks = TestSlave_Index1005_callbacks; break;
00354 case 0x1006: i = 3;*callbacks = TestSlave_Index1006_callbacks; break;
00355 case 0x1010: i = 4;*callbacks = TestSlave_Index1010_callbacks; break;
00356 case 0x1011: i = 5;*callbacks = TestSlave_Index1011_callbacks; break;
00357 case 0x1017: i = 6;*callbacks = TestSlave_Index1017_callbacks; break;
00358 case 0x1018: i = 7;break;
00359 case 0x1200: i = 8;break;
00360 case 0x1800: i = 9;break;
00361 case 0x1801: i = 10;break;
00362 case 0x1A00: i = 11;break;
00363 case 0x1A01: i = 12;break;
00364 case 0x2000: i = 13;break;
00365 case 0x2001: i = 14;break;
00366 case 0x2002: i = 15;break;
00367 case 0x2003: i = 16;break;
00368 case 0x2004: i = 17;break;
00369 case 0x2005: i = 18;break;
00370 case 0x2006: i = 19;break;
00371 case 0x2007: i = 20;break;
00372 case 0x2008: i = 21;break;
00373 case 0x2009: i = 22;break;
00374 case 0x200A: i = 23;break;
00375 default:
00376 *errorCode = OD_NO_SUCH_OBJECT;
00377 return NULL;
00378 }
00379 *errorCode = OD_SUCCESSFUL;
00380 return &TestSlave_objdict[i];
00381 }
00382
00383
00384
00385
00386
00387 UNS8 TestSlave_count_sync[2] = {0,};
00388
00389 quick_index TestSlave_firstIndex = {
00390 8,
00391 0,
00392 0,
00393 0,
00394 9,
00395 11
00396 };
00397
00398 quick_index TestSlave_lastIndex = {
00399 8,
00400 0,
00401 0,
00402 0,
00403 10,
00404 12
00405 };
00406
00407 UNS16 TestSlave_ObjdictSize = sizeof(TestSlave_objdict)/sizeof(TestSlave_objdict[0]);
00408
00409 CO_Data TestSlave_Data = CANOPEN_NODE_DATA_INITIALIZER(TestSlave);
00410