IgH EtherCAT Master  1.5.3
fsm_slave.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * $Id$
4  *
5  * Copyright (C) 2006-2012 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_SLAVE_H__
38 #define __EC_FSM_SLAVE_H__
39 
40 #include "globals.h"
41 #include "datagram.h"
42 #include "sdo_request.h"
43 #include "reg_request.h"
44 #include "fsm_coe.h"
45 #include "fsm_foe.h"
46 #include "fsm_soe.h"
47 
48 /*****************************************************************************/
49 
50 typedef struct ec_fsm_slave ec_fsm_slave_t;
54 struct ec_fsm_slave {
56  struct list_head list;
63  off_t foe_index;
69 };
70 
71 /*****************************************************************************/
72 
75 
79 
80 /*****************************************************************************/
81 
82 
83 #endif // __EC_FSM_SLAVE_H__
Finite state machines for the Sercos over EtherCAT protocol.
Definition: fsm_soe.h:51
ec_foe_request_t * foe_request
FoE request to process.
Definition: fsm_slave.h:62
ec_reg_request_t * reg_request
Register request to process.
Definition: fsm_slave.h:61
CANopen SDO request.
Definition: sdo_request.h:46
Register request.
Definition: reg_request.h:48
EtherCAT datagram.
Definition: datagram.h:87
ec_fsm_soe_t fsm_soe
SoE state machine.
Definition: fsm_slave.h:68
Finite state machine of an EtherCAT slave.
Definition: fsm_slave.h:54
ec_datagram_t * datagram
Previous state datagram.
Definition: fsm_slave.h:59
ec_sdo_request_t * sdo_request
SDO request to process.
Definition: fsm_slave.h:60
Global definitions and macros.
EtherCAT CoE state machines.
EtherCAT slave.
Definition: slave.h:176
ec_slave_t * slave
slave the FSM runs on
Definition: fsm_slave.h:55
void ec_fsm_slave_set_ready(ec_fsm_slave_t *)
Sets the current state of the state machine to READY.
Definition: fsm_slave.c:146
off_t foe_index
Index to FoE write request data.
Definition: fsm_slave.h:63
EtherCAT CANopen SDO request structure.
void ec_fsm_slave_clear(ec_fsm_slave_t *)
Destructor.
Definition: fsm_slave.c:83
int ec_fsm_slave_exec(ec_fsm_slave_t *, ec_datagram_t *)
Executes the current state of the state machine.
Definition: fsm_slave.c:121
int ec_fsm_slave_is_ready(const ec_fsm_slave_t *)
Returns, if the FSM is currently not busy and ready to execute.
Definition: fsm_slave.c:162
ec_soe_request_t * soe_request
SoE request to process.
Definition: fsm_slave.h:64
EtherCAT CoE state machines.
EtherCAT datagram structure.
FoE request.
Definition: foe_request.h:50
EtherCAT register request structure.
struct list_head list
Used for execution list.
Definition: fsm_slave.h:56
ec_fsm_foe_t fsm_foe
FoE state machine.
Definition: fsm_slave.h:67
ec_fsm_coe_t fsm_coe
CoE state machine.
Definition: fsm_slave.h:66
void ec_fsm_slave_init(ec_fsm_slave_t *, ec_slave_t *)
Constructor.
Definition: fsm_slave.c:58
void(* state)(ec_fsm_slave_t *, ec_datagram_t *)
State function.
Definition: fsm_slave.h:58
EtherCAT FoE state machines.
Sercos-over-EtherCAT request.
Definition: soe_request.h:48
Finite state machines for the CANopen-over-EtherCAT protocol.
Definition: fsm_foe.h:53
Finite state machines for the CANopen over EtherCAT protocol.
Definition: fsm_coe.h:52