fp@39: /****************************************************************************** fp@0: * fp@54: * t y p e s . h fp@0: * fp@195: * EtherCAT slave types. fp@0: * fp@39: * $Id$ fp@0: * fp@39: *****************************************************************************/ fp@0: fp@0: #ifndef _EC_TYPES_H_ fp@0: #define _EC_TYPES_H_ fp@0: fp@73: #include fp@73: fp@104: #include "../include/ecrt.h" fp@55: fp@41: /*****************************************************************************/ fp@41: fp@73: #define EC_MAX_FIELDS 10 fp@73: #define EC_MAX_SYNC 16 fp@73: fp@73: /*****************************************************************************/ fp@73: fp@0: /** fp@195: Special slaves. fp@145: */ fp@145: fp@145: typedef enum fp@145: { fp@195: EC_TYPE_NORMAL, /**< no special slave */ fp@195: EC_TYPE_BUS_COUPLER, /**< slave is a bus coupler */ fp@195: EC_TYPE_EOE /**< slave is an EoE switch */ fp@145: } fp@145: ec_special_type_t; fp@145: fp@145: /*****************************************************************************/ fp@145: fp@145: /** fp@195: Process data field. fp@73: */ fp@73: fp@73: typedef struct fp@73: { fp@195: const char *name; /**< field name */ fp@195: size_t size; /**< field size in bytes */ fp@73: } fp@73: ec_field_t; fp@73: fp@73: /*****************************************************************************/ fp@73: fp@73: /** fp@73: Sync-Manager. fp@73: */ fp@73: fp@73: typedef struct fp@73: { fp@195: uint16_t physical_start_address; /**< physical start address */ fp@195: uint16_t size; /**< size in bytes */ fp@195: uint8_t control_byte; /**< control register value */ fp@195: const ec_field_t *fields[EC_MAX_FIELDS]; /**< field array */ fp@73: } fp@73: ec_sync_t; fp@73: fp@73: /*****************************************************************************/ fp@73: fp@73: /** fp@195: Slave description type. fp@0: */ fp@0: fp@73: typedef struct ec_slave_type fp@0: { fp@195: const char *vendor_name; /**< vendor name*/ fp@195: const char *product_name; /**< product name */ fp@195: const char *description; /**< free description */ fp@195: ec_special_type_t special; /**< special slave type? */ fp@195: const ec_sync_t *sync_managers[EC_MAX_SYNC]; /**< sync managers */ fp@73: } fp@73: ec_slave_type_t; fp@0: fp@39: /*****************************************************************************/ fp@0: fp@0: /** fp@195: Slave type identification. fp@0: */ fp@0: fp@195: typedef struct fp@0: { fp@195: uint32_t vendor_id; /**< vendor id */ fp@195: uint32_t product_code; /**< product code */ fp@195: const ec_slave_type_t *type; /**< associated slave description object */ fp@39: } fp@54: ec_slave_ident_t; fp@0: fp@195: extern ec_slave_ident_t slave_idents[]; /**< array with slave descriptions */ fp@0: fp@39: /*****************************************************************************/ fp@0: fp@0: #endif