drivers/ec_globals.h
changeset 54 7506e67dd122
parent 53 6b3b8acb71b5
child 55 059a9e712aa7
equal deleted inserted replaced
53:6b3b8acb71b5 54:7506e67dd122
     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  *  $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 ECAT_FRAME_BUFFER_SIZE 1500
       
    20 
       
    21 /**
       
    22    Maximale Anzahl der Prozessdatendomänen in einem Master
       
    23 */
       
    24 #define ECAT_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   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 
       
    53 /*****************************************************************************/
       
    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 typedef struct EtherCAT_master EtherCAT_master_t;
       
    78 
       
    79 /*****************************************************************************/
       
    80 
       
    81 #endif