greg@179: greg@179: /* File generated by gen_cfile.py. Should not be modified. */ greg@179: greg@179: #include "TestSlaveC.h" greg@179: greg@179: /**************************************************************************/ greg@179: /* Declaration of the mapped variables */ greg@179: /**************************************************************************/ greg@179: UNS8 SlaveMap1 = 0x0; /* Mapped at index 0x2000, subindex 0x00 */ greg@179: UNS8 SlaveMap2 = 0x0; /* Mapped at index 0x2001, subindex 0x00 */ greg@179: UNS8 SlaveMap3 = 0x0; /* Mapped at index 0x2002, subindex 0x00 */ greg@179: UNS8 SlaveMap4 = 0x0; /* Mapped at index 0x2003, subindex 0x00 */ greg@179: greg@179: /**************************************************************************/ greg@179: /* Declaration of the value range types */ greg@179: /**************************************************************************/ greg@179: greg@179: UNS32 TestSlave_valueRangeTest (UNS8 typeValue, void * value) greg@179: { greg@179: switch (typeValue) { greg@179: } greg@179: return 0; greg@179: } greg@179: greg@179: /**************************************************************************/ greg@179: /* The node id */ greg@179: /**************************************************************************/ greg@179: /* node_id default value.*/ greg@179: UNS8 TestSlave_bDeviceNodeId = 0x00; greg@179: greg@179: /**************************************************************************/ greg@179: /* Array of message processing information */ greg@179: greg@179: const UNS8 TestSlave_iam_a_slave = 1; greg@179: greg@179: TIMER_HANDLE TestSlave_heartBeatTimers[1]; greg@179: greg@179: /* greg@179: $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ greg@179: greg@179: OBJECT DICTIONARY greg@179: greg@179: $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ greg@179: */ greg@179: greg@179: /* index 0x1000 : Device Type. */ greg@179: UNS32 TestSlave_obj1000 = 0x12D; /* 301 */ greg@179: subindex TestSlave_Index1000[] = greg@179: { greg@179: { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1000 } greg@179: }; greg@179: greg@179: /* index 0x1001 : Error Register. */ greg@179: UNS8 TestSlave_obj1001 = 0x0; /* 0 */ greg@179: subindex TestSlave_Index1001[] = greg@179: { greg@179: { RO, uint8, sizeof (UNS8), (void*)&TestSlave_obj1001 } greg@179: }; greg@179: greg@179: /* index 0x1005 : SYNC COB ID. */ greg@179: UNS32 TestSlave_obj1005 = 0x80; /* 128 */ greg@179: ODCallback_t TestSlave_Index1005_callbacks[] = greg@179: { greg@179: NULL, greg@179: }; greg@179: subindex TestSlave_Index1005[] = greg@179: { greg@179: { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1005 } greg@179: }; greg@179: greg@179: /* index 0x1006 : Communication / Cycle Period. */ greg@179: UNS32 TestSlave_obj1006 = 0x0; /* 0 */ greg@179: ODCallback_t TestSlave_Index1006_callbacks[] = greg@179: { greg@179: NULL, greg@179: }; greg@179: subindex TestSlave_Index1006[] = greg@179: { greg@179: { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1006 } greg@179: }; greg@179: greg@179: /* index 0x1010 : Store parameters. */ greg@179: UNS8 TestSlave_highestSubIndex_obj1010 = 4; /* number of subindex - 1*/ greg@179: UNS32 TestSlave_obj1010_Save_All_Parameters = 0x0; /* 0 */ greg@179: UNS32 TestSlave_obj1010_Save_Communication_Parameters = 0x0; /* 0 */ greg@179: UNS32 TestSlave_obj1010_Save_Application_Parameters = 0x0; /* 0 */ greg@179: UNS32 TestSlave_obj1010_Save_Manufacturer_Parameters = 0x0; /* 0 */ greg@179: ODCallback_t TestSlave_Index1010_callbacks[] = greg@179: { greg@179: NULL, greg@179: NULL, greg@179: NULL, greg@179: NULL, greg@179: NULL, greg@179: }; greg@179: subindex TestSlave_Index1010[] = greg@179: { greg@179: { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1010 }, greg@179: { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_All_Parameters }, greg@179: { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_Communication_Parameters }, greg@179: { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_Application_Parameters }, greg@179: { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_Manufacturer_Parameters } greg@179: }; greg@179: greg@179: /* index 0x1011 : Restore Default Parameters. */ greg@179: UNS8 TestSlave_highestSubIndex_obj1011 = 4; /* number of subindex - 1*/ greg@179: UNS32 TestSlave_obj1011_Restore_All_Default_Parameters = 0x0; /* 0 */ greg@179: UNS32 TestSlave_obj1011_Restore_Communication_Default_Parameters = 0x0; /* 0 */ greg@179: UNS32 TestSlave_obj1011_Restore_Application_Default_Parameters = 0x0; /* 0 */ greg@179: UNS32 TestSlave_obj1011_Restore_Manufacturer_Default_Parameters = 0x0; /* 0 */ greg@179: ODCallback_t TestSlave_Index1011_callbacks[] = greg@179: { greg@179: NULL, greg@179: NULL, greg@179: NULL, greg@179: NULL, greg@179: NULL, greg@179: }; greg@179: subindex TestSlave_Index1011[] = greg@179: { greg@179: { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1011 }, greg@179: { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_All_Default_Parameters }, greg@179: { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_Communication_Default_Parameters }, greg@179: { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_Application_Default_Parameters }, greg@179: { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_Manufacturer_Default_Parameters } greg@179: }; greg@179: greg@179: /* index 0x1016 : Consumer Heartbeat Time */ greg@179: UNS8 TestSlave_highestSubIndex_obj1016 = 0; greg@179: UNS32 TestSlave_obj1016[]={0}; greg@179: greg@179: /* index 0x1017 : Producer Heartbeat Time. */ greg@179: UNS16 TestSlave_obj1017 = 0x0; /* 0 */ greg@179: subindex TestSlave_Index1017[] = greg@179: { greg@179: { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1017 } greg@179: }; greg@179: greg@179: /* index 0x1018 : Identity. */ greg@179: UNS8 TestSlave_highestSubIndex_obj1018 = 4; /* number of subindex - 1*/ greg@179: UNS32 TestSlave_obj1018_Vendor_ID = 0x0; /* 0 */ greg@179: UNS32 TestSlave_obj1018_Product_Code = 0x0; /* 0 */ greg@179: UNS32 TestSlave_obj1018_Revision_Number = 0x0; /* 0 */ greg@179: UNS32 TestSlave_obj1018_Serial_Number = 0x0; /* 0 */ greg@179: subindex TestSlave_Index1018[] = greg@179: { greg@179: { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1018 }, greg@179: { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Vendor_ID }, greg@179: { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Product_Code }, greg@179: { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Revision_Number }, greg@179: { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Serial_Number } greg@179: }; greg@179: greg@179: /* index 0x1200 : Server SDO Parameter. */ greg@179: UNS8 TestSlave_highestSubIndex_obj1200 = 2; /* number of subindex - 1*/ greg@179: UNS32 TestSlave_obj1200_COB_ID_Client_to_Server_Receive_SDO = 0x601; /* 1537 */ greg@179: UNS32 TestSlave_obj1200_COB_ID_Server_to_Client_Transmit_SDO = 0x581; /* 1409 */ greg@179: subindex TestSlave_Index1200[] = greg@179: { greg@179: { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1200 }, greg@179: { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1200_COB_ID_Client_to_Server_Receive_SDO }, greg@179: { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1200_COB_ID_Server_to_Client_Transmit_SDO } greg@179: }; greg@179: greg@179: /* index 0x1800 : Transmit PDO 1 Parameter. */ greg@179: UNS8 TestSlave_highestSubIndex_obj1800 = 5; /* number of subindex - 1*/ greg@179: UNS32 TestSlave_obj1800_COB_ID_used_by_PDO = 0x182; /* 386 */ greg@179: UNS8 TestSlave_obj1800_Transmission_Type = 0x1; /* 1 */ greg@179: UNS16 TestSlave_obj1800_Inhibit_Time = 0x0; /* 0 */ greg@179: UNS16 TestSlave_obj1800_Compatibility_Entry = 0x0; /* 0 */ greg@179: UNS16 TestSlave_obj1800_Event_Timer = 0x0; /* 0 */ greg@179: subindex TestSlave_Index1800[] = greg@179: { greg@179: { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1800 }, greg@179: { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1800_COB_ID_used_by_PDO }, greg@179: { RW|TO_BE_SAVE, uint8, sizeof (UNS8), (void*)&TestSlave_obj1800_Transmission_Type }, greg@179: { RW|TO_BE_SAVE, uint16, sizeof (UNS16), (void*)&TestSlave_obj1800_Inhibit_Time }, greg@179: { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1800_Compatibility_Entry }, greg@179: { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1800_Event_Timer } greg@179: }; greg@179: greg@179: /* index 0x1801 : Transmit PDO 2 Parameter. */ greg@179: UNS8 TestSlave_highestSubIndex_obj1801 = 5; /* number of subindex - 1*/ greg@179: UNS32 TestSlave_obj1801_COB_ID_used_by_PDO = 0x282; /* 642 */ greg@179: UNS8 TestSlave_obj1801_Transmission_Type = 0x1; /* 1 */ greg@179: UNS16 TestSlave_obj1801_Inhibit_Time = 0x0; /* 0 */ greg@179: UNS16 TestSlave_obj1801_Compatibility_Entry = 0x0; /* 0 */ greg@179: UNS16 TestSlave_obj1801_Event_Timer = 0x0; /* 0 */ greg@179: subindex TestSlave_Index1801[] = greg@179: { greg@179: { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1801 }, greg@179: { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1801_COB_ID_used_by_PDO }, greg@179: { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1801_Transmission_Type }, greg@179: { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1801_Inhibit_Time }, greg@179: { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1801_Compatibility_Entry }, greg@179: { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1801_Event_Timer } greg@179: }; greg@179: greg@179: /* index 0x1A00 : Transmit PDO 1 Mapping. */ greg@179: UNS8 TestSlave_highestSubIndex_obj1A00 = 2; /* number of subindex - 1*/ greg@179: UNS32 TestSlave_obj1A00[] = greg@179: { greg@179: 0x20000008, /* 536870920 */ greg@179: 0x20010008 /* 536936456 */ greg@179: }; greg@179: subindex TestSlave_Index1A00[] = greg@179: { greg@179: { RW, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1A00 }, greg@179: { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[0] }, greg@179: { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[1] } greg@179: }; greg@179: greg@179: /* index 0x1A01 : Transmit PDO 2 Mapping. */ greg@179: UNS8 TestSlave_highestSubIndex_obj1A01 = 2; /* number of subindex - 1*/ greg@179: UNS32 TestSlave_obj1A01[] = greg@179: { greg@179: 0x20020008, /* 537001992 */ greg@179: 0x20030008 /* 537067528 */ greg@179: }; greg@179: subindex TestSlave_Index1A01[] = greg@179: { greg@179: { RW, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1A01 }, greg@179: { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A01[0] }, greg@179: { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A01[1] } greg@179: }; greg@179: greg@179: /* index 0x2000 : Mapped variable SlaveMap1 */ greg@179: subindex TestSlave_Index2000[] = greg@179: { greg@179: { RW, uint8, sizeof (UNS8), (void*)&SlaveMap1 } greg@179: }; greg@179: greg@179: /* index 0x2001 : Mapped variable SlaveMap2 */ greg@179: subindex TestSlave_Index2001[] = greg@179: { greg@179: { RW, uint8, sizeof (UNS8), (void*)&SlaveMap2 } greg@179: }; greg@179: greg@179: /* index 0x2002 : Mapped variable SlaveMap3 */ greg@179: subindex TestSlave_Index2002[] = greg@179: { greg@179: { RW, uint8, sizeof (UNS8), (void*)&SlaveMap3 } greg@179: }; greg@179: greg@179: /* index 0x2003 : Mapped variable SlaveMap4 */ greg@179: subindex TestSlave_Index2003[] = greg@179: { greg@179: { RW, uint8, sizeof (UNS8), (void*)&SlaveMap4 } greg@179: }; greg@179: greg@179: const indextable TestSlave_objdict[] = greg@179: { greg@179: { (subindex*)TestSlave_Index1000,sizeof(TestSlave_Index1000)/sizeof(TestSlave_Index1000[0]), 0x1000}, greg@179: { (subindex*)TestSlave_Index1001,sizeof(TestSlave_Index1001)/sizeof(TestSlave_Index1001[0]), 0x1001}, greg@179: { (subindex*)TestSlave_Index1005,sizeof(TestSlave_Index1005)/sizeof(TestSlave_Index1005[0]), 0x1005}, greg@179: { (subindex*)TestSlave_Index1006,sizeof(TestSlave_Index1006)/sizeof(TestSlave_Index1006[0]), 0x1006}, greg@179: { (subindex*)TestSlave_Index1010,sizeof(TestSlave_Index1010)/sizeof(TestSlave_Index1010[0]), 0x1010}, greg@179: { (subindex*)TestSlave_Index1011,sizeof(TestSlave_Index1011)/sizeof(TestSlave_Index1011[0]), 0x1011}, greg@179: { (subindex*)TestSlave_Index1017,sizeof(TestSlave_Index1017)/sizeof(TestSlave_Index1017[0]), 0x1017}, greg@179: { (subindex*)TestSlave_Index1018,sizeof(TestSlave_Index1018)/sizeof(TestSlave_Index1018[0]), 0x1018}, greg@179: { (subindex*)TestSlave_Index1200,sizeof(TestSlave_Index1200)/sizeof(TestSlave_Index1200[0]), 0x1200}, greg@179: { (subindex*)TestSlave_Index1800,sizeof(TestSlave_Index1800)/sizeof(TestSlave_Index1800[0]), 0x1800}, greg@179: { (subindex*)TestSlave_Index1801,sizeof(TestSlave_Index1801)/sizeof(TestSlave_Index1801[0]), 0x1801}, greg@179: { (subindex*)TestSlave_Index1A00,sizeof(TestSlave_Index1A00)/sizeof(TestSlave_Index1A00[0]), 0x1A00}, greg@179: { (subindex*)TestSlave_Index1A01,sizeof(TestSlave_Index1A01)/sizeof(TestSlave_Index1A01[0]), 0x1A01}, greg@179: { (subindex*)TestSlave_Index2000,sizeof(TestSlave_Index2000)/sizeof(TestSlave_Index2000[0]), 0x2000}, greg@179: { (subindex*)TestSlave_Index2001,sizeof(TestSlave_Index2001)/sizeof(TestSlave_Index2001[0]), 0x2001}, greg@179: { (subindex*)TestSlave_Index2002,sizeof(TestSlave_Index2002)/sizeof(TestSlave_Index2002[0]), 0x2002}, greg@179: { (subindex*)TestSlave_Index2003,sizeof(TestSlave_Index2003)/sizeof(TestSlave_Index2003[0]), 0x2003}, greg@179: }; greg@179: greg@179: const indextable * TestSlave_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks) greg@179: { greg@179: int i; greg@179: *callbacks = NULL; greg@179: switch(wIndex){ greg@179: case 0x1000: i = 0;break; greg@179: case 0x1001: i = 1;break; greg@179: case 0x1005: i = 2;*callbacks = TestSlave_Index1005_callbacks; break; greg@179: case 0x1006: i = 3;*callbacks = TestSlave_Index1006_callbacks; break; greg@179: case 0x1010: i = 4;*callbacks = TestSlave_Index1010_callbacks; break; greg@179: case 0x1011: i = 5;*callbacks = TestSlave_Index1011_callbacks; break; greg@179: case 0x1017: i = 6;break; greg@179: case 0x1018: i = 7;break; greg@179: case 0x1200: i = 8;break; greg@179: case 0x1800: i = 9;break; greg@179: case 0x1801: i = 10;break; greg@179: case 0x1A00: i = 11;break; greg@179: case 0x1A01: i = 12;break; greg@179: case 0x2000: i = 13;break; greg@179: case 0x2001: i = 14;break; greg@179: case 0x2002: i = 15;break; greg@179: case 0x2003: i = 16;break; greg@179: default: greg@179: *errorCode = OD_NO_SUCH_OBJECT; greg@179: return NULL; greg@179: } greg@179: *errorCode = OD_SUCCESSFUL; greg@179: return &TestSlave_objdict[i]; greg@179: } greg@179: greg@179: /* To count at which received SYNC a PDO must be sent. greg@179: * Even if no pdoTransmit are defined, at least one entry is computed greg@179: * for compilations issues. greg@179: */ greg@179: UNS8 TestSlave_count_sync[2] = {0,}; greg@179: greg@179: quick_index TestSlave_firstIndex = { greg@179: 8, /* SDO_SVR */ greg@179: 0, /* SDO_CLT */ greg@179: 0, /* PDO_RCV */ greg@179: 0, /* PDO_RCV_MAP */ greg@179: 9, /* PDO_TRS */ greg@179: 11 /* PDO_TRS_MAP */ greg@179: }; greg@179: greg@179: quick_index TestSlave_lastIndex = { greg@179: 8, /* SDO_SVR */ greg@179: 0, /* SDO_CLT */ greg@179: 0, /* PDO_RCV */ greg@179: 0, /* PDO_RCV_MAP */ greg@179: 10, /* PDO_TRS */ greg@179: 12 /* PDO_TRS_MAP */ greg@179: }; greg@179: greg@179: UNS16 TestSlave_ObjdictSize = sizeof(TestSlave_objdict)/sizeof(TestSlave_objdict[0]); greg@179: greg@179: CO_Data TestSlave_Data = CANOPEN_NODE_DATA_INITIALIZER(TestSlave); greg@179: