master/globals.h
changeset 73 9f4ea66d89a3
parent 54 7506e67dd122
child 84 b4ae98855cea
equal deleted inserted replaced
72:7c986b717411 73:9f4ea66d89a3
    11 #ifndef _EC_GLOBALS_
    11 #ifndef _EC_GLOBALS_
    12 #define _EC_GLOBALS_
    12 #define _EC_GLOBALS_
    13 
    13 
    14 /*****************************************************************************/
    14 /*****************************************************************************/
    15 
    15 
    16 /**
    16 // EtherCAT-Protokoll
    17    Maximale Größe eines EtherCAT-Frames
    17 #define EC_MAX_FRAME_SIZE 1500 /**< Maximale Größe eines EtherCAT-Frames ohne
    18 */
    18                                   Ethernet-II-Header und -Prüfsumme*/
    19 #define EC_FRAME_SIZE 1500
    19 #define EC_MIN_FRAME_SIZE 46 /** Minimale Größe, s. o. */
       
    20 #define EC_FRAME_HEADER_SIZE 2 /**< Größe des EtherCAT-Frame-Headers */
       
    21 #define EC_COMMAND_HEADER_SIZE 10 /**< Größe eines EtherCAT-Kommando-Headers */
       
    22 #define EC_COMMAND_FOOTER_SIZE 2 /**< Größe eines EtherCAT-Kommando-Footers */
       
    23 #define EC_SYNC_SIZE 8 /**< Größe einer Sync-Manager-Konfigurationsseite */
       
    24 #define EC_FMMU_SIZE 16 /**< Größe einer FMMU-Konfigurationsseite */
       
    25 #define EC_MAX_FMMUS 16 /**< Maximale Anzahl FMMUs pro Slave */
    20 
    26 
    21 /**
    27 #define EC_MASTER_MAX_DOMAINS 10 /**< Maximale Anzahl Domänen eines Masters */
    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 
    28 
    30 #ifndef NULL
    29 #ifndef NULL
    31 #define NULL ((void *) 0)
    30 #define NULL ((void *) 0) /**< NULL-Define, falls noch nicht definiert. */
    32 #endif
    31 #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 
    32 
    53 /*****************************************************************************/
    33 /*****************************************************************************/
    54 
    34 
    55 /**
    35 /**
    56    Zustand eines EtherCAT-Slaves
    36    Zustand eines EtherCAT-Slaves
    57 */
    37 */
    58 
    38 
    59 typedef enum
    39 typedef enum
    60 {
    40 {
    61   EC_SLAVE_STATE_UNKNOWN = 0x00, /**< Status unbekannt */
    41     EC_SLAVE_STATE_UNKNOWN = 0x00, /**< Status unbekannt */
    62   EC_SLAVE_STATE_INIT = 0x01,    /**< Init-Zustand (Keine Mailbox-
    42     EC_SLAVE_STATE_INIT = 0x01,    /**< Init-Zustand (Keine Mailbox-
    63                                     Kommunikation, Kein I/O) */
    43                                       Kommunikation, Kein I/O) */
    64   EC_SLAVE_STATE_PREOP = 0x02,   /**< Pre-Operational (Mailbox-
    44     EC_SLAVE_STATE_PREOP = 0x02,   /**< Pre-Operational (Mailbox-
    65                                     Kommunikation, Kein I/O) */
    45                                       Kommunikation, Kein I/O) */
    66   EC_SLAVE_STATE_SAVEOP = 0x04,  /**< Save-Operational (Mailbox-
    46     EC_SLAVE_STATE_SAVEOP = 0x04,  /**< Save-Operational (Mailbox-
    67                                     Kommunikation und Input Update) */
    47                                       Kommunikation und Input Update) */
    68   EC_SLAVE_STATE_OP = 0x08,      /**< Operational, (Mailbox-
    48     EC_SLAVE_STATE_OP = 0x08,      /**< Operational, (Mailbox-
    69                                     Kommunikation und Input/Output Update) */
    49                                       Kommunikation und Input/Output Update) */
    70   EC_ACK = 0x10      /**< Acknoledge-Bit beim Zustandswechsel
    50     EC_ACK = 0x10                  /**< Acknoledge-Bit beim Zustandswechsel
    71                         (dies ist kein eigener Zustand) */
    51                                       (dies ist kein eigener Zustand) */
    72 }
    52 }
    73 ec_slave_state_t;
    53 ec_slave_state_t;
    74 
    54 
    75 /*****************************************************************************/
    55 /*****************************************************************************/
    76 
    56 
    77 #endif
    57 #endif
       
    58 
       
    59 /* Emacs-Konfiguration
       
    60 ;;; Local Variables: ***
       
    61 ;;; c-basic-offset:4 ***
       
    62 ;;; End: ***
       
    63 */