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 |
|
|
23 |
/* File generated by gen_cfile.py. Should not be modified. */
|
|
24 |
|
|
25 |
#include "TestSlave.h"
|
|
26 |
|
|
27 |
/**************************************************************************/
|
|
28 |
/* Declaration of the mapped variables */
|
|
29 |
/**************************************************************************/
|
|
30 |
UNS8 SlaveMap1 = 0x0; // Mapped at index 0x2000, subindex 0x00
|
|
31 |
UNS8 SlaveMap2 = 0x0; // Mapped at index 0x2001, subindex 0x00
|
|
32 |
UNS8 SlaveMap3 = 0x0; // Mapped at index 0x2002, subindex 0x00
|
|
33 |
UNS8 SlaveMap4 = 0x0; // Mapped at index 0x2003, subindex 0x00
|
|
34 |
|
|
35 |
/**************************************************************************/
|
|
36 |
/* Declaration of the value range types */
|
|
37 |
/**************************************************************************/
|
|
38 |
|
|
39 |
UNS32 TestSlave_valueRangeTest (UNS8 typeValue, void * value)
|
|
40 |
{
|
|
41 |
switch (typeValue) {
|
|
42 |
}
|
|
43 |
return 0;
|
|
44 |
}
|
|
45 |
|
|
46 |
/**************************************************************************/
|
|
47 |
/* The node id */
|
|
48 |
/**************************************************************************/
|
|
49 |
/* node_id default value.*/
|
|
50 |
UNS8 TestSlave_bDeviceNodeId = 0x00;
|
|
51 |
|
|
52 |
//*****************************************************************************/
|
|
53 |
/* Array of message processing information */
|
|
54 |
|
|
55 |
const UNS8 TestSlave_iam_a_slave = 1;
|
|
56 |
|
|
57 |
TIMER_HANDLE TestSlave_heartBeatTimers[0];
|
|
58 |
|
|
59 |
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
60 |
//
|
|
61 |
// OBJECT DICTIONARY
|
|
62 |
//
|
|
63 |
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
64 |
|
|
65 |
/* index 0x1000 : Device Type. */
|
23
|
66 |
UNS32 TestSlave_obj1000 = 0x12D; // 301
|
0
|
67 |
subindex TestSlave_Index1000[] =
|
|
68 |
{
|
|
69 |
{ RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1000 }
|
|
70 |
};
|
|
71 |
|
|
72 |
/* index 0x1001 : Error Register. */
|
23
|
73 |
UNS8 TestSlave_obj1001 = 0x0; // 0
|
0
|
74 |
subindex TestSlave_Index1001[] =
|
|
75 |
{
|
|
76 |
{ RO, uint8, sizeof (UNS8), (void*)&TestSlave_obj1001 }
|
|
77 |
};
|
|
78 |
|
|
79 |
/* index 0x1005 : SYNC COB ID. */
|
23
|
80 |
UNS32 TestSlave_obj1005 = 0x80; // 128
|
0
|
81 |
ODCallback_t TestSlave_Index1005_callbacks[] =
|
|
82 |
{
|
|
83 |
NULL,
|
|
84 |
};
|
|
85 |
subindex TestSlave_Index1005[] =
|
|
86 |
{
|
|
87 |
{ RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1005 }
|
|
88 |
};
|
|
89 |
|
|
90 |
/* index 0x1006 : Communication / Cycle Period. */
|
23
|
91 |
UNS32 TestSlave_obj1006 = 0x0; // 0
|
0
|
92 |
ODCallback_t TestSlave_Index1006_callbacks[] =
|
|
93 |
{
|
|
94 |
NULL,
|
|
95 |
};
|
|
96 |
subindex TestSlave_Index1006[] =
|
|
97 |
{
|
|
98 |
{ RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1006 }
|
|
99 |
};
|
|
100 |
|
23
|
101 |
/* index 0x1010 : Store parameters. */
|
|
102 |
UNS8 TestSlave_highestSubIndex_obj1010 = 4; // number of subindex - 1
|
|
103 |
UNS32 TestSlave_obj1010_Save_All_Parameters = 0x0; // 0
|
|
104 |
UNS32 TestSlave_obj1010_Save_Communication_Parameters = 0x0; // 0
|
|
105 |
UNS32 TestSlave_obj1010_Save_Application_Parameters = 0x0; // 0
|
|
106 |
UNS32 TestSlave_obj1010_Save_Manufacturer_Parameters = 0x0; // 0
|
|
107 |
ODCallback_t TestSlave_Index1010_callbacks[] =
|
|
108 |
{
|
|
109 |
NULL,
|
|
110 |
NULL,
|
|
111 |
NULL,
|
|
112 |
NULL,
|
|
113 |
NULL,
|
|
114 |
};
|
|
115 |
subindex TestSlave_Index1010[] =
|
|
116 |
{
|
|
117 |
{ RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1010 },
|
|
118 |
{ RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_All_Parameters },
|
|
119 |
{ RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_Communication_Parameters },
|
|
120 |
{ RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_Application_Parameters },
|
|
121 |
{ RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_Manufacturer_Parameters }
|
|
122 |
};
|
|
123 |
|
|
124 |
/* index 0x1011 : Restore Default Parameters. */
|
|
125 |
UNS8 TestSlave_highestSubIndex_obj1011 = 4; // number of subindex - 1
|
|
126 |
UNS32 TestSlave_obj1011_Restore_All_Default_Parameters = 0x0; // 0
|
|
127 |
UNS32 TestSlave_obj1011_Restore_Communication_Default_Parameters = 0x0; // 0
|
|
128 |
UNS32 TestSlave_obj1011_Restore_Application_Default_Parameters = 0x0; // 0
|
|
129 |
UNS32 TestSlave_obj1011_Restore_Manufacturer_Default_Parameters = 0x0; // 0
|
|
130 |
ODCallback_t TestSlave_Index1011_callbacks[] =
|
|
131 |
{
|
|
132 |
NULL,
|
|
133 |
NULL,
|
|
134 |
NULL,
|
|
135 |
NULL,
|
|
136 |
NULL,
|
|
137 |
};
|
|
138 |
subindex TestSlave_Index1011[] =
|
|
139 |
{
|
|
140 |
{ RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1011 },
|
|
141 |
{ RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_All_Default_Parameters },
|
|
142 |
{ RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_Communication_Default_Parameters },
|
|
143 |
{ RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_Application_Default_Parameters },
|
|
144 |
{ RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_Manufacturer_Default_Parameters }
|
|
145 |
};
|
|
146 |
|
0
|
147 |
/* index 0x1016 : Consumer Heartbeat Time */
|
|
148 |
UNS8 TestSlave_highestSubIndex_obj1016 = 0;
|
|
149 |
UNS32 TestSlave_obj1016[0];
|
|
150 |
subindex TestSlave_Index1016[0];
|
|
151 |
|
|
152 |
/* index 0x1017 : Producer Heartbeat Time. */
|
23
|
153 |
UNS16 TestSlave_obj1017 = 0x3E8; // 1000
|
0
|
154 |
subindex TestSlave_Index1017[] =
|
|
155 |
{
|
|
156 |
{ RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1017 }
|
|
157 |
};
|
|
158 |
|
|
159 |
/* index 0x1018 : Identity. */
|
|
160 |
UNS8 TestSlave_highestSubIndex_obj1018 = 4; // number of subindex - 1
|
23
|
161 |
UNS32 TestSlave_obj1018_Vendor_ID = 0x0; // 0
|
|
162 |
UNS32 TestSlave_obj1018_Product_Code = 0x0; // 0
|
|
163 |
UNS32 TestSlave_obj1018_Revision_Number = 0x0; // 0
|
|
164 |
UNS32 TestSlave_obj1018_Serial_Number = 0x0; // 0
|
0
|
165 |
subindex TestSlave_Index1018[] =
|
|
166 |
{
|
|
167 |
{ RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1018 },
|
|
168 |
{ RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Vendor_ID },
|
|
169 |
{ RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Product_Code },
|
|
170 |
{ RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Revision_Number },
|
|
171 |
{ RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Serial_Number }
|
|
172 |
};
|
|
173 |
|
|
174 |
/* index 0x1200 : Server SDO Parameter. */
|
|
175 |
UNS8 TestSlave_highestSubIndex_obj1200 = 2; // number of subindex - 1
|
23
|
176 |
UNS32 TestSlave_obj1200_COB_ID_Client_to_Server_Receive_SDO = 0x601; // 1537
|
|
177 |
UNS32 TestSlave_obj1200_COB_ID_Server_to_Client_Transmit_SDO = 0x581; // 1409
|
0
|
178 |
subindex TestSlave_Index1200[] =
|
|
179 |
{
|
|
180 |
{ RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1200 },
|
|
181 |
{ RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1200_COB_ID_Client_to_Server_Receive_SDO },
|
|
182 |
{ RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1200_COB_ID_Server_to_Client_Transmit_SDO }
|
|
183 |
};
|
|
184 |
|
|
185 |
/* index 0x1800 : Transmit PDO 1 Parameter. */
|
|
186 |
UNS8 TestSlave_highestSubIndex_obj1800 = 5; // number of subindex - 1
|
23
|
187 |
UNS32 TestSlave_obj1800_COB_ID_used_by_PDO = 0x182; // 386
|
|
188 |
UNS8 TestSlave_obj1800_Transmission_Type = 0x1; // 1
|
|
189 |
UNS16 TestSlave_obj1800_Inhibit_Time = 0x0; // 0
|
|
190 |
UNS16 TestSlave_obj1800_Compatibility_Entry = 0x0; // 0
|
|
191 |
UNS16 TestSlave_obj1800_Event_Timer = 0x0; // 0
|
0
|
192 |
subindex TestSlave_Index1800[] =
|
|
193 |
{
|
|
194 |
{ RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1800 },
|
|
195 |
{ RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1800_COB_ID_used_by_PDO },
|
|
196 |
{ RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1800_Transmission_Type },
|
|
197 |
{ RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1800_Inhibit_Time },
|
|
198 |
{ RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1800_Compatibility_Entry },
|
|
199 |
{ RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1800_Event_Timer }
|
|
200 |
};
|
|
201 |
|
|
202 |
/* index 0x1801 : Transmit PDO 2 Parameter. */
|
|
203 |
UNS8 TestSlave_highestSubIndex_obj1801 = 5; // number of subindex - 1
|
23
|
204 |
UNS32 TestSlave_obj1801_COB_ID_used_by_PDO = 0x282; // 642
|
|
205 |
UNS8 TestSlave_obj1801_Transmission_Type = 0x1; // 1
|
|
206 |
UNS16 TestSlave_obj1801_Inhibit_Time = 0x0; // 0
|
|
207 |
UNS16 TestSlave_obj1801_Compatibility_Entry = 0x0; // 0
|
|
208 |
UNS16 TestSlave_obj1801_Event_Timer = 0x0; // 0
|
0
|
209 |
subindex TestSlave_Index1801[] =
|
|
210 |
{
|
|
211 |
{ RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1801 },
|
|
212 |
{ RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1801_COB_ID_used_by_PDO },
|
|
213 |
{ RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1801_Transmission_Type },
|
|
214 |
{ RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1801_Inhibit_Time },
|
|
215 |
{ RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1801_Compatibility_Entry },
|
|
216 |
{ RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1801_Event_Timer }
|
|
217 |
};
|
|
218 |
|
|
219 |
/* index 0x1A00 : Transmit PDO 1 Mapping. */
|
|
220 |
UNS8 TestSlave_highestSubIndex_obj1A00 = 2; // number of subindex - 1
|
|
221 |
UNS32 TestSlave_obj1A00[] =
|
|
222 |
{
|
23
|
223 |
0x20000008, // 536870920
|
|
224 |
0x20010008 // 536936456
|
0
|
225 |
};
|
|
226 |
subindex TestSlave_Index1A00[] =
|
|
227 |
{
|
|
228 |
{ RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1A00 },
|
|
229 |
{ RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[0] },
|
|
230 |
{ RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A00[1] }
|
|
231 |
};
|
|
232 |
|
|
233 |
/* index 0x1A01 : Transmit PDO 2 Mapping. */
|
|
234 |
UNS8 TestSlave_highestSubIndex_obj1A01 = 2; // number of subindex - 1
|
|
235 |
UNS32 TestSlave_obj1A01[] =
|
|
236 |
{
|
23
|
237 |
0x20020008, // 537001992
|
|
238 |
0x20030008 // 537067528
|
0
|
239 |
};
|
|
240 |
subindex TestSlave_Index1A01[] =
|
|
241 |
{
|
|
242 |
{ RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1A01 },
|
|
243 |
{ RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A01[0] },
|
|
244 |
{ RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1A01[1] }
|
|
245 |
};
|
|
246 |
|
|
247 |
/* index 0x2000 : Mapped variable SlaveMap1 */
|
|
248 |
subindex TestSlave_Index2000[] =
|
|
249 |
{
|
|
250 |
{ RW, uint8, sizeof (UNS8), (void*)&SlaveMap1 }
|
|
251 |
};
|
|
252 |
|
|
253 |
/* index 0x2001 : Mapped variable SlaveMap2 */
|
|
254 |
subindex TestSlave_Index2001[] =
|
|
255 |
{
|
|
256 |
{ RW, uint8, sizeof (UNS8), (void*)&SlaveMap2 }
|
|
257 |
};
|
|
258 |
|
|
259 |
/* index 0x2002 : Mapped variable SlaveMap3 */
|
|
260 |
subindex TestSlave_Index2002[] =
|
|
261 |
{
|
|
262 |
{ RW, uint8, sizeof (UNS8), (void*)&SlaveMap3 }
|
|
263 |
};
|
|
264 |
|
|
265 |
/* index 0x2003 : Mapped variable SlaveMap4 */
|
|
266 |
subindex TestSlave_Index2003[] =
|
|
267 |
{
|
|
268 |
{ RW, uint8, sizeof (UNS8), (void*)&SlaveMap4 }
|
|
269 |
};
|
|
270 |
|
|
271 |
const indextable TestSlave_objdict[] =
|
|
272 |
{
|
|
273 |
{ (subindex*)TestSlave_Index1000,sizeof(TestSlave_Index1000)/sizeof(TestSlave_Index1000[0]), 0x1000},
|
|
274 |
{ (subindex*)TestSlave_Index1001,sizeof(TestSlave_Index1001)/sizeof(TestSlave_Index1001[0]), 0x1001},
|
|
275 |
{ (subindex*)TestSlave_Index1005,sizeof(TestSlave_Index1005)/sizeof(TestSlave_Index1005[0]), 0x1005},
|
|
276 |
{ (subindex*)TestSlave_Index1006,sizeof(TestSlave_Index1006)/sizeof(TestSlave_Index1006[0]), 0x1006},
|
23
|
277 |
{ (subindex*)TestSlave_Index1010,sizeof(TestSlave_Index1010)/sizeof(TestSlave_Index1010[0]), 0x1010},
|
|
278 |
{ (subindex*)TestSlave_Index1011,sizeof(TestSlave_Index1011)/sizeof(TestSlave_Index1011[0]), 0x1011},
|
0
|
279 |
{ (subindex*)TestSlave_Index1017,sizeof(TestSlave_Index1017)/sizeof(TestSlave_Index1017[0]), 0x1017},
|
|
280 |
{ (subindex*)TestSlave_Index1018,sizeof(TestSlave_Index1018)/sizeof(TestSlave_Index1018[0]), 0x1018},
|
|
281 |
{ (subindex*)TestSlave_Index1200,sizeof(TestSlave_Index1200)/sizeof(TestSlave_Index1200[0]), 0x1200},
|
|
282 |
{ (subindex*)TestSlave_Index1800,sizeof(TestSlave_Index1800)/sizeof(TestSlave_Index1800[0]), 0x1800},
|
|
283 |
{ (subindex*)TestSlave_Index1801,sizeof(TestSlave_Index1801)/sizeof(TestSlave_Index1801[0]), 0x1801},
|
|
284 |
{ (subindex*)TestSlave_Index1A00,sizeof(TestSlave_Index1A00)/sizeof(TestSlave_Index1A00[0]), 0x1A00},
|
|
285 |
{ (subindex*)TestSlave_Index1A01,sizeof(TestSlave_Index1A01)/sizeof(TestSlave_Index1A01[0]), 0x1A01},
|
|
286 |
{ (subindex*)TestSlave_Index2000,sizeof(TestSlave_Index2000)/sizeof(TestSlave_Index2000[0]), 0x2000},
|
|
287 |
{ (subindex*)TestSlave_Index2001,sizeof(TestSlave_Index2001)/sizeof(TestSlave_Index2001[0]), 0x2001},
|
|
288 |
{ (subindex*)TestSlave_Index2002,sizeof(TestSlave_Index2002)/sizeof(TestSlave_Index2002[0]), 0x2002},
|
|
289 |
{ (subindex*)TestSlave_Index2003,sizeof(TestSlave_Index2003)/sizeof(TestSlave_Index2003[0]), 0x2003},
|
|
290 |
};
|
|
291 |
|
|
292 |
const indextable * TestSlave_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks)
|
|
293 |
{
|
|
294 |
int i;
|
23
|
295 |
*callbacks = NULL;
|
0
|
296 |
switch(wIndex){
|
23
|
297 |
case 0x1000: i = 0;break;
|
|
298 |
case 0x1001: i = 1;break;
|
|
299 |
case 0x1005: i = 2;*callbacks = TestSlave_Index1005_callbacks; break;
|
|
300 |
case 0x1006: i = 3;*callbacks = TestSlave_Index1006_callbacks; break;
|
|
301 |
case 0x1010: i = 4;*callbacks = TestSlave_Index1010_callbacks; break;
|
|
302 |
case 0x1011: i = 5;*callbacks = TestSlave_Index1011_callbacks; break;
|
|
303 |
case 0x1017: i = 6;break;
|
|
304 |
case 0x1018: i = 7;break;
|
|
305 |
case 0x1200: i = 8;break;
|
|
306 |
case 0x1800: i = 9;break;
|
|
307 |
case 0x1801: i = 10;break;
|
|
308 |
case 0x1A00: i = 11;break;
|
|
309 |
case 0x1A01: i = 12;break;
|
|
310 |
case 0x2000: i = 13;break;
|
|
311 |
case 0x2001: i = 14;break;
|
|
312 |
case 0x2002: i = 15;break;
|
|
313 |
case 0x2003: i = 16;break;
|
0
|
314 |
default:
|
|
315 |
*errorCode = OD_NO_SUCH_OBJECT;
|
|
316 |
return NULL;
|
|
317 |
}
|
|
318 |
*errorCode = OD_SUCCESSFUL;
|
|
319 |
return &TestSlave_objdict[i];
|
|
320 |
}
|
|
321 |
|
|
322 |
// To count at which received SYNC a PDO must be sent.
|
|
323 |
// Even if no pdoTransmit are defined, at least one entry is computed
|
|
324 |
// for compilations issues.
|
|
325 |
UNS8 TestSlave_count_sync[2] = {0,};
|
|
326 |
|
|
327 |
quick_index TestSlave_firstIndex = {
|
23
|
328 |
SDO_SVR : 8,
|
0
|
329 |
SDO_CLT : 0,
|
|
330 |
PDO_RCV : 0,
|
|
331 |
PDO_RCV_MAP : 0,
|
23
|
332 |
PDO_TRS : 9,
|
|
333 |
PDO_TRS_MAP : 11
|
0
|
334 |
};
|
|
335 |
|
|
336 |
quick_index TestSlave_lastIndex = {
|
23
|
337 |
SDO_SVR : 8,
|
0
|
338 |
SDO_CLT : 0,
|
|
339 |
PDO_RCV : 0,
|
|
340 |
PDO_RCV_MAP : 0,
|
23
|
341 |
PDO_TRS : 10,
|
|
342 |
PDO_TRS_MAP : 12
|
0
|
343 |
};
|
|
344 |
|
|
345 |
UNS16 TestSlave_ObjdictSize = sizeof(TestSlave_objdict)/sizeof(TestSlave_objdict[0]);
|
|
346 |
|
|
347 |
CO_Data TestSlave_Data = CANOPEN_NODE_DATA_INITIALIZER(TestSlave);
|
|
348 |
|