701
|
1 |
|
|
2 |
/* File generated by gen_cfile.py. Should not be modified. */
|
|
3 |
|
|
4 |
#include "win32test.h"
|
|
5 |
|
|
6 |
/**************************************************************************/
|
|
7 |
/* Declaration of mapped variables */
|
|
8 |
/**************************************************************************/
|
|
9 |
|
|
10 |
/**************************************************************************/
|
|
11 |
/* Declaration of value range types */
|
|
12 |
/**************************************************************************/
|
|
13 |
|
|
14 |
#define valueRange_EMC 0x9F /* Type for index 0x1003 subindex 0x00 (only set of value 0 is possible) */
|
|
15 |
UNS32 win32test_valueRangeTest (UNS8 typeValue, void * value)
|
|
16 |
{
|
|
17 |
switch (typeValue) {
|
|
18 |
case valueRange_EMC:
|
|
19 |
if (*(UNS8*)value != (UNS8)0) return OD_VALUE_RANGE_EXCEEDED;
|
|
20 |
break;
|
|
21 |
}
|
|
22 |
return 0;
|
|
23 |
}
|
|
24 |
|
|
25 |
/**************************************************************************/
|
|
26 |
/* The node id */
|
|
27 |
/**************************************************************************/
|
|
28 |
/* node_id default value.*/
|
|
29 |
UNS8 win32test_bDeviceNodeId = 0x00;
|
|
30 |
|
|
31 |
/**************************************************************************/
|
|
32 |
/* Array of message processing information */
|
|
33 |
|
|
34 |
const UNS8 win32test_iam_a_slave = 0;
|
|
35 |
|
|
36 |
TIMER_HANDLE win32test_heartBeatTimers[1];
|
|
37 |
|
|
38 |
/*
|
|
39 |
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
40 |
|
|
41 |
OBJECT DICTIONARY
|
|
42 |
|
|
43 |
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
|
44 |
*/
|
|
45 |
|
|
46 |
/* index 0x1000 : Device Type. */
|
|
47 |
UNS32 win32test_obj1000 = 0x12D; /* 301 */
|
|
48 |
subindex win32test_Index1000[] =
|
|
49 |
{
|
|
50 |
{ RO, uint32, sizeof (UNS32), (void*)&win32test_obj1000 }
|
|
51 |
};
|
|
52 |
|
|
53 |
/* index 0x1001 : Error Register. */
|
|
54 |
UNS8 win32test_obj1001 = 0x0; /* 0 */
|
|
55 |
subindex win32test_Index1001[] =
|
|
56 |
{
|
|
57 |
{ RO, uint8, sizeof (UNS8), (void*)&win32test_obj1001 }
|
|
58 |
};
|
|
59 |
|
|
60 |
/* index 0x1003 : Pre-defined Error Field */
|
|
61 |
UNS8 win32test_highestSubIndex_obj1003 = 0; /* number of subindex - 1*/
|
|
62 |
UNS32 win32test_obj1003[] =
|
|
63 |
{
|
|
64 |
0x0 /* 0 */
|
|
65 |
};
|
|
66 |
ODCallback_t win32test_Index1003_callbacks[] =
|
|
67 |
{
|
|
68 |
NULL,
|
|
69 |
NULL,
|
|
70 |
};
|
|
71 |
subindex win32test_Index1003[] =
|
|
72 |
{
|
|
73 |
{ RW, valueRange_EMC, sizeof (UNS8), (void*)&win32test_highestSubIndex_obj1003 },
|
|
74 |
{ RO, uint32, sizeof (UNS32), (void*)&win32test_obj1003[0] }
|
|
75 |
};
|
|
76 |
|
|
77 |
/* index 0x1005 : SYNC COB ID. */
|
|
78 |
UNS32 win32test_obj1005 = 0x0; /* 0 */
|
|
79 |
ODCallback_t win32test_Index1005_callbacks[] =
|
|
80 |
{
|
|
81 |
NULL,
|
|
82 |
};
|
|
83 |
subindex win32test_Index1005[] =
|
|
84 |
{
|
|
85 |
{ RW, uint32, sizeof (UNS32), (void*)&win32test_obj1005 }
|
|
86 |
};
|
|
87 |
|
|
88 |
/* index 0x1006 : Communication / Cycle Period */
|
|
89 |
UNS32 win32test_obj1006 = 0x0; /* 0 */
|
|
90 |
|
|
91 |
/* index 0x1014 : Emergency COB ID */
|
|
92 |
UNS32 win32test_obj1014 = 0x80 + 0x00; /* 128 + NodeID */
|
|
93 |
|
|
94 |
/* index 0x1016 : Consumer Heartbeat Time */
|
|
95 |
UNS8 win32test_highestSubIndex_obj1016 = 0;
|
|
96 |
UNS32 win32test_obj1016[]={0};
|
|
97 |
|
|
98 |
/* index 0x1017 : Producer Heartbeat Time */
|
|
99 |
UNS16 win32test_obj1017 = 0x0; /* 0 */
|
|
100 |
|
|
101 |
/* index 0x1018 : Identity. */
|
|
102 |
UNS8 win32test_highestSubIndex_obj1018 = 4; /* number of subindex - 1*/
|
|
103 |
UNS32 win32test_obj1018_Vendor_ID = 0x0; /* 0 */
|
|
104 |
UNS32 win32test_obj1018_Product_Code = 0x0; /* 0 */
|
|
105 |
UNS32 win32test_obj1018_Revision_Number = 0x0; /* 0 */
|
|
106 |
UNS32 win32test_obj1018_Serial_Number = 0x0; /* 0 */
|
|
107 |
subindex win32test_Index1018[] =
|
|
108 |
{
|
|
109 |
{ RO, uint8, sizeof (UNS8), (void*)&win32test_highestSubIndex_obj1018 },
|
|
110 |
{ RO, uint32, sizeof (UNS32), (void*)&win32test_obj1018_Vendor_ID },
|
|
111 |
{ RO, uint32, sizeof (UNS32), (void*)&win32test_obj1018_Product_Code },
|
|
112 |
{ RO, uint32, sizeof (UNS32), (void*)&win32test_obj1018_Revision_Number },
|
|
113 |
{ RO, uint32, sizeof (UNS32), (void*)&win32test_obj1018_Serial_Number }
|
|
114 |
};
|
|
115 |
|
|
116 |
/* index 0x1280 : Client SDO 1 Parameter. */
|
|
117 |
UNS8 win32test_highestSubIndex_obj1280 = 3; /* number of subindex - 1*/
|
|
118 |
UNS32 win32test_obj1280_COB_ID_Client_to_Server_Transmit_SDO = 0x0; /* 0 */
|
|
119 |
UNS32 win32test_obj1280_COB_ID_Server_to_Client_Receive_SDO = 0x0; /* 0 */
|
|
120 |
UNS8 win32test_obj1280_Node_ID_of_the_SDO_Server = 0x0; /* 0 */
|
|
121 |
subindex win32test_Index1280[] =
|
|
122 |
{
|
|
123 |
{ RO, uint8, sizeof (UNS8), (void*)&win32test_highestSubIndex_obj1280 },
|
|
124 |
{ RW, uint32, sizeof (UNS32), (void*)&win32test_obj1280_COB_ID_Client_to_Server_Transmit_SDO },
|
|
125 |
{ RW, uint32, sizeof (UNS32), (void*)&win32test_obj1280_COB_ID_Server_to_Client_Receive_SDO },
|
|
126 |
{ RW, uint8, sizeof (UNS8), (void*)&win32test_obj1280_Node_ID_of_the_SDO_Server }
|
|
127 |
};
|
|
128 |
|
|
129 |
/**************************************************************************/
|
|
130 |
/* Declaration of pointed variables */
|
|
131 |
/**************************************************************************/
|
|
132 |
|
|
133 |
const indextable win32test_objdict[] =
|
|
134 |
{
|
|
135 |
{ (subindex*)win32test_Index1000,sizeof(win32test_Index1000)/sizeof(win32test_Index1000[0]), 0x1000},
|
|
136 |
{ (subindex*)win32test_Index1001,sizeof(win32test_Index1001)/sizeof(win32test_Index1001[0]), 0x1001},
|
|
137 |
{ (subindex*)win32test_Index1005,sizeof(win32test_Index1005)/sizeof(win32test_Index1005[0]), 0x1005},
|
|
138 |
{ (subindex*)win32test_Index1018,sizeof(win32test_Index1018)/sizeof(win32test_Index1018[0]), 0x1018},
|
|
139 |
{ (subindex*)win32test_Index1280,sizeof(win32test_Index1280)/sizeof(win32test_Index1280[0]), 0x1280},
|
|
140 |
};
|
|
141 |
|
|
142 |
const indextable * win32test_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks)
|
|
143 |
{
|
|
144 |
int i;
|
|
145 |
*callbacks = NULL;
|
|
146 |
switch(wIndex){
|
|
147 |
case 0x1000: i = 0;break;
|
|
148 |
case 0x1001: i = 1;break;
|
|
149 |
case 0x1005: i = 2;*callbacks = win32test_Index1005_callbacks; break;
|
|
150 |
case 0x1018: i = 3;break;
|
|
151 |
case 0x1280: i = 4;break;
|
|
152 |
default:
|
|
153 |
*errorCode = OD_NO_SUCH_OBJECT;
|
|
154 |
return NULL;
|
|
155 |
}
|
|
156 |
*errorCode = OD_SUCCESSFUL;
|
|
157 |
return &win32test_objdict[i];
|
|
158 |
}
|
|
159 |
|
|
160 |
/*
|
|
161 |
* To count at which received SYNC a PDO must be sent.
|
|
162 |
* Even if no pdoTransmit are defined, at least one entry is computed
|
|
163 |
* for compilations issues.
|
|
164 |
*/
|
|
165 |
s_PDO_status win32test_PDO_status[1] = {s_PDO_status_Initializer};
|
|
166 |
|
|
167 |
const quick_index win32test_firstIndex = {
|
|
168 |
0, /* SDO_SVR */
|
|
169 |
4, /* SDO_CLT */
|
|
170 |
0, /* PDO_RCV */
|
|
171 |
0, /* PDO_RCV_MAP */
|
|
172 |
0, /* PDO_TRS */
|
|
173 |
0 /* PDO_TRS_MAP */
|
|
174 |
};
|
|
175 |
|
|
176 |
const quick_index win32test_lastIndex = {
|
|
177 |
0, /* SDO_SVR */
|
|
178 |
4, /* SDO_CLT */
|
|
179 |
0, /* PDO_RCV */
|
|
180 |
0, /* PDO_RCV_MAP */
|
|
181 |
0, /* PDO_TRS */
|
|
182 |
0 /* PDO_TRS_MAP */
|
|
183 |
};
|
|
184 |
|
|
185 |
const UNS16 win32test_ObjdictSize = sizeof(win32test_objdict)/sizeof(win32test_objdict[0]);
|
|
186 |
|
|
187 |
CO_Data win32test_Data = CANOPEN_NODE_DATA_INITIALIZER(win32test);
|
|
188 |
|