master/slave.h
changeset 126 bbc963b9fead
parent 123 4d5dc58d48e2
child 133 b36d187ecc0b
equal deleted inserted replaced
125:b01bd5b830d7 126:bbc963b9fead
    19    Zustand eines EtherCAT-Slaves.
    19    Zustand eines EtherCAT-Slaves.
    20 */
    20 */
    21 
    21 
    22 typedef enum
    22 typedef enum
    23 {
    23 {
    24     EC_SLAVE_STATE_UNKNOWN = 0x00, /**< Status unbekannt */
    24     EC_SLAVE_STATE_UNKNOWN = 0x00,
    25     EC_SLAVE_STATE_INIT = 0x01,    /**< Init-Zustand (Keine Mailbox-
    25     /**< Status unbekannt */
    26                                       Kommunikation, Kein I/O) */
    26     EC_SLAVE_STATE_INIT = 0x01,
    27     EC_SLAVE_STATE_PREOP = 0x02,   /**< Pre-Operational (Mailbox-
    27     /**< Init-Zustand (Keine Mailbox-Kommunikation, Kein I/O) */
    28                                       Kommunikation, Kein I/O) */
    28     EC_SLAVE_STATE_PREOP = 0x02,
    29     EC_SLAVE_STATE_SAVEOP = 0x04,  /**< Save-Operational (Mailbox-
    29     /**< Pre-Operational (Mailbox-Kommunikation, Kein I/O) */
    30                                       Kommunikation und Input Update) */
    30     EC_SLAVE_STATE_SAVEOP = 0x04,
    31     EC_SLAVE_STATE_OP = 0x08,      /**< Operational, (Mailbox-
    31     /**< Save-Operational (Mailbox-Kommunikation und Input Update) */
    32                                       Kommunikation und Input/Output Update) */
    32     EC_SLAVE_STATE_OP = 0x08,
    33     EC_ACK = 0x10                  /**< Acknoledge-Bit beim Zustandswechsel
    33     /**< Operational, (Mailbox-Kommunikation und Input/Output Update) */
    34                                       (dies ist kein eigener Zustand) */
    34     EC_ACK = 0x10
       
    35     /**< Acknoledge-Bit beim Zustandswechsel (kein eigener Zustand) */
    35 }
    36 }
    36 ec_slave_state_t;
    37 ec_slave_state_t;
    37 
    38 
    38 /*****************************************************************************/
    39 /*****************************************************************************/
    39 
    40 
    50 ec_fmmu_t;
    51 ec_fmmu_t;
    51 
    52 
    52 /*****************************************************************************/
    53 /*****************************************************************************/
    53 
    54 
    54 /**
    55 /**
    55    EEPROM-String.
    56    String im EEPROM eines EtherCAT-Slaves.
    56 */
    57 */
    57 
    58 
    58 typedef struct
    59 typedef struct
    59 {
    60 {
    60     struct list_head list;
    61     struct list_head list;
    61     size_t size;
    62     size_t size;
    62     char *data;
    63     char *data;
    63 }
    64 }
    64 ec_slave_string_t;
    65 ec_eeprom_string_t;
       
    66 
       
    67 /*****************************************************************************/
       
    68 
       
    69 /**
       
    70    Sync-Manager-Konfiguration laut EEPROM.
       
    71 */
       
    72 
       
    73 typedef struct
       
    74 {
       
    75     struct list_head list;
       
    76     unsigned int index;
       
    77     uint16_t physical_start_address;
       
    78     uint16_t length;
       
    79     uint8_t control_register;
       
    80     uint8_t enable;
       
    81 }
       
    82 ec_eeprom_sync_t;
       
    83 
       
    84 /*****************************************************************************/
       
    85 
       
    86 /**
       
    87    PDO-Typ.
       
    88 */
       
    89 
       
    90 typedef enum
       
    91 {
       
    92     EC_RX_PDO,
       
    93     EC_TX_PDO
       
    94 }
       
    95 ec_pdo_type_t;
       
    96 
       
    97 /*****************************************************************************/
       
    98 
       
    99 /**
       
   100    PDO-Beschreibung im EEPROM.
       
   101 */
       
   102 
       
   103 typedef struct
       
   104 {
       
   105     struct list_head list;
       
   106     ec_pdo_type_t type;
       
   107     uint16_t index;
       
   108     uint8_t sync_manager;
       
   109     char *name;
       
   110     struct list_head entries;
       
   111 }
       
   112 ec_eeprom_pdo_t;
       
   113 
       
   114 /*****************************************************************************/
       
   115 
       
   116 /**
       
   117    PDO-Entry-Beschreibung im EEPROM.
       
   118 */
       
   119 
       
   120 typedef struct
       
   121 {
       
   122     struct list_head list;
       
   123     uint16_t index;
       
   124     uint8_t subindex;
       
   125     char *name;
       
   126     uint8_t bit_length;
       
   127 }
       
   128 ec_eeprom_pdo_entry_t;
    65 
   129 
    66 /*****************************************************************************/
   130 /*****************************************************************************/
    67 
   131 
    68 /**
   132 /**
    69    EtherCAT-Slave
   133    EtherCAT-Slave
    98 
   162 
    99     ec_fmmu_t fmmus[EC_MAX_FMMUS]; /**< FMMU-Konfigurationen */
   163     ec_fmmu_t fmmus[EC_MAX_FMMUS]; /**< FMMU-Konfigurationen */
   100     uint8_t fmmu_count; /**< Wieviele FMMUs schon benutzt sind. */
   164     uint8_t fmmu_count; /**< Wieviele FMMUs schon benutzt sind. */
   101 
   165 
   102     struct list_head eeprom_strings; /**< Strings im EEPROM */
   166     struct list_head eeprom_strings; /**< Strings im EEPROM */
       
   167     struct list_head eeprom_syncs; /**< Syncmanager-Konfigurationen (EEPROM) */
       
   168     struct list_head eeprom_pdos; /**< PDO-Beschreibungen im EEPROM */
   103 
   169 
   104     char *eeprom_name; /**< Slave-Name laut Hersteller */
   170     char *eeprom_name; /**< Slave-Name laut Hersteller */
   105     char *eeprom_group; /**< Slave-Beschreibung laut Hersteller */
   171     char *eeprom_group; /**< Slave-Beschreibung laut Hersteller */
   106     char *eeprom_desc; /**< Slave-Beschreibung laut Hersteller */
   172     char *eeprom_desc; /**< Slave-Beschreibung laut Hersteller */
   107 };
   173 };