fsm.h

Go to the documentation of this file.
00001 /******************************************************************************
00002  *
00003  *  $Id: fsm.h 533 2006-09-01 12:35:41Z fp $
00004  *
00005  *  Copyright (C) 2006  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
00010  *  and/or modify it under the terms of the GNU General Public License
00011  *  as published by the Free Software Foundation; either version 2 of the
00012  *  License, or (at your option) any later version.
00013  *
00014  *  The IgH EtherCAT Master is distributed in the hope that it will be
00015  *  useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  *  GNU General Public License for more details.
00018  *
00019  *  You should have received a copy of the GNU General Public License
00020  *  along 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  *  The right to use EtherCAT Technology is granted and comes free of
00024  *  charge under condition of compatibility of product made by
00025  *  Licensee. People intending to distribute/sell products based on the
00026  *  code, have to sign an agreement to guarantee that products using
00027  *  software based on IgH EtherCAT master stay compatible with the actual
00028  *  EtherCAT specification (which are released themselves as an open
00029  *  standard) as the (only) precondition to have the right to use EtherCAT
00030  *  Technology, IP and trade marks.
00031  *
00032  *****************************************************************************/
00033 
00039 /*****************************************************************************/
00040 
00041 #ifndef __EC_STATES__
00042 #define __EC_STATES__
00043 
00044 #include "globals.h"
00045 #include "../include/ecrt.h"
00046 #include "datagram.h"
00047 #include "slave.h"
00048 
00049 /*****************************************************************************/
00050 
00051 typedef struct ec_fsm ec_fsm_t; 
00057 struct ec_fsm
00058 {
00059     ec_master_t *master; 
00060     ec_slave_t *slave; 
00061     ec_datagram_t datagram; 
00063     void (*master_state)(ec_fsm_t *); 
00064     unsigned int master_slaves_responding; 
00065     ec_slave_state_t master_slave_states; 
00066     unsigned int master_validation; 
00068     void (*slave_state)(ec_fsm_t *); 
00070     void (*sii_state)(ec_fsm_t *); 
00071     uint16_t sii_offset; 
00072     unsigned int sii_mode; 
00073     uint8_t sii_value[4]; 
00074     cycles_t sii_start; 
00076     void (*change_state)(ec_fsm_t *); 
00077     ec_slave_state_t change_new; 
00078     unsigned long change_jiffies; 
00080     void (*coe_state)(ec_fsm_t *); 
00081     ec_sdo_data_t *sdodata; 
00082     cycles_t coe_start; 
00083 };
00084 
00085 /*****************************************************************************/
00086 
00087 int ec_fsm_init(ec_fsm_t *, ec_master_t *);
00088 void ec_fsm_clear(ec_fsm_t *);
00089 void ec_fsm_reset(ec_fsm_t *);
00090 void ec_fsm_execute(ec_fsm_t *);
00091 
00092 void ec_fsm_startup(ec_fsm_t *);
00093 int ec_fsm_startup_running(ec_fsm_t *);
00094 int ec_fsm_startup_success(ec_fsm_t *);
00095 
00096 void ec_fsm_configuration(ec_fsm_t *);
00097 int ec_fsm_configuration_running(ec_fsm_t *);
00098 int ec_fsm_configuration_success(ec_fsm_t *);
00099 
00100 /*****************************************************************************/
00101 
00102 #endif

Generated on Fri Sep 1 14:56:56 2006 for IgH EtherCAT master by  doxygen 1.4.6