fp@39: /****************************************************************************** fp@0: * fp@54: * t y p e s . h fp@0: * fp@0: * EtherCAT-Slave-Typen. 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@145: Besondere Slaves. fp@145: */ fp@145: fp@145: typedef enum fp@145: { fp@145: EC_TYPE_NORMAL, fp@145: EC_TYPE_BUS_COUPLER, fp@145: EC_TYPE_EOE fp@145: } fp@145: ec_special_type_t; fp@145: fp@145: /*****************************************************************************/ fp@145: fp@145: /** fp@73: Prozessdatenfeld. fp@73: */ fp@73: fp@73: typedef struct fp@73: { fp@104: const char *name; fp@104: size_t size; 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@73: uint16_t physical_start_address; fp@73: uint16_t size; fp@73: uint8_t control_byte; fp@73: const ec_field_t *fields[EC_MAX_FIELDS]; fp@73: } fp@73: ec_sync_t; fp@73: fp@73: /*****************************************************************************/ fp@73: fp@73: /** fp@0: Beschreibung eines EtherCAT-Slave-Typs. fp@0: fp@0: Diese Beschreibung dient zur Konfiguration einer bestimmten fp@0: Slave-Art. Sie enthält die Konfigurationsdaten für die fp@91: Slave-internen Sync-Manager und FMMUs. fp@0: */ fp@0: fp@73: typedef struct ec_slave_type fp@0: { fp@61: const char *vendor_name; /**< Name des Herstellers */ fp@61: const char *product_name; /**< Name des Slaves-Typs */ fp@73: const char *description; /**< Genauere Beschreibung des Slave-Typs */ fp@145: ec_special_type_t special; /**< Spezieller Slave-Typ */ fp@73: const ec_sync_t *sync_managers[EC_MAX_SYNC]; /**< Sync-Manager fp@73: Konfigurationen */ fp@73: } fp@73: ec_slave_type_t; fp@0: fp@39: /*****************************************************************************/ fp@0: fp@0: /** fp@0: Identifikation eines Slave-Typs. fp@0: fp@0: Diese Struktur wird zur 1:n-Zuordnung von Hersteller- und fp@0: Produktcodes zu den einzelnen Slave-Typen verwendet. fp@0: */ fp@0: fp@39: typedef struct slave_ident fp@0: { fp@101: uint32_t vendor_id; /**< Hersteller-Code */ fp@101: uint32_t product_code; /**< Herstellerspezifischer Produktcode */ fp@61: const ec_slave_type_t *type; /**< Zeiger auf den entsprechenden Typ */ fp@39: } fp@54: ec_slave_ident_t; fp@0: fp@54: extern ec_slave_ident_t slave_idents[]; /**< Statisches Array der fp@54: Slave-Identifikationen */ fp@0: fp@39: /*****************************************************************************/ fp@0: fp@0: #endif fp@73: fp@73: /* Emacs-Konfiguration fp@73: ;;; Local Variables: *** fp@73: ;;; c-basic-offset:4 *** fp@73: ;;; End: *** fp@73: */