00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <stddef.h>
00025
00026 #include <canfestival/applicfg.h>
00027 #include "canfestival/def.h"
00028 #include "canfestival/can.h"
00029 #include "canfestival/objdictdef.h"
00030 #include "canfestival/pdo.h"
00031 #include "canfestival/sdo.h"
00032 #include "canfestival/sync.h"
00033 #include "canfestival/lifegrd.h"
00034 #include "canfestival/nmtSlave.h"
00035
00036
00037
00038
00039 UNS8 seconds = 0;
00040 UNS8 minutes = 0;
00041 UNS8 hours = 0;
00042 UNS8 day = 0;
00043 UNS32 canopenErrNB = 0;
00044 UNS32 canopenErrVAL = 0;
00045 UNS8 strTest[10] = 0;
00046
00047
00048
00049
00050
00051
00052
00053 UNS32 Linux_slave_valueRangeTest (UNS8 typeValue, UNS32 unsValue, REAL32 realValue)
00054 {
00055 switch (typeValue) {
00056 }
00057 return 0;
00058 }
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068 #define NODE_ID 0x01
00069 UNS8 Linux_slave_bDeviceNodeId = NODE_ID;
00070
00071
00072
00073
00074
00075
00076 const UNS8 Linux_slave_iam_a_slave = 1
00077
00078
00079
00080
00081
00082
00083
00084
00085 #define PDO_MAP(index, sub_index, size_variable_in_bits)\
00086 0x ## index ## sub_index ## size_variable_in_bits
00087
00092 #define DeclareIndexTableEntry(entryname, index) { (subindex*)entryname,sizeof(entryname)/sizeof(entryname[0]), index}
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108 UNS32 Linux_slave_obj1000 = 0;
00109 subindex Linux_slave_Index1000[] =
00110 {
00111 { RO, uint32, sizeof(UNS32), (void*)&Linux_slave_obj1000 }
00112 };
00113
00114
00115
00116
00117 UNS8 Linux_slave_obj1001 = 0x0;
00118 subindex Linux_slave_Index1001[] =
00119 {
00120 { RO, uint8, sizeof(UNS8), (void*)&Linux_slave_obj1001 }
00121 };
00122
00123
00124
00125 UNS32 Linux_slave_obj1005 = 0x00000080;
00126
00127
00128
00129 subindex Linux_slave_Index1005[] =
00130 {
00131 { RW, uint32, sizeof(UNS32), (void*)&Linux_slave_obj1005 }
00132 };
00133
00134
00135
00136
00137 UNS32 Linux_slave_obj1006 = 0x0;
00138
00139
00140
00141
00142 subindex Linux_slave_Index1006[] =
00143 {
00144 { RW, uint32, sizeof(UNS32), (void*)&Linux_slave_obj1006 }
00145 };
00146
00147
00148
00149 UNS32 Linux_slave_obj1007 = 0x0;
00150 subindex Linux_slave_Index1007[] =
00151 {
00152 { RW, uint32, sizeof(UNS32), (void*)&Linux_slave_obj1007 }
00153 };
00154
00155
00156 UNS8 Linux_slave_obj1008[] = "Appli_Slave_HC12";
00157 subindex Linux_slave_Index1008[] =
00158 {
00159 { RO, uint32, sizeof(Linux_slave_obj1008), (void*)&Linux_slave_obj1008 }
00160 };
00161
00162
00163 UNS8 Linux_slave_obj1009[] = "__DATE__";
00164 subindex Linux_slave_Index1009[] =
00165 {
00166 { RO, uint32, sizeof(Linux_slave_obj1009), (void*)&Linux_slave_obj1009 }
00167 };
00168
00169
00170 UNS8 Linux_slave_obj100A[] = __TIME__;
00171 subindex Linux_slave_Index100A[] =
00172 {
00173 { RO, uint32, Linux_slave_sizeof(obj100A), (void*)&Linux_slave_obj100A}
00174 };
00175
00176
00177 TIMER_HANDLE Linux_slave_heartBeatTimers[1] = {TIMER_NONE,};
00178
00179
00180 UNS32 Linux_slave_obj1016[] = {
00181 0x00000000};
00182
00183 UNS8 Linux_slave_obj1016_cnt = 1;
00184
00185 subindex Linux_slave_Index1016[] =
00186 {
00187 { RO, uint8, sizeof(UNS8), (void*)&Linux_slave_obj1016_cnt },
00188 { RW, uint32, sizeof(UNS32), (void*)&Linux_slave_obj1016[0] }
00189 };
00190
00191
00192
00193 UNS16 Linux_slave_obj1017 = 0;
00194
00195
00196
00197 subindex Linux_slave_Index1017[] =
00198 {
00199 { RW, uint16, sizeof(UNS16), &Linux_slave_obj1017 }
00200 };
00201
00202
00205
00206
00207 s_identity Linux_slave_obj1018 =
00208 {
00209 4,
00210 0,
00211 0,
00212 0,
00213 0
00214 };
00215
00216 subindex Linux_slave_Index1018[] =
00217 {
00218 { RO, uint8, sizeof(UNS8), (void*)&Linux_slave_obj1018.count },
00219 { RO, uint32, sizeof(UNS32), (void*)&Linux_slave_obj1018.vendor_id},
00220 { RO, uint32, sizeof(UNS32), (void*)&Linux_slave_obj1018.product_code},
00221 { RO, uint32, sizeof(UNS32), (void*)&Linux_slave_obj1018.revision_number},
00222 { RO, uint32, sizeof(UNS32), (void*)&Linux_slave_obj1018.serial_number}
00223 };
00224
00225
00226
00227
00228
00229
00230
00231
00232 s_sdo_parameter Linux_slave_obj1200 =
00233 { 3,
00234 0x601,
00235 0x581,
00236 0x01
00237 };
00238 subindex Linux_slave_Index1200[] =
00239 {
00240 { RO, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1200.count },
00241 { RO, uint32, sizeof( UNS32), (void*)&Linux_slave_obj1200.cob_id_client },
00242 { RO, uint32, sizeof( UNS32), (void*)&Linux_slave_obj1200.cob_id_server },
00243 { RW, uint8, sizeof( UNS8), (void*)&Linux_slave_obj1200.node_id }
00244 };
00245
00246
00247 s_sdo_parameter Linux_slave_obj1280 =
00248 { 3,
00249 0x600,
00250 0x580,
00251 0x01
00252 };
00253 subindex Linux_slave_Index1280[] =
00254 {
00255 { RO, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1280.count },
00256 { RW, uint8, sizeof( UNS32 ), (void*)&Linux_slave_obj1280.cob_id_client },
00257 { RW, uint8, sizeof( UNS32 ), (void*)&Linux_slave_obj1280.cob_id_server },
00258 { RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1280.node_id }
00259 };
00260
00261
00262 s_pdo_communication_parameter Linux_slave_obj1400 =
00263 { 2,
00264 0x0,
00265 253
00266 };
00267 subindex Linux_slave_Index1400[] =
00268 {
00269 { RO, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1400.count },
00270 { RW, uint8, sizeof( UNS32 ), (void*)&Linux_slave_obj1400.cob_id },
00271 { RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1400.type },
00272 };
00273
00274
00275 s_pdo_communication_parameter Linux_slave_obj1401 =
00276 { 2,
00277 0x0,
00278 253
00279 };
00280 subindex Linux_slave_Index1401[] =
00281 {
00282 { RO, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1401.count },
00283 { RW, uint8, sizeof( UNS32 ), (void*)&Linux_slave_obj1401.cob_id },
00284 { RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1401.type },
00285 };
00286
00287
00288 s_pdo_communication_parameter Linux_slave_obj1402 =
00289 { 2,
00290 0x0,
00291 253
00292 };
00293 subindex Linux_slave_Index1402[] =
00294 {
00295 { RO, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1402.count },
00296 { RW, uint8, sizeof( UNS32 ), (void*)&Linux_slave_obj1402.cob_id },
00297 { RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1402.type },
00298 };
00299
00300
00301 UNS8 Linux_slave_obj1600_cnt = 0;
00302 UNS32 Linux_slave_obj1600_mappedVar[] = {
00303 0x00000000,
00304 0x00000000,
00305 0x00000000,
00306 0x00000000,
00307 0x00000000,
00308 0x00000000,
00309 0x00000000,
00310 0x00000000
00311 };
00312 subindex Linux_slave_Index1600[] =
00313 {
00314 { RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1600_cnt },
00315 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1600_mappedVar[0]},
00316 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1600_mappedVar[1]},
00317 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1600_mappedVar[2]},
00318 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1600_mappedVar[3]},
00319 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1600_mappedVar[4]},
00320 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1600_mappedVar[5]},
00321 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1600_mappedVar[6]},
00322 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1600_mappedVar[7]}
00323 };
00324
00325
00326 UNS8 Linux_slave_obj1601_cnt = 0;
00327 UNS32 Linux_slave_obj1601_mappedVar[] = {
00328 0x00000000,
00329 0x00000000,
00330 0x00000000,
00331 0x00000000,
00332 0x00000000,
00333 0x00000000,
00334 0x00000000,
00335 0x00000000
00336 };
00337 subindex Linux_slave_Index1601[] =
00338 {
00339 { RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1601_cnt },
00340 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1601_mappedVar[0]},
00341 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1601_mappedVar[1]},
00342 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1601_mappedVar[2]},
00343 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1601_mappedVar[3]},
00344 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1601_mappedVar[4]},
00345 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1601_mappedVar[5]},
00346 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1601_mappedVar[6]},
00347 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1601_mappedVar[7]}
00348 };
00349
00350
00351 UNS8 Linux_slave_obj1602_cnt = 0;
00352 UNS32 Linux_slave_obj1602_mappedVar[] = {
00353 0x00000000,
00354 0x00000000,
00355 0x00000000,
00356 0x00000000,
00357 0x00000000,
00358 0x00000000,
00359 0x00000000,
00360 0x00000000
00361 };
00362 subindex Linux_slave_Index1602[] =
00363 {
00364 { RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1602_cnt },
00365 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1602_mappedVar[0]},
00366 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1602_mappedVar[1]},
00367 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1602_mappedVar[2]},
00368 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1602_mappedVar[3]},
00369 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1602_mappedVar[4]},
00370 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1602_mappedVar[5]},
00371 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1602_mappedVar[6]},
00372 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1602_mappedVar[7]}
00373 };
00374
00375
00376 s_pdo_communication_parameter Linux_slave_obj1800 =
00377 { 2,
00378 0x0,
00379 253
00380 };
00381 subindex Linux_slave_Index1800[] =
00382 {
00383 { RO, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1800.count },
00384 { RW, uint8, sizeof( UNS32 ), (void*)&Linux_slave_obj1800.cob_id },
00385 { RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1800.type },
00386 };
00387
00388
00389 s_pdo_communication_parameter Linux_slave_obj1801 =
00390 { 2,
00391 0x0,
00392 253
00393 };
00394 subindex Linux_slave_Index1801[] =
00395 {
00396 { RO, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1801.count },
00397 { RW, uint8, sizeof( UNS32 ), (void*)&Linux_slave_obj1801.cob_id },
00398 { RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1801.type },
00399 };
00400
00401
00402 s_pdo_communication_parameter Linux_slave_obj1802 =
00403 { 2,
00404 0x0,
00405 253
00406 };
00407 subindex Linux_slave_Index1802[] =
00408 {
00409 { RO, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1802.count },
00410 { RW, uint8, sizeof( UNS32 ), (void*)&Linux_slave_obj1802.cob_id },
00411 { RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1802.type },
00412 };
00413
00414
00415 UNS8 Linux_slave_obj1A00_cnt = 0;
00416 UNS32 Linux_slave_obj1A00_mappedVar[] = {
00417 0x00000000,
00418 0x00000000,
00419 0x00000000,
00420 0x00000000,
00421 0x00000000,
00422 0x00000000,
00423 0x00000000,
00424 0x00000000
00425 };
00426 subindex Linux_slave_Index1A00[] =
00427 {
00428 { RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1A00_cnt },
00429 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A00_mappedVar[0]},
00430 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A00_mappedVar[1]},
00431 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A00_mappedVar[2]},
00432 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A00_mappedVar[3]},
00433 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A00_mappedVar[4]},
00434 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A00_mappedVar[5]},
00435 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A00_mappedVar[6]},
00436 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A00_mappedVar[7]}
00437 };
00438
00439
00440 UNS8 Linux_slave_obj1A01_cnt = 0;
00441 UNS32 Linux_slave_obj1A01_mappedVar[] = {
00442 0x00000000,
00443 0x00000000,
00444 0x00000000,
00445 0x00000000,
00446 0x00000000,
00447 0x00000000,
00448 0x00000000,
00449 0x00000000
00450 };
00451 subindex Linux_slave_Index1A01[] =
00452 {
00453 { RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1A01_cnt },
00454 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A01_mappedVar[0]},
00455 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A01_mappedVar[1]},
00456 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A01_mappedVar[2]},
00457 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A01_mappedVar[3]},
00458 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A01_mappedVar[4]},
00459 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A01_mappedVar[5]},
00460 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A01_mappedVar[6]},
00461 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A01_mappedVar[7]}
00462 };
00463
00464
00465 UNS8 Linux_slave_obj1A02_cnt = 0;
00466 UNS32 Linux_slave_obj1A02_mappedVar[] = {
00467 0x00000000,
00468 0x00000000,
00469 0x00000000,
00470 0x00000000,
00471 0x00000000,
00472 0x00000000,
00473 0x00000000,
00474 0x00000000
00475 };
00476 subindex Linux_slave_Index1A02[] =
00477 {
00478 { RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1A02_cnt },
00479 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A02_mappedVar[0]},
00480 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A02_mappedVar[1]},
00481 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A02_mappedVar[2]},
00482 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A02_mappedVar[3]},
00483 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A02_mappedVar[4]},
00484 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A02_mappedVar[5]},
00485 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A02_mappedVar[6]},
00486 { RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A02_mappedVar[7]}
00487 };
00488
00489
00490
00491 UNS8 Linux_slave_highestSubIndex_2000 = 4;
00492 subindex Linux_slave_Index2000[] =
00493 {
00494 { RO, uint8, sizeof (UNS8), (void*)&Linux_slave_highestSubIndex_2000 },
00495 { RW, uint8, sizeof (UNS8), (void*)&seconds },
00496 { RW, uint8, sizeof (UNS8), (void*)&minutes },
00497 { RW, uint8, sizeof (UNS8), (void*)&hours },
00498 { RW, uint8, sizeof (UNS8), (void*)&day }
00499 };
00500
00501
00502 UNS8 Linux_slave_highestSubIndex_6000 = 0;
00503 subindex Linux_slave_Index6000[] =
00504 {
00505 { RW, uint32, sizeof (UNS32), (void*)&canopenErrNB }
00506 };
00507
00508
00509 UNS8 Linux_slave_highestSubIndex_6001 = 0;
00510 subindex Linux_slave_Index6001[] =
00511 {
00512 { RW, uint32, sizeof (UNS32), (void*)&canopenErrVAL }
00513 };
00514
00515
00516 UNS8 Linux_slave_highestSubIndex_6002 = 0;
00517 subindex Linux_slave_Index6002[] =
00518 {
00519 { RW, visible_string, sizeof (strTest), (void*)&strTest }
00520 };
00521
00522 const indextable Linux_slave_objdict[] =
00523 {
00524 DeclareIndexTableEntry(Linux_slave_Index1000, 0x1000),
00525 DeclareIndexTableEntry(Linux_slave_Index1001, 0x1001),
00526 DeclareIndexTableEntry(Linux_slave_Index1005, 0x1005),
00527 DeclareIndexTableEntry(Linux_slave_Index1006, 0x1006),
00528 DeclareIndexTableEntry(Linux_slave_Index1007, 0x1007),
00529 DeclareIndexTableEntry(Linux_slave_Index1008, 0x1008),
00530 DeclareIndexTableEntry(Linux_slave_Index1009, 0x1009),
00531 DeclareIndexTableEntry(Linux_slave_Index100A, 0x100A),
00532 DeclareIndexTableEntry(Linux_slave_Index1016, 0x1016),
00533 DeclareIndexTableEntry(Linux_slave_Index1017, 0x1017),
00534 DeclareIndexTableEntry(Linux_slave_Index1018, 0x1018),
00535 DeclareIndexTableEntry(Linux_slave_Index1200, 0x1200),
00536 DeclareIndexTableEntry(Linux_slave_Index1280, 0x1280),
00537 DeclareIndexTableEntry(Linux_slave_Index1400, 0x1400),
00538 DeclareIndexTableEntry(Linux_slave_Index1401, 0x1401),
00539 DeclareIndexTableEntry(Linux_slave_Index1402, 0x1402),
00540 DeclareIndexTableEntry(Linux_slave_Index1600, 0x1600),
00541 DeclareIndexTableEntry(Linux_slave_Index1601, 0x1601),
00542 DeclareIndexTableEntry(Linux_slave_Index1602, 0x1602),
00543 DeclareIndexTableEntry(Linux_slave_Index1800, 0x1800),
00544 DeclareIndexTableEntry(Linux_slave_Index1801, 0x1801),
00545 DeclareIndexTableEntry(Linux_slave_Index1802, 0x1802),
00546 DeclareIndexTableEntry(Linux_slave_Index1A00, 0x1A00),
00547 DeclareIndexTableEntry(Linux_slave_Index1A01, 0x1A01),
00548 DeclareIndexTableEntry(Linux_slave_Index1A02, 0x1A02),
00549 DeclareIndexTableEntry(Linux_slave_Index2000, 0x2000),
00550 DeclareIndexTableEntry(Linux_slave_Index6000, 0x6000),
00551 DeclareIndexTableEntry(Linux_slave_Index6001, 0x6001),
00552 DeclareIndexTableEntry(Linux_slave_Index6002, 0x6002),
00553 };
00554
00555
00556
00557
00558 UNS8 Linux_slave_count_sync[1] = {0, };
00559
00560 quick_index Linux_slave_firstIndex = {
00561 SDO_SVR : 11,
00562 SDO_CLT : 12,
00563 PDO_RCV : 13,
00564 PDO_RCV_MAP : 16,
00565 PDO_TRS : 19,
00566 PDO_TRS_MAP : 22
00567 }
00568
00569 quick_index Linux_slave_lastIndex{
00570 SDO_SVR : 11,
00571 SDO_CLT : 12,
00572 PDO_RCV : 15,
00573 PDO_RCV_MAP : 18,
00574 PDO_TRS : 21,
00575 PDO_TRS_MAP : 24
00576 }
00577
00578 UNS16 Linux_slave_ObjdictSize = sizeof(Linux_slave_objdict)/sizeof(Linux_slave_objdict[0]);
00579