equal
deleted
inserted
replaced
10 |
10 |
11 #ifndef _EC_SLAVE_H_ |
11 #ifndef _EC_SLAVE_H_ |
12 #define _EC_SLAVE_H_ |
12 #define _EC_SLAVE_H_ |
13 |
13 |
14 #include <linux/list.h> |
14 #include <linux/list.h> |
|
15 #include <linux/kobject.h> |
15 |
16 |
16 #include "globals.h" |
17 #include "globals.h" |
17 #include "command.h" |
18 #include "command.h" |
18 #include "types.h" |
19 #include "types.h" |
19 |
20 |
186 EtherCAT-Slave |
187 EtherCAT-Slave |
187 */ |
188 */ |
188 |
189 |
189 struct ec_slave |
190 struct ec_slave |
190 { |
191 { |
|
192 struct list_head list; /**< Noetig fuer Slave-Liste im Master */ |
|
193 struct kobject kobj; /**< Kernel-Object */ |
191 ec_master_t *master; /**< EtherCAT-Master, zu dem der Slave gehört. */ |
194 ec_master_t *master; /**< EtherCAT-Master, zu dem der Slave gehört. */ |
192 |
195 |
193 // Addresses |
196 // Addresses |
194 uint16_t ring_position; /**< Position des Slaves im Bus */ |
197 uint16_t ring_position; /**< Position des Slaves im Bus */ |
195 uint16_t station_address; /**< Konfigurierte Slave-Adresse */ |
198 uint16_t station_address; /**< Konfigurierte Slave-Adresse */ |
|
199 uint16_t buscoupler_index; /**< Letzter Buskoppler */ |
|
200 uint16_t index_after_buscoupler; /**< Index hinter letztem Buskoppler */ |
196 |
201 |
197 // Base data |
202 // Base data |
198 uint8_t base_type; /**< Slave-Typ */ |
203 uint8_t base_type; /**< Slave-Typ */ |
199 uint8_t base_revision; /**< Revision */ |
204 uint8_t base_revision; /**< Revision */ |
200 uint16_t base_build; /**< Build-Nummer */ |
205 uint16_t base_build; /**< Build-Nummer */ |
240 }; |
245 }; |
241 |
246 |
242 /*****************************************************************************/ |
247 /*****************************************************************************/ |
243 |
248 |
244 // Slave construction/destruction |
249 // Slave construction/destruction |
245 void ec_slave_init(ec_slave_t *, ec_master_t *); |
250 int ec_slave_init(ec_slave_t *, ec_master_t *, uint16_t, uint16_t); |
246 void ec_slave_clear(ec_slave_t *); |
251 void ec_slave_clear(struct kobject *); |
247 |
252 |
248 // Slave control |
253 // Slave control |
249 int ec_slave_fetch(ec_slave_t *); |
254 int ec_slave_fetch(ec_slave_t *); |
250 int ec_slave_sii_read16(ec_slave_t *, uint16_t, uint16_t *); |
255 int ec_slave_sii_read16(ec_slave_t *, uint16_t, uint16_t *); |
251 int ec_slave_sii_read32(ec_slave_t *, uint16_t, uint32_t *); |
256 int ec_slave_sii_read32(ec_slave_t *, uint16_t, uint32_t *); |