fp@1174: /****************************************************************************** fp@1174: * fp@1174: * $Id$ fp@1174: * fp@1174: * Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH fp@1174: * fp@1174: * This file is part of the IgH EtherCAT Master. fp@1174: * fp@1174: * The IgH EtherCAT Master is free software; you can redistribute it fp@1174: * and/or modify it under the terms of the GNU General Public License fp@1174: * as published by the Free Software Foundation; either version 2 of the fp@1174: * License, or (at your option) any later version. fp@1174: * fp@1174: * The IgH EtherCAT Master is distributed in the hope that it will be fp@1174: * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of fp@1174: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the fp@1174: * GNU General Public License for more details. fp@1174: * fp@1174: * You should have received a copy of the GNU General Public License fp@1174: * along with the IgH EtherCAT Master; if not, write to the Free Software fp@1174: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA fp@1174: * fp@1174: * The right to use EtherCAT Technology is granted and comes free of fp@1174: * charge under condition of compatibility of product made by fp@1174: * Licensee. People intending to distribute/sell products based on the fp@1174: * code, have to sign an agreement to guarantee that products using fp@1174: * software based on IgH EtherCAT master stay compatible with the actual fp@1174: * EtherCAT specification (which are released themselves as an open fp@1174: * standard) as the (only) precondition to have the right to use EtherCAT fp@1174: * Technology, IP and trade marks. fp@1174: * fp@1174: *****************************************************************************/ fp@1174: fp@1174: /** fp@1174: \file fp@1174: EtherCAT Pdo configuration state machine structures. fp@1174: */ fp@1174: fp@1174: /*****************************************************************************/ fp@1174: fp@1174: #ifndef __EC_FSM_PDO_H__ fp@1174: #define __EC_FSM_PDO_H__ fp@1174: fp@1174: #include "globals.h" fp@1174: #include "datagram.h" fp@1174: #include "fsm_coe.h" fp@1174: #include "fsm_pdo_entry.h" fp@1174: fp@1174: /*****************************************************************************/ fp@1174: fp@1174: /** fp@1174: * \see ec_fsm_pdo fp@1174: */ fp@1174: typedef struct ec_fsm_pdo ec_fsm_pdo_t; fp@1174: fp@1174: /** Pdo configuration state machine. fp@1174: */ fp@1174: struct ec_fsm_pdo fp@1174: { fp@1174: void (*state)(ec_fsm_pdo_t *); /**< State function. */ fp@1174: ec_fsm_coe_t *fsm_coe; /**< CoE state machine to use. */ fp@1174: ec_fsm_pdo_entry_t fsm_pdo_entry; /**< Pdo entry state machine. */ fp@1174: ec_pdo_list_t pdos; /**< Pdo configuration. */ fp@1174: ec_sdo_request_t request; /**< Sdo request. */ fp@1174: ec_pdo_t slave_pdo; /**< Pdo actually appearing in a slave. */ fp@1174: fp@1174: ec_slave_t *slave; /**< Slave the FSM runs on. */ fp@1174: uint8_t sync_index; /**< Current sync manager index. */ fp@1174: ec_sync_t *sync; /**< Current sync manager. */ fp@1174: ec_pdo_t *pdo; /**< Current Pdo. */ fp@1174: unsigned int pdo_pos; /**< Assignment position of current Pdos. */ fp@1174: unsigned int pdo_count; /**< Number of assigned Pdos. */ fp@1174: }; fp@1174: fp@1174: /*****************************************************************************/ fp@1174: fp@1174: void ec_fsm_pdo_init(ec_fsm_pdo_t *, ec_fsm_coe_t *); fp@1174: void ec_fsm_pdo_clear(ec_fsm_pdo_t *); fp@1174: fp@1174: void ec_fsm_pdo_start_reading(ec_fsm_pdo_t *, ec_slave_t *); fp@1174: void ec_fsm_pdo_start_configuration(ec_fsm_pdo_t *, ec_slave_t *); fp@1174: fp@1174: int ec_fsm_pdo_exec(ec_fsm_pdo_t *); fp@1174: int ec_fsm_pdo_success(const ec_fsm_pdo_t *); fp@1174: fp@1174: /*****************************************************************************/ fp@1174: fp@1174: #endif