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