author | Florian Pose <fp@igh-essen.com> |
Fri, 23 Dec 2005 08:20:10 +0000 | |
changeset 40 | d07ebafe62dd |
parent 39 | 6965c23a6826 |
child 41 | 42c66194c0c8 |
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 |
||
14 |
/** |
|
15 |
Maximale Größe eines EtherCAT-Frames |
|
16 |
*/ |
|
19
a51289e6cb2d
Warten beim Empfangen der Prozessdaten, Bugfix und kleinere Verbesserungen.
Florian Pose <fp@igh-essen.com>
parents:
0
diff
changeset
|
17 |
#define ECAT_FRAME_BUFFER_SIZE 1500 |
0 | 18 |
|
19 |
/** |
|
20 |
NULL-Define, falls noch nicht definiert. |
|
21 |
*/ |
|
22 |
||
23 |
#ifndef NULL |
|
24 |
#define NULL ((void *) 0) |
|
25 |
#endif |
|
26 |
||
27 |
/** |
|
28 |
EtherCAT-Kommando-Typ |
|
29 |
*/ |
|
30 |
||
31 |
typedef enum |
|
32 |
{ |
|
33 |
ECAT_CMD_NONE = 0x00, /**< Dummy */ |
|
34 |
ECAT_CMD_APRD = 0x01, /**< Auto-increment physical read */ |
|
35 |
ECAT_CMD_APWR = 0x02, /**< Auto-increment physical write */ |
|
36 |
ECAT_CMD_NPRD = 0x04, /**< Node-addressed physical read */ |
|
37 |
ECAT_CMD_NPWR = 0x05, /**< Node-addressed physical write */ |
|
38 |
ECAT_CMD_BRD = 0x07, /**< Broadcast read */ |
|
39 |
ECAT_CMD_BWR = 0x08, /**< Broadcast write */ |
|
40 |
ECAT_CMD_LRW = 0x0C /**< Logical read/write */ |
|
41 |
} |
|
42 |
EtherCAT_cmd_type_t; |
|
43 |
||
44 |
/** |
|
45 |
Zustand eines EtherCAT-Slaves |
|
46 |
*/ |
|
47 |
||
48 |
typedef enum |
|
49 |
{ |
|
50 |
ECAT_STATE_UNKNOWN = 0x00, /**< Status unbekannt */ |
|
51 |
ECAT_STATE_INIT = 0x01, /**< Init-Zustand (Keine Mailbox- |
|
52 |
Kommunikation, Kein I/O) */ |
|
53 |
ECAT_STATE_PREOP = 0x02, /**< Pre-Operational (Mailbox- |
|
54 |
Kommunikation, Kein I/O) */ |
|
55 |
ECAT_STATE_SAVEOP = 0x04, /**< Save-Operational (Mailbox- |
|
56 |
Kommunikation und Input Update) */ |
|
57 |
ECAT_STATE_OP = 0x08, /**< Operational, (Mailbox- |
|
58 |
Kommunikation und Input/Output Update) */ |
|
59 |
ECAT_ACK_STATE = 0x10 /**< Acknoledge-Bit beim Zustandswechsel |
|
60 |
(dies ist kein eigener Zustand) */ |
|
61 |
} |
|
62 |
EtherCAT_state_t; |
|
63 |
||
39
6965c23a6826
likely/unlikely, Fehlermeldungen in zyklischem Code begrenzt und Kommentare ge??ndert.
Florian Pose <fp@igh-essen.com>
parents:
19
diff
changeset
|
64 |
/*****************************************************************************/ |
0 | 65 |
|
66 |
#endif |