examples/gene_SYNC_HCS12/objdict.c
changeset 80 37354e408645
parent 54 a2ca09ac1523
equal deleted inserted replaced
79:9d8959095936 80:37354e408645
     1 /*
       
     2 This file is part of CanFestival, a library implementing CanOpen Stack. 
       
     3 
       
     4 Copyright (C): Edouard TISSERANT and Francis DUPIN
       
     5 
       
     6 See COPYING file for copyrights details.
       
     7 
       
     8 This library is free software; you can redistribute it and/or
       
     9 modify it under the terms of the GNU Lesser General Public
       
    10 License as published by the Free Software Foundation; either
       
    11 version 2.1 of the License, or (at your option) any later version.
       
    12 
       
    13 This library is distributed in the hope that it will be useful,
       
    14 but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    16 Lesser General Public License for more details.
       
    17 
       
    18 You should have received a copy of the GNU Lesser General Public
       
    19 License along with this library; if not, write to the Free Software
       
    20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
       
    21 */
       
    22 
     1 
    23 /* File generated by gen_cfile.py. Should not be modified. */
     2 /* File generated by gen_cfile.py. Should not be modified. */
    24 
     3 
    25 #include "objdict.h"
     4 #include "objdict.h"
    26 
     5 
    27 /**************************************************************************/
     6 /**************************************************************************/
    28 /* Declaration of the mapped variables                                    */
     7 /* Declaration of the mapped variables                                    */
    29 /**************************************************************************/
     8 /**************************************************************************/
    30 UNS16 acceptanceFilter1 = 0x0;		// Mapped at index 0x2015, subindex 0x00
     9 UNS16 acceptanceFilter1 = 0x0;		/* Mapped at index 0x2015, subindex 0x00 */
    31 UNS16 acceptanceFilter2 = 0x0;		// Mapped at index 0x2016, subindex 0x00
    10 UNS16 acceptanceFilter2 = 0x0;		/* Mapped at index 0x2016, subindex 0x00 */
    32 UNS16 acceptanceFilter3 = 0x0;		// Mapped at index 0x2017, subindex 0x00
    11 UNS16 acceptanceFilter3 = 0x0;		/* Mapped at index 0x2017, subindex 0x00 */
    33 UNS16 acceptanceFilter4 = 0x0;		// Mapped at index 0x2018, subindex 0x00
    12 UNS16 acceptanceFilter4 = 0x0;		/* Mapped at index 0x2018, subindex 0x00 */
    34 UNS16 mask1 = 0x0;		// Mapped at index 0x2019, subindex 0x00
    13 UNS16 mask1 = 0x0;		/* Mapped at index 0x2019, subindex 0x00 */
    35 UNS16 mask2 = 0x0;		// Mapped at index 0x2020, subindex 0x00
    14 UNS16 mask2 = 0x0;		/* Mapped at index 0x2020, subindex 0x00 */
    36 UNS16 mask3 = 0x0;		// Mapped at index 0x2021, subindex 0x00
    15 UNS16 mask3 = 0x0;		/* Mapped at index 0x2021, subindex 0x00 */
    37 UNS16 mask4 = 0x0;		// Mapped at index 0x2022, subindex 0x00
    16 UNS16 mask4 = 0x0;		/* Mapped at index 0x2022, subindex 0x00 */
    38 UNS8 applyDownloadedFilters = 0x0;		// Mapped at index 0x2023, subindex 0x00
    17 UNS8 applyDownloadedFilters = 0x0;		/* Mapped at index 0x2023, subindex 0x00 */
    39 
    18 
    40 /**************************************************************************/
    19 /**************************************************************************/
    41 /* Declaration of the value range types                                   */
    20 /* Declaration of the value range types                                   */
    42 /**************************************************************************/
    21 /**************************************************************************/
    43 
    22 
    52 /* The node id                                                            */
    31 /* The node id                                                            */
    53 /**************************************************************************/
    32 /**************************************************************************/
    54 /* node_id default value.*/
    33 /* node_id default value.*/
    55 UNS8 gene_SYNC_bDeviceNodeId = 0x03;
    34 UNS8 gene_SYNC_bDeviceNodeId = 0x03;
    56 
    35 
    57 //*****************************************************************************/
    36 /**************************************************************************/
    58 /* Array of message processing information */
    37 /* Array of message processing information */
    59 
    38 
    60 const UNS8 gene_SYNC_iam_a_slave = 1;
    39 const UNS8 gene_SYNC_iam_a_slave = 1;
    61 
    40 
    62 TIMER_HANDLE gene_SYNC_heartBeatTimers[0];
    41 TIMER_HANDLE gene_SYNC_heartBeatTimers[1];
    63 
    42 
    64 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
    43 /*
    65 //
    44 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
    66 //                       OBJECT DICTIONARY
    45 
    67 //                   
    46                                OBJECT DICTIONARY
    68 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
    47 
       
    48 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
       
    49 */
    69 
    50 
    70 /* index 0x1000 :   Device Type. */
    51 /* index 0x1000 :   Device Type. */
    71                     UNS32 gene_SYNC_obj1000 = 0x0;	// 0
    52                     UNS32 gene_SYNC_obj1000 = 0x0;	/* 0 */
    72                     subindex gene_SYNC_Index1000[] = 
    53                     subindex gene_SYNC_Index1000[] = 
    73                      {
    54                      {
    74                        { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1000 }
    55                        { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1000 }
    75                      };
    56                      };
    76 
    57 
    77 /* index 0x1001 :   Error Register. */
    58 /* index 0x1001 :   Error Register. */
    78                     UNS8 gene_SYNC_obj1001 = 0x0;	// 0
    59                     UNS8 gene_SYNC_obj1001 = 0x0;	/* 0 */
    79                     subindex gene_SYNC_Index1001[] = 
    60                     subindex gene_SYNC_Index1001[] = 
    80                      {
    61                      {
    81                        { RO, uint8, sizeof (UNS8), (void*)&gene_SYNC_obj1001 }
    62                        { RO, uint8, sizeof (UNS8), (void*)&gene_SYNC_obj1001 }
    82                      };
    63                      };
    83 
    64 
    84 /* index 0x1005 :   SYNC COB ID. */
    65 /* index 0x1005 :   SYNC COB ID. */
    85                     UNS32 gene_SYNC_obj1005 = 0x40000080;	// 1073741952
    66                     UNS32 gene_SYNC_obj1005 = 0x40000080;	/* 1073741952 */
    86                     ODCallback_t gene_SYNC_Index1005_callbacks[] = 
    67                     ODCallback_t gene_SYNC_Index1005_callbacks[] = 
    87                      {
    68                      {
    88                        NULL,
    69                        NULL,
    89                      };
    70                      };
    90                     subindex gene_SYNC_Index1005[] = 
    71                     subindex gene_SYNC_Index1005[] = 
    91                      {
    72                      {
    92                        { RW, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1005 }
    73                        { RW, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1005 }
    93                      };
    74                      };
    94 
    75 
    95 /* index 0x1006 :   Communication / Cycle Period. */
    76 /* index 0x1006 :   Communication / Cycle Period. */
    96                     UNS32 gene_SYNC_obj1006 = 0x2710;	// 10000
    77                     UNS32 gene_SYNC_obj1006 = 0x2710;	/* 10000 */
    97                     ODCallback_t gene_SYNC_Index1006_callbacks[] = 
    78                     ODCallback_t gene_SYNC_Index1006_callbacks[] = 
    98                      {
    79                      {
    99                        NULL,
    80                        NULL,
   100                      };
    81                      };
   101                     subindex gene_SYNC_Index1006[] = 
    82                     subindex gene_SYNC_Index1006[] = 
   110                        { RO, visible_string, sizeof (gene_SYNC_obj1008), (void*)&gene_SYNC_obj1008 }
    91                        { RO, visible_string, sizeof (gene_SYNC_obj1008), (void*)&gene_SYNC_obj1008 }
   111                      };
    92                      };
   112 
    93 
   113 /* index 0x1016 :   Consumer Heartbeat Time */
    94 /* index 0x1016 :   Consumer Heartbeat Time */
   114                     UNS8 gene_SYNC_highestSubIndex_obj1016 = 0;
    95                     UNS8 gene_SYNC_highestSubIndex_obj1016 = 0;
   115                     UNS32 gene_SYNC_obj1016[0];
    96                     UNS32 gene_SYNC_obj1016[];
   116                     subindex gene_SYNC_Index1016[0];
    97                     subindex gene_SYNC_Index1016[];
   117 
    98 
   118 /* index 0x1017 :   Producer Heartbeat Time */ 
    99 /* index 0x1017 :   Producer Heartbeat Time */ 
   119                     UNS16 gene_SYNC_obj1017 = 0x0;   // 0
   100                     UNS16 gene_SYNC_obj1017 = 0x0;   /* 0 */
   120 
   101 
   121 /* index 0x1018 :   Identity. */
   102 /* index 0x1018 :   Identity. */
   122                     UNS8 gene_SYNC_highestSubIndex_obj1018 = 4; // number of subindex - 1
   103                     UNS8 gene_SYNC_highestSubIndex_obj1018 = 4; /* number of subindex - 1*/
   123                     UNS32 gene_SYNC_obj1018_Vendor_ID = 0x0;	// 0
   104                     UNS32 gene_SYNC_obj1018_Vendor_ID = 0x0;	/* 0 */
   124                     UNS32 gene_SYNC_obj1018_Product_Code = 0x0;	// 0
   105                     UNS32 gene_SYNC_obj1018_Product_Code = 0x0;	/* 0 */
   125                     UNS32 gene_SYNC_obj1018_Revision_Number = 0x0;	// 0
   106                     UNS32 gene_SYNC_obj1018_Revision_Number = 0x0;	/* 0 */
   126                     UNS32 gene_SYNC_obj1018_Serial_Number = 0x0;	// 0
   107                     UNS32 gene_SYNC_obj1018_Serial_Number = 0x0;	/* 0 */
   127                     subindex gene_SYNC_Index1018[] = 
   108                     subindex gene_SYNC_Index1018[] = 
   128                      {
   109                      {
   129                        { RO, uint8, sizeof (UNS8), (void*)&gene_SYNC_highestSubIndex_obj1018 },
   110                        { RO, uint8, sizeof (UNS8), (void*)&gene_SYNC_highestSubIndex_obj1018 },
   130                        { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1018_Vendor_ID },
   111                        { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1018_Vendor_ID },
   131                        { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1018_Product_Code },
   112                        { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1018_Product_Code },
   132                        { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1018_Revision_Number },
   113                        { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1018_Revision_Number },
   133                        { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1018_Serial_Number }
   114                        { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1018_Serial_Number }
   134                      };
   115                      };
   135 
   116 
   136 /* index 0x1200 :   Server SDO Parameter. */
   117 /* index 0x1200 :   Server SDO Parameter. */
   137                     UNS8 gene_SYNC_highestSubIndex_obj1200 = 2; // number of subindex - 1
   118                     UNS8 gene_SYNC_highestSubIndex_obj1200 = 2; /* number of subindex - 1*/
   138                     UNS32 gene_SYNC_obj1200_COB_ID_Client_to_Server_Receive_SDO = 0x0;	// 0
   119                     UNS32 gene_SYNC_obj1200_COB_ID_Client_to_Server_Receive_SDO = 0x0;	/* 0 */
   139                     UNS32 gene_SYNC_obj1200_COB_ID_Server_to_Client_Transmit_SDO = 0x0;	// 0
   120                     UNS32 gene_SYNC_obj1200_COB_ID_Server_to_Client_Transmit_SDO = 0x0;	/* 0 */
   140                     subindex gene_SYNC_Index1200[] = 
   121                     subindex gene_SYNC_Index1200[] = 
   141                      {
   122                      {
   142                        { RO, uint8, sizeof (UNS8), (void*)&gene_SYNC_highestSubIndex_obj1200 },
   123                        { RO, uint8, sizeof (UNS8), (void*)&gene_SYNC_highestSubIndex_obj1200 },
   143                        { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1200_COB_ID_Client_to_Server_Receive_SDO },
   124                        { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1200_COB_ID_Client_to_Server_Receive_SDO },
   144                        { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1200_COB_ID_Server_to_Client_Transmit_SDO }
   125                        { RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1200_COB_ID_Server_to_Client_Transmit_SDO }
   245 	}
   226 	}
   246 	*errorCode = OD_SUCCESSFUL;
   227 	*errorCode = OD_SUCCESSFUL;
   247 	return &gene_SYNC_objdict[i];
   228 	return &gene_SYNC_objdict[i];
   248 }
   229 }
   249 
   230 
   250 // To count at which received SYNC a PDO must be sent.
   231 /* To count at which received SYNC a PDO must be sent.
   251 // Even if no pdoTransmit are defined, at least one entry is computed
   232  * Even if no pdoTransmit are defined, at least one entry is computed
   252 // for compilations issues.
   233  * for compilations issues.
       
   234  */
   253 UNS8 gene_SYNC_count_sync[1] = {0,};
   235 UNS8 gene_SYNC_count_sync[1] = {0,};
   254 
   236 
   255 quick_index gene_SYNC_firstIndex = {
   237 quick_index gene_SYNC_firstIndex = {
   256   SDO_SVR : 6,
   238   6, /* SDO_SVR */
   257   SDO_CLT : 0,
   239   0, /* SDO_CLT */
   258   PDO_RCV : 0,
   240   0, /* PDO_RCV */
   259   PDO_RCV_MAP : 0,
   241   0, /* PDO_RCV_MAP */
   260   PDO_TRS : 0,
   242   0, /* PDO_TRS */
   261   PDO_TRS_MAP : 0
   243   0 /* PDO_TRS_MAP */
   262 };
   244 };
   263 
   245 
   264 quick_index gene_SYNC_lastIndex = {
   246 quick_index gene_SYNC_lastIndex = {
   265   SDO_SVR : 6,
   247   6, /* SDO_SVR */
   266   SDO_CLT : 0,
   248   0, /* SDO_CLT */
   267   PDO_RCV : 0,
   249   0, /* PDO_RCV */
   268   PDO_RCV_MAP : 0,
   250   0, /* PDO_RCV_MAP */
   269   PDO_TRS : 0,
   251   0, /* PDO_TRS */
   270   PDO_TRS_MAP : 0
   252   0 /* PDO_TRS_MAP */
   271 };
   253 };
   272 
   254 
   273 UNS16 gene_SYNC_ObjdictSize = sizeof(gene_SYNC_objdict)/sizeof(gene_SYNC_objdict[0]); 
   255 UNS16 gene_SYNC_ObjdictSize = sizeof(gene_SYNC_objdict)/sizeof(gene_SYNC_objdict[0]); 
   274 
   256 
   275 CO_Data gene_SYNC_Data = CANOPEN_NODE_DATA_INITIALIZER(gene_SYNC);
   257 CO_Data gene_SYNC_Data = CANOPEN_NODE_DATA_INITIALIZER(gene_SYNC);