00001 /****************************************************************************** 00002 * 00003 * $Id$ 00004 * 00005 * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 00006 * 00007 * This file is part of the IgH EtherCAT Master. 00008 * 00009 * The IgH EtherCAT Master is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU General Public License version 2, as 00011 * published by the Free Software Foundation. 00012 * 00013 * The IgH EtherCAT Master is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 00016 * Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License along 00019 * with the IgH EtherCAT Master; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00021 * 00022 * --- 00023 * 00024 * The license mentioned above concerns the source code only. Using the 00025 * EtherCAT technology and brand is only permitted in compliance with the 00026 * industrial property and similar rights of Beckhoff Automation GmbH. 00027 * 00028 *****************************************************************************/ 00029 00035 /*****************************************************************************/ 00036 00037 #ifndef __EC_FSM_SII_H__ 00038 #define __EC_FSM_SII_H__ 00039 00040 #include "globals.h" 00041 #include "datagram.h" 00042 #include "slave.h" 00043 00044 /*****************************************************************************/ 00045 00048 typedef enum { 00049 EC_FSM_SII_USE_INCREMENT_ADDRESS, 00050 EC_FSM_SII_USE_CONFIGURED_ADDRESS 00051 } ec_fsm_sii_addressing_t; 00052 00053 /*****************************************************************************/ 00054 00055 typedef struct ec_fsm_sii ec_fsm_sii_t; 00061 struct ec_fsm_sii 00062 { 00063 ec_slave_t *slave; 00064 ec_datagram_t *datagram; 00065 unsigned int retries; 00067 void (*state)(ec_fsm_sii_t *); 00068 uint16_t word_offset; 00069 ec_fsm_sii_addressing_t mode; 00070 uint8_t value[4]; 00071 unsigned long jiffies_start; 00072 uint8_t check_once_more; 00073 }; 00074 00075 /*****************************************************************************/ 00076 00077 void ec_fsm_sii_init(ec_fsm_sii_t *, ec_datagram_t *); 00078 void ec_fsm_sii_clear(ec_fsm_sii_t *); 00079 00080 void ec_fsm_sii_read(ec_fsm_sii_t *, ec_slave_t *, 00081 uint16_t, ec_fsm_sii_addressing_t); 00082 void ec_fsm_sii_write(ec_fsm_sii_t *, ec_slave_t *, uint16_t, 00083 const uint16_t *, ec_fsm_sii_addressing_t); 00084 00085 int ec_fsm_sii_exec(ec_fsm_sii_t *); 00086 int ec_fsm_sii_success(ec_fsm_sii_t *); 00087 00088 /*****************************************************************************/ 00089 00090 #endif
1.5.6