fp@792: /****************************************************************************** fp@792: * fp@792: * $Id$ fp@792: * fp@1685: * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH fp@792: * fp@792: * This file is part of the IgH EtherCAT Master. fp@792: * fp@1685: * The IgH EtherCAT Master is free software; you can redistribute it and/or fp@1685: * modify it under the terms of the GNU General Public License version 2, as fp@1685: * published by the Free Software Foundation. fp@792: * fp@1685: * The IgH EtherCAT Master is distributed in the hope that it will be useful, fp@1685: * but WITHOUT ANY WARRANTY; without even the implied warranty of fp@1685: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General fp@1685: * Public License for more details. fp@792: * fp@1685: * You should have received a copy of the GNU General Public License along fp@1685: * with the IgH EtherCAT Master; if not, write to the Free Software fp@792: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA fp@792: * fp@1685: * Using the EtherCAT technology and brand is permitted in compliance with fp@1685: * the industrial property and similar rights of Beckhoff Automation GmbH. fp@792: * fp@792: *****************************************************************************/ fp@792: fp@792: /** fp@792: \file fp@792: EtherCAT slave configuration structure. fp@792: */ fp@792: fp@792: /*****************************************************************************/ fp@792: fp@883: #ifndef __EC_SLAVE_CONFIG_H__ fp@883: #define __EC_SLAVE_CONFIG_H__ fp@792: fp@792: #include fp@792: fp@792: #include "../include/ecrt.h" fp@792: fp@792: #include "globals.h" fp@792: #include "slave.h" fp@1055: #include "sync_config.h" fp@792: #include "fmmu_config.h" fp@792: fp@792: /*****************************************************************************/ fp@792: fp@792: /** EtherCAT slave configuration. fp@792: */ fp@792: struct ec_slave_config { fp@792: struct list_head list; /**< List item. */ fp@792: ec_master_t *master; /**< Master owning the slave configuration. */ fp@792: fp@792: uint16_t alias; /**< Slave alias. */ fp@792: uint16_t position; /**< Index after alias. If alias is zero, this is the fp@792: ring position. */ fp@792: uint32_t vendor_id; /**< Slave vendor ID. */ fp@792: uint32_t product_code; /**< Slave product code. */ fp@792: fp@792: ec_slave_t *slave; /**< Slave pointer. This is \a NULL, if the slave is fp@792: offline. */ fp@792: fp@1082: ec_sync_config_t sync_configs[EC_MAX_SYNC_MANAGERS]; /**< Sync manager fp@1055: configurations. */ fp@1055: ec_fmmu_config_t fmmu_configs[EC_MAX_FMMUS]; /**< FMMU configurations. */ fp@1055: uint8_t used_fmmus; /**< Number of FMMUs used. */ fp@792: fp@1686: struct list_head sdo_configs; /**< List of SDO configurations. */ fp@1686: struct list_head sdo_requests; /**< List of SDO requests. */ fp@792: fp@792: }; fp@792: fp@792: /*****************************************************************************/ fp@792: fp@995: void ec_slave_config_init(ec_slave_config_t *, ec_master_t *, uint16_t, fp@1010: uint16_t, uint32_t, uint32_t); fp@995: void ec_slave_config_clear(ec_slave_config_t *); fp@792: fp@792: int ec_slave_config_attach(ec_slave_config_t *); fp@792: void ec_slave_config_detach(ec_slave_config_t *); fp@792: fp@1055: void ec_slave_config_load_default_sync_config(ec_slave_config_t *); fp@792: fp@990: unsigned int ec_slave_config_sdo_count(const ec_slave_config_t *); fp@990: const ec_sdo_request_t *ec_slave_config_get_sdo_by_pos_const( fp@990: const ec_slave_config_t *, unsigned int); fp@990: fp@792: /*****************************************************************************/ fp@792: fp@792: #endif