etisserant@0: /* etisserant@0: This file is part of CanFestival, a library implementing CanOpen Stack. etisserant@0: etisserant@0: Copyright (C): Edouard TISSERANT and Francis DUPIN etisserant@0: etisserant@0: See COPYING file for copyrights details. etisserant@0: etisserant@0: This library is free software; you can redistribute it and/or etisserant@0: modify it under the terms of the GNU Lesser General Public etisserant@0: License as published by the Free Software Foundation; either etisserant@0: version 2.1 of the License, or (at your option) any later version. etisserant@0: etisserant@0: This library is distributed in the hope that it will be useful, etisserant@0: but WITHOUT ANY WARRANTY; without even the implied warranty of etisserant@0: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU etisserant@0: Lesser General Public License for more details. etisserant@0: etisserant@0: You should have received a copy of the GNU Lesser General Public etisserant@0: License along with this library; if not, write to the Free Software etisserant@0: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA etisserant@0: */ etisserant@0: etisserant@0: /* File generated by gen_cfile.py. Should not be modified. */ etisserant@0: etisserant@0: #include "TestSlave.h" etisserant@0: etisserant@0: /**************************************************************************/ etisserant@0: /* Declaration of the mapped variables */ etisserant@0: /**************************************************************************/ etisserant@0: UNS8 SlaveMap1 = 0x0; // Mapped at index 0x2000, subindex 0x00 etisserant@0: UNS8 SlaveMap2 = 0x0; // Mapped at index 0x2001, subindex 0x00 etisserant@0: UNS8 SlaveMap3 = 0x0; // Mapped at index 0x2002, subindex 0x00 etisserant@0: UNS8 SlaveMap4 = 0x0; // Mapped at index 0x2003, subindex 0x00 etisserant@0: etisserant@0: /**************************************************************************/ etisserant@0: /* Declaration of the value range types */ etisserant@0: /**************************************************************************/ etisserant@0: etisserant@0: UNS32 TestSlave_valueRangeTest (UNS8 typeValue, void * value) etisserant@0: { etisserant@0: switch (typeValue) { etisserant@0: } etisserant@0: return 0; etisserant@0: } etisserant@0: etisserant@0: /**************************************************************************/ etisserant@0: /* The node id */ etisserant@0: /**************************************************************************/ etisserant@0: /* node_id default value.*/ etisserant@0: UNS8 TestSlave_bDeviceNodeId = 0x00; etisserant@0: etisserant@0: //*****************************************************************************/ etisserant@0: /* Array of message processing information */ etisserant@0: etisserant@0: const UNS8 TestSlave_iam_a_slave = 1; etisserant@0: etisserant@0: TIMER_HANDLE TestSlave_heartBeatTimers[0]; etisserant@0: etisserant@0: //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ etisserant@0: // etisserant@0: // OBJECT DICTIONARY etisserant@0: // etisserant@0: //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ etisserant@0: etisserant@0: /* index 0x1000 : Device Type. */ etisserant@0: UNS32 TestSlave_obj1000 = 0x12D; etisserant@0: subindex TestSlave_Index1000[] = etisserant@0: { etisserant@0: { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1000 } etisserant@0: }; etisserant@0: etisserant@0: /* index 0x1001 : Error Register. */ etisserant@0: UNS8 TestSlave_obj1001 = 0x0; etisserant@0: subindex TestSlave_Index1001[] = etisserant@0: { etisserant@0: { RO, uint8, sizeof (UNS8), (void*)&TestSlave_obj1001 } etisserant@0: }; etisserant@0: etisserant@0: /* index 0x1005 : SYNC COB ID. */ etisserant@0: UNS32 TestSlave_obj1005 = 0x80; etisserant@0: ODCallback_t TestSlave_Index1005_callbacks[] = etisserant@0: { etisserant@0: NULL, etisserant@0: }; etisserant@0: subindex TestSlave_Index1005[] = etisserant@0: { etisserant@0: { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1005 } etisserant@0: }; etisserant@0: etisserant@0: /* index 0x1006 : Communication / Cycle Period. */ etisserant@0: UNS32 TestSlave_obj1006 = 0x0; etisserant@0: ODCallback_t TestSlave_Index1006_callbacks[] = etisserant@0: { etisserant@0: NULL, etisserant@0: }; etisserant@0: subindex TestSlave_Index1006[] = etisserant@0: { etisserant@0: { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1006 } etisserant@0: }; etisserant@0: etisserant@0: /* index 0x1016 : Consumer Heartbeat Time */ etisserant@0: UNS8 TestSlave_highestSubIndex_obj1016 = 0; etisserant@0: UNS32 TestSlave_obj1016[0]; etisserant@0: subindex TestSlave_Index1016[0]; etisserant@0: etisserant@0: /* index 0x1017 : Producer Heartbeat Time. */ etisserant@0: UNS16 TestSlave_obj1017 = 0x3E8; etisserant@0: subindex TestSlave_Index1017[] = etisserant@0: { etisserant@0: { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1017 } etisserant@0: }; etisserant@0: etisserant@0: /* index 0x1018 : Identity. */ etisserant@0: UNS8 TestSlave_highestSubIndex_obj1018 = 4; // number of subindex - 1 etisserant@0: UNS32 TestSlave_obj1018_Vendor_ID = 0x0; etisserant@0: UNS32 TestSlave_obj1018_Product_Code = 0x0; etisserant@0: UNS32 TestSlave_obj1018_Revision_Number = 0x0; etisserant@0: UNS32 TestSlave_obj1018_Serial_Number = 0x0; etisserant@0: subindex TestSlave_Index1018[] = etisserant@0: { etisserant@0: { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1018 }, etisserant@0: { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Vendor_ID }, etisserant@0: { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Product_Code }, etisserant@0: { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Revision_Number }, etisserant@0: { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Serial_Number } etisserant@0: }; etisserant@0: etisserant@0: /* index 0x1200 : Server SDO Parameter. */ etisserant@0: UNS8 TestSlave_highestSubIndex_obj1200 = 2; // number of subindex - 1 etisserant@0: UNS32 TestSlave_obj1200_COB_ID_Client_to_Server_Receive_SDO = 0x601; etisserant@0: UNS32 TestSlave_obj1200_COB_ID_Server_to_Client_Transmit_SDO = 0x581; etisserant@0: subindex TestSlave_Index1200[] = etisserant@0: { etisserant@0: { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1200 }, etisserant@0: { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1200_COB_ID_Client_to_Server_Receive_SDO }, etisserant@0: { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1200_COB_ID_Server_to_Client_Transmit_SDO } etisserant@0: }; etisserant@0: etisserant@0: /* index 0x1800 : Transmit PDO 1 Parameter. */ etisserant@0: UNS8 TestSlave_highestSubIndex_obj1800 = 5; // number of subindex - 1 etisserant@0: UNS32 TestSlave_obj1800_COB_ID_used_by_PDO = 0x182; etisserant@0: UNS8 TestSlave_obj1800_Transmission_Type = 0x1; etisserant@0: UNS16 TestSlave_obj1800_Inhibit_Time = 0x0; etisserant@0: UNS16 TestSlave_obj1800_Compatibility_Entry = 0x0; etisserant@0: UNS16 TestSlave_obj1800_Event_Timer = 0x0; etisserant@0: subindex TestSlave_Index1800[] = etisserant@0: { etisserant@0: { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1800 }, etisserant@0: { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1800_COB_ID_used_by_PDO }, etisserant@0: { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1800_Transmission_Type }, etisserant@0: { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1800_Inhibit_Time }, etisserant@0: { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1800_Compatibility_Entry }, etisserant@0: { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1800_Event_Timer } etisserant@0: }; etisserant@0: etisserant@0: /* index 0x1801 : Transmit PDO 2 Parameter. */ etisserant@0: UNS8 TestSlave_highestSubIndex_obj1801 = 5; // number of subindex - 1 etisserant@0: UNS32 TestSlave_obj1801_COB_ID_used_by_PDO = 0x282; etisserant@0: UNS8 TestSlave_obj1801_Transmission_Type = 0x1; etisserant@0: UNS16 TestSlave_obj1801_Inhibit_Time = 0x0; etisserant@0: UNS16 TestSlave_obj1801_Compatibility_Entry = 0x0; etisserant@0: UNS16 TestSlave_obj1801_Event_Timer = 0x0; etisserant@0: subindex TestSlave_Index1801[] = etisserant@0: { etisserant@0: { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1801 }, etisserant@0: { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1801_COB_ID_used_by_PDO }, etisserant@0: { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1801_Transmission_Type }, etisserant@0: { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1801_Inhibit_Time }, etisserant@0: { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1801_Compatibility_Entry }, etisserant@0: { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1801_Event_Timer } etisserant@0: }; etisserant@0: etisserant@0: /* index 0x1A00 : Transmit PDO 1 Mapping. */ etisserant@0: UNS8 TestSlave_highestSubIndex_obj1A00 = 2; // number of subindex - 1 etisserant@0: UNS32 TestSlave_obj1A00[] = etisserant@0: { etisserant@0: 536870920, etisserant@0: 536936456 etisserant@0: }; etisserant@0: subindex TestSlave_Index1A00[] = etisserant@0: { etisserant@0: { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1A00 }, etisserant@0: { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[0] }, etisserant@0: { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[1] } etisserant@0: }; etisserant@0: etisserant@0: /* index 0x1A01 : Transmit PDO 2 Mapping. */ etisserant@0: UNS8 TestSlave_highestSubIndex_obj1A01 = 2; // number of subindex - 1 etisserant@0: UNS32 TestSlave_obj1A01[] = etisserant@0: { etisserant@0: 537001992, etisserant@0: 537067528 etisserant@0: }; etisserant@0: subindex TestSlave_Index1A01[] = etisserant@0: { etisserant@0: { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1A01 }, etisserant@0: { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A01[0] }, etisserant@0: { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A01[1] } etisserant@0: }; etisserant@0: etisserant@0: /* index 0x2000 : Mapped variable SlaveMap1 */ etisserant@0: subindex TestSlave_Index2000[] = etisserant@0: { etisserant@0: { RW, uint8, sizeof (UNS8), (void*)&SlaveMap1 } etisserant@0: }; etisserant@0: etisserant@0: /* index 0x2001 : Mapped variable SlaveMap2 */ etisserant@0: subindex TestSlave_Index2001[] = etisserant@0: { etisserant@0: { RW, uint8, sizeof (UNS8), (void*)&SlaveMap2 } etisserant@0: }; etisserant@0: etisserant@0: /* index 0x2002 : Mapped variable SlaveMap3 */ etisserant@0: subindex TestSlave_Index2002[] = etisserant@0: { etisserant@0: { RW, uint8, sizeof (UNS8), (void*)&SlaveMap3 } etisserant@0: }; etisserant@0: etisserant@0: /* index 0x2003 : Mapped variable SlaveMap4 */ etisserant@0: subindex TestSlave_Index2003[] = etisserant@0: { etisserant@0: { RW, uint8, sizeof (UNS8), (void*)&SlaveMap4 } etisserant@0: }; etisserant@0: etisserant@0: const indextable TestSlave_objdict[] = etisserant@0: { etisserant@0: { (subindex*)TestSlave_Index1000,sizeof(TestSlave_Index1000)/sizeof(TestSlave_Index1000[0]), 0x1000}, etisserant@0: { (subindex*)TestSlave_Index1001,sizeof(TestSlave_Index1001)/sizeof(TestSlave_Index1001[0]), 0x1001}, etisserant@0: { (subindex*)TestSlave_Index1005,sizeof(TestSlave_Index1005)/sizeof(TestSlave_Index1005[0]), 0x1005}, etisserant@0: { (subindex*)TestSlave_Index1006,sizeof(TestSlave_Index1006)/sizeof(TestSlave_Index1006[0]), 0x1006}, etisserant@0: { (subindex*)TestSlave_Index1017,sizeof(TestSlave_Index1017)/sizeof(TestSlave_Index1017[0]), 0x1017}, etisserant@0: { (subindex*)TestSlave_Index1018,sizeof(TestSlave_Index1018)/sizeof(TestSlave_Index1018[0]), 0x1018}, etisserant@0: { (subindex*)TestSlave_Index1200,sizeof(TestSlave_Index1200)/sizeof(TestSlave_Index1200[0]), 0x1200}, etisserant@0: { (subindex*)TestSlave_Index1800,sizeof(TestSlave_Index1800)/sizeof(TestSlave_Index1800[0]), 0x1800}, etisserant@0: { (subindex*)TestSlave_Index1801,sizeof(TestSlave_Index1801)/sizeof(TestSlave_Index1801[0]), 0x1801}, etisserant@0: { (subindex*)TestSlave_Index1A00,sizeof(TestSlave_Index1A00)/sizeof(TestSlave_Index1A00[0]), 0x1A00}, etisserant@0: { (subindex*)TestSlave_Index1A01,sizeof(TestSlave_Index1A01)/sizeof(TestSlave_Index1A01[0]), 0x1A01}, etisserant@0: { (subindex*)TestSlave_Index2000,sizeof(TestSlave_Index2000)/sizeof(TestSlave_Index2000[0]), 0x2000}, etisserant@0: { (subindex*)TestSlave_Index2001,sizeof(TestSlave_Index2001)/sizeof(TestSlave_Index2001[0]), 0x2001}, etisserant@0: { (subindex*)TestSlave_Index2002,sizeof(TestSlave_Index2002)/sizeof(TestSlave_Index2002[0]), 0x2002}, etisserant@0: { (subindex*)TestSlave_Index2003,sizeof(TestSlave_Index2003)/sizeof(TestSlave_Index2003[0]), 0x2003}, etisserant@0: }; etisserant@0: etisserant@0: const indextable * TestSlave_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks) etisserant@0: { etisserant@0: int i; etisserant@0: switch(wIndex){ etisserant@0: case 0x1000: i = 0; *callbacks = NULL; break; etisserant@0: case 0x1001: i = 1; *callbacks = NULL; break; etisserant@0: case 0x1005: i = 2; *callbacks = TestSlave_Index1005_callbacks; break; etisserant@0: case 0x1006: i = 3; *callbacks = TestSlave_Index1006_callbacks; break; etisserant@0: case 0x1017: i = 4; *callbacks = NULL; break; etisserant@0: case 0x1018: i = 5; *callbacks = NULL; break; etisserant@0: case 0x1200: i = 6; *callbacks = NULL; break; etisserant@0: case 0x1800: i = 7; *callbacks = NULL; break; etisserant@0: case 0x1801: i = 8; *callbacks = NULL; break; etisserant@0: case 0x1A00: i = 9; *callbacks = NULL; break; etisserant@0: case 0x1A01: i = 10; *callbacks = NULL; break; etisserant@0: case 0x2000: i = 11; *callbacks = NULL; break; etisserant@0: case 0x2001: i = 12; *callbacks = NULL; break; etisserant@0: case 0x2002: i = 13; *callbacks = NULL; break; etisserant@0: case 0x2003: i = 14; *callbacks = NULL; break; etisserant@0: default: etisserant@0: *errorCode = OD_NO_SUCH_OBJECT; etisserant@0: return NULL; etisserant@0: } etisserant@0: *errorCode = OD_SUCCESSFUL; etisserant@0: return &TestSlave_objdict[i]; etisserant@0: } etisserant@0: etisserant@0: // To count at which received SYNC a PDO must be sent. etisserant@0: // Even if no pdoTransmit are defined, at least one entry is computed etisserant@0: // for compilations issues. etisserant@0: UNS8 TestSlave_count_sync[2] = {0,}; etisserant@0: etisserant@0: quick_index TestSlave_firstIndex = { etisserant@0: SDO_SVR : 6, etisserant@0: SDO_CLT : 0, etisserant@0: PDO_RCV : 0, etisserant@0: PDO_RCV_MAP : 0, etisserant@0: PDO_TRS : 7, etisserant@0: PDO_TRS_MAP : 9 etisserant@0: }; etisserant@0: etisserant@0: quick_index TestSlave_lastIndex = { etisserant@0: SDO_SVR : 6, etisserant@0: SDO_CLT : 0, etisserant@0: PDO_RCV : 0, etisserant@0: PDO_RCV_MAP : 0, etisserant@0: PDO_TRS : 8, etisserant@0: PDO_TRS_MAP : 10 etisserant@0: }; etisserant@0: etisserant@0: UNS16 TestSlave_ObjdictSize = sizeof(TestSlave_objdict)/sizeof(TestSlave_objdict[0]); etisserant@0: etisserant@0: CO_Data TestSlave_Data = CANOPEN_NODE_DATA_INITIALIZER(TestSlave); etisserant@0: