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: frdupin@54: /* File generated by gen_cfile.py. Should not be modified. */ frdupin@54: etisserant@0: #include "objdict.h" etisserant@0: etisserant@0: /**************************************************************************/ etisserant@0: /* Declaration of the mapped variables */ etisserant@0: /**************************************************************************/ frdupin@54: UNS16 acceptanceFilter1 = 0x0; // Mapped at index 0x2015, subindex 0x00 frdupin@54: UNS16 acceptanceFilter2 = 0x0; // Mapped at index 0x2016, subindex 0x00 frdupin@54: UNS16 acceptanceFilter3 = 0x0; // Mapped at index 0x2017, subindex 0x00 frdupin@54: UNS16 acceptanceFilter4 = 0x0; // Mapped at index 0x2018, subindex 0x00 frdupin@54: UNS16 mask1 = 0x0; // Mapped at index 0x2019, subindex 0x00 frdupin@54: UNS16 mask2 = 0x0; // Mapped at index 0x2020, subindex 0x00 frdupin@54: UNS16 mask3 = 0x0; // Mapped at index 0x2021, subindex 0x00 frdupin@54: UNS16 mask4 = 0x0; // Mapped at index 0x2022, subindex 0x00 frdupin@54: UNS8 applyDownloadedFilters = 0x0; // Mapped at index 0x2023, subindex 0x00 etisserant@0: etisserant@0: /**************************************************************************/ etisserant@0: /* Declaration of the value range types */ etisserant@0: /**************************************************************************/ etisserant@0: frdupin@54: UNS32 gene_SYNC_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: /**************************************************************************/ frdupin@54: /* node_id default value.*/ frdupin@54: UNS8 gene_SYNC_bDeviceNodeId = 0x03; etisserant@0: etisserant@0: //*****************************************************************************/ etisserant@0: /* Array of message processing information */ etisserant@0: etisserant@0: const UNS8 gene_SYNC_iam_a_slave = 1; etisserant@0: frdupin@54: TIMER_HANDLE gene_SYNC_heartBeatTimers[0]; etisserant@0: etisserant@0: //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ etisserant@0: // etisserant@0: // OBJECT DICTIONARY etisserant@0: // etisserant@0: //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ frdupin@54: frdupin@54: /* index 0x1000 : Device Type. */ frdupin@54: UNS32 gene_SYNC_obj1000 = 0x0; // 0 frdupin@54: subindex gene_SYNC_Index1000[] = frdupin@54: { frdupin@54: { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1000 } frdupin@54: }; frdupin@54: frdupin@54: /* index 0x1001 : Error Register. */ frdupin@54: UNS8 gene_SYNC_obj1001 = 0x0; // 0 frdupin@54: subindex gene_SYNC_Index1001[] = frdupin@54: { frdupin@54: { RO, uint8, sizeof (UNS8), (void*)&gene_SYNC_obj1001 } frdupin@54: }; frdupin@54: frdupin@54: /* index 0x1005 : SYNC COB ID. */ frdupin@54: UNS32 gene_SYNC_obj1005 = 0x40000080; // 1073741952 frdupin@54: ODCallback_t gene_SYNC_Index1005_callbacks[] = frdupin@54: { frdupin@54: NULL, frdupin@54: }; frdupin@54: subindex gene_SYNC_Index1005[] = frdupin@54: { frdupin@54: { RW, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1005 } frdupin@54: }; frdupin@54: frdupin@54: /* index 0x1006 : Communication / Cycle Period. */ frdupin@54: UNS32 gene_SYNC_obj1006 = 0x2710; // 10000 frdupin@54: ODCallback_t gene_SYNC_Index1006_callbacks[] = frdupin@54: { frdupin@54: NULL, frdupin@54: }; frdupin@54: subindex gene_SYNC_Index1006[] = frdupin@54: { frdupin@54: { RW, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1006 } frdupin@54: }; frdupin@54: frdupin@54: /* index 0x1008 : Manufacturer Device Name. */ frdupin@54: UNS8 gene_SYNC_obj1008[10] = "GENE_SYNC"; frdupin@54: subindex gene_SYNC_Index1008[] = frdupin@54: { frdupin@54: { RO, visible_string, sizeof (gene_SYNC_obj1008), (void*)&gene_SYNC_obj1008 } frdupin@54: }; frdupin@54: frdupin@54: /* index 0x1016 : Consumer Heartbeat Time */ frdupin@54: UNS8 gene_SYNC_highestSubIndex_obj1016 = 0; frdupin@54: UNS32 gene_SYNC_obj1016[0]; etisserant@0: subindex gene_SYNC_Index1016[0]; etisserant@0: frdupin@54: /* index 0x1017 : Producer Heartbeat Time */ frdupin@54: UNS16 gene_SYNC_obj1017 = 0x0; // 0 frdupin@54: frdupin@54: /* index 0x1018 : Identity. */ frdupin@54: UNS8 gene_SYNC_highestSubIndex_obj1018 = 4; // number of subindex - 1 frdupin@54: UNS32 gene_SYNC_obj1018_Vendor_ID = 0x0; // 0 frdupin@54: UNS32 gene_SYNC_obj1018_Product_Code = 0x0; // 0 frdupin@54: UNS32 gene_SYNC_obj1018_Revision_Number = 0x0; // 0 frdupin@54: UNS32 gene_SYNC_obj1018_Serial_Number = 0x0; // 0 frdupin@54: subindex gene_SYNC_Index1018[] = frdupin@54: { frdupin@54: { RO, uint8, sizeof (UNS8), (void*)&gene_SYNC_highestSubIndex_obj1018 }, frdupin@54: { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1018_Vendor_ID }, frdupin@54: { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1018_Product_Code }, frdupin@54: { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1018_Revision_Number }, frdupin@54: { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1018_Serial_Number } frdupin@54: }; frdupin@54: frdupin@54: /* index 0x1200 : Server SDO Parameter. */ frdupin@54: UNS8 gene_SYNC_highestSubIndex_obj1200 = 2; // number of subindex - 1 frdupin@54: UNS32 gene_SYNC_obj1200_COB_ID_Client_to_Server_Receive_SDO = 0x0; // 0 frdupin@54: UNS32 gene_SYNC_obj1200_COB_ID_Server_to_Client_Transmit_SDO = 0x0; // 0 frdupin@54: subindex gene_SYNC_Index1200[] = frdupin@54: { frdupin@54: { RO, uint8, sizeof (UNS8), (void*)&gene_SYNC_highestSubIndex_obj1200 }, frdupin@54: { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1200_COB_ID_Client_to_Server_Receive_SDO }, frdupin@54: { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1200_COB_ID_Server_to_Client_Transmit_SDO } frdupin@54: }; frdupin@54: frdupin@54: /* index 0x2015 : Mapped variable acceptanceFilter1 */ frdupin@54: subindex gene_SYNC_Index2015[] = frdupin@54: { frdupin@54: { RW, uint16, sizeof (UNS16), (void*)&acceptanceFilter1 } frdupin@54: }; frdupin@54: frdupin@54: /* index 0x2016 : Mapped variable acceptanceFilter2 */ frdupin@54: subindex gene_SYNC_Index2016[] = frdupin@54: { frdupin@54: { RW, uint16, sizeof (UNS16), (void*)&acceptanceFilter2 } frdupin@54: }; frdupin@54: frdupin@54: /* index 0x2017 : Mapped variable acceptanceFilter3 */ frdupin@54: subindex gene_SYNC_Index2017[] = frdupin@54: { frdupin@54: { RW, uint16, sizeof (UNS16), (void*)&acceptanceFilter3 } frdupin@54: }; frdupin@54: frdupin@54: /* index 0x2018 : Mapped variable acceptanceFilter4 */ frdupin@54: subindex gene_SYNC_Index2018[] = frdupin@54: { frdupin@54: { RW, uint16, sizeof (UNS16), (void*)&acceptanceFilter4 } frdupin@54: }; frdupin@54: frdupin@54: /* index 0x2019 : Mapped variable mask1 */ frdupin@54: subindex gene_SYNC_Index2019[] = frdupin@54: { frdupin@54: { RW, uint16, sizeof (UNS16), (void*)&mask1 } frdupin@54: }; frdupin@54: frdupin@54: /* index 0x2020 : Mapped variable mask2 */ frdupin@54: subindex gene_SYNC_Index2020[] = frdupin@54: { frdupin@54: { RW, uint16, sizeof (UNS16), (void*)&mask2 } frdupin@54: }; frdupin@54: frdupin@54: /* index 0x2021 : Mapped variable mask3 */ frdupin@54: subindex gene_SYNC_Index2021[] = frdupin@54: { frdupin@54: { RW, uint16, sizeof (UNS16), (void*)&mask3 } frdupin@54: }; frdupin@54: frdupin@54: /* index 0x2022 : Mapped variable mask4 */ frdupin@54: subindex gene_SYNC_Index2022[] = frdupin@54: { frdupin@54: { RW, uint16, sizeof (UNS16), (void*)&mask4 } frdupin@54: }; frdupin@54: frdupin@54: /* index 0x2023 : Mapped variable applyDownloadedFilters */ frdupin@54: subindex gene_SYNC_Index2023[] = frdupin@54: { frdupin@54: { RW, uint8, sizeof (UNS8), (void*)&applyDownloadedFilters } frdupin@54: }; etisserant@0: etisserant@0: const indextable gene_SYNC_objdict[] = etisserant@0: { frdupin@54: { (subindex*)gene_SYNC_Index1000,sizeof(gene_SYNC_Index1000)/sizeof(gene_SYNC_Index1000[0]), 0x1000}, frdupin@54: { (subindex*)gene_SYNC_Index1001,sizeof(gene_SYNC_Index1001)/sizeof(gene_SYNC_Index1001[0]), 0x1001}, frdupin@54: { (subindex*)gene_SYNC_Index1005,sizeof(gene_SYNC_Index1005)/sizeof(gene_SYNC_Index1005[0]), 0x1005}, frdupin@54: { (subindex*)gene_SYNC_Index1006,sizeof(gene_SYNC_Index1006)/sizeof(gene_SYNC_Index1006[0]), 0x1006}, frdupin@54: { (subindex*)gene_SYNC_Index1008,sizeof(gene_SYNC_Index1008)/sizeof(gene_SYNC_Index1008[0]), 0x1008}, frdupin@54: { (subindex*)gene_SYNC_Index1018,sizeof(gene_SYNC_Index1018)/sizeof(gene_SYNC_Index1018[0]), 0x1018}, frdupin@54: { (subindex*)gene_SYNC_Index1200,sizeof(gene_SYNC_Index1200)/sizeof(gene_SYNC_Index1200[0]), 0x1200}, frdupin@54: { (subindex*)gene_SYNC_Index2015,sizeof(gene_SYNC_Index2015)/sizeof(gene_SYNC_Index2015[0]), 0x2015}, frdupin@54: { (subindex*)gene_SYNC_Index2016,sizeof(gene_SYNC_Index2016)/sizeof(gene_SYNC_Index2016[0]), 0x2016}, frdupin@54: { (subindex*)gene_SYNC_Index2017,sizeof(gene_SYNC_Index2017)/sizeof(gene_SYNC_Index2017[0]), 0x2017}, frdupin@54: { (subindex*)gene_SYNC_Index2018,sizeof(gene_SYNC_Index2018)/sizeof(gene_SYNC_Index2018[0]), 0x2018}, frdupin@54: { (subindex*)gene_SYNC_Index2019,sizeof(gene_SYNC_Index2019)/sizeof(gene_SYNC_Index2019[0]), 0x2019}, frdupin@54: { (subindex*)gene_SYNC_Index2020,sizeof(gene_SYNC_Index2020)/sizeof(gene_SYNC_Index2020[0]), 0x2020}, frdupin@54: { (subindex*)gene_SYNC_Index2021,sizeof(gene_SYNC_Index2021)/sizeof(gene_SYNC_Index2021[0]), 0x2021}, frdupin@54: { (subindex*)gene_SYNC_Index2022,sizeof(gene_SYNC_Index2022)/sizeof(gene_SYNC_Index2022[0]), 0x2022}, frdupin@54: { (subindex*)gene_SYNC_Index2023,sizeof(gene_SYNC_Index2023)/sizeof(gene_SYNC_Index2023[0]), 0x2023}, etisserant@0: }; etisserant@0: frdupin@54: const indextable * gene_SYNC_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks) frdupin@54: { frdupin@54: int i; frdupin@54: *callbacks = NULL; frdupin@54: switch(wIndex){ frdupin@54: case 0x1000: i = 0;break; frdupin@54: case 0x1001: i = 1;break; frdupin@54: case 0x1005: i = 2;*callbacks = gene_SYNC_Index1005_callbacks; break; frdupin@54: case 0x1006: i = 3;*callbacks = gene_SYNC_Index1006_callbacks; break; frdupin@54: case 0x1008: i = 4;break; frdupin@54: case 0x1018: i = 5;break; frdupin@54: case 0x1200: i = 6;break; frdupin@54: case 0x2015: i = 7;break; frdupin@54: case 0x2016: i = 8;break; frdupin@54: case 0x2017: i = 9;break; frdupin@54: case 0x2018: i = 10;break; frdupin@54: case 0x2019: i = 11;break; frdupin@54: case 0x2020: i = 12;break; frdupin@54: case 0x2021: i = 13;break; frdupin@54: case 0x2022: i = 14;break; frdupin@54: case 0x2023: i = 15;break; frdupin@54: default: frdupin@54: *errorCode = OD_NO_SUCH_OBJECT; frdupin@54: return NULL; frdupin@54: } frdupin@54: *errorCode = OD_SUCCESSFUL; frdupin@54: return &gene_SYNC_objdict[i]; frdupin@54: } frdupin@54: 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. frdupin@54: UNS8 gene_SYNC_count_sync[1] = {0,}; etisserant@0: etisserant@0: quick_index gene_SYNC_firstIndex = { frdupin@54: SDO_SVR : 6, frdupin@54: SDO_CLT : 0, frdupin@54: PDO_RCV : 0, frdupin@54: PDO_RCV_MAP : 0, frdupin@54: PDO_TRS : 0, frdupin@54: PDO_TRS_MAP : 0 etisserant@0: }; etisserant@0: etisserant@0: quick_index gene_SYNC_lastIndex = { frdupin@54: SDO_SVR : 6, frdupin@54: SDO_CLT : 0, frdupin@54: PDO_RCV : 0, frdupin@54: PDO_RCV_MAP : 0, frdupin@54: PDO_TRS : 0, frdupin@54: PDO_TRS_MAP : 0 etisserant@0: }; etisserant@0: etisserant@0: UNS16 gene_SYNC_ObjdictSize = sizeof(gene_SYNC_objdict)/sizeof(gene_SYNC_objdict[0]); etisserant@0: etisserant@0: CO_Data gene_SYNC_Data = CANOPEN_NODE_DATA_INITIALIZER(gene_SYNC); etisserant@0: