IgH EtherCAT Master  1.6.2
fsm_change.h
Go to the documentation of this file.
1 /*****************************************************************************
2  *
3  * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
4  *
5  * This file is part of the IgH EtherCAT Master.
6  *
7  * The IgH EtherCAT Master is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License version 2, as
9  * published by the Free Software Foundation.
10  *
11  * The IgH EtherCAT Master is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
14  * Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with the IgH EtherCAT Master; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19  *
20  ****************************************************************************/
21 
27 /****************************************************************************/
28 
29 #ifndef __EC_FSM_CHANGE_H__
30 #define __EC_FSM_CHANGE_H__
31 
32 #include "globals.h"
33 #include "datagram.h"
34 #include "slave.h"
35 
36 /****************************************************************************/
37 
42 typedef enum {
45 }
47 
48 /****************************************************************************/
49 
57 {
60  unsigned int retries;
62  void (*state)(ec_fsm_change_t *);
66  unsigned long jiffies_start;
67  uint8_t take_time;
69 };
70 
71 /****************************************************************************/
72 
75 
78 
81 
82 /****************************************************************************/
83 
84 #endif
uint8_t spontaneous_change
spontaneous state change detected
Definition: fsm_change.h:68
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:123
uint8_t take_time
take sending timestamp
Definition: fsm_change.h:67
EtherCAT slave structure.
EtherCAT datagram.
Definition: datagram.h:79
Global definitions and macros.
ec_datagram_t * datagram
datagram used in the state machine
Definition: fsm_change.h:59
EtherCAT slave.
Definition: slave.h:168
only state acknowledgement
Definition: fsm_change.h:44
int ec_fsm_change_exec(ec_fsm_change_t *)
Executes the current state of the state machine.
Definition: fsm_change.c:157
ec_fsm_change_mode_t
Mode of the change state machine.
Definition: fsm_change.h:42
unsigned long jiffies_start
change timer
Definition: fsm_change.h:66
void(* state)(ec_fsm_change_t *)
slave state change state function
Definition: fsm_change.h:62
ec_fsm_change_mode_t mode
full state change, or ack only.
Definition: fsm_change.h:63
ec_slave_state_t
State of an EtherCAT slave.
Definition: globals.h:121
void ec_fsm_change_init(ec_fsm_change_t *, ec_datagram_t *)
Constructor.
Definition: fsm_change.c:54
EtherCAT datagram structure.
full state change
Definition: fsm_change.h:43
int ec_fsm_change_success(ec_fsm_change_t *)
Returns, if the state machine terminated with success.
Definition: fsm_change.c:172
ec_slave_state_t requested_state
input: state
Definition: fsm_change.h:64
ec_slave_t * slave
slave the FSM runs on
Definition: fsm_change.h:58
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:140
ec_slave_state_t old_state
prior slave state
Definition: fsm_change.h:65
unsigned int retries
retries upon datagram timeout
Definition: fsm_change.h:60
void ec_fsm_change_clear(ec_fsm_change_t *)
Destructor.
Definition: fsm_change.c:69
EtherCAT state change FSM.
Definition: fsm_change.h:56