drivers/ec_globals.h
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--
20kHz, Wilhelm
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
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     2
 *
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     3
 *  e c _ g l o b a l s . h
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     4
 *
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     5
 *  Globale Definitionen und Makros für das EtherCAT-Protokoll.
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     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
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     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
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    10
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    11
#ifndef _EC_GLOBALS_
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    12
#define _EC_GLOBALS_
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    13
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    14
/**
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    15
   Maximale Größe eines EtherCAT-Frames
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    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
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    18
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    19
/**
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    20
   NULL-Define, falls noch nicht definiert.
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    21
*/
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    22
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    23
#ifndef NULL
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    24
#define NULL ((void *) 0)
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    25
#endif
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    26
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    27
/**
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    28
   EtherCAT-Kommando-Typ
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    29
*/
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    30
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    31
typedef enum
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    32
{
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    33
  ECAT_CMD_NONE = 0x00, /**< Dummy */
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    34
  ECAT_CMD_APRD = 0x01, /**< Auto-increment physical read */
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    35
  ECAT_CMD_APWR = 0x02, /**< Auto-increment physical write */
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    36
  ECAT_CMD_NPRD = 0x04, /**< Node-addressed physical read */
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    37
  ECAT_CMD_NPWR = 0x05, /**< Node-addressed physical write */
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    38
  ECAT_CMD_BRD = 0x07,  /**< Broadcast read */
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    39
  ECAT_CMD_BWR = 0x08,  /**< Broadcast write */
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    40
  ECAT_CMD_LRW = 0x0C   /**< Logical read/write */
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    41
}
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    42
EtherCAT_cmd_type_t;
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    43
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    44
/**
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    45
   Zustand eines EtherCAT-Slaves
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    46
*/
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    47
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    48
typedef enum
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    49
{
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    50
  ECAT_STATE_UNKNOWN = 0x00, /**< Status unbekannt */
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    51
  ECAT_STATE_INIT = 0x01,    /**< Init-Zustand (Keine Mailbox-
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    52
                                Kommunikation, Kein I/O) */
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    53
  ECAT_STATE_PREOP = 0x02,   /**< Pre-Operational (Mailbox-
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    54
                                Kommunikation, Kein I/O) */
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    55
  ECAT_STATE_SAVEOP = 0x04,  /**< Save-Operational (Mailbox-
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    56
                                Kommunikation und Input Update) */
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    57
  ECAT_STATE_OP = 0x08,      /**< Operational, (Mailbox-
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    58
                                Kommunikation und Input/Output Update) */
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    59
  ECAT_ACK_STATE = 0x10      /**< Acknoledge-Bit beim Zustandswechsel
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    60
                                (dies ist kein eigener Zustand) */
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    61
}
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    62
EtherCAT_state_t;
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    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
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    65
05c992bf5847 trunk, tags und branches
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    66
#endif