fp@799: /****************************************************************************** fp@799: * fp@799: * $Id$ fp@799: * fp@799: * Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH fp@799: * fp@799: * This file is part of the IgH EtherCAT Master. fp@799: * fp@799: * The IgH EtherCAT Master is free software; you can redistribute it fp@799: * and/or modify it under the terms of the GNU General Public License fp@799: * as published by the Free Software Foundation; either version 2 of the fp@799: * License, or (at your option) any later version. fp@799: * fp@799: * The IgH EtherCAT Master is distributed in the hope that it will be fp@799: * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of fp@799: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the fp@799: * GNU General Public License for more details. fp@799: * fp@799: * You should have received a copy of the GNU General Public License fp@799: * along with the IgH EtherCAT Master; if not, write to the Free Software fp@799: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA fp@799: * fp@799: * The right to use EtherCAT Technology is granted and comes free of fp@799: * charge under condition of compatibility of product made by fp@799: * Licensee. People intending to distribute/sell products based on the fp@799: * code, have to sign an agreement to guarantee that products using fp@799: * software based on IgH EtherCAT master stay compatible with the actual fp@799: * EtherCAT specification (which are released themselves as an open fp@799: * standard) as the (only) precondition to have the right to use EtherCAT fp@799: * Technology, IP and trade marks. fp@799: * fp@799: *****************************************************************************/ fp@799: fp@801: /** \file fp@801: * EtherCAT PDO configuration state machine structures. fp@801: */ fp@799: fp@799: /*****************************************************************************/ fp@799: fp@799: #ifndef __EC_FSM_PDO_CONFIG__ fp@799: #define __EC_FSM_PDO_CONFIG__ fp@799: fp@799: #include "globals.h" fp@799: #include "../include/ecrt.h" fp@799: #include "datagram.h" fp@799: #include "fsm_coe.h" fp@799: fp@799: /*****************************************************************************/ fp@799: fp@799: /** fp@799: * \see ec_fsm_pdo_config fp@799: */ fp@799: typedef struct ec_fsm_pdo_config ec_fsm_pdo_config_t; fp@799: fp@799: /** Pdo configuration state machine. fp@799: */ fp@799: struct ec_fsm_pdo_config fp@799: { fp@799: void (*state)(ec_fsm_pdo_config_t *); /**< state function */ fp@799: ec_fsm_coe_t *fsm_coe; /**< CoE state machine to use */ fp@799: ec_slave_t *slave; /**< Slave the FSM runs on. */ fp@799: fp@799: const ec_pdo_t *pdo; /**< Current PDO to configure. */ fp@800: const ec_pdo_entry_t *entry; /**< Current entry. */ fp@799: fp@799: ec_sdo_data_t sdodata; /**< SDO configuration data. */ fp@799: uint16_t sdo_value; /**< SDO value. */ fp@799: unsigned int entry_count; /**< Number of configured entries. */ fp@799: }; fp@799: fp@799: /*****************************************************************************/ fp@799: fp@799: void ec_fsm_pdo_config_init(ec_fsm_pdo_config_t *, ec_fsm_coe_t *); fp@799: void ec_fsm_pdo_config_clear(ec_fsm_pdo_config_t *); fp@799: fp@799: void ec_fsm_pdo_config_start(ec_fsm_pdo_config_t *, ec_slave_t *); fp@799: int ec_fsm_pdo_config_exec(ec_fsm_pdo_config_t *); fp@799: int ec_fsm_pdo_config_success(const ec_fsm_pdo_config_t *); fp@799: fp@799: /*****************************************************************************/ fp@799: fp@799: #endif