0
|
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 |
|
54
|
23 |
/* File generated by gen_cfile.py. Should not be modified. */
|
|
24 |
|
0
|
25 |
#include "objdict.h"
|
|
26 |
|
|
27 |
/**************************************************************************/
|
|
28 |
/* Declaration of the mapped variables */
|
|
29 |
/**************************************************************************/
|
54
|
30 |
UNS16 acceptanceFilter1 = 0x0; // Mapped at index 0x2015, subindex 0x00
|
|
31 |
UNS16 acceptanceFilter2 = 0x0; // Mapped at index 0x2016, subindex 0x00
|
|
32 |
UNS16 acceptanceFilter3 = 0x0; // Mapped at index 0x2017, subindex 0x00
|
|
33 |
UNS16 acceptanceFilter4 = 0x0; // Mapped at index 0x2018, subindex 0x00
|
|
34 |
UNS16 mask1 = 0x0; // Mapped at index 0x2019, subindex 0x00
|
|
35 |
UNS16 mask2 = 0x0; // Mapped at index 0x2020, subindex 0x00
|
|
36 |
UNS16 mask3 = 0x0; // Mapped at index 0x2021, subindex 0x00
|
|
37 |
UNS16 mask4 = 0x0; // Mapped at index 0x2022, subindex 0x00
|
|
38 |
UNS8 applyDownloadedFilters = 0x0; // Mapped at index 0x2023, subindex 0x00
|
0
|
39 |
|
|
40 |
/**************************************************************************/
|
|
41 |
/* Declaration of the value range types */
|
|
42 |
/**************************************************************************/
|
|
43 |
|
54
|
44 |
UNS32 gene_SYNC_valueRangeTest (UNS8 typeValue, void * value)
|
0
|
45 |
{
|
|
46 |
switch (typeValue) {
|
|
47 |
}
|
|
48 |
return 0;
|
|
49 |
}
|
|
50 |
|
|
51 |
/**************************************************************************/
|
|
52 |
/* The node id */
|
|
53 |
/**************************************************************************/
|
54
|
54 |
/* node_id default value.*/
|
|
55 |
UNS8 gene_SYNC_bDeviceNodeId = 0x03;
|
0
|
56 |
|
|
57 |
//*****************************************************************************/
|
|
58 |
/* Array of message processing information */
|
|
59 |
|
|
60 |
const UNS8 gene_SYNC_iam_a_slave = 1;
|
|
61 |
|
54
|
62 |
TIMER_HANDLE gene_SYNC_heartBeatTimers[0];
|
0
|
63 |
|
|
64 |
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
65 |
//
|
|
66 |
// OBJECT DICTIONARY
|
|
67 |
//
|
|
68 |
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
54
|
69 |
|
|
70 |
/* index 0x1000 : Device Type. */
|
|
71 |
UNS32 gene_SYNC_obj1000 = 0x0; // 0
|
|
72 |
subindex gene_SYNC_Index1000[] =
|
|
73 |
{
|
|
74 |
{ RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1000 }
|
|
75 |
};
|
|
76 |
|
|
77 |
/* index 0x1001 : Error Register. */
|
|
78 |
UNS8 gene_SYNC_obj1001 = 0x0; // 0
|
|
79 |
subindex gene_SYNC_Index1001[] =
|
|
80 |
{
|
|
81 |
{ RO, uint8, sizeof (UNS8), (void*)&gene_SYNC_obj1001 }
|
|
82 |
};
|
|
83 |
|
|
84 |
/* index 0x1005 : SYNC COB ID. */
|
|
85 |
UNS32 gene_SYNC_obj1005 = 0x40000080; // 1073741952
|
|
86 |
ODCallback_t gene_SYNC_Index1005_callbacks[] =
|
|
87 |
{
|
|
88 |
NULL,
|
|
89 |
};
|
|
90 |
subindex gene_SYNC_Index1005[] =
|
|
91 |
{
|
|
92 |
{ RW, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1005 }
|
|
93 |
};
|
|
94 |
|
|
95 |
/* index 0x1006 : Communication / Cycle Period. */
|
|
96 |
UNS32 gene_SYNC_obj1006 = 0x2710; // 10000
|
|
97 |
ODCallback_t gene_SYNC_Index1006_callbacks[] =
|
|
98 |
{
|
|
99 |
NULL,
|
|
100 |
};
|
|
101 |
subindex gene_SYNC_Index1006[] =
|
|
102 |
{
|
|
103 |
{ RW, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1006 }
|
|
104 |
};
|
|
105 |
|
|
106 |
/* index 0x1008 : Manufacturer Device Name. */
|
|
107 |
UNS8 gene_SYNC_obj1008[10] = "GENE_SYNC";
|
|
108 |
subindex gene_SYNC_Index1008[] =
|
|
109 |
{
|
|
110 |
{ RO, visible_string, sizeof (gene_SYNC_obj1008), (void*)&gene_SYNC_obj1008 }
|
|
111 |
};
|
|
112 |
|
|
113 |
/* index 0x1016 : Consumer Heartbeat Time */
|
|
114 |
UNS8 gene_SYNC_highestSubIndex_obj1016 = 0;
|
|
115 |
UNS32 gene_SYNC_obj1016[0];
|
0
|
116 |
subindex gene_SYNC_Index1016[0];
|
|
117 |
|
54
|
118 |
/* index 0x1017 : Producer Heartbeat Time */
|
|
119 |
UNS16 gene_SYNC_obj1017 = 0x0; // 0
|
|
120 |
|
|
121 |
/* index 0x1018 : Identity. */
|
|
122 |
UNS8 gene_SYNC_highestSubIndex_obj1018 = 4; // number of subindex - 1
|
|
123 |
UNS32 gene_SYNC_obj1018_Vendor_ID = 0x0; // 0
|
|
124 |
UNS32 gene_SYNC_obj1018_Product_Code = 0x0; // 0
|
|
125 |
UNS32 gene_SYNC_obj1018_Revision_Number = 0x0; // 0
|
|
126 |
UNS32 gene_SYNC_obj1018_Serial_Number = 0x0; // 0
|
|
127 |
subindex gene_SYNC_Index1018[] =
|
|
128 |
{
|
|
129 |
{ RO, uint8, sizeof (UNS8), (void*)&gene_SYNC_highestSubIndex_obj1018 },
|
|
130 |
{ RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1018_Vendor_ID },
|
|
131 |
{ RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1018_Product_Code },
|
|
132 |
{ RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1018_Revision_Number },
|
|
133 |
{ RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1018_Serial_Number }
|
|
134 |
};
|
|
135 |
|
|
136 |
/* index 0x1200 : Server SDO Parameter. */
|
|
137 |
UNS8 gene_SYNC_highestSubIndex_obj1200 = 2; // number of subindex - 1
|
|
138 |
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
|
|
140 |
subindex gene_SYNC_Index1200[] =
|
|
141 |
{
|
|
142 |
{ 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 },
|
|
144 |
{ RO, uint32, sizeof (UNS32), (void*)&gene_SYNC_obj1200_COB_ID_Server_to_Client_Transmit_SDO }
|
|
145 |
};
|
|
146 |
|
|
147 |
/* index 0x2015 : Mapped variable acceptanceFilter1 */
|
|
148 |
subindex gene_SYNC_Index2015[] =
|
|
149 |
{
|
|
150 |
{ RW, uint16, sizeof (UNS16), (void*)&acceptanceFilter1 }
|
|
151 |
};
|
|
152 |
|
|
153 |
/* index 0x2016 : Mapped variable acceptanceFilter2 */
|
|
154 |
subindex gene_SYNC_Index2016[] =
|
|
155 |
{
|
|
156 |
{ RW, uint16, sizeof (UNS16), (void*)&acceptanceFilter2 }
|
|
157 |
};
|
|
158 |
|
|
159 |
/* index 0x2017 : Mapped variable acceptanceFilter3 */
|
|
160 |
subindex gene_SYNC_Index2017[] =
|
|
161 |
{
|
|
162 |
{ RW, uint16, sizeof (UNS16), (void*)&acceptanceFilter3 }
|
|
163 |
};
|
|
164 |
|
|
165 |
/* index 0x2018 : Mapped variable acceptanceFilter4 */
|
|
166 |
subindex gene_SYNC_Index2018[] =
|
|
167 |
{
|
|
168 |
{ RW, uint16, sizeof (UNS16), (void*)&acceptanceFilter4 }
|
|
169 |
};
|
|
170 |
|
|
171 |
/* index 0x2019 : Mapped variable mask1 */
|
|
172 |
subindex gene_SYNC_Index2019[] =
|
|
173 |
{
|
|
174 |
{ RW, uint16, sizeof (UNS16), (void*)&mask1 }
|
|
175 |
};
|
|
176 |
|
|
177 |
/* index 0x2020 : Mapped variable mask2 */
|
|
178 |
subindex gene_SYNC_Index2020[] =
|
|
179 |
{
|
|
180 |
{ RW, uint16, sizeof (UNS16), (void*)&mask2 }
|
|
181 |
};
|
|
182 |
|
|
183 |
/* index 0x2021 : Mapped variable mask3 */
|
|
184 |
subindex gene_SYNC_Index2021[] =
|
|
185 |
{
|
|
186 |
{ RW, uint16, sizeof (UNS16), (void*)&mask3 }
|
|
187 |
};
|
|
188 |
|
|
189 |
/* index 0x2022 : Mapped variable mask4 */
|
|
190 |
subindex gene_SYNC_Index2022[] =
|
|
191 |
{
|
|
192 |
{ RW, uint16, sizeof (UNS16), (void*)&mask4 }
|
|
193 |
};
|
|
194 |
|
|
195 |
/* index 0x2023 : Mapped variable applyDownloadedFilters */
|
|
196 |
subindex gene_SYNC_Index2023[] =
|
|
197 |
{
|
|
198 |
{ RW, uint8, sizeof (UNS8), (void*)&applyDownloadedFilters }
|
|
199 |
};
|
0
|
200 |
|
|
201 |
const indextable gene_SYNC_objdict[] =
|
|
202 |
{
|
54
|
203 |
{ (subindex*)gene_SYNC_Index1000,sizeof(gene_SYNC_Index1000)/sizeof(gene_SYNC_Index1000[0]), 0x1000},
|
|
204 |
{ (subindex*)gene_SYNC_Index1001,sizeof(gene_SYNC_Index1001)/sizeof(gene_SYNC_Index1001[0]), 0x1001},
|
|
205 |
{ (subindex*)gene_SYNC_Index1005,sizeof(gene_SYNC_Index1005)/sizeof(gene_SYNC_Index1005[0]), 0x1005},
|
|
206 |
{ (subindex*)gene_SYNC_Index1006,sizeof(gene_SYNC_Index1006)/sizeof(gene_SYNC_Index1006[0]), 0x1006},
|
|
207 |
{ (subindex*)gene_SYNC_Index1008,sizeof(gene_SYNC_Index1008)/sizeof(gene_SYNC_Index1008[0]), 0x1008},
|
|
208 |
{ (subindex*)gene_SYNC_Index1018,sizeof(gene_SYNC_Index1018)/sizeof(gene_SYNC_Index1018[0]), 0x1018},
|
|
209 |
{ (subindex*)gene_SYNC_Index1200,sizeof(gene_SYNC_Index1200)/sizeof(gene_SYNC_Index1200[0]), 0x1200},
|
|
210 |
{ (subindex*)gene_SYNC_Index2015,sizeof(gene_SYNC_Index2015)/sizeof(gene_SYNC_Index2015[0]), 0x2015},
|
|
211 |
{ (subindex*)gene_SYNC_Index2016,sizeof(gene_SYNC_Index2016)/sizeof(gene_SYNC_Index2016[0]), 0x2016},
|
|
212 |
{ (subindex*)gene_SYNC_Index2017,sizeof(gene_SYNC_Index2017)/sizeof(gene_SYNC_Index2017[0]), 0x2017},
|
|
213 |
{ (subindex*)gene_SYNC_Index2018,sizeof(gene_SYNC_Index2018)/sizeof(gene_SYNC_Index2018[0]), 0x2018},
|
|
214 |
{ (subindex*)gene_SYNC_Index2019,sizeof(gene_SYNC_Index2019)/sizeof(gene_SYNC_Index2019[0]), 0x2019},
|
|
215 |
{ (subindex*)gene_SYNC_Index2020,sizeof(gene_SYNC_Index2020)/sizeof(gene_SYNC_Index2020[0]), 0x2020},
|
|
216 |
{ (subindex*)gene_SYNC_Index2021,sizeof(gene_SYNC_Index2021)/sizeof(gene_SYNC_Index2021[0]), 0x2021},
|
|
217 |
{ (subindex*)gene_SYNC_Index2022,sizeof(gene_SYNC_Index2022)/sizeof(gene_SYNC_Index2022[0]), 0x2022},
|
|
218 |
{ (subindex*)gene_SYNC_Index2023,sizeof(gene_SYNC_Index2023)/sizeof(gene_SYNC_Index2023[0]), 0x2023},
|
0
|
219 |
};
|
|
220 |
|
54
|
221 |
const indextable * gene_SYNC_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks)
|
|
222 |
{
|
|
223 |
int i;
|
|
224 |
*callbacks = NULL;
|
|
225 |
switch(wIndex){
|
|
226 |
case 0x1000: i = 0;break;
|
|
227 |
case 0x1001: i = 1;break;
|
|
228 |
case 0x1005: i = 2;*callbacks = gene_SYNC_Index1005_callbacks; break;
|
|
229 |
case 0x1006: i = 3;*callbacks = gene_SYNC_Index1006_callbacks; break;
|
|
230 |
case 0x1008: i = 4;break;
|
|
231 |
case 0x1018: i = 5;break;
|
|
232 |
case 0x1200: i = 6;break;
|
|
233 |
case 0x2015: i = 7;break;
|
|
234 |
case 0x2016: i = 8;break;
|
|
235 |
case 0x2017: i = 9;break;
|
|
236 |
case 0x2018: i = 10;break;
|
|
237 |
case 0x2019: i = 11;break;
|
|
238 |
case 0x2020: i = 12;break;
|
|
239 |
case 0x2021: i = 13;break;
|
|
240 |
case 0x2022: i = 14;break;
|
|
241 |
case 0x2023: i = 15;break;
|
|
242 |
default:
|
|
243 |
*errorCode = OD_NO_SUCH_OBJECT;
|
|
244 |
return NULL;
|
|
245 |
}
|
|
246 |
*errorCode = OD_SUCCESSFUL;
|
|
247 |
return &gene_SYNC_objdict[i];
|
|
248 |
}
|
|
249 |
|
0
|
250 |
// To count at which received SYNC a PDO must be sent.
|
|
251 |
// Even if no pdoTransmit are defined, at least one entry is computed
|
|
252 |
// for compilations issues.
|
54
|
253 |
UNS8 gene_SYNC_count_sync[1] = {0,};
|
0
|
254 |
|
|
255 |
quick_index gene_SYNC_firstIndex = {
|
54
|
256 |
SDO_SVR : 6,
|
|
257 |
SDO_CLT : 0,
|
|
258 |
PDO_RCV : 0,
|
|
259 |
PDO_RCV_MAP : 0,
|
|
260 |
PDO_TRS : 0,
|
|
261 |
PDO_TRS_MAP : 0
|
0
|
262 |
};
|
|
263 |
|
|
264 |
quick_index gene_SYNC_lastIndex = {
|
54
|
265 |
SDO_SVR : 6,
|
|
266 |
SDO_CLT : 0,
|
|
267 |
PDO_RCV : 0,
|
|
268 |
PDO_RCV_MAP : 0,
|
|
269 |
PDO_TRS : 0,
|
|
270 |
PDO_TRS_MAP : 0
|
0
|
271 |
};
|
|
272 |
|
|
273 |
UNS16 gene_SYNC_ObjdictSize = sizeof(gene_SYNC_objdict)/sizeof(gene_SYNC_objdict[0]);
|
|
274 |
|
|
275 |
CO_Data gene_SYNC_Data = CANOPEN_NODE_DATA_INITIALIZER(gene_SYNC);
|
|
276 |
|