changeset 1079 | ef1266652c4d |
parent 1057 | 435d7f36f13d |
child 1082 | ff06c58e269c |
1078:fce58ba8a912 | 1079:ef1266652c4d |
---|---|
45 |
45 |
46 #include "globals.h" |
46 #include "globals.h" |
47 |
47 |
48 /*****************************************************************************/ |
48 /*****************************************************************************/ |
49 |
49 |
50 #define EC_IOCTL_TYPE 0xa4 |
50 #define EC_IOCTL_TYPE 0xa4 |
51 |
51 |
52 #define EC_IO(nr) _IO(EC_IOCTL_TYPE,nr) |
52 #define EC_IO(nr) _IO(EC_IOCTL_TYPE, nr) |
53 #define EC_IOR(nr,type) _IOR(EC_IOCTL_TYPE,nr,type) |
53 #define EC_IOR(nr, type) _IOR(EC_IOCTL_TYPE, nr, type) |
54 #define EC_IOW(nr,type) _IOW(EC_IOCTL_TYPE,nr,type) |
54 #define EC_IOW(nr, type) _IOW(EC_IOCTL_TYPE, nr, type) |
55 #define EC_IOWR(nr,type) _IOWR(EC_IOCTL_TYPE,nr,type) |
55 #define EC_IOWR(nr, type) _IOWR(EC_IOCTL_TYPE, nr, type) |
56 |
56 |
57 #define EC_IOCTL_MASTER EC_IOR(0x00, ec_ioctl_master_t) |
57 #define EC_IOCTL_MASTER EC_IOR(0x00, ec_ioctl_master_t) |
58 #define EC_IOCTL_SLAVE EC_IOWR(0x01, ec_ioctl_slave_t) |
58 #define EC_IOCTL_SLAVE EC_IOWR(0x01, ec_ioctl_slave_t) |
59 #define EC_IOCTL_SYNC EC_IOWR(0x02, ec_ioctl_sync_t) |
59 #define EC_IOCTL_SLAVE_SYNC EC_IOWR(0x02, ec_ioctl_slave_sync_t) |
60 #define EC_IOCTL_PDO EC_IOWR(0x03, ec_ioctl_pdo_t) |
60 #define EC_IOCTL_SLAVE_SYNC_PDO EC_IOWR(0x03, ec_ioctl_slave_sync_pdo_t) |
61 #define EC_IOCTL_PDO_ENTRY EC_IOWR(0x04, ec_ioctl_pdo_entry_t) |
61 #define EC_IOCTL_SLAVE_SYNC_PDO_ENTRY EC_IOWR(0x04, ec_ioctl_slave_sync_pdo_entry_t) |
62 #define EC_IOCTL_DOMAIN EC_IOWR(0x05, ec_ioctl_domain_t) |
62 #define EC_IOCTL_DOMAIN EC_IOWR(0x05, ec_ioctl_domain_t) |
63 #define EC_IOCTL_DOMAIN_FMMU EC_IOWR(0x06, ec_ioctl_domain_fmmu_t) |
63 #define EC_IOCTL_DOMAIN_FMMU EC_IOWR(0x06, ec_ioctl_domain_fmmu_t) |
64 #define EC_IOCTL_DATA EC_IOWR(0x07, ec_ioctl_data_t) |
64 #define EC_IOCTL_DOMAIN_DATA EC_IOWR(0x07, ec_ioctl_domain_data_t) |
65 #define EC_IOCTL_SET_DEBUG EC_IO(0x08) |
65 #define EC_IOCTL_MASTER_DEBUG EC_IO(0x08) |
66 #define EC_IOCTL_SLAVE_STATE EC_IOW(0x09, ec_ioctl_slave_state_t) |
66 #define EC_IOCTL_SLAVE_STATE EC_IOW(0x09, ec_ioctl_slave_state_t) |
67 #define EC_IOCTL_SDO EC_IOWR(0x0a, ec_ioctl_sdo_t) |
67 #define EC_IOCTL_SLAVE_SDO EC_IOWR(0x0a, ec_ioctl_slave_sdo_t) |
68 #define EC_IOCTL_SDO_ENTRY EC_IOWR(0x0b, ec_ioctl_sdo_entry_t) |
68 #define EC_IOCTL_SLAVE_SDO_ENTRY EC_IOWR(0x0b, ec_ioctl_slave_sdo_entry_t) |
69 #define EC_IOCTL_SDO_UPLOAD EC_IOWR(0x0c, ec_ioctl_sdo_upload_t) |
69 #define EC_IOCTL_SLAVE_SDO_UPLOAD EC_IOWR(0x0c, ec_ioctl_slave_sdo_upload_t) |
70 #define EC_IOCTL_SDO_DOWNLOAD EC_IOWR(0x0d, ec_ioctl_sdo_download_t) |
70 #define EC_IOCTL_SLAVE_SDO_DOWNLOAD EC_IOWR(0x0d, ec_ioctl_slave_sdo_download_t) |
71 #define EC_IOCTL_SII_READ EC_IOWR(0x0e, ec_ioctl_sii_t) |
71 #define EC_IOCTL_SLAVE_SII_READ EC_IOWR(0x0e, ec_ioctl_slave_sii_t) |
72 #define EC_IOCTL_SII_WRITE EC_IOW(0x0f, ec_ioctl_sii_t) |
72 #define EC_IOCTL_SLAVE_SII_WRITE EC_IOW(0x0f, ec_ioctl_slave_sii_t) |
73 #define EC_IOCTL_CONFIG EC_IOWR(0x10, ec_ioctl_config_t) |
73 #define EC_IOCTL_CONFIG EC_IOWR(0x10, ec_ioctl_config_t) |
74 #define EC_IOCTL_CONFIG_PDO EC_IOWR(0x11, ec_ioctl_config_pdo_t) |
74 #define EC_IOCTL_CONFIG_PDO EC_IOWR(0x11, ec_ioctl_config_pdo_t) |
75 #define EC_IOCTL_CONFIG_PDO_ENTRY EC_IOWR(0x12, ec_ioctl_config_pdo_entry_t) |
75 #define EC_IOCTL_CONFIG_PDO_ENTRY EC_IOWR(0x12, ec_ioctl_config_pdo_entry_t) |
76 #define EC_IOCTL_CONFIG_SDO EC_IOWR(0x13, ec_ioctl_config_sdo_t) |
76 #define EC_IOCTL_CONFIG_SDO EC_IOWR(0x13, ec_ioctl_config_sdo_t) |
77 |
77 |
78 #define EC_IOCTL_STRING_SIZE 64 |
78 #define EC_IOCTL_STRING_SIZE 64 |
79 |
79 |
80 /*****************************************************************************/ |
80 /*****************************************************************************/ |
81 |
81 |
133 uint16_t default_size; |
133 uint16_t default_size; |
134 uint8_t control_register; |
134 uint8_t control_register; |
135 uint8_t enable; |
135 uint8_t enable; |
136 uint8_t assign_source; |
136 uint8_t assign_source; |
137 uint8_t pdo_count; |
137 uint8_t pdo_count; |
138 } ec_ioctl_sync_t; |
138 } ec_ioctl_slave_sync_t; |
139 |
139 |
140 /*****************************************************************************/ |
140 /*****************************************************************************/ |
141 |
141 |
142 typedef struct { |
142 typedef struct { |
143 // inputs |
143 // inputs |
147 |
147 |
148 // outputs |
148 // outputs |
149 uint16_t index; |
149 uint16_t index; |
150 uint8_t entry_count; |
150 uint8_t entry_count; |
151 int8_t name[EC_IOCTL_STRING_SIZE]; |
151 int8_t name[EC_IOCTL_STRING_SIZE]; |
152 } ec_ioctl_pdo_t; |
152 } ec_ioctl_slave_sync_pdo_t; |
153 |
153 |
154 /*****************************************************************************/ |
154 /*****************************************************************************/ |
155 |
155 |
156 typedef struct { |
156 typedef struct { |
157 // inputs |
157 // inputs |
163 // outputs |
163 // outputs |
164 uint16_t index; |
164 uint16_t index; |
165 uint8_t subindex; |
165 uint8_t subindex; |
166 uint8_t bit_length; |
166 uint8_t bit_length; |
167 int8_t name[EC_IOCTL_STRING_SIZE]; |
167 int8_t name[EC_IOCTL_STRING_SIZE]; |
168 } ec_ioctl_pdo_entry_t; |
168 } ec_ioctl_slave_sync_pdo_entry_t; |
169 |
169 |
170 /*****************************************************************************/ |
170 /*****************************************************************************/ |
171 |
171 |
172 typedef struct { |
172 typedef struct { |
173 // inputs |
173 // inputs |
202 typedef struct { |
202 typedef struct { |
203 // inputs |
203 // inputs |
204 uint32_t domain_index; |
204 uint32_t domain_index; |
205 uint32_t data_size; |
205 uint32_t data_size; |
206 uint8_t *target; |
206 uint8_t *target; |
207 } ec_ioctl_data_t; |
207 } ec_ioctl_domain_data_t; |
208 |
208 |
209 /*****************************************************************************/ |
209 /*****************************************************************************/ |
210 |
210 |
211 typedef struct { |
211 typedef struct { |
212 // inputs |
212 // inputs |
223 |
223 |
224 // outputs |
224 // outputs |
225 uint16_t sdo_index; |
225 uint16_t sdo_index; |
226 uint8_t max_subindex; |
226 uint8_t max_subindex; |
227 int8_t name[EC_IOCTL_STRING_SIZE]; |
227 int8_t name[EC_IOCTL_STRING_SIZE]; |
228 } ec_ioctl_sdo_t; |
228 } ec_ioctl_slave_sdo_t; |
229 |
229 |
230 /*****************************************************************************/ |
230 /*****************************************************************************/ |
231 |
231 |
232 typedef struct { |
232 typedef struct { |
233 // inputs |
233 // inputs |
237 |
237 |
238 // outputs |
238 // outputs |
239 uint16_t data_type; |
239 uint16_t data_type; |
240 uint16_t bit_length; |
240 uint16_t bit_length; |
241 int8_t description[EC_IOCTL_STRING_SIZE]; |
241 int8_t description[EC_IOCTL_STRING_SIZE]; |
242 } ec_ioctl_sdo_entry_t; |
242 } ec_ioctl_slave_sdo_entry_t; |
243 |
243 |
244 /*****************************************************************************/ |
244 /*****************************************************************************/ |
245 |
245 |
246 typedef struct { |
246 typedef struct { |
247 // inputs |
247 // inputs |
252 uint8_t *target; |
252 uint8_t *target; |
253 |
253 |
254 // outputs |
254 // outputs |
255 uint32_t data_size; |
255 uint32_t data_size; |
256 uint32_t abort_code; |
256 uint32_t abort_code; |
257 } ec_ioctl_sdo_upload_t; |
257 } ec_ioctl_slave_sdo_upload_t; |
258 |
258 |
259 /*****************************************************************************/ |
259 /*****************************************************************************/ |
260 |
260 |
261 typedef struct { |
261 typedef struct { |
262 // inputs |
262 // inputs |
266 uint32_t data_size; |
266 uint32_t data_size; |
267 uint8_t *data; |
267 uint8_t *data; |
268 |
268 |
269 // outputs |
269 // outputs |
270 uint32_t abort_code; |
270 uint32_t abort_code; |
271 } ec_ioctl_sdo_download_t; |
271 } ec_ioctl_slave_sdo_download_t; |
272 |
272 |
273 /*****************************************************************************/ |
273 /*****************************************************************************/ |
274 |
274 |
275 typedef struct { |
275 typedef struct { |
276 // inputs |
276 // inputs |
277 uint16_t slave_position; |
277 uint16_t slave_position; |
278 uint16_t offset; |
278 uint16_t offset; |
279 uint32_t nwords; |
279 uint32_t nwords; |
280 uint16_t *words; |
280 uint16_t *words; |
281 } ec_ioctl_sii_t; |
281 } ec_ioctl_slave_sii_t; |
282 |
282 |
283 /*****************************************************************************/ |
283 /*****************************************************************************/ |
284 |
284 |
285 typedef struct { |
285 typedef struct { |
286 // inputs |
286 // inputs |