examples/TestMasterSlave/TestMaster.c
changeset 314 68e83c3ffbb5
parent 307 230d55cb75a4
child 369 8b67289d50b5
equal deleted inserted replaced
313:fed411af774a 314:68e83c3ffbb5
   137                        { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1011_Restore_Communication_Default_Parameters },
   137                        { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1011_Restore_Communication_Default_Parameters },
   138                        { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1011_Restore_Application_Default_Parameters },
   138                        { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1011_Restore_Application_Default_Parameters },
   139                        { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1011_Restore_Manufacturer_Default_Parameters }
   139                        { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1011_Restore_Manufacturer_Default_Parameters }
   140                      };
   140                      };
   141 
   141 
       
   142 /* index 0x1014 :   Emergency COB ID. */
       
   143                     UNS32 TestMaster_obj1014 = 0x80;	/* 128 */
       
   144                     subindex TestMaster_Index1014[] = 
       
   145                      {
       
   146                        { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1014 }
       
   147                      };
       
   148 
   142 /* index 0x1016 :   Consumer Heartbeat Time. */
   149 /* index 0x1016 :   Consumer Heartbeat Time. */
   143                     UNS8 TestMaster_highestSubIndex_obj1016 = 1; /* number of subindex - 1*/
   150                     UNS8 TestMaster_highestSubIndex_obj1016 = 1; /* number of subindex - 1*/
   144                     UNS32 TestMaster_obj1016[] = 
   151                     UNS32 TestMaster_obj1016[] = 
   145                     {
   152                     {
   146                       0x205DC	/* 132572 */
   153                       0x205DC	/* 132572 */
   414   { (subindex*)TestMaster_Index1001,sizeof(TestMaster_Index1001)/sizeof(TestMaster_Index1001[0]), 0x1001},
   421   { (subindex*)TestMaster_Index1001,sizeof(TestMaster_Index1001)/sizeof(TestMaster_Index1001[0]), 0x1001},
   415   { (subindex*)TestMaster_Index1005,sizeof(TestMaster_Index1005)/sizeof(TestMaster_Index1005[0]), 0x1005},
   422   { (subindex*)TestMaster_Index1005,sizeof(TestMaster_Index1005)/sizeof(TestMaster_Index1005[0]), 0x1005},
   416   { (subindex*)TestMaster_Index1006,sizeof(TestMaster_Index1006)/sizeof(TestMaster_Index1006[0]), 0x1006},
   423   { (subindex*)TestMaster_Index1006,sizeof(TestMaster_Index1006)/sizeof(TestMaster_Index1006[0]), 0x1006},
   417   { (subindex*)TestMaster_Index1010,sizeof(TestMaster_Index1010)/sizeof(TestMaster_Index1010[0]), 0x1010},
   424   { (subindex*)TestMaster_Index1010,sizeof(TestMaster_Index1010)/sizeof(TestMaster_Index1010[0]), 0x1010},
   418   { (subindex*)TestMaster_Index1011,sizeof(TestMaster_Index1011)/sizeof(TestMaster_Index1011[0]), 0x1011},
   425   { (subindex*)TestMaster_Index1011,sizeof(TestMaster_Index1011)/sizeof(TestMaster_Index1011[0]), 0x1011},
       
   426   { (subindex*)TestMaster_Index1014,sizeof(TestMaster_Index1014)/sizeof(TestMaster_Index1014[0]), 0x1014},
   419   { (subindex*)TestMaster_Index1016,sizeof(TestMaster_Index1016)/sizeof(TestMaster_Index1016[0]), 0x1016},
   427   { (subindex*)TestMaster_Index1016,sizeof(TestMaster_Index1016)/sizeof(TestMaster_Index1016[0]), 0x1016},
   420   { (subindex*)TestMaster_Index1018,sizeof(TestMaster_Index1018)/sizeof(TestMaster_Index1018[0]), 0x1018},
   428   { (subindex*)TestMaster_Index1018,sizeof(TestMaster_Index1018)/sizeof(TestMaster_Index1018[0]), 0x1018},
   421   { (subindex*)TestMaster_Index1280,sizeof(TestMaster_Index1280)/sizeof(TestMaster_Index1280[0]), 0x1280},
   429   { (subindex*)TestMaster_Index1280,sizeof(TestMaster_Index1280)/sizeof(TestMaster_Index1280[0]), 0x1280},
   422   { (subindex*)TestMaster_Index1400,sizeof(TestMaster_Index1400)/sizeof(TestMaster_Index1400[0]), 0x1400},
   430   { (subindex*)TestMaster_Index1400,sizeof(TestMaster_Index1400)/sizeof(TestMaster_Index1400[0]), 0x1400},
   423   { (subindex*)TestMaster_Index1401,sizeof(TestMaster_Index1401)/sizeof(TestMaster_Index1401[0]), 0x1401},
   431   { (subindex*)TestMaster_Index1401,sizeof(TestMaster_Index1401)/sizeof(TestMaster_Index1401[0]), 0x1401},
   452 		case 0x1001: i = 1;break;
   460 		case 0x1001: i = 1;break;
   453 		case 0x1005: i = 2;*callbacks = TestMaster_Index1005_callbacks; break;
   461 		case 0x1005: i = 2;*callbacks = TestMaster_Index1005_callbacks; break;
   454 		case 0x1006: i = 3;*callbacks = TestMaster_Index1006_callbacks; break;
   462 		case 0x1006: i = 3;*callbacks = TestMaster_Index1006_callbacks; break;
   455 		case 0x1010: i = 4;break;
   463 		case 0x1010: i = 4;break;
   456 		case 0x1011: i = 5;break;
   464 		case 0x1011: i = 5;break;
   457 		case 0x1016: i = 6;break;
   465 		case 0x1014: i = 6;break;
   458 		case 0x1018: i = 7;break;
   466 		case 0x1016: i = 7;break;
   459 		case 0x1280: i = 8;break;
   467 		case 0x1018: i = 8;break;
   460 		case 0x1400: i = 9;break;
   468 		case 0x1280: i = 9;break;
   461 		case 0x1401: i = 10;break;
   469 		case 0x1400: i = 10;break;
   462 		case 0x1402: i = 11;break;
   470 		case 0x1401: i = 11;break;
   463 		case 0x1403: i = 12;break;
   471 		case 0x1402: i = 12;break;
   464 		case 0x1600: i = 13;break;
   472 		case 0x1403: i = 13;break;
   465 		case 0x1601: i = 14;break;
   473 		case 0x1600: i = 14;break;
   466 		case 0x1602: i = 15;break;
   474 		case 0x1601: i = 15;break;
   467 		case 0x1603: i = 16;break;
   475 		case 0x1602: i = 16;break;
   468 		case 0x1F22: i = 17;break;
   476 		case 0x1603: i = 17;break;
   469 		case 0x2000: i = 18;break;
   477 		case 0x1F22: i = 18;break;
   470 		case 0x2001: i = 19;break;
   478 		case 0x2000: i = 19;break;
   471 		case 0x2002: i = 20;break;
   479 		case 0x2001: i = 20;break;
   472 		case 0x2003: i = 21;break;
   480 		case 0x2002: i = 21;break;
   473 		case 0x2004: i = 22;break;
   481 		case 0x2003: i = 22;break;
   474 		case 0x2005: i = 23;break;
   482 		case 0x2004: i = 23;break;
   475 		case 0x2006: i = 24;break;
   483 		case 0x2005: i = 24;break;
   476 		case 0x2007: i = 25;break;
   484 		case 0x2006: i = 25;break;
   477 		case 0x2008: i = 26;break;
   485 		case 0x2007: i = 26;break;
   478 		case 0x2009: i = 27;break;
   486 		case 0x2008: i = 27;break;
   479 		case 0x200A: i = 28;break;
   487 		case 0x2009: i = 28;break;
   480 		case 0x200B: i = 29;break;
   488 		case 0x200A: i = 29;break;
   481 		case 0x200C: i = 30;break;
   489 		case 0x200B: i = 30;break;
       
   490 		case 0x200C: i = 31;break;
   482 		default:
   491 		default:
   483 			*errorCode = OD_NO_SUCH_OBJECT;
   492 			*errorCode = OD_NO_SUCH_OBJECT;
   484 			return NULL;
   493 			return NULL;
   485 	}
   494 	}
   486 	*errorCode = OD_SUCCESSFUL;
   495 	*errorCode = OD_SUCCESSFUL;
   494  */
   503  */
   495 s_PDO_status TestMaster_PDO_status[1] = {s_PDO_staus_Initializer};
   504 s_PDO_status TestMaster_PDO_status[1] = {s_PDO_staus_Initializer};
   496 
   505 
   497 quick_index TestMaster_firstIndex = {
   506 quick_index TestMaster_firstIndex = {
   498   0, /* SDO_SVR */
   507   0, /* SDO_SVR */
   499   8, /* SDO_CLT */
   508   9, /* SDO_CLT */
   500   9, /* PDO_RCV */
   509   10, /* PDO_RCV */
   501   13, /* PDO_RCV_MAP */
   510   14, /* PDO_RCV_MAP */
   502   0, /* PDO_TRS */
   511   0, /* PDO_TRS */
   503   0 /* PDO_TRS_MAP */
   512   0 /* PDO_TRS_MAP */
   504 };
   513 };
   505 
   514 
   506 quick_index TestMaster_lastIndex = {
   515 quick_index TestMaster_lastIndex = {
   507   0, /* SDO_SVR */
   516   0, /* SDO_SVR */
   508   8, /* SDO_CLT */
   517   9, /* SDO_CLT */
   509   12, /* PDO_RCV */
   518   13, /* PDO_RCV */
   510   16, /* PDO_RCV_MAP */
   519   17, /* PDO_RCV_MAP */
   511   0, /* PDO_TRS */
   520   0, /* PDO_TRS */
   512   0 /* PDO_TRS_MAP */
   521   0 /* PDO_TRS_MAP */
   513 };
   522 };
   514 
   523 
   515 UNS16 TestMaster_ObjdictSize = sizeof(TestMaster_objdict)/sizeof(TestMaster_objdict[0]); 
   524 UNS16 TestMaster_ObjdictSize = sizeof(TestMaster_objdict)/sizeof(TestMaster_objdict[0]);