21 #define EC_MAX_SYNC 16 |
21 #define EC_MAX_SYNC 16 |
22 |
22 |
23 /*****************************************************************************/ |
23 /*****************************************************************************/ |
24 |
24 |
25 /** |
25 /** |
26 Besondere Slaves. |
26 Special slaves. |
27 */ |
27 */ |
28 |
28 |
29 typedef enum |
29 typedef enum |
30 { |
30 { |
31 EC_TYPE_NORMAL, |
31 EC_TYPE_NORMAL, /**< no special slave */ |
32 EC_TYPE_BUS_COUPLER, |
32 EC_TYPE_BUS_COUPLER, /**< slave is a bus coupler */ |
33 EC_TYPE_EOE |
33 EC_TYPE_EOE /**< slave is an EoE switch */ |
34 } |
34 } |
35 ec_special_type_t; |
35 ec_special_type_t; |
36 |
36 |
37 /*****************************************************************************/ |
37 /*****************************************************************************/ |
38 |
38 |
39 /** |
39 /** |
40 Prozessdatenfeld. |
40 Process data field. |
41 */ |
41 */ |
42 |
42 |
43 typedef struct |
43 typedef struct |
44 { |
44 { |
45 const char *name; |
45 const char *name; /**< field name */ |
46 size_t size; |
46 size_t size; /**< field size in bytes */ |
47 } |
47 } |
48 ec_field_t; |
48 ec_field_t; |
49 |
49 |
50 /*****************************************************************************/ |
50 /*****************************************************************************/ |
51 |
51 |
53 Sync-Manager. |
53 Sync-Manager. |
54 */ |
54 */ |
55 |
55 |
56 typedef struct |
56 typedef struct |
57 { |
57 { |
58 uint16_t physical_start_address; |
58 uint16_t physical_start_address; /**< physical start address */ |
59 uint16_t size; |
59 uint16_t size; /**< size in bytes */ |
60 uint8_t control_byte; |
60 uint8_t control_byte; /**< control register value */ |
61 const ec_field_t *fields[EC_MAX_FIELDS]; |
61 const ec_field_t *fields[EC_MAX_FIELDS]; /**< field array */ |
62 } |
62 } |
63 ec_sync_t; |
63 ec_sync_t; |
64 |
64 |
65 /*****************************************************************************/ |
65 /*****************************************************************************/ |
66 |
66 |
67 /** |
67 /** |
68 Beschreibung eines EtherCAT-Slave-Typs. |
68 Slave description type. |
69 |
|
70 Diese Beschreibung dient zur Konfiguration einer bestimmten |
|
71 Slave-Art. Sie enthält die Konfigurationsdaten für die |
|
72 Slave-internen Sync-Manager und FMMUs. |
|
73 */ |
69 */ |
74 |
70 |
75 typedef struct ec_slave_type |
71 typedef struct ec_slave_type |
76 { |
72 { |
77 const char *vendor_name; /**< Name des Herstellers */ |
73 const char *vendor_name; /**< vendor name*/ |
78 const char *product_name; /**< Name des Slaves-Typs */ |
74 const char *product_name; /**< product name */ |
79 const char *description; /**< Genauere Beschreibung des Slave-Typs */ |
75 const char *description; /**< free description */ |
80 ec_special_type_t special; /**< Spezieller Slave-Typ */ |
76 ec_special_type_t special; /**< special slave type? */ |
81 const ec_sync_t *sync_managers[EC_MAX_SYNC]; /**< Sync-Manager |
77 const ec_sync_t *sync_managers[EC_MAX_SYNC]; /**< sync managers */ |
82 Konfigurationen */ |
|
83 } |
78 } |
84 ec_slave_type_t; |
79 ec_slave_type_t; |
85 |
80 |
86 /*****************************************************************************/ |
81 /*****************************************************************************/ |
87 |
82 |
88 /** |
83 /** |
89 Identifikation eines Slave-Typs. |
84 Slave type identification. |
90 |
|
91 Diese Struktur wird zur 1:n-Zuordnung von Hersteller- und |
|
92 Produktcodes zu den einzelnen Slave-Typen verwendet. |
|
93 */ |
85 */ |
94 |
86 |
95 typedef struct slave_ident |
87 typedef struct |
96 { |
88 { |
97 uint32_t vendor_id; /**< Hersteller-Code */ |
89 uint32_t vendor_id; /**< vendor id */ |
98 uint32_t product_code; /**< Herstellerspezifischer Produktcode */ |
90 uint32_t product_code; /**< product code */ |
99 const ec_slave_type_t *type; /**< Zeiger auf den entsprechenden Typ */ |
91 const ec_slave_type_t *type; /**< associated slave description object */ |
100 } |
92 } |
101 ec_slave_ident_t; |
93 ec_slave_ident_t; |
102 |
94 |
103 extern ec_slave_ident_t slave_idents[]; /**< Statisches Array der |
95 extern ec_slave_ident_t slave_idents[]; /**< array with slave descriptions */ |
104 Slave-Identifikationen */ |
|
105 |
96 |
106 /*****************************************************************************/ |
97 /*****************************************************************************/ |
107 |
98 |
108 #endif |
99 #endif |
109 |
|
110 /* Emacs-Konfiguration |
|
111 ;;; Local Variables: *** |
|
112 ;;; c-basic-offset:4 *** |
|
113 ;;; End: *** |
|
114 */ |
|