drivers/ec_globals.h
changeset 0 05c992bf5847
child 19 a51289e6cb2d
equal deleted inserted replaced
-1:000000000000 0:05c992bf5847
       
     1 /****************************************************************
       
     2  *
       
     3  *  e c _ g l o b a l s . h
       
     4  *
       
     5  *  Globale Definitionen und Makros für das EtherCAT-Protokoll.
       
     6  *
       
     7  *  $Date$
       
     8  *  $Author$
       
     9  *
       
    10  ***************************************************************/
       
    11 
       
    12 #ifndef _EC_GLOBALS_
       
    13 #define _EC_GLOBALS_
       
    14 
       
    15 /**
       
    16    Maximale Größe eines EtherCAT-Frames
       
    17 */
       
    18 #define ECAT_FRAME_BUFFER_SIZE 1600
       
    19 
       
    20 /**
       
    21    Anzahl der Kommandos in einem Master-Kommandoring
       
    22 */
       
    23 #define ECAT_COMMAND_RING_SIZE 10
       
    24 
       
    25 /**
       
    26    Anzahl der Versuche beim Asynchronen Senden/Empfangen
       
    27 */
       
    28 #define ECAT_NUM_RETRIES 10
       
    29 
       
    30 /**
       
    31    NULL-Define, falls noch nicht definiert.
       
    32 */
       
    33 
       
    34 #ifndef NULL
       
    35 #define NULL ((void *) 0)
       
    36 #endif
       
    37 
       
    38 /**
       
    39    EtherCAT-Kommando-Typ
       
    40 */
       
    41 
       
    42 typedef enum
       
    43 {
       
    44   ECAT_CMD_NONE = 0x00, /**< Dummy */
       
    45   ECAT_CMD_APRD = 0x01, /**< Auto-increment physical read */
       
    46   ECAT_CMD_APWR = 0x02, /**< Auto-increment physical write */
       
    47   ECAT_CMD_NPRD = 0x04, /**< Node-addressed physical read */
       
    48   ECAT_CMD_NPWR = 0x05, /**< Node-addressed physical write */
       
    49   ECAT_CMD_BRD = 0x07,  /**< Broadcast read */
       
    50   ECAT_CMD_BWR = 0x08,  /**< Broadcast write */
       
    51   ECAT_CMD_LRW = 0x0C   /**< Logical read/write */
       
    52 }
       
    53 EtherCAT_cmd_type_t;
       
    54 
       
    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 
       
    75 /***************************************************************/
       
    76 
       
    77 #endif