fp@635: /****************************************************************************** fp@635: * fp@635: * $Id$ fp@635: * fp@635: * Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH fp@635: * fp@635: * This file is part of the IgH EtherCAT Master. fp@635: * fp@635: * The IgH EtherCAT Master is free software; you can redistribute it fp@635: * and/or modify it under the terms of the GNU General Public License fp@635: * as published by the Free Software Foundation; either version 2 of the fp@635: * License, or (at your option) any later version. fp@635: * fp@635: * The IgH EtherCAT Master is distributed in the hope that it will be fp@635: * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of fp@635: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the fp@635: * GNU General Public License for more details. fp@635: * fp@635: * You should have received a copy of the GNU General Public License fp@635: * along with the IgH EtherCAT Master; if not, write to the Free Software fp@635: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA fp@635: * fp@635: * The right to use EtherCAT Technology is granted and comes free of fp@635: * charge under condition of compatibility of product made by fp@635: * Licensee. People intending to distribute/sell products based on the fp@635: * code, have to sign an agreement to guarantee that products using fp@635: * software based on IgH EtherCAT master stay compatible with the actual fp@635: * EtherCAT specification (which are released themselves as an open fp@635: * standard) as the (only) precondition to have the right to use EtherCAT fp@635: * Technology, IP and trade marks. fp@635: * fp@635: *****************************************************************************/ fp@635: fp@635: /** fp@635: \file fp@879: EtherCAT Pdo assignment state machine structures. fp@635: */ fp@635: fp@635: /*****************************************************************************/ fp@635: fp@883: #ifndef __EC_FSM_PDO_ASSIGN_H__ fp@883: #define __EC_FSM_PDO_ASSIGN_H__ fp@802: fp@802: #include "../include/ecrt.h" fp@635: fp@635: #include "globals.h" fp@635: #include "datagram.h" fp@635: #include "fsm_coe.h" fp@635: fp@635: /*****************************************************************************/ fp@635: fp@802: /** fp@879: * \see ec_fsm_pdo_assign fp@802: */ fp@879: typedef struct ec_fsm_pdo_assign ec_fsm_pdo_assign_t; fp@635: fp@879: /** Pdo assignment state machine. fp@635: */ fp@879: struct ec_fsm_pdo_assign fp@635: { fp@879: void (*state)(ec_fsm_pdo_assign_t *); /**< State function. */ fp@801: ec_fsm_coe_t *fsm_coe; /**< CoE state machine to use. */ fp@801: ec_slave_t *slave; /**< Slave the FSM runs on. */ fp@635: fp@821: ec_direction_t dir; /**< Current direction. */ fp@890: const ec_pdo_list_t *pdos; /**< Target Pdo assignment. */ fp@801: const ec_sync_t *sync; /**< Current sync manager. */ fp@890: unsigned int num_configured_dirs; /**< Number of configured directions. */ fp@801: const ec_pdo_t *pdo; /**< Current Pdo. */ fp@635: fp@854: ec_sdo_request_t request; /**< Sdo request. */ fp@879: unsigned int pdo_count; /**< Number of assigned Pdos. */ fp@635: }; fp@635: fp@635: /*****************************************************************************/ fp@635: fp@879: void ec_fsm_pdo_assign_init(ec_fsm_pdo_assign_t *, ec_fsm_coe_t *); fp@879: void ec_fsm_pdo_assign_clear(ec_fsm_pdo_assign_t *); fp@635: fp@879: void ec_fsm_pdo_assign_start(ec_fsm_pdo_assign_t *, ec_slave_t *); fp@879: int ec_fsm_pdo_assign_exec(ec_fsm_pdo_assign_t *); fp@879: int ec_fsm_pdo_assign_success(const ec_fsm_pdo_assign_t *); fp@635: fp@635: /*****************************************************************************/ fp@635: fp@635: #endif