etisserant@400: etisserant@400: /* File generated by gen_cfile.py. Should not be modified. */ etisserant@400: etisserant@400: #include "SillySlave.h" etisserant@400: etisserant@400: /**************************************************************************/ etisserant@400: /* Declaration of the mapped variables */ etisserant@400: /**************************************************************************/ etisserant@400: UNS8 LifeSignal = 0x0; /* Mapped at index 0x2001, subindex 0x00 */ etisserant@400: etisserant@400: /**************************************************************************/ etisserant@400: /* Declaration of the value range types */ etisserant@400: /**************************************************************************/ etisserant@400: etisserant@400: #define valueRange_EMC 0x9F /* Type for index 0x1003 subindex 0x00 (only set of value 0 is possible) */ etisserant@400: UNS32 SillySlave_valueRangeTest (UNS8 typeValue, void * value) etisserant@400: { etisserant@400: switch (typeValue) { etisserant@400: case valueRange_EMC: etisserant@400: if (*(UNS8*)value != (UNS8)0) return OD_VALUE_RANGE_EXCEEDED; etisserant@400: break; etisserant@400: } etisserant@400: return 0; etisserant@400: } etisserant@400: etisserant@400: /**************************************************************************/ etisserant@400: /* The node id */ etisserant@400: /**************************************************************************/ etisserant@400: /* node_id default value.*/ etisserant@400: UNS8 SillySlave_bDeviceNodeId = 0x00; etisserant@400: etisserant@400: /**************************************************************************/ etisserant@400: /* Array of message processing information */ etisserant@400: etisserant@400: const UNS8 SillySlave_iam_a_slave = 1; etisserant@400: etisserant@400: TIMER_HANDLE SillySlave_heartBeatTimers[1]; etisserant@400: etisserant@400: /* etisserant@400: $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ etisserant@400: etisserant@400: OBJECT DICTIONARY etisserant@400: etisserant@400: $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ etisserant@400: */ etisserant@400: etisserant@400: /* index 0x1000 : Device Type. */ etisserant@400: UNS32 SillySlave_obj1000 = 0x2000000; /* 33554432 */ etisserant@400: subindex SillySlave_Index1000[] = etisserant@400: { etisserant@400: { RO, uint32, sizeof (UNS32), (void*)&SillySlave_obj1000 } etisserant@400: }; etisserant@400: etisserant@400: /* index 0x1001 : Error Register. */ etisserant@400: UNS8 SillySlave_obj1001 = 0x0; /* 0 */ etisserant@400: subindex SillySlave_Index1001[] = etisserant@400: { etisserant@400: { RO, uint8, sizeof (UNS8), (void*)&SillySlave_obj1001 } etisserant@400: }; etisserant@400: etisserant@400: /* index 0x1003 : Pre-defined Error Field */ etisserant@400: UNS8 SillySlave_highestSubIndex_obj1003 = 0; /* number of subindex - 1*/ etisserant@400: UNS32 SillySlave_obj1003[] = etisserant@400: { etisserant@400: 0x0 /* 0 */ etisserant@400: }; etisserant@400: ODCallback_t SillySlave_Index1003_callbacks[] = etisserant@400: { etisserant@400: NULL, etisserant@400: NULL, etisserant@400: }; etisserant@400: subindex SillySlave_Index1003[] = etisserant@400: { etisserant@400: { RW, valueRange_EMC, sizeof (UNS8), (void*)&SillySlave_highestSubIndex_obj1003 }, etisserant@400: { RO, uint32, sizeof (UNS32), (void*)&SillySlave_obj1003[0] } etisserant@400: }; etisserant@400: etisserant@400: /* index 0x1005 : SYNC COB ID */ etisserant@400: UNS32 SillySlave_obj1005 = 0x0; /* 0 */ etisserant@400: etisserant@400: /* index 0x1006 : Communication / Cycle Period */ etisserant@400: UNS32 SillySlave_obj1006 = 0x0; /* 0 */ etisserant@400: etisserant@400: /* index 0x1012 : TIME COB ID. */ etisserant@400: UNS32 SillySlave_obj1012 = 0x80000100; /* 2147483904 */ etisserant@400: subindex SillySlave_Index1012[] = etisserant@400: { etisserant@400: { RW, uint32, sizeof (UNS32), (void*)&SillySlave_obj1012 } etisserant@400: }; etisserant@400: etisserant@400: /* index 0x1013 : High Resolution Timestamp. */ etisserant@400: UNS32 SillySlave_obj1013 = 0x0; /* 0 */ etisserant@400: subindex SillySlave_Index1013[] = etisserant@400: { etisserant@400: { RW, uint32, sizeof (UNS32), (void*)&SillySlave_obj1013 } etisserant@400: }; etisserant@400: etisserant@400: /* index 0x1014 : Emergency COB ID */ etisserant@400: UNS32 SillySlave_obj1014 = 0x0; /* 0 */ etisserant@400: etisserant@400: /* index 0x1016 : Consumer Heartbeat Time */ etisserant@400: UNS8 SillySlave_highestSubIndex_obj1016 = 0; etisserant@400: UNS32 SillySlave_obj1016[]={0}; etisserant@400: etisserant@400: /* index 0x1017 : Producer Heartbeat Time */ etisserant@400: UNS16 SillySlave_obj1017 = 0x0; /* 0 */ etisserant@400: etisserant@400: /* index 0x1018 : Identity. */ etisserant@400: UNS8 SillySlave_highestSubIndex_obj1018 = 4; /* number of subindex - 1*/ etisserant@400: UNS32 SillySlave_obj1018_Vendor_ID = 0x4321; /* 17185 */ etisserant@400: UNS32 SillySlave_obj1018_Product_Code = 0x12; /* 18 */ etisserant@400: UNS32 SillySlave_obj1018_Revision_Number = 0x1; /* 1 */ etisserant@400: UNS32 SillySlave_obj1018_Serial_Number = 0x1; /* 1 */ etisserant@400: subindex SillySlave_Index1018[] = etisserant@400: { etisserant@400: { RO, uint8, sizeof (UNS8), (void*)&SillySlave_highestSubIndex_obj1018 }, etisserant@400: { RO, uint32, sizeof (UNS32), (void*)&SillySlave_obj1018_Vendor_ID }, etisserant@400: { RO, uint32, sizeof (UNS32), (void*)&SillySlave_obj1018_Product_Code }, etisserant@400: { RO, uint32, sizeof (UNS32), (void*)&SillySlave_obj1018_Revision_Number }, etisserant@400: { RO, uint32, sizeof (UNS32), (void*)&SillySlave_obj1018_Serial_Number } etisserant@400: }; etisserant@400: etisserant@400: /* index 0x1200 : Server SDO Parameter. */ etisserant@400: UNS8 SillySlave_highestSubIndex_obj1200 = 2; /* number of subindex - 1*/ etisserant@400: UNS32 SillySlave_obj1200_COB_ID_Client_to_Server_Receive_SDO = 0x600; /* 1536 */ etisserant@400: UNS32 SillySlave_obj1200_COB_ID_Server_to_Client_Transmit_SDO = 0x580; /* 1408 */ etisserant@400: ODCallback_t SillySlave_Index1200_callbacks[] = etisserant@400: { etisserant@400: NULL, etisserant@400: NULL, etisserant@400: NULL, etisserant@400: }; etisserant@400: subindex SillySlave_Index1200[] = etisserant@400: { etisserant@400: { RO, uint8, sizeof (UNS8), (void*)&SillySlave_highestSubIndex_obj1200 }, etisserant@400: { RO, uint32, sizeof (UNS32), (void*)&SillySlave_obj1200_COB_ID_Client_to_Server_Receive_SDO }, etisserant@400: { RO, uint32, sizeof (UNS32), (void*)&SillySlave_obj1200_COB_ID_Server_to_Client_Transmit_SDO } etisserant@400: }; etisserant@400: etisserant@400: /* index 0x1800 : Transmit PDO 1 Parameter. */ etisserant@400: UNS8 SillySlave_highestSubIndex_obj1800 = 5; /* number of subindex - 1*/ etisserant@400: UNS32 SillySlave_obj1800_COB_ID_used_by_PDO = 0x180; /* 384 */ etisserant@400: UNS8 SillySlave_obj1800_Transmission_Type = 0x1; /* 1 */ etisserant@400: UNS16 SillySlave_obj1800_Inhibit_Time = 0x64; /* 100 */ etisserant@400: UNS8 SillySlave_obj1800_Compatibility_Entry = 0x0; /* 0 */ etisserant@400: UNS16 SillySlave_obj1800_Event_Timer = 0x0; /* 0 */ etisserant@400: ODCallback_t SillySlave_Index1800_callbacks[] = etisserant@400: { etisserant@400: NULL, etisserant@400: NULL, etisserant@400: NULL, etisserant@400: NULL, etisserant@400: NULL, etisserant@400: NULL, etisserant@400: }; etisserant@400: subindex SillySlave_Index1800[] = etisserant@400: { etisserant@400: { RO, uint8, sizeof (UNS8), (void*)&SillySlave_highestSubIndex_obj1800 }, etisserant@400: { RW, uint32, sizeof (UNS32), (void*)&SillySlave_obj1800_COB_ID_used_by_PDO }, etisserant@400: { RW, uint8, sizeof (UNS8), (void*)&SillySlave_obj1800_Transmission_Type }, etisserant@400: { RW, uint16, sizeof (UNS16), (void*)&SillySlave_obj1800_Inhibit_Time }, etisserant@400: { RW, uint8, sizeof (UNS8), (void*)&SillySlave_obj1800_Compatibility_Entry }, etisserant@400: { RW, uint16, sizeof (UNS16), (void*)&SillySlave_obj1800_Event_Timer } etisserant@400: }; etisserant@400: etisserant@400: /* index 0x1A00 : Transmit PDO 1 Mapping. */ etisserant@400: UNS8 SillySlave_highestSubIndex_obj1A00 = 1; /* number of subindex - 1*/ etisserant@400: UNS32 SillySlave_obj1A00[] = etisserant@400: { etisserant@400: 0x20010008 /* 536936456 */ etisserant@400: }; etisserant@400: subindex SillySlave_Index1A00[] = etisserant@400: { etisserant@400: { RW, uint8, sizeof (UNS8), (void*)&SillySlave_highestSubIndex_obj1A00 }, etisserant@400: { RW, uint32, sizeof (UNS32), (void*)&SillySlave_obj1A00[0] } etisserant@400: }; etisserant@400: etisserant@400: /* index 0x2001 : Mapped variable LifeSignal */ etisserant@400: subindex SillySlave_Index2001[] = etisserant@400: { etisserant@400: { RO, uint8, sizeof (UNS8), (void*)&LifeSignal } etisserant@400: }; etisserant@400: etisserant@400: const indextable SillySlave_objdict[] = etisserant@400: { etisserant@400: { (subindex*)SillySlave_Index1000,sizeof(SillySlave_Index1000)/sizeof(SillySlave_Index1000[0]), 0x1000}, etisserant@400: { (subindex*)SillySlave_Index1001,sizeof(SillySlave_Index1001)/sizeof(SillySlave_Index1001[0]), 0x1001}, etisserant@400: { (subindex*)SillySlave_Index1012,sizeof(SillySlave_Index1012)/sizeof(SillySlave_Index1012[0]), 0x1012}, etisserant@400: { (subindex*)SillySlave_Index1013,sizeof(SillySlave_Index1013)/sizeof(SillySlave_Index1013[0]), 0x1013}, etisserant@400: { (subindex*)SillySlave_Index1018,sizeof(SillySlave_Index1018)/sizeof(SillySlave_Index1018[0]), 0x1018}, etisserant@400: { (subindex*)SillySlave_Index1200,sizeof(SillySlave_Index1200)/sizeof(SillySlave_Index1200[0]), 0x1200}, etisserant@400: { (subindex*)SillySlave_Index1800,sizeof(SillySlave_Index1800)/sizeof(SillySlave_Index1800[0]), 0x1800}, etisserant@400: { (subindex*)SillySlave_Index1A00,sizeof(SillySlave_Index1A00)/sizeof(SillySlave_Index1A00[0]), 0x1A00}, etisserant@400: { (subindex*)SillySlave_Index2001,sizeof(SillySlave_Index2001)/sizeof(SillySlave_Index2001[0]), 0x2001}, etisserant@400: }; etisserant@400: etisserant@400: const indextable * SillySlave_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks) etisserant@400: { etisserant@400: int i; etisserant@400: *callbacks = NULL; etisserant@400: switch(wIndex){ etisserant@400: case 0x1000: i = 0;break; etisserant@400: case 0x1001: i = 1;break; etisserant@400: case 0x1012: i = 2;break; etisserant@400: case 0x1013: i = 3;break; etisserant@400: case 0x1018: i = 4;break; etisserant@400: case 0x1200: i = 5;*callbacks = SillySlave_Index1200_callbacks; break; etisserant@400: case 0x1800: i = 6;*callbacks = SillySlave_Index1800_callbacks; break; etisserant@400: case 0x1A00: i = 7;break; etisserant@400: case 0x2001: i = 8;break; etisserant@400: default: etisserant@400: *errorCode = OD_NO_SUCH_OBJECT; etisserant@400: return NULL; etisserant@400: } etisserant@400: *errorCode = OD_SUCCESSFUL; etisserant@400: return &SillySlave_objdict[i]; etisserant@400: } etisserant@400: etisserant@400: /* etisserant@400: * To count at which received SYNC a PDO must be sent. etisserant@400: * Even if no pdoTransmit are defined, at least one entry is computed etisserant@400: * for compilations issues. etisserant@400: */ etisserant@400: s_PDO_status SillySlave_PDO_status[1] = {s_PDO_status_Initializer}; etisserant@400: etisserant@400: quick_index SillySlave_firstIndex = { etisserant@400: 5, /* SDO_SVR */ etisserant@400: 0, /* SDO_CLT */ etisserant@400: 0, /* PDO_RCV */ etisserant@400: 0, /* PDO_RCV_MAP */ etisserant@400: 6, /* PDO_TRS */ etisserant@400: 7 /* PDO_TRS_MAP */ etisserant@400: }; etisserant@400: etisserant@400: quick_index SillySlave_lastIndex = { etisserant@400: 5, /* SDO_SVR */ etisserant@400: 0, /* SDO_CLT */ etisserant@400: 0, /* PDO_RCV */ etisserant@400: 0, /* PDO_RCV_MAP */ etisserant@400: 6, /* PDO_TRS */ etisserant@400: 7 /* PDO_TRS_MAP */ etisserant@400: }; etisserant@400: etisserant@400: UNS16 SillySlave_ObjdictSize = sizeof(SillySlave_objdict)/sizeof(SillySlave_objdict[0]); etisserant@400: etisserant@400: CO_Data SillySlave_Data = CANOPEN_NODE_DATA_INITIALIZER(SillySlave); etisserant@400: