IgH EtherCAT Master  1.5.3
fsm_change.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * $Id$
4  *
5  * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
6  *
7  * This file is part of the IgH EtherCAT Master.
8  *
9  * The IgH EtherCAT Master is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License version 2, as
11  * published by the Free Software Foundation.
12  *
13  * The IgH EtherCAT Master is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
16  * Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with the IgH EtherCAT Master; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  * ---
23  *
24  * The license mentioned above concerns the source code only. Using the
25  * EtherCAT technology and brand is only permitted in compliance with the
26  * industrial property and similar rights of Beckhoff Automation GmbH.
27  *
28  *****************************************************************************/
29 
35 /*****************************************************************************/
36 
37 #ifndef __EC_FSM_CHANGE_H__
38 #define __EC_FSM_CHANGE_H__
39 
40 #include "globals.h"
41 #include "datagram.h"
42 #include "slave.h"
43 
44 /*****************************************************************************/
45 
50 typedef enum {
53 }
55 
56 /*****************************************************************************/
57 
65 {
68  unsigned int retries;
70  void (*state)(ec_fsm_change_t *);
74  unsigned long jiffies_start;
75  uint8_t take_time;
77 };
78 
79 /*****************************************************************************/
80 
83 
86 
89 
90 /*****************************************************************************/
91 
92 #endif
uint8_t spontaneous_change
spontaneous state change detected
Definition: fsm_change.h:76
void ec_fsm_change_start(ec_fsm_change_t *, ec_slave_t *, ec_slave_state_t)
Starts the change state machine.
Definition: fsm_change.c:90
uint8_t take_time
take sending timestamp
Definition: fsm_change.h:75
EtherCAT slave structure.
EtherCAT datagram.
Definition: datagram.h:87
Global definitions and macros.
ec_datagram_t * datagram
datagram used in the state machine
Definition: fsm_change.h:67
EtherCAT slave.
Definition: slave.h:176
only state acknowledgement
Definition: fsm_change.h:52
int ec_fsm_change_exec(ec_fsm_change_t *)
Executes the current state of the state machine.
Definition: fsm_change.c:124
ec_fsm_change_mode_t
Mode of the change state machine.
Definition: fsm_change.h:50
unsigned long jiffies_start
change timer
Definition: fsm_change.h:74
void(* state)(ec_fsm_change_t *)
slave state change state function
Definition: fsm_change.h:70
ec_fsm_change_mode_t mode
full state change, or ack only.
Definition: fsm_change.h:71
ec_slave_state_t
State of an EtherCAT slave.
Definition: globals.h:115
void ec_fsm_change_init(ec_fsm_change_t *, ec_datagram_t *)
Constructor.
Definition: fsm_change.c:65
EtherCAT datagram structure.
full state change
Definition: fsm_change.h:51
int ec_fsm_change_success(ec_fsm_change_t *)
Returns, if the state machine terminated with success.
Definition: fsm_change.c:139
ec_slave_state_t requested_state
input: state
Definition: fsm_change.h:72
ec_slave_t * slave
slave the FSM runs on
Definition: fsm_change.h:66
void ec_fsm_change_ack(ec_fsm_change_t *, ec_slave_t *)
Starts the change state machine to only acknowlegde a slave's state.
Definition: fsm_change.c:107
ec_slave_state_t old_state
prior slave state
Definition: fsm_change.h:73
unsigned int retries
retries upon datagram timeout
Definition: fsm_change.h:68
void ec_fsm_change_clear(ec_fsm_change_t *)
Destructor.
Definition: fsm_change.c:80
EtherCAT state change FSM.
Definition: fsm_change.h:64