fp@792: /****************************************************************************** fp@792: * fp@792: * $Id$ fp@792: * fp@792: * Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH fp@792: * fp@792: * This file is part of the IgH EtherCAT Master. fp@792: * fp@792: * The IgH EtherCAT Master is free software; you can redistribute it fp@792: * and/or modify it under the terms of the GNU General Public License fp@792: * as published by the Free Software Foundation; either version 2 of the fp@792: * License, or (at your option) any later version. fp@792: * fp@792: * The IgH EtherCAT Master is distributed in the hope that it will be fp@792: * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of fp@792: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the fp@792: * GNU General Public License for more details. fp@792: * fp@792: * You should have received a copy of the GNU General Public License fp@792: * along 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@792: * The right to use EtherCAT Technology is granted and comes free of fp@792: * charge under condition of compatibility of product made by fp@792: * Licensee. People intending to distribute/sell products based on the fp@792: * code, have to sign an agreement to guarantee that products using fp@792: * software based on IgH EtherCAT master stay compatible with the actual fp@792: * EtherCAT specification (which are released themselves as an open fp@792: * standard) as the (only) precondition to have the right to use EtherCAT fp@792: * Technology, IP and trade marks. 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@792: #ifndef _EC_SLAVE_CONFIG_H_ fp@792: #define _EC_SLAVE_CONFIG_H_ fp@792: fp@792: #include fp@792: #include fp@792: fp@792: #include "../include/ecrt.h" fp@792: fp@792: #include "globals.h" fp@792: #include "slave.h" fp@792: #include "fmmu_config.h" fp@879: #include "pdo_list.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: struct kobject kobj; /**< kobject. */ 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@879: ec_pdo_list_t pdos[2]; /**< Output and input Pdo assignment / mapping. */ fp@792: fp@858: struct list_head sdo_configs; /**< List of Sdo configurations. */ fp@858: struct list_head sdo_requests; /**< List of Sdo requests. */ fp@792: fp@792: ec_fmmu_config_t fmmu_configs[EC_MAX_FMMUS]; /**< FMMU configurations. */ fp@792: uint8_t used_fmmus; /**< Number of FMMUs used. */ fp@792: }; fp@792: fp@792: /*****************************************************************************/ fp@792: fp@792: int ec_slave_config_init(ec_slave_config_t *, ec_master_t *, uint16_t, fp@792: uint16_t, uint32_t, uint32_t); fp@792: void ec_slave_config_destroy(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@879: void ec_slave_config_load_default_assignment(ec_slave_config_t *); fp@879: void ec_slave_config_load_default_mapping(const ec_slave_config_t *, fp@842: ec_pdo_t *); fp@792: fp@792: /*****************************************************************************/ fp@792: fp@792: #endif