martin@1583: /****************************************************************************** martin@1583: * martin@1583: * $Id$ martin@1583: * martin@1583: * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH martin@1583: * martin@1583: * This file is part of the IgH EtherCAT Master. martin@1583: * martin@1583: * The IgH EtherCAT Master is free software; you can redistribute it and/or martin@1583: * modify it under the terms of the GNU General Public License version 2, as martin@1583: * published by the Free Software Foundation. martin@1583: * martin@1583: * The IgH EtherCAT Master is distributed in the hope that it will be useful, martin@1583: * but WITHOUT ANY WARRANTY; without even the implied warranty of martin@1583: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General martin@1583: * Public License for more details. martin@1583: * martin@1583: * You should have received a copy of the GNU General Public License along martin@1583: * with the IgH EtherCAT Master; if not, write to the Free Software martin@1583: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA martin@1583: * martin@1583: * --- martin@1583: * martin@1583: * The license mentioned above concerns the source code only. Using the martin@1583: * EtherCAT technology and brand is only permitted in compliance with the martin@1583: * industrial property and similar rights of Beckhoff Automation GmbH. martin@1583: * martin@1583: *****************************************************************************/ martin@1583: martin@1583: /** martin@1583: \file martin@1583: EtherCAT slave request (SDO) state machine. martin@1583: */ martin@1583: martin@1583: /*****************************************************************************/ martin@1583: #ifndef __EC_FSM_SLAVE_H__ martin@1583: #define __EC_FSM_SLAVE_H__ martin@1583: martin@1583: #include "globals.h" martin@1583: #include "datagram.h" martin@1583: #include "sdo_request.h" martin@1583: #include "fsm_coe.h" martin@1597: #include "fsm_foe.h" fp@1831: #include "fsm_soe.h" ch1010277@2027: #include "fsm_master.h" martin@1583: martin@1583: typedef struct ec_fsm_slave ec_fsm_slave_t; /**< \see ec_fsm_slave */ martin@1583: martin@1583: /** Finite state machine of an EtherCAT slave. martin@1583: */ martin@1583: struct ec_fsm_slave { martin@1583: ec_slave_t *slave; /**< slave the FSM runs on */ martin@1583: ec_datagram_t *datagram; /**< datagram used in the state machine */ martin@1583: martin@1583: void (*state)(ec_fsm_slave_t *); /**< master state function */ ch1010277@2027: ec_master_sdo_request_t *sdo_request; /**< SDO request to process. */ martin@1597: ec_foe_request_t *foe_request; /**< FoE request to process. */ martin@1597: off_t foe_index; /**< index to FoE write request data */ fp@1831: ec_soe_request_t *soe_request; /**< SoE request to process. */ martin@1583: martin@1583: ec_fsm_coe_t fsm_coe; /**< CoE state machine */ martin@1597: ec_fsm_foe_t fsm_foe; /**< FoE state machine */ fp@1831: ec_fsm_soe_t fsm_soe; /**< SoE state machine */ martin@1583: }; martin@1583: martin@1583: /*****************************************************************************/ martin@1583: martin@1583: void ec_fsm_slave_init(ec_fsm_slave_t *, ec_slave_t *, ec_datagram_t *); martin@1583: void ec_fsm_slave_clear(ec_fsm_slave_t *); martin@1583: ch1010277@2017: int ec_fsm_slave_exec(ec_fsm_slave_t *); martin@1601: void ec_fsm_slave_ready(ec_fsm_slave_t *); martin@1583: martin@1583: /*****************************************************************************/ martin@1583: martin@1583: martin@1583: #endif // __EC_FSM_SLAVE_H__