fp@39: /****************************************************************************** fp@0: * fp@39: * $Id$ fp@0: * fp@1618: * Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH fp@1618: * fp@1618: * This file is part of the IgH EtherCAT Master. fp@1618: * fp@1618: * The IgH EtherCAT Master is free software; you can redistribute it fp@1618: * and/or modify it under the terms of the GNU General Public License fp@1618: * as published by the Free Software Foundation; version 2 of the License. fp@1618: * fp@1618: * The IgH EtherCAT Master is distributed in the hope that it will be fp@1618: * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of fp@1618: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the fp@1618: * GNU General Public License for more details. fp@1618: * fp@1618: * You should have received a copy of the GNU General Public License fp@1618: * along with the IgH EtherCAT Master; if not, write to the Free Software fp@1618: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA fp@1618: * fp@39: *****************************************************************************/ fp@0: fp@1618: /** fp@1618: \file fp@1618: EtherCAT slave types. fp@1618: */ fp@1618: fp@1618: /*****************************************************************************/ fp@1618: 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@1618: 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