author | Florian Pose <fp@igh-essen.com> |
Fri, 06 Jan 2006 16:19:35 +0000 | |
changeset 49 | 3f8e769ca747 |
parent 42 | a22a202d0f42 |
permissions | -rw-r--r-- |
39
6965c23a6826
likely/unlikely, Fehlermeldungen in zyklischem Code begrenzt und Kommentare ge??ndert.
Florian Pose <fp@igh-essen.com>
parents:
19
diff
changeset
|
1 |
/****************************************************************************** |
0 | 2 |
* |
3 |
* e c _ g l o b a l s . h |
|
4 |
* |
|
5 |
* Globale Definitionen und Makros für das EtherCAT-Protokoll. |
|
6 |
* |
|
39
6965c23a6826
likely/unlikely, Fehlermeldungen in zyklischem Code begrenzt und Kommentare ge??ndert.
Florian Pose <fp@igh-essen.com>
parents:
19
diff
changeset
|
7 |
* $Id$ |
0 | 8 |
* |
39
6965c23a6826
likely/unlikely, Fehlermeldungen in zyklischem Code begrenzt und Kommentare ge??ndert.
Florian Pose <fp@igh-essen.com>
parents:
19
diff
changeset
|
9 |
*****************************************************************************/ |
0 | 10 |
|
11 |
#ifndef _EC_GLOBALS_ |
|
12 |
#define _EC_GLOBALS_ |
|
13 |
||
41 | 14 |
/*****************************************************************************/ |
15 |
||
0 | 16 |
/** |
17 |
Maximale Größe eines EtherCAT-Frames |
|
18 |
*/ |
|
19
a51289e6cb2d
Warten beim Empfangen der Prozessdaten, Bugfix und kleinere Verbesserungen.
Florian Pose <fp@igh-essen.com>
parents:
0
diff
changeset
|
19 |
#define ECAT_FRAME_BUFFER_SIZE 1500 |
0 | 20 |
|
21 |
/** |
|
42
a22a202d0f42
Domains, Warten beim Senden, 10kHz.
Florian Pose <fp@igh-essen.com>
parents:
41
diff
changeset
|
22 |
Maximale Anzahl der Prozessdatendomänen in einem Master |
a22a202d0f42
Domains, Warten beim Senden, 10kHz.
Florian Pose <fp@igh-essen.com>
parents:
41
diff
changeset
|
23 |
*/ |
a22a202d0f42
Domains, Warten beim Senden, 10kHz.
Florian Pose <fp@igh-essen.com>
parents:
41
diff
changeset
|
24 |
#define ECAT_MAX_DOMAINS 10 |
a22a202d0f42
Domains, Warten beim Senden, 10kHz.
Florian Pose <fp@igh-essen.com>
parents:
41
diff
changeset
|
25 |
|
a22a202d0f42
Domains, Warten beim Senden, 10kHz.
Florian Pose <fp@igh-essen.com>
parents:
41
diff
changeset
|
26 |
/** |
0 | 27 |
NULL-Define, falls noch nicht definiert. |
28 |
*/ |
|
29 |
||
30 |
#ifndef NULL |
|
31 |
#define NULL ((void *) 0) |
|
32 |
#endif |
|
33 |
||
41 | 34 |
/*****************************************************************************/ |
35 |
||
0 | 36 |
/** |
37 |
EtherCAT-Kommando-Typ |
|
38 |
*/ |
|
39 |
||
40 |
typedef enum |
|
41 |
{ |
|
42 |
ECAT_CMD_NONE = 0x00, /**< Dummy */ |
|
43 |
ECAT_CMD_APRD = 0x01, /**< Auto-increment physical read */ |
|
44 |
ECAT_CMD_APWR = 0x02, /**< Auto-increment physical write */ |
|
45 |
ECAT_CMD_NPRD = 0x04, /**< Node-addressed physical read */ |
|
46 |
ECAT_CMD_NPWR = 0x05, /**< Node-addressed physical write */ |
|
47 |
ECAT_CMD_BRD = 0x07, /**< Broadcast read */ |
|
48 |
ECAT_CMD_BWR = 0x08, /**< Broadcast write */ |
|
49 |
ECAT_CMD_LRW = 0x0C /**< Logical read/write */ |
|
50 |
} |
|
51 |
EtherCAT_cmd_type_t; |
|
52 |
||
41 | 53 |
/*****************************************************************************/ |
54 |
||
0 | 55 |
/** |
56 |
Zustand eines EtherCAT-Slaves |
|
57 |
*/ |
|
58 |
||
59 |
typedef enum |
|
60 |
{ |
|
61 |
ECAT_STATE_UNKNOWN = 0x00, /**< Status unbekannt */ |
|
62 |
ECAT_STATE_INIT = 0x01, /**< Init-Zustand (Keine Mailbox- |
|
63 |
Kommunikation, Kein I/O) */ |
|
64 |
ECAT_STATE_PREOP = 0x02, /**< Pre-Operational (Mailbox- |
|
65 |
Kommunikation, Kein I/O) */ |
|
66 |
ECAT_STATE_SAVEOP = 0x04, /**< Save-Operational (Mailbox- |
|
67 |
Kommunikation und Input Update) */ |
|
68 |
ECAT_STATE_OP = 0x08, /**< Operational, (Mailbox- |
|
69 |
Kommunikation und Input/Output Update) */ |
|
70 |
ECAT_ACK_STATE = 0x10 /**< Acknoledge-Bit beim Zustandswechsel |
|
71 |
(dies ist kein eigener Zustand) */ |
|
72 |
} |
|
73 |
EtherCAT_state_t; |
|
74 |
||
39
6965c23a6826
likely/unlikely, Fehlermeldungen in zyklischem Code begrenzt und Kommentare ge??ndert.
Florian Pose <fp@igh-essen.com>
parents:
19
diff
changeset
|
75 |
/*****************************************************************************/ |
0 | 76 |
|
42
a22a202d0f42
Domains, Warten beim Senden, 10kHz.
Florian Pose <fp@igh-essen.com>
parents:
41
diff
changeset
|
77 |
typedef struct EtherCAT_master EtherCAT_master_t; |
a22a202d0f42
Domains, Warten beim Senden, 10kHz.
Florian Pose <fp@igh-essen.com>
parents:
41
diff
changeset
|
78 |
|
a22a202d0f42
Domains, Warten beim Senden, 10kHz.
Florian Pose <fp@igh-essen.com>
parents:
41
diff
changeset
|
79 |
/*****************************************************************************/ |
a22a202d0f42
Domains, Warten beim Senden, 10kHz.
Florian Pose <fp@igh-essen.com>
parents:
41
diff
changeset
|
80 |
|
0 | 81 |
#endif |