00001 /****************************************************************************** 00002 * 00003 * $Id$ 00004 * 00005 * Copyright (C) 2008 Olav Zarges, imc Messsysteme GmbH 00006 * 2009-2012 Florian Pose <fp@igh-essen.com> 00007 * 00008 * This file is part of the IgH EtherCAT Master. 00009 * 00010 * The IgH EtherCAT Master is free software; you can redistribute it and/or 00011 * modify it under the terms of the GNU General Public License version 2, as 00012 * published by the Free Software Foundation. 00013 * 00014 * The IgH EtherCAT Master is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 00017 * Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License along 00020 * with the IgH EtherCAT Master; if not, write to the Free Software 00021 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00022 * 00023 * --- 00024 * 00025 * The license mentioned above concerns the source code only. Using the 00026 * EtherCAT technology and brand is only permitted in compliance with the 00027 * industrial property and similar rights of Beckhoff Automation GmbH. 00028 * 00029 *****************************************************************************/ 00030 00036 /*****************************************************************************/ 00037 00038 #ifndef __EC_FSM_FOE_H__ 00039 #define __EC_FSM_FOE_H__ 00040 00041 #include "globals.h" 00042 #include "../include/ecrt.h" 00043 #include "datagram.h" 00044 #include "slave.h" 00045 #include "foe_request.h" 00046 00047 /*****************************************************************************/ 00048 00049 typedef struct ec_fsm_foe ec_fsm_foe_t; 00053 struct ec_fsm_foe { 00054 ec_slave_t *slave; 00055 unsigned int retries; 00057 void (*state)(ec_fsm_foe_t *, ec_datagram_t *); 00058 ec_datagram_t *datagram; 00059 unsigned long jiffies_start; 00060 uint8_t subindex; 00061 ec_foe_request_t *request; 00062 uint8_t toggle; 00064 uint8_t *tx_buffer; 00065 uint32_t tx_buffer_size; 00066 uint32_t tx_buffer_offset; 00067 uint32_t tx_last_packet; 00068 uint32_t tx_packet_no; 00069 uint32_t tx_current_size; 00070 uint8_t *tx_filename; 00071 uint32_t tx_filename_len; 00073 uint8_t *rx_buffer; 00074 uint32_t rx_buffer_size; 00075 uint32_t rx_buffer_offset; 00076 uint32_t rx_expected_packet_no; 00077 uint32_t rx_last_packet; 00078 uint8_t *rx_filename; 00079 uint32_t rx_filename_len; 00080 }; 00081 00082 /*****************************************************************************/ 00083 00084 void ec_fsm_foe_init(ec_fsm_foe_t *); 00085 void ec_fsm_foe_clear(ec_fsm_foe_t *); 00086 00087 int ec_fsm_foe_exec(ec_fsm_foe_t *, ec_datagram_t *); 00088 int ec_fsm_foe_success(const ec_fsm_foe_t *); 00089 00090 void ec_fsm_foe_transfer(ec_fsm_foe_t *, ec_slave_t *, ec_foe_request_t *); 00091 00092 /*****************************************************************************/ 00093 00094 #endif
1.5.6