master/globals.h
changeset 54 7506e67dd122
parent 42 a22a202d0f42
child 73 9f4ea66d89a3
equal deleted inserted replaced
53:6b3b8acb71b5 54:7506e67dd122
       
     1 /******************************************************************************
       
     2  *
       
     3  *  g l o b a l s . h
       
     4  *
       
     5  *  Globale Definitionen und Makros für das EtherCAT-Protokoll.
       
     6  *
       
     7  *  $Id$
       
     8  *
       
     9  *****************************************************************************/
       
    10 
       
    11 #ifndef _EC_GLOBALS_
       
    12 #define _EC_GLOBALS_
       
    13 
       
    14 /*****************************************************************************/
       
    15 
       
    16 /**
       
    17    Maximale Größe eines EtherCAT-Frames
       
    18 */
       
    19 #define EC_FRAME_SIZE 1500
       
    20 
       
    21 /**
       
    22    Maximale Anzahl der Prozessdatendomänen in einem Master
       
    23 */
       
    24 #define EC_MAX_DOMAINS 10
       
    25 
       
    26 /**
       
    27    NULL-Define, falls noch nicht definiert.
       
    28 */
       
    29 
       
    30 #ifndef NULL
       
    31 #define NULL ((void *) 0)
       
    32 #endif
       
    33 
       
    34 /*****************************************************************************/
       
    35 
       
    36 /**
       
    37    EtherCAT-Kommando-Typ
       
    38 */
       
    39 
       
    40 typedef enum
       
    41 {
       
    42   EC_COMMAND_NONE = 0x00, /**< Dummy */
       
    43   EC_COMMAND_APRD = 0x01, /**< Auto-increment physical read */
       
    44   EC_COMMAND_APWR = 0x02, /**< Auto-increment physical write */
       
    45   EC_COMMAND_NPRD = 0x04, /**< Node-addressed physical read */
       
    46   EC_COMMAND_NPWR = 0x05, /**< Node-addressed physical write */
       
    47   EC_COMMAND_BRD = 0x07,  /**< Broadcast read */
       
    48   EC_COMMAND_BWR = 0x08,  /**< Broadcast write */
       
    49   EC_COMMAND_LRW = 0x0C   /**< Logical read/write */
       
    50 }
       
    51 ec_command_type_t;
       
    52 
       
    53 /*****************************************************************************/
       
    54 
       
    55 /**
       
    56    Zustand eines EtherCAT-Slaves
       
    57 */
       
    58 
       
    59 typedef enum
       
    60 {
       
    61   EC_SLAVE_STATE_UNKNOWN = 0x00, /**< Status unbekannt */
       
    62   EC_SLAVE_STATE_INIT = 0x01,    /**< Init-Zustand (Keine Mailbox-
       
    63                                     Kommunikation, Kein I/O) */
       
    64   EC_SLAVE_STATE_PREOP = 0x02,   /**< Pre-Operational (Mailbox-
       
    65                                     Kommunikation, Kein I/O) */
       
    66   EC_SLAVE_STATE_SAVEOP = 0x04,  /**< Save-Operational (Mailbox-
       
    67                                     Kommunikation und Input Update) */
       
    68   EC_SLAVE_STATE_OP = 0x08,      /**< Operational, (Mailbox-
       
    69                                     Kommunikation und Input/Output Update) */
       
    70   EC_ACK = 0x10      /**< Acknoledge-Bit beim Zustandswechsel
       
    71                         (dies ist kein eigener Zustand) */
       
    72 }
       
    73 ec_slave_state_t;
       
    74 
       
    75 /*****************************************************************************/
       
    76 
       
    77 #endif