fp@830: /****************************************************************************** fp@830: * fp@830: * $Id$ fp@830: * fp@830: * Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH fp@830: * fp@830: * This file is part of the IgH EtherCAT Master. fp@830: * fp@830: * The IgH EtherCAT Master is free software; you can redistribute it fp@830: * and/or modify it under the terms of the GNU General Public License fp@830: * as published by the Free Software Foundation; either version 2 of the fp@830: * License, or (at your option) any later version. fp@830: * fp@830: * The IgH EtherCAT Master is distributed in the hope that it will be fp@830: * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of fp@830: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the fp@830: * GNU General Public License for more details. fp@830: * fp@830: * You should have received a copy of the GNU General Public License fp@830: * along with the IgH EtherCAT Master; if not, write to the Free Software fp@830: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA fp@830: * fp@830: * The right to use EtherCAT Technology is granted and comes free of fp@830: * charge under condition of compatibility of product made by fp@830: * Licensee. People intending to distribute/sell products based on the fp@830: * code, have to sign an agreement to guarantee that products using fp@830: * software based on IgH EtherCAT master stay compatible with the actual fp@830: * EtherCAT specification (which are released themselves as an open fp@830: * standard) as the (only) precondition to have the right to use EtherCAT fp@830: * Technology, IP and trade marks. fp@830: * fp@830: *****************************************************************************/ fp@830: fp@830: /** fp@830: \file fp@830: EtherCAT slave configuration state machine. fp@830: */ fp@830: fp@830: /*****************************************************************************/ fp@830: fp@830: #ifndef __EC_FSM_SLAVE_CONFIG__ fp@830: #define __EC_FSM_SLAVE_CONFIG__ fp@830: fp@830: #include "../include/ecrt.h" fp@830: fp@830: #include "globals.h" fp@830: #include "slave.h" fp@830: #include "datagram.h" fp@830: #include "fsm_change.h" fp@830: #include "fsm_coe.h" fp@879: #include "fsm_pdo_assign.h" fp@830: #include "fsm_pdo_mapping.h" fp@830: fp@830: /*****************************************************************************/ fp@830: fp@830: /** \see ec_fsm_slave_config */ fp@830: typedef struct ec_fsm_slave_config ec_fsm_slave_config_t; fp@830: fp@830: /** Finite state machine to configure an EtherCAT slave. fp@830: */ fp@830: struct ec_fsm_slave_config fp@830: { fp@830: ec_slave_t *slave; /**< Slave the FSM runs on. */ fp@830: ec_datagram_t *datagram; /**< Datagram used in the state machine. */ fp@830: unsigned int retries; /**< Retries on datagram timeout. */ fp@830: fp@830: void (*state)(ec_fsm_slave_config_t *); /**< State function. */ fp@854: ec_sdo_request_t *request; /**< Sdo request for Sdo configuration. */ fp@830: ec_fsm_change_t fsm_change; /**< State change state machine. */ fp@830: ec_fsm_coe_t fsm_coe; /**< CoE state machine. */ fp@879: ec_fsm_pdo_assign_t fsm_pdo_assign; /**< Pdo assignment state machine. */ fp@879: ec_fsm_pdo_mapping_t fsm_pdo_mapping; /**< Pdo mapping state machine. */ fp@830: }; fp@830: fp@830: /*****************************************************************************/ fp@830: fp@830: void ec_fsm_slave_config_init(ec_fsm_slave_config_t *, ec_datagram_t *); fp@830: void ec_fsm_slave_config_clear(ec_fsm_slave_config_t *); fp@830: fp@830: void ec_fsm_slave_config_start(ec_fsm_slave_config_t *, ec_slave_t *); fp@830: fp@830: int ec_fsm_slave_config_exec(ec_fsm_slave_config_t *); fp@830: int ec_fsm_slave_config_success(const ec_fsm_slave_config_t *); fp@830: fp@830: /*****************************************************************************/ fp@830: fp@830: #endif