author | Florian Pose <fp@igh-essen.com> |
Thu, 02 Oct 2008 09:56:39 +0000 | |
branch | stable-1.3 |
changeset 1760 | 036f19bde00b |
parent 1746 | 72e7507b3f1b |
permissions | -rw-r--r-- |
39
6965c23a6826
likely/unlikely, Fehlermeldungen in zyklischem Code begrenzt und Kommentare ge??ndert.
Florian Pose <fp@igh-essen.com>
parents:
5
diff
changeset
|
1 |
/****************************************************************************** |
0 | 2 |
* |
39
6965c23a6826
likely/unlikely, Fehlermeldungen in zyklischem Code begrenzt und Kommentare ge??ndert.
Florian Pose <fp@igh-essen.com>
parents:
5
diff
changeset
|
3 |
* $Id$ |
0 | 4 |
* |
197
b9a6e2c22745
GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents:
195
diff
changeset
|
5 |
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH |
b9a6e2c22745
GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents:
195
diff
changeset
|
6 |
* |
b9a6e2c22745
GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents:
195
diff
changeset
|
7 |
* This file is part of the IgH EtherCAT Master. |
b9a6e2c22745
GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents:
195
diff
changeset
|
8 |
* |
b9a6e2c22745
GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents:
195
diff
changeset
|
9 |
* The IgH EtherCAT Master is free software; you can redistribute it |
b9a6e2c22745
GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents:
195
diff
changeset
|
10 |
* and/or modify it under the terms of the GNU General Public License |
246
0bf7c769de06
Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents:
238
diff
changeset
|
11 |
* as published by the Free Software Foundation; either version 2 of the |
0bf7c769de06
Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents:
238
diff
changeset
|
12 |
* License, or (at your option) any later version. |
197
b9a6e2c22745
GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents:
195
diff
changeset
|
13 |
* |
b9a6e2c22745
GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents:
195
diff
changeset
|
14 |
* The IgH EtherCAT Master is distributed in the hope that it will be |
b9a6e2c22745
GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents:
195
diff
changeset
|
15 |
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of |
b9a6e2c22745
GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents:
195
diff
changeset
|
16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
b9a6e2c22745
GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents:
195
diff
changeset
|
17 |
* GNU General Public License for more details. |
b9a6e2c22745
GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents:
195
diff
changeset
|
18 |
* |
b9a6e2c22745
GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents:
195
diff
changeset
|
19 |
* You should have received a copy of the GNU General Public License |
b9a6e2c22745
GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents:
195
diff
changeset
|
20 |
* along with the IgH EtherCAT Master; if not, write to the Free Software |
b9a6e2c22745
GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents:
195
diff
changeset
|
21 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
b9a6e2c22745
GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents:
195
diff
changeset
|
22 |
* |
246
0bf7c769de06
Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents:
238
diff
changeset
|
23 |
* The right to use EtherCAT Technology is granted and comes free of |
0bf7c769de06
Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents:
238
diff
changeset
|
24 |
* charge under condition of compatibility of product made by |
0bf7c769de06
Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents:
238
diff
changeset
|
25 |
* Licensee. People intending to distribute/sell products based on the |
0bf7c769de06
Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents:
238
diff
changeset
|
26 |
* code, have to sign an agreement to guarantee that products using |
0bf7c769de06
Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents:
238
diff
changeset
|
27 |
* software based on IgH EtherCAT master stay compatible with the actual |
0bf7c769de06
Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents:
238
diff
changeset
|
28 |
* EtherCAT specification (which are released themselves as an open |
0bf7c769de06
Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents:
238
diff
changeset
|
29 |
* standard) as the (only) precondition to have the right to use EtherCAT |
0bf7c769de06
Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents:
238
diff
changeset
|
30 |
* Technology, IP and trade marks. |
0bf7c769de06
Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents:
238
diff
changeset
|
31 |
* |
39
6965c23a6826
likely/unlikely, Fehlermeldungen in zyklischem Code begrenzt und Kommentare ge??ndert.
Florian Pose <fp@igh-essen.com>
parents:
5
diff
changeset
|
32 |
*****************************************************************************/ |
0 | 33 |
|
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
34 |
/** |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
35 |
\file |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
36 |
EtherCAT stave structure. |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
37 |
*/ |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
38 |
|
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
39 |
/*****************************************************************************/ |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
40 |
|
0 | 41 |
#ifndef _EC_SLAVE_H_ |
42 |
#define _EC_SLAVE_H_ |
|
43 |
||
145
11a82e4fd31b
Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
144
diff
changeset
|
44 |
#include <linux/list.h> |
182
8c0bc99229a9
Slaves stored in list, slaves in SysFS
Florian Pose <fp@igh-essen.com>
parents:
175
diff
changeset
|
45 |
#include <linux/kobject.h> |
145
11a82e4fd31b
Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
144
diff
changeset
|
46 |
|
1715
e675450f2174
MERGE trunk -r463:494 -> branches/stable-1.1 (Version 1.1)
Florian Pose <fp@igh-essen.com>
parents:
293
diff
changeset
|
47 |
#include "../include/ecrt.h" |
e675450f2174
MERGE trunk -r463:494 -> branches/stable-1.1 (Version 1.1)
Florian Pose <fp@igh-essen.com>
parents:
293
diff
changeset
|
48 |
|
145
11a82e4fd31b
Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
144
diff
changeset
|
49 |
#include "globals.h" |
293
14aeb79aa992
Renamed command structure to datagram.
Florian Pose <fp@igh-essen.com>
parents:
291
diff
changeset
|
50 |
#include "datagram.h" |
1744
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
51 |
#include "pdo.h" |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
52 |
#include "sync.h" |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
53 |
#include "fmmu.h" |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
54 |
|
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
55 |
/*****************************************************************************/ |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
56 |
|
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
57 |
/** maximum number of FMMUs per slave */ |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
58 |
#define EC_MAX_FMMUS 16 |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
59 |
|
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
60 |
/*****************************************************************************/ |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
61 |
|
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
62 |
/** |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
63 |
* State of an EtherCAT slave. |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
64 |
*/ |
98
f564d0929292
MERGE branches/async 222:233 -> trunk (Kommando-Warteschlangen).
Florian Pose <fp@igh-essen.com>
parents:
74
diff
changeset
|
65 |
|
f564d0929292
MERGE branches/async 222:233 -> trunk (Kommando-Warteschlangen).
Florian Pose <fp@igh-essen.com>
parents:
74
diff
changeset
|
66 |
typedef enum |
f564d0929292
MERGE branches/async 222:233 -> trunk (Kommando-Warteschlangen).
Florian Pose <fp@igh-essen.com>
parents:
74
diff
changeset
|
67 |
{ |
126
bbc963b9fead
Restliche EEPROM-Daten ausgelesen.
Florian Pose <fp@igh-essen.com>
parents:
123
diff
changeset
|
68 |
EC_SLAVE_STATE_UNKNOWN = 0x00, |
195
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
69 |
/**< unknown state */ |
126
bbc963b9fead
Restliche EEPROM-Daten ausgelesen.
Florian Pose <fp@igh-essen.com>
parents:
123
diff
changeset
|
70 |
EC_SLAVE_STATE_INIT = 0x01, |
195
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
71 |
/**< INIT state (no mailbox communication, no IO) */ |
126
bbc963b9fead
Restliche EEPROM-Daten ausgelesen.
Florian Pose <fp@igh-essen.com>
parents:
123
diff
changeset
|
72 |
EC_SLAVE_STATE_PREOP = 0x02, |
195
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
73 |
/**< PREOP state (mailbox communication, no IO) */ |
126
bbc963b9fead
Restliche EEPROM-Daten ausgelesen.
Florian Pose <fp@igh-essen.com>
parents:
123
diff
changeset
|
74 |
EC_SLAVE_STATE_SAVEOP = 0x04, |
195
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
75 |
/**< SAVEOP (mailbox communication and input update) */ |
126
bbc963b9fead
Restliche EEPROM-Daten ausgelesen.
Florian Pose <fp@igh-essen.com>
parents:
123
diff
changeset
|
76 |
EC_SLAVE_STATE_OP = 0x08, |
195
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
77 |
/**< OP (mailbox communication and input/output update) */ |
1732
1cc865ba17c2
MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents:
1731
diff
changeset
|
78 |
EC_SLAVE_STATE_ACK_ERR = 0x10 |
1cc865ba17c2
MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents:
1731
diff
changeset
|
79 |
/**< Acknowledge/Error bit (no actual state) */ |
98
f564d0929292
MERGE branches/async 222:233 -> trunk (Kommando-Warteschlangen).
Florian Pose <fp@igh-essen.com>
parents:
74
diff
changeset
|
80 |
} |
f564d0929292
MERGE branches/async 222:233 -> trunk (Kommando-Warteschlangen).
Florian Pose <fp@igh-essen.com>
parents:
74
diff
changeset
|
81 |
ec_slave_state_t; |
f564d0929292
MERGE branches/async 222:233 -> trunk (Kommando-Warteschlangen).
Florian Pose <fp@igh-essen.com>
parents:
74
diff
changeset
|
82 |
|
f564d0929292
MERGE branches/async 222:233 -> trunk (Kommando-Warteschlangen).
Florian Pose <fp@igh-essen.com>
parents:
74
diff
changeset
|
83 |
/*****************************************************************************/ |
f564d0929292
MERGE branches/async 222:233 -> trunk (Kommando-Warteschlangen).
Florian Pose <fp@igh-essen.com>
parents:
74
diff
changeset
|
84 |
|
f564d0929292
MERGE branches/async 222:233 -> trunk (Kommando-Warteschlangen).
Florian Pose <fp@igh-essen.com>
parents:
74
diff
changeset
|
85 |
/** |
1746
72e7507b3f1b
merge -r931:HEAD svn://yak/vol/projekte/msr_messen_steuern_regeln/ethercat/rep/trunk .
Florian Pose <fp@igh-essen.com>
parents:
1744
diff
changeset
|
86 |
* EtherCAT slave online state. |
1744
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
87 |
*/ |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
88 |
|
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
89 |
typedef enum { |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
90 |
EC_SLAVE_OFFLINE, |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
91 |
EC_SLAVE_ONLINE |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
92 |
} |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
93 |
ec_slave_online_state_t; |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
94 |
|
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
95 |
/*****************************************************************************/ |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
96 |
|
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
97 |
/** |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
98 |
* Supported mailbox protocols. |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
99 |
*/ |
133
b36d187ecc0b
Unterst?tzte Prot. auslesen, Mailbox in Slave ausgelagert, Bugfix in Anzeige des Watch-Frames und erste SDO-List-Abfrage.
Florian Pose <fp@igh-essen.com>
parents:
126
diff
changeset
|
100 |
|
b36d187ecc0b
Unterst?tzte Prot. auslesen, Mailbox in Slave ausgelagert, Bugfix in Anzeige des Watch-Frames und erste SDO-List-Abfrage.
Florian Pose <fp@igh-essen.com>
parents:
126
diff
changeset
|
101 |
enum |
b36d187ecc0b
Unterst?tzte Prot. auslesen, Mailbox in Slave ausgelagert, Bugfix in Anzeige des Watch-Frames und erste SDO-List-Abfrage.
Florian Pose <fp@igh-essen.com>
parents:
126
diff
changeset
|
102 |
{ |
145
11a82e4fd31b
Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
144
diff
changeset
|
103 |
EC_MBOX_AOE = 0x01, /**< ADS-over-EtherCAT */ |
11a82e4fd31b
Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
144
diff
changeset
|
104 |
EC_MBOX_EOE = 0x02, /**< Ethernet-over-EtherCAT */ |
11a82e4fd31b
Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
144
diff
changeset
|
105 |
EC_MBOX_COE = 0x04, /**< CANopen-over-EtherCAT */ |
11a82e4fd31b
Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
144
diff
changeset
|
106 |
EC_MBOX_FOE = 0x08, /**< File-Access-over-EtherCAT */ |
11a82e4fd31b
Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
144
diff
changeset
|
107 |
EC_MBOX_SOE = 0x10, /**< Servo-Profile-over-EtherCAT */ |
133
b36d187ecc0b
Unterst?tzte Prot. auslesen, Mailbox in Slave ausgelagert, Bugfix in Anzeige des Watch-Frames und erste SDO-List-Abfrage.
Florian Pose <fp@igh-essen.com>
parents:
126
diff
changeset
|
108 |
EC_MBOX_VOE = 0x20 /**< Vendor specific */ |
b36d187ecc0b
Unterst?tzte Prot. auslesen, Mailbox in Slave ausgelagert, Bugfix in Anzeige des Watch-Frames und erste SDO-List-Abfrage.
Florian Pose <fp@igh-essen.com>
parents:
126
diff
changeset
|
109 |
}; |
b36d187ecc0b
Unterst?tzte Prot. auslesen, Mailbox in Slave ausgelagert, Bugfix in Anzeige des Watch-Frames und erste SDO-List-Abfrage.
Florian Pose <fp@igh-essen.com>
parents:
126
diff
changeset
|
110 |
|
b36d187ecc0b
Unterst?tzte Prot. auslesen, Mailbox in Slave ausgelagert, Bugfix in Anzeige des Watch-Frames und erste SDO-List-Abfrage.
Florian Pose <fp@igh-essen.com>
parents:
126
diff
changeset
|
111 |
/*****************************************************************************/ |
b36d187ecc0b
Unterst?tzte Prot. auslesen, Mailbox in Slave ausgelagert, Bugfix in Anzeige des Watch-Frames und erste SDO-List-Abfrage.
Florian Pose <fp@igh-essen.com>
parents:
126
diff
changeset
|
112 |
|
b36d187ecc0b
Unterst?tzte Prot. auslesen, Mailbox in Slave ausgelagert, Bugfix in Anzeige des Watch-Frames und erste SDO-List-Abfrage.
Florian Pose <fp@igh-essen.com>
parents:
126
diff
changeset
|
113 |
/** |
1744
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
114 |
* EtherCAT slave. |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
115 |
*/ |
73
9f4ea66d89a3
Dynamische FMMU-Konfiguration, zwei Kopieroperationen eingespart, Einr?ckungen angepasst.
Florian Pose <fp@igh-essen.com>
parents:
55
diff
changeset
|
116 |
|
9f4ea66d89a3
Dynamische FMMU-Konfiguration, zwei Kopieroperationen eingespart, Einr?ckungen angepasst.
Florian Pose <fp@igh-essen.com>
parents:
55
diff
changeset
|
117 |
struct ec_slave |
9f4ea66d89a3
Dynamische FMMU-Konfiguration, zwei Kopieroperationen eingespart, Einr?ckungen angepasst.
Florian Pose <fp@igh-essen.com>
parents:
55
diff
changeset
|
118 |
{ |
195
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
119 |
struct list_head list; /**< list item */ |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
120 |
struct kobject kobj; /**< kobject */ |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
121 |
ec_master_t *master; /**< master owning the slave */ |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
122 |
|
1744
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
123 |
ec_slave_state_t requested_state; /**< requested application state */ |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
124 |
ec_slave_state_t current_state; /**< current application state */ |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
125 |
ec_slave_online_state_t online_state; /**< online state */ |
1739
5fcbd29151d2
MERGE -r688:759 trunk -> branches/stable-1.2 (release 1.2, part one).
Florian Pose <fp@igh-essen.com>
parents:
1732
diff
changeset
|
126 |
unsigned int self_configured; /**< slave was configured by this master */ |
1715
e675450f2174
MERGE trunk -r463:494 -> branches/stable-1.1 (Version 1.1)
Florian Pose <fp@igh-essen.com>
parents:
293
diff
changeset
|
127 |
unsigned int error_flag; /**< stop processing after an error */ |
1744
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
128 |
unsigned int pdos_registered; /**< non-zero, if PDOs were registered */ |
1715
e675450f2174
MERGE trunk -r463:494 -> branches/stable-1.1 (Version 1.1)
Florian Pose <fp@igh-essen.com>
parents:
293
diff
changeset
|
129 |
|
195
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
130 |
// addresses |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
131 |
uint16_t ring_position; /**< ring position */ |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
132 |
uint16_t station_address; /**< configured station address */ |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
133 |
|
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
134 |
// base data |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
135 |
uint8_t base_type; /**< slave type */ |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
136 |
uint8_t base_revision; /**< revision */ |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
137 |
uint16_t base_build; /**< build number */ |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
138 |
uint16_t base_fmmu_count; /**< number of supported FMMUs */ |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
139 |
|
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
140 |
// data link status |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
141 |
uint8_t dl_link[4]; /**< link detected */ |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
142 |
uint8_t dl_loop[4]; /**< loop closed */ |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
143 |
uint8_t dl_signal[4]; /**< detected signal on RX port */ |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
144 |
|
1715
e675450f2174
MERGE trunk -r463:494 -> branches/stable-1.1 (Version 1.1)
Florian Pose <fp@igh-essen.com>
parents:
293
diff
changeset
|
145 |
// EEPROM |
e675450f2174
MERGE trunk -r463:494 -> branches/stable-1.1 (Version 1.1)
Florian Pose <fp@igh-essen.com>
parents:
293
diff
changeset
|
146 |
uint8_t *eeprom_data; /**< Complete EEPROM image */ |
1744
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
147 |
size_t eeprom_size; /**< size of the EEPROM contents in bytes */ |
1715
e675450f2174
MERGE trunk -r463:494 -> branches/stable-1.1 (Version 1.1)
Florian Pose <fp@igh-essen.com>
parents:
293
diff
changeset
|
148 |
|
195
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
149 |
// slave information interface |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
150 |
uint16_t sii_alias; /**< configured station alias */ |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
151 |
uint32_t sii_vendor_id; /**< vendor id */ |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
152 |
uint32_t sii_product_code; /**< vendor's product code */ |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
153 |
uint32_t sii_revision_number; /**< revision number */ |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
154 |
uint32_t sii_serial_number; /**< serial number */ |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
155 |
uint16_t sii_rx_mailbox_offset; /**< mailbox address (master to slave) */ |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
156 |
uint16_t sii_rx_mailbox_size; /**< mailbox size (master to slave) */ |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
157 |
uint16_t sii_tx_mailbox_offset; /**< mailbox address (slave to master) */ |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
158 |
uint16_t sii_tx_mailbox_size; /**< mailbox size (slave to master) */ |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
159 |
uint16_t sii_mailbox_protocols; /**< supported mailbox protocols */ |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
160 |
uint8_t sii_physical_layer[4]; /**< port media */ |
1744
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
161 |
char **sii_strings; /**< strings in EEPROM categories */ |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
162 |
unsigned int sii_string_count; /**< number of EEPROM strings */ |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
163 |
ec_sync_t *sii_syncs; /**< EEPROM SYNC MANAGER categories */ |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
164 |
unsigned int sii_sync_count; /**< number of sync managers in EEPROM */ |
1715
e675450f2174
MERGE trunk -r463:494 -> branches/stable-1.1 (Version 1.1)
Florian Pose <fp@igh-essen.com>
parents:
293
diff
changeset
|
165 |
struct list_head sii_pdos; /**< EEPROM [RT]XPDO categories */ |
e675450f2174
MERGE trunk -r463:494 -> branches/stable-1.1 (Version 1.1)
Florian Pose <fp@igh-essen.com>
parents:
293
diff
changeset
|
166 |
char *sii_group; /**< slave group acc. to EEPROM */ |
e675450f2174
MERGE trunk -r463:494 -> branches/stable-1.1 (Version 1.1)
Florian Pose <fp@igh-essen.com>
parents:
293
diff
changeset
|
167 |
char *sii_image; /**< slave image name acc. to EEPROM */ |
e675450f2174
MERGE trunk -r463:494 -> branches/stable-1.1 (Version 1.1)
Florian Pose <fp@igh-essen.com>
parents:
293
diff
changeset
|
168 |
char *sii_order; /**< slave order number acc. to EEPROM */ |
e675450f2174
MERGE trunk -r463:494 -> branches/stable-1.1 (Version 1.1)
Florian Pose <fp@igh-essen.com>
parents:
293
diff
changeset
|
169 |
char *sii_name; /**< slave name acc. to EEPROM */ |
1739
5fcbd29151d2
MERGE -r688:759 trunk -> branches/stable-1.2 (release 1.2, part one).
Florian Pose <fp@igh-essen.com>
parents:
1732
diff
changeset
|
170 |
int16_t sii_current_on_ebus; /**< power consumption */ |
195
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
171 |
|
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
172 |
ec_fmmu_t fmmus[EC_MAX_FMMUS]; /**< FMMU configurations */ |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
173 |
uint8_t fmmu_count; /**< number of FMMUs used */ |
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
174 |
|
1732
1cc865ba17c2
MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents:
1731
diff
changeset
|
175 |
struct kobject sdo_kobj; /**< kobject for SDOs */ |
1cc865ba17c2
MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents:
1731
diff
changeset
|
176 |
struct list_head sdo_dictionary; /**< SDO dictionary list */ |
1716
9440f4ff25c7
MERGE trunk -r494:513 -> branches/stable-1.1 (SDO configuration, bugfixes, EoE frame rates)
Florian Pose <fp@igh-essen.com>
parents:
1715
diff
changeset
|
177 |
struct list_head sdo_confs; /**< list of SDO configurations */ |
1732
1cc865ba17c2
MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents:
1731
diff
changeset
|
178 |
uint8_t sdo_dictionary_fetched; /**< dictionary has been fetched */ |
1cc865ba17c2
MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents:
1731
diff
changeset
|
179 |
unsigned long jiffies_preop; /**< time, the slave went to PREOP */ |
1746
72e7507b3f1b
merge -r931:HEAD svn://yak/vol/projekte/msr_messen_steuern_regeln/ethercat/rep/trunk .
Florian Pose <fp@igh-essen.com>
parents:
1744
diff
changeset
|
180 |
|
72e7507b3f1b
merge -r931:HEAD svn://yak/vol/projekte/msr_messen_steuern_regeln/ethercat/rep/trunk .
Florian Pose <fp@igh-essen.com>
parents:
1744
diff
changeset
|
181 |
uint8_t pdo_mapping_fetched; /**< PDO mapping has been fetched */ |
73
9f4ea66d89a3
Dynamische FMMU-Konfiguration, zwei Kopieroperationen eingespart, Einr?ckungen angepasst.
Florian Pose <fp@igh-essen.com>
parents:
55
diff
changeset
|
182 |
}; |
9f4ea66d89a3
Dynamische FMMU-Konfiguration, zwei Kopieroperationen eingespart, Einr?ckungen angepasst.
Florian Pose <fp@igh-essen.com>
parents:
55
diff
changeset
|
183 |
|
9f4ea66d89a3
Dynamische FMMU-Konfiguration, zwei Kopieroperationen eingespart, Einr?ckungen angepasst.
Florian Pose <fp@igh-essen.com>
parents:
55
diff
changeset
|
184 |
/*****************************************************************************/ |
9f4ea66d89a3
Dynamische FMMU-Konfiguration, zwei Kopieroperationen eingespart, Einr?ckungen angepasst.
Florian Pose <fp@igh-essen.com>
parents:
55
diff
changeset
|
185 |
|
195
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
186 |
// slave construction/destruction |
182
8c0bc99229a9
Slaves stored in list, slaves in SysFS
Florian Pose <fp@igh-essen.com>
parents:
175
diff
changeset
|
187 |
int ec_slave_init(ec_slave_t *, ec_master_t *, uint16_t, uint16_t); |
1732
1cc865ba17c2
MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents:
1731
diff
changeset
|
188 |
void ec_slave_destroy(ec_slave_t *); |
1cc865ba17c2
MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents:
1731
diff
changeset
|
189 |
|
1cc865ba17c2
MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents:
1731
diff
changeset
|
190 |
void ec_slave_reset(ec_slave_t *); |
73
9f4ea66d89a3
Dynamische FMMU-Konfiguration, zwei Kopieroperationen eingespart, Einr?ckungen angepasst.
Florian Pose <fp@igh-essen.com>
parents:
55
diff
changeset
|
191 |
|
160
7ddf8367196a
Renamed slave_set_fmmu() to slave_prepare_fmmu().
Florian Pose <fp@igh-essen.com>
parents:
145
diff
changeset
|
192 |
int ec_slave_prepare_fmmu(ec_slave_t *, const ec_domain_t *, |
1744
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
193 |
const ec_sync_t *); |
73
9f4ea66d89a3
Dynamische FMMU-Konfiguration, zwei Kopieroperationen eingespart, Einr?ckungen angepasst.
Florian Pose <fp@igh-essen.com>
parents:
55
diff
changeset
|
194 |
|
1732
1cc865ba17c2
MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents:
1731
diff
changeset
|
195 |
void ec_slave_request_state(ec_slave_t *, ec_slave_state_t); |
1744
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
196 |
void ec_slave_set_state(ec_slave_t *, ec_slave_state_t); |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
197 |
void ec_slave_set_online_state(ec_slave_t *, ec_slave_online_state_t); |
1715
e675450f2174
MERGE trunk -r463:494 -> branches/stable-1.1 (Version 1.1)
Florian Pose <fp@igh-essen.com>
parents:
293
diff
changeset
|
198 |
|
e675450f2174
MERGE trunk -r463:494 -> branches/stable-1.1 (Version 1.1)
Florian Pose <fp@igh-essen.com>
parents:
293
diff
changeset
|
199 |
// SII categories |
1746
72e7507b3f1b
merge -r931:HEAD svn://yak/vol/projekte/msr_messen_steuern_regeln/ethercat/rep/trunk .
Florian Pose <fp@igh-essen.com>
parents:
1744
diff
changeset
|
200 |
int ec_slave_fetch_sii_strings(ec_slave_t *, const uint8_t *, size_t); |
72e7507b3f1b
merge -r931:HEAD svn://yak/vol/projekte/msr_messen_steuern_regeln/ethercat/rep/trunk .
Florian Pose <fp@igh-essen.com>
parents:
1744
diff
changeset
|
201 |
int ec_slave_fetch_sii_general(ec_slave_t *, const uint8_t *, size_t); |
1744
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
202 |
int ec_slave_fetch_sii_syncs(ec_slave_t *, const uint8_t *, size_t); |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
203 |
int ec_slave_fetch_sii_pdos(ec_slave_t *, const uint8_t *, size_t, |
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
204 |
ec_pdo_type_t); |
238
b4960499098f
Added finite state machine (FSM) processing.
Florian Pose <fp@igh-essen.com>
parents:
199
diff
changeset
|
205 |
|
195
674071846ee3
Translated all comments and documentation to english language.
Florian Pose <fp@igh-essen.com>
parents:
190
diff
changeset
|
206 |
// misc. |
1744
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
207 |
ec_sync_t *ec_slave_get_pdo_sync(ec_slave_t *, ec_direction_t); |
1732
1cc865ba17c2
MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents:
1731
diff
changeset
|
208 |
int ec_slave_validate(const ec_slave_t *, uint32_t, uint32_t); |
1cc865ba17c2
MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents:
1731
diff
changeset
|
209 |
void ec_slave_sdo_dict_info(const ec_slave_t *, |
1744
7bc131b92039
MERGE trunk -r770:907 -> branches-1.3 (1.3 changes)
Florian Pose <fp@igh-essen.com>
parents:
1739
diff
changeset
|
210 |
unsigned int *, unsigned int *); |
1746
72e7507b3f1b
merge -r931:HEAD svn://yak/vol/projekte/msr_messen_steuern_regeln/ethercat/rep/trunk .
Florian Pose <fp@igh-essen.com>
parents:
1744
diff
changeset
|
211 |
ec_sdo_t *ec_slave_get_sdo(ec_slave_t *, uint16_t); |
1732
1cc865ba17c2
MERGE trunk -r588:681 -> branches/stable-1.1 (Bugfixes, Ack behaviour, CoE via Sysfs, PDO ranges, 2.6.17 support, improved autotools, documentation)
Florian Pose <fp@igh-essen.com>
parents:
1731
diff
changeset
|
212 |
|
39
6965c23a6826
likely/unlikely, Fehlermeldungen in zyklischem Code begrenzt und Kommentare ge??ndert.
Florian Pose <fp@igh-essen.com>
parents:
5
diff
changeset
|
213 |
/*****************************************************************************/ |
0 | 214 |
|
215 |
#endif |