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 |
|
|
24 |
#include <stddef.h>
|
|
25 |
|
|
26 |
#include <canfestival/applicfg.h>
|
|
27 |
#include "canfestival/def.h"
|
|
28 |
#include "canfestival/can.h"
|
|
29 |
#include "canfestival/objdictdef.h"
|
|
30 |
#include "canfestival/pdo.h"
|
|
31 |
#include "canfestival/sdo.h"
|
|
32 |
#include "canfestival/sync.h"
|
|
33 |
#include "canfestival/lifegrd.h"
|
|
34 |
#include "canfestival/nmtSlave.h"
|
|
35 |
|
|
36 |
/**************************************************************************/
|
|
37 |
/* Declaration of the mapped variables */
|
|
38 |
/**************************************************************************/
|
|
39 |
UNS8 seconds = 0; // Mapped at index 0x2000, subindex 0x01
|
|
40 |
UNS8 minutes = 0; // Mapped at index 0x2000, subindex 0x02
|
|
41 |
UNS8 hours = 0; // Mapped at index 0x2000, subindex 0x03
|
|
42 |
UNS8 day = 0; // Mapped at index 0x2000, subindex 0x04
|
|
43 |
UNS32 canopenErrNB = 0; // Mapped at index 0x6000, subindex 0x00
|
|
44 |
UNS32 canopenErrVAL = 0; // Mapped at index 0x6001, subindex 0x00
|
|
45 |
UNS8 strTest[10] = 0; // Mapped at index 0x6002, subindex 0x00
|
|
46 |
|
|
47 |
/**************************************************************************/
|
|
48 |
/* Declaration of the value range types */
|
|
49 |
/**************************************************************************/
|
|
50 |
|
|
51 |
|
|
52 |
|
|
53 |
UNS32 Linux_slave_valueRangeTest (UNS8 typeValue, UNS32 unsValue, REAL32 realValue)
|
|
54 |
{
|
|
55 |
switch (typeValue) {
|
|
56 |
}
|
|
57 |
return 0;
|
|
58 |
}
|
|
59 |
|
|
60 |
|
|
61 |
/**************************************************************************/
|
|
62 |
/* The node id */
|
|
63 |
/**************************************************************************/
|
|
64 |
/* node_id default value.
|
|
65 |
This default value is deprecated.
|
|
66 |
You should always overwrite this by using the function setNodeId(UNS8 nodeId) in your C code.
|
|
67 |
*/
|
|
68 |
#define NODE_ID 0x01
|
|
69 |
UNS8 Linux_slave_bDeviceNodeId = NODE_ID;
|
|
70 |
|
|
71 |
|
|
72 |
//*****************************************************************************/
|
|
73 |
/* Array of message processing information */
|
|
74 |
/* Should not be modified */
|
|
75 |
|
|
76 |
const UNS8 Linux_slave_iam_a_slave = 1
|
|
77 |
|
|
78 |
// Macros definition
|
|
79 |
|
|
80 |
/* Beware :
|
|
81 |
index *must* be writen 4 numbers in hexa
|
|
82 |
sub_index *must* be writen 2 numbers in hexa
|
|
83 |
size_variable_in_UNS8 *must* be writen 2 numbers in hexa
|
|
84 |
*/
|
|
85 |
#define PDO_MAP(index, sub_index, size_variable_in_bits)\
|
|
86 |
0x ## index ## sub_index ## size_variable_in_bits
|
|
87 |
|
|
88 |
/** This macro helps creating the object dictionary entries.
|
|
89 |
* by calling this macro
|
|
90 |
* it creates an entry in form of: 7 of entries, pointer to the entry.
|
|
91 |
*/
|
|
92 |
#define DeclareIndexTableEntry(entryname, index) { (subindex*)entryname,sizeof(entryname)/sizeof(entryname[0]), index}
|
|
93 |
|
|
94 |
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
95 |
//
|
|
96 |
// OBJECT DICTIONARY
|
|
97 |
//
|
|
98 |
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
99 |
// Make your change, depending of your application
|
|
100 |
|
|
101 |
|
|
102 |
/* index 0x1000 : Device type.
|
|
103 |
You have to change the value below, so
|
|
104 |
it fits your canopen-slave-module */
|
|
105 |
|
|
106 |
/* Not used, so, should not be modified */
|
|
107 |
|
|
108 |
UNS32 Linux_slave_obj1000 = 0;
|
|
109 |
subindex Linux_slave_Index1000[] =
|
|
110 |
{
|
|
111 |
{ RO, uint32, sizeof(UNS32), (void*)&Linux_slave_obj1000 }
|
|
112 |
};
|
|
113 |
|
|
114 |
/* index 0x1001 : Error register.
|
|
115 |
Change the entries to fit your application
|
|
116 |
Not used, so, should not be modified */
|
|
117 |
/*const*/ UNS8 Linux_slave_obj1001 = 0x0;
|
|
118 |
/*const*/ subindex Linux_slave_Index1001[] =
|
|
119 |
{
|
|
120 |
{ RO, uint8, sizeof(UNS8), (void*)&Linux_slave_obj1001 }
|
|
121 |
};
|
|
122 |
|
|
123 |
/* index 0x1005 : COB_ID SYNC */
|
|
124 |
/* Should not be modified */
|
|
125 |
UNS32 Linux_slave_obj1005 = 0x00000080; // bit 30 = 1 : device can generate a SYNC message
|
|
126 |
// Beware, it is over written when the node
|
|
127 |
// enters in reset mode
|
|
128 |
// See initResetMode() in init.c
|
|
129 |
/*const*/ subindex Linux_slave_Index1005[] =
|
|
130 |
{
|
|
131 |
{ RW, uint32, sizeof(UNS32), (void*)&Linux_slave_obj1005 }
|
|
132 |
};
|
|
133 |
|
|
134 |
/* index 0x1006 : SYNC period */
|
|
135 |
// For producing the SYNC signal every n micro-seconds.
|
|
136 |
// Put 0 to not producing SYNC
|
|
137 |
/*const*/ UNS32 Linux_slave_obj1006 = 0x0;
|
|
138 |
// Default 0 to not produce SYNC //
|
|
139 |
// Beware, it is over written when the
|
|
140 |
// node enters in reset mode.
|
|
141 |
// See initResetMode() in init.c
|
|
142 |
/*const*/ subindex Linux_slave_Index1006[] =
|
|
143 |
{
|
|
144 |
{ RW, uint32, sizeof(UNS32), (void*)&Linux_slave_obj1006 }
|
|
145 |
};
|
|
146 |
|
|
147 |
/* index 0x1007 : Synchronous Window Length
|
|
148 |
Seems to be needed by DS401 to generate the SYNC signal ! */
|
|
149 |
/*const*/ UNS32 Linux_slave_obj1007 = 0x0; /* Default 0 */
|
|
150 |
/*const*/ subindex Linux_slave_Index1007[] =
|
|
151 |
{
|
|
152 |
{ RW, uint32, sizeof(UNS32), (void*)&Linux_slave_obj1007 }
|
|
153 |
};
|
|
154 |
|
|
155 |
/* index 0x1008 : Manufacturer device name */
|
|
156 |
UNS8 Linux_slave_obj1008[] = "Appli_Slave_HC12"; /* Default 0 */
|
|
157 |
subindex Linux_slave_Index1008[] =
|
|
158 |
{
|
|
159 |
{ RO, uint32, sizeof(Linux_slave_obj1008), (void*)&Linux_slave_obj1008 }
|
|
160 |
};
|
|
161 |
|
|
162 |
/* index 0x1009 : Manufacturer hardware version */
|
|
163 |
UNS8 Linux_slave_obj1009[] = "__DATE__"; /* Default 0 */
|
|
164 |
subindex Linux_slave_Index1009[] =
|
|
165 |
{
|
|
166 |
{ RO, uint32, sizeof(Linux_slave_obj1009), (void*)&Linux_slave_obj1009 }
|
|
167 |
};
|
|
168 |
|
|
169 |
/* index 0x100A : Manufacturer software version */
|
|
170 |
UNS8 Linux_slave_obj100A[] = __TIME__; /* Default 0 */
|
|
171 |
subindex Linux_slave_Index100A[] =
|
|
172 |
{
|
|
173 |
{ RO, uint32, Linux_slave_sizeof(obj100A), (void*)&Linux_slave_obj100A}
|
|
174 |
};
|
|
175 |
|
|
176 |
|
|
177 |
TIMER_HANDLE Linux_slave_heartBeatTimers[1] = {TIMER_NONE,};
|
|
178 |
/* index 0x1016 : HeartBeat consumers
|
|
179 |
The nodes which can send a heartbeat */
|
|
180 |
UNS32 Linux_slave_obj1016[] = {// Consumer time for each node
|
|
181 |
0x00000000}; // Format 0x00NNTTTT (N=Node T=time in ms)
|
|
182 |
|
|
183 |
UNS8 Linux_slave_obj1016_cnt = 1; // 1 nodes could send me
|
|
184 |
// their heartbeat.
|
|
185 |
subindex Linux_slave_Index1016[] =
|
|
186 |
{
|
|
187 |
{ RO, uint8, sizeof(UNS8), (void*)&Linux_slave_obj1016_cnt },
|
|
188 |
{ RW, uint32, sizeof(UNS32), (void*)&Linux_slave_obj1016[0] }
|
|
189 |
};
|
|
190 |
|
|
191 |
/* index 0x1017 : Heartbeat producer
|
|
192 |
Every HBProducerTime, the node sends its heartbeat */
|
|
193 |
UNS16 Linux_slave_obj1017 = 0; //HBProducerTime in ms. If 0 : not activated
|
|
194 |
// Beware, it is over written when the
|
|
195 |
// node enters in reset mode.
|
|
196 |
// See initResetMode() in init.c
|
|
197 |
subindex Linux_slave_Index1017[] =
|
|
198 |
{
|
|
199 |
{ RW, uint16, sizeof(UNS16), &Linux_slave_obj1017 }
|
|
200 |
};
|
|
201 |
|
|
202 |
/* index 0x1018 : Identity object */
|
|
203 |
/** index 1018: identify object. Adjust the entries for your node/company
|
|
204 |
*/
|
|
205 |
/* Values can be modified */
|
|
206 |
|
|
207 |
s_identity Linux_slave_obj1018 =
|
|
208 |
{
|
|
209 |
4, // number of supported entries
|
|
210 |
0, // Vendor-ID (given by the can-cia)
|
|
211 |
0, // Product Code
|
|
212 |
0, // Revision number
|
|
213 |
0 // serial number
|
|
214 |
};
|
|
215 |
|
|
216 |
subindex Linux_slave_Index1018[] =
|
|
217 |
{
|
|
218 |
{ RO, uint8, sizeof(UNS8), (void*)&Linux_slave_obj1018.count },
|
|
219 |
{ RO, uint32, sizeof(UNS32), (void*)&Linux_slave_obj1018.vendor_id},
|
|
220 |
{ RO, uint32, sizeof(UNS32), (void*)&Linux_slave_obj1018.product_code},
|
|
221 |
{ RO, uint32, sizeof(UNS32), (void*)&Linux_slave_obj1018.revision_number},
|
|
222 |
{ RO, uint32, sizeof(UNS32), (void*)&Linux_slave_obj1018.serial_number}
|
|
223 |
};
|
|
224 |
|
|
225 |
/* index 0x1200 : The SDO Server parameters */
|
|
226 |
/* BEWARE You cannot define more than one SDO server */
|
|
227 |
/* The values should not be modified here,
|
|
228 |
but can be changed at runtime */
|
|
229 |
// Beware that the default values that you could put here
|
|
230 |
// will be over written at the initialisation of the node.
|
|
231 |
// See setNodeId() in init.c
|
|
232 |
s_sdo_parameter Linux_slave_obj1200 =
|
|
233 |
{ 3, // Number of entries. Always 3 for the SDO
|
|
234 |
0x601, // The cob_id transmited in CAN msg to the server
|
|
235 |
0x581, // The cob_id received in CAN msg from the server
|
|
236 |
0x01 // The node id of the client. Should not be modified
|
|
237 |
};
|
|
238 |
subindex Linux_slave_Index1200[] =
|
|
239 |
{
|
|
240 |
{ RO, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1200.count },
|
|
241 |
{ RO, uint32, sizeof( UNS32), (void*)&Linux_slave_obj1200.cob_id_client },
|
|
242 |
{ RO, uint32, sizeof( UNS32), (void*)&Linux_slave_obj1200.cob_id_server },
|
|
243 |
{ RW, uint8, sizeof( UNS8), (void*)&Linux_slave_obj1200.node_id }
|
|
244 |
};
|
|
245 |
|
|
246 |
/* index 0x1280 : SDO client parameter */
|
|
247 |
s_sdo_parameter Linux_slave_obj1280 =
|
|
248 |
{ 3, // Nb of entries
|
|
249 |
0x600, // cobid transmited to the server. The good value should be 0x600 + server nodeId
|
|
250 |
0x580, // cobid received from the server. The good value should be 0x580 + server nodeId
|
|
251 |
0x01 // server NodeId
|
|
252 |
};
|
|
253 |
subindex Linux_slave_Index1280[] =
|
|
254 |
{
|
|
255 |
{ RO, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1280.count },
|
|
256 |
{ RW, uint8, sizeof( UNS32 ), (void*)&Linux_slave_obj1280.cob_id_client },
|
|
257 |
{ RW, uint8, sizeof( UNS32 ), (void*)&Linux_slave_obj1280.cob_id_server },
|
|
258 |
{ RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1280.node_id }
|
|
259 |
};
|
|
260 |
|
|
261 |
/* index 0x1400 : PDO receive communication parameter */
|
|
262 |
s_pdo_communication_parameter Linux_slave_obj1400 =
|
|
263 |
{ 2, // Largest subindex supported
|
|
264 |
0x0, // Default COBID (overwritten at init for index 0x1400 to 0x1403)
|
|
265 |
253 // Transmission type. See objdictdef.h
|
|
266 |
};
|
|
267 |
subindex Linux_slave_Index1400[] =
|
|
268 |
{
|
|
269 |
{ RO, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1400.count },
|
|
270 |
{ RW, uint8, sizeof( UNS32 ), (void*)&Linux_slave_obj1400.cob_id },
|
|
271 |
{ RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1400.type },
|
|
272 |
};
|
|
273 |
|
|
274 |
/* index 0x1401 : PDO receive communication parameter */
|
|
275 |
s_pdo_communication_parameter Linux_slave_obj1401 =
|
|
276 |
{ 2, // Largest subindex supported
|
|
277 |
0x0, // Default COBID (overwritten at init for index 0x1400 to 0x1403)
|
|
278 |
253 // Transmission type. See objdictdef.h
|
|
279 |
};
|
|
280 |
subindex Linux_slave_Index1401[] =
|
|
281 |
{
|
|
282 |
{ RO, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1401.count },
|
|
283 |
{ RW, uint8, sizeof( UNS32 ), (void*)&Linux_slave_obj1401.cob_id },
|
|
284 |
{ RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1401.type },
|
|
285 |
};
|
|
286 |
|
|
287 |
/* index 0x1402 : PDO receive communication parameter */
|
|
288 |
s_pdo_communication_parameter Linux_slave_obj1402 =
|
|
289 |
{ 2, // Largest subindex supported
|
|
290 |
0x0, // Default COBID (overwritten at init for index 0x1400 to 0x1403)
|
|
291 |
253 // Transmission type. See objdictdef.h
|
|
292 |
};
|
|
293 |
subindex Linux_slave_Index1402[] =
|
|
294 |
{
|
|
295 |
{ RO, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1402.count },
|
|
296 |
{ RW, uint8, sizeof( UNS32 ), (void*)&Linux_slave_obj1402.cob_id },
|
|
297 |
{ RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1402.type },
|
|
298 |
};
|
|
299 |
|
|
300 |
/* index 0x1600 : PDO receive mapping parameter of PDO communication index 0x1400 */
|
|
301 |
UNS8 Linux_slave_obj1600_cnt = 0; // Number of mapped variables
|
|
302 |
UNS32 Linux_slave_obj1600_mappedVar[] = {
|
|
303 |
0x00000000,
|
|
304 |
0x00000000,
|
|
305 |
0x00000000,
|
|
306 |
0x00000000,
|
|
307 |
0x00000000,
|
|
308 |
0x00000000,
|
|
309 |
0x00000000,
|
|
310 |
0x00000000
|
|
311 |
};
|
|
312 |
subindex Linux_slave_Index1600[] =
|
|
313 |
{
|
|
314 |
{ RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1600_cnt },
|
|
315 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1600_mappedVar[0]},
|
|
316 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1600_mappedVar[1]},
|
|
317 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1600_mappedVar[2]},
|
|
318 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1600_mappedVar[3]},
|
|
319 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1600_mappedVar[4]},
|
|
320 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1600_mappedVar[5]},
|
|
321 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1600_mappedVar[6]},
|
|
322 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1600_mappedVar[7]}
|
|
323 |
};
|
|
324 |
|
|
325 |
/* index 0x1601 : PDO receive mapping parameter of PDO communication index 0x1401 */
|
|
326 |
UNS8 Linux_slave_obj1601_cnt = 0; // Number of mapped variables
|
|
327 |
UNS32 Linux_slave_obj1601_mappedVar[] = {
|
|
328 |
0x00000000,
|
|
329 |
0x00000000,
|
|
330 |
0x00000000,
|
|
331 |
0x00000000,
|
|
332 |
0x00000000,
|
|
333 |
0x00000000,
|
|
334 |
0x00000000,
|
|
335 |
0x00000000
|
|
336 |
};
|
|
337 |
subindex Linux_slave_Index1601[] =
|
|
338 |
{
|
|
339 |
{ RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1601_cnt },
|
|
340 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1601_mappedVar[0]},
|
|
341 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1601_mappedVar[1]},
|
|
342 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1601_mappedVar[2]},
|
|
343 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1601_mappedVar[3]},
|
|
344 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1601_mappedVar[4]},
|
|
345 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1601_mappedVar[5]},
|
|
346 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1601_mappedVar[6]},
|
|
347 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1601_mappedVar[7]}
|
|
348 |
};
|
|
349 |
|
|
350 |
/* index 0x1602 : PDO receive mapping parameter of PDO communication index 0x1402 */
|
|
351 |
UNS8 Linux_slave_obj1602_cnt = 0; // Number of mapped variables
|
|
352 |
UNS32 Linux_slave_obj1602_mappedVar[] = {
|
|
353 |
0x00000000,
|
|
354 |
0x00000000,
|
|
355 |
0x00000000,
|
|
356 |
0x00000000,
|
|
357 |
0x00000000,
|
|
358 |
0x00000000,
|
|
359 |
0x00000000,
|
|
360 |
0x00000000
|
|
361 |
};
|
|
362 |
subindex Linux_slave_Index1602[] =
|
|
363 |
{
|
|
364 |
{ RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1602_cnt },
|
|
365 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1602_mappedVar[0]},
|
|
366 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1602_mappedVar[1]},
|
|
367 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1602_mappedVar[2]},
|
|
368 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1602_mappedVar[3]},
|
|
369 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1602_mappedVar[4]},
|
|
370 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1602_mappedVar[5]},
|
|
371 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1602_mappedVar[6]},
|
|
372 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1602_mappedVar[7]}
|
|
373 |
};
|
|
374 |
|
|
375 |
/* index 0x1800 : PDO transmit communication parameter */
|
|
376 |
s_pdo_communication_parameter Linux_slave_obj1800 =
|
|
377 |
{ 2, // Largest subindex supported
|
|
378 |
0x0, // Default COBID (overwritten at init for index 0x1400 to 0x1403)
|
|
379 |
253 // Transmission type. See objdictdef.h
|
|
380 |
};
|
|
381 |
subindex Linux_slave_Index1800[] =
|
|
382 |
{
|
|
383 |
{ RO, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1800.count },
|
|
384 |
{ RW, uint8, sizeof( UNS32 ), (void*)&Linux_slave_obj1800.cob_id },
|
|
385 |
{ RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1800.type },
|
|
386 |
};
|
|
387 |
|
|
388 |
/* index 0x1801 : PDO transmit communication parameter */
|
|
389 |
s_pdo_communication_parameter Linux_slave_obj1801 =
|
|
390 |
{ 2, // Largest subindex supported
|
|
391 |
0x0, // Default COBID (overwritten at init for index 0x1400 to 0x1403)
|
|
392 |
253 // Transmission type. See objdictdef.h
|
|
393 |
};
|
|
394 |
subindex Linux_slave_Index1801[] =
|
|
395 |
{
|
|
396 |
{ RO, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1801.count },
|
|
397 |
{ RW, uint8, sizeof( UNS32 ), (void*)&Linux_slave_obj1801.cob_id },
|
|
398 |
{ RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1801.type },
|
|
399 |
};
|
|
400 |
|
|
401 |
/* index 0x1802 : PDO transmit communication parameter */
|
|
402 |
s_pdo_communication_parameter Linux_slave_obj1802 =
|
|
403 |
{ 2, // Largest subindex supported
|
|
404 |
0x0, // Default COBID (overwritten at init for index 0x1400 to 0x1403)
|
|
405 |
253 // Transmission type. See objdictdef.h
|
|
406 |
};
|
|
407 |
subindex Linux_slave_Index1802[] =
|
|
408 |
{
|
|
409 |
{ RO, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1802.count },
|
|
410 |
{ RW, uint8, sizeof( UNS32 ), (void*)&Linux_slave_obj1802.cob_id },
|
|
411 |
{ RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1802.type },
|
|
412 |
};
|
|
413 |
|
|
414 |
/* index 0x1A00 : PDO transmit mapping parameter of PDO communication index 0x1800 */
|
|
415 |
UNS8 Linux_slave_obj1A00_cnt = 0; // Number of mapped variables
|
|
416 |
UNS32 Linux_slave_obj1A00_mappedVar[] = {
|
|
417 |
0x00000000,
|
|
418 |
0x00000000,
|
|
419 |
0x00000000,
|
|
420 |
0x00000000,
|
|
421 |
0x00000000,
|
|
422 |
0x00000000,
|
|
423 |
0x00000000,
|
|
424 |
0x00000000
|
|
425 |
};
|
|
426 |
subindex Linux_slave_Index1A00[] =
|
|
427 |
{
|
|
428 |
{ RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1A00_cnt },
|
|
429 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A00_mappedVar[0]},
|
|
430 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A00_mappedVar[1]},
|
|
431 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A00_mappedVar[2]},
|
|
432 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A00_mappedVar[3]},
|
|
433 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A00_mappedVar[4]},
|
|
434 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A00_mappedVar[5]},
|
|
435 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A00_mappedVar[6]},
|
|
436 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A00_mappedVar[7]}
|
|
437 |
};
|
|
438 |
|
|
439 |
/* index 0x1A01 : PDO transmit mapping parameter of PDO communication index 0x1801 */
|
|
440 |
UNS8 Linux_slave_obj1A01_cnt = 0; // Number of mapped variables
|
|
441 |
UNS32 Linux_slave_obj1A01_mappedVar[] = {
|
|
442 |
0x00000000,
|
|
443 |
0x00000000,
|
|
444 |
0x00000000,
|
|
445 |
0x00000000,
|
|
446 |
0x00000000,
|
|
447 |
0x00000000,
|
|
448 |
0x00000000,
|
|
449 |
0x00000000
|
|
450 |
};
|
|
451 |
subindex Linux_slave_Index1A01[] =
|
|
452 |
{
|
|
453 |
{ RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1A01_cnt },
|
|
454 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A01_mappedVar[0]},
|
|
455 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A01_mappedVar[1]},
|
|
456 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A01_mappedVar[2]},
|
|
457 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A01_mappedVar[3]},
|
|
458 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A01_mappedVar[4]},
|
|
459 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A01_mappedVar[5]},
|
|
460 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A01_mappedVar[6]},
|
|
461 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A01_mappedVar[7]}
|
|
462 |
};
|
|
463 |
|
|
464 |
/* index 0x1A02 : PDO transmit mapping parameter of PDO communication index 0x1802 */
|
|
465 |
UNS8 Linux_slave_obj1A02_cnt = 0; // Number of mapped variables
|
|
466 |
UNS32 Linux_slave_obj1A02_mappedVar[] = {
|
|
467 |
0x00000000,
|
|
468 |
0x00000000,
|
|
469 |
0x00000000,
|
|
470 |
0x00000000,
|
|
471 |
0x00000000,
|
|
472 |
0x00000000,
|
|
473 |
0x00000000,
|
|
474 |
0x00000000
|
|
475 |
};
|
|
476 |
subindex Linux_slave_Index1A02[] =
|
|
477 |
{
|
|
478 |
{ RW, uint8, sizeof( UNS8 ), (void*)&Linux_slave_obj1A02_cnt },
|
|
479 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A02_mappedVar[0]},
|
|
480 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A02_mappedVar[1]},
|
|
481 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A02_mappedVar[2]},
|
|
482 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A02_mappedVar[3]},
|
|
483 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A02_mappedVar[4]},
|
|
484 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A02_mappedVar[5]},
|
|
485 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A02_mappedVar[6]},
|
|
486 |
{ RW, uint32, sizeof( UNS32 ), (void*)&Linux_slave_obj1A02_mappedVar[7]}
|
|
487 |
};
|
|
488 |
|
|
489 |
|
|
490 |
/* index 0x2000 : Mapped variable */
|
|
491 |
UNS8 Linux_slave_highestSubIndex_2000 = 4; // number of subindex - 1
|
|
492 |
subindex Linux_slave_Index2000[] =
|
|
493 |
{
|
|
494 |
{ RO, uint8, sizeof (UNS8), (void*)&Linux_slave_highestSubIndex_2000 },
|
|
495 |
{ RW, uint8, sizeof (UNS8), (void*)&seconds },
|
|
496 |
{ RW, uint8, sizeof (UNS8), (void*)&minutes },
|
|
497 |
{ RW, uint8, sizeof (UNS8), (void*)&hours },
|
|
498 |
{ RW, uint8, sizeof (UNS8), (void*)&day }
|
|
499 |
};
|
|
500 |
|
|
501 |
/* index 0x6000 : Mapped variable */
|
|
502 |
UNS8 Linux_slave_highestSubIndex_6000 = 0; // number of subindex - 1
|
|
503 |
subindex Linux_slave_Index6000[] =
|
|
504 |
{
|
|
505 |
{ RW, uint32, sizeof (UNS32), (void*)&canopenErrNB }
|
|
506 |
};
|
|
507 |
|
|
508 |
/* index 0x6001 : Mapped variable */
|
|
509 |
UNS8 Linux_slave_highestSubIndex_6001 = 0; // number of subindex - 1
|
|
510 |
subindex Linux_slave_Index6001[] =
|
|
511 |
{
|
|
512 |
{ RW, uint32, sizeof (UNS32), (void*)&canopenErrVAL }
|
|
513 |
};
|
|
514 |
|
|
515 |
/* index 0x6002 : Mapped variable */
|
|
516 |
UNS8 Linux_slave_highestSubIndex_6002 = 0; // number of subindex - 1
|
|
517 |
subindex Linux_slave_Index6002[] =
|
|
518 |
{
|
|
519 |
{ RW, visible_string, sizeof (strTest), (void*)&strTest }
|
|
520 |
};
|
|
521 |
|
|
522 |
const indextable Linux_slave_objdict[] =
|
|
523 |
{
|
|
524 |
DeclareIndexTableEntry(Linux_slave_Index1000, 0x1000),
|
|
525 |
DeclareIndexTableEntry(Linux_slave_Index1001, 0x1001),
|
|
526 |
DeclareIndexTableEntry(Linux_slave_Index1005, 0x1005),
|
|
527 |
DeclareIndexTableEntry(Linux_slave_Index1006, 0x1006),
|
|
528 |
DeclareIndexTableEntry(Linux_slave_Index1007, 0x1007),
|
|
529 |
DeclareIndexTableEntry(Linux_slave_Index1008, 0x1008),
|
|
530 |
DeclareIndexTableEntry(Linux_slave_Index1009, 0x1009),
|
|
531 |
DeclareIndexTableEntry(Linux_slave_Index100A, 0x100A),
|
|
532 |
DeclareIndexTableEntry(Linux_slave_Index1016, 0x1016),
|
|
533 |
DeclareIndexTableEntry(Linux_slave_Index1017, 0x1017),
|
|
534 |
DeclareIndexTableEntry(Linux_slave_Index1018, 0x1018),
|
|
535 |
DeclareIndexTableEntry(Linux_slave_Index1200, 0x1200),
|
|
536 |
DeclareIndexTableEntry(Linux_slave_Index1280, 0x1280),
|
|
537 |
DeclareIndexTableEntry(Linux_slave_Index1400, 0x1400),
|
|
538 |
DeclareIndexTableEntry(Linux_slave_Index1401, 0x1401),
|
|
539 |
DeclareIndexTableEntry(Linux_slave_Index1402, 0x1402),
|
|
540 |
DeclareIndexTableEntry(Linux_slave_Index1600, 0x1600),
|
|
541 |
DeclareIndexTableEntry(Linux_slave_Index1601, 0x1601),
|
|
542 |
DeclareIndexTableEntry(Linux_slave_Index1602, 0x1602),
|
|
543 |
DeclareIndexTableEntry(Linux_slave_Index1800, 0x1800),
|
|
544 |
DeclareIndexTableEntry(Linux_slave_Index1801, 0x1801),
|
|
545 |
DeclareIndexTableEntry(Linux_slave_Index1802, 0x1802),
|
|
546 |
DeclareIndexTableEntry(Linux_slave_Index1A00, 0x1A00),
|
|
547 |
DeclareIndexTableEntry(Linux_slave_Index1A01, 0x1A01),
|
|
548 |
DeclareIndexTableEntry(Linux_slave_Index1A02, 0x1A02),
|
|
549 |
DeclareIndexTableEntry(Linux_slave_Index2000, 0x2000),
|
|
550 |
DeclareIndexTableEntry(Linux_slave_Index6000, 0x6000),
|
|
551 |
DeclareIndexTableEntry(Linux_slave_Index6001, 0x6001),
|
|
552 |
DeclareIndexTableEntry(Linux_slave_Index6002, 0x6002),
|
|
553 |
};
|
|
554 |
|
|
555 |
// To count at which received SYNC a PDO must be sent.
|
|
556 |
// Even if no pdoTransmit are defined, at least one entry is computed
|
|
557 |
// for compilations issues.
|
|
558 |
UNS8 Linux_slave_count_sync[1] = {0, };
|
|
559 |
|
|
560 |
quick_index Linux_slave_firstIndex = {
|
|
561 |
SDO_SVR : 11,
|
|
562 |
SDO_CLT : 12,
|
|
563 |
PDO_RCV : 13,
|
|
564 |
PDO_RCV_MAP : 16,
|
|
565 |
PDO_TRS : 19,
|
|
566 |
PDO_TRS_MAP : 22
|
|
567 |
}
|
|
568 |
|
|
569 |
quick_index Linux_slave_lastIndex{
|
|
570 |
SDO_SVR : 11,
|
|
571 |
SDO_CLT : 12,
|
|
572 |
PDO_RCV : 15,
|
|
573 |
PDO_RCV_MAP : 18,
|
|
574 |
PDO_TRS : 21,
|
|
575 |
PDO_TRS_MAP : 24
|
|
576 |
}
|
|
577 |
|
|
578 |
UNS16 Linux_slave_ObjdictSize = sizeof(Linux_slave_objdict)/sizeof(Linux_slave_objdict[0]);
|
|
579 |
|