IgH EtherCAT Master  1.5.3
fsm_soe.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_SOE_H__
38 #define __EC_FSM_SOE_H__
39 
40 #include "globals.h"
41 #include "datagram.h"
42 #include "slave.h"
43 #include "soe_request.h"
44 
45 /*****************************************************************************/
46 
47 typedef struct ec_fsm_soe ec_fsm_soe_t;
51 struct ec_fsm_soe {
53  unsigned int retries;
57  unsigned long jiffies_start;
59  off_t offset;
60  size_t fragment_size;
61 };
62 
63 /*****************************************************************************/
64 
67 
69 
71 int ec_fsm_soe_success(const ec_fsm_soe_t *);
72 
73 /*****************************************************************************/
74 
75 #endif
Finite state machines for the Sercos over EtherCAT protocol.
Definition: fsm_soe.h:51
size_t fragment_size
Size of the current fragment.
Definition: fsm_soe.h:60
ec_soe_request_t * request
SoE request.
Definition: fsm_soe.h:58
EtherCAT slave structure.
EtherCAT datagram.
Definition: datagram.h:87
void ec_fsm_soe_init(ec_fsm_soe_t *)
Constructor.
Definition: fsm_soe.c:105
Global definitions and macros.
void ec_fsm_soe_clear(ec_fsm_soe_t *)
Destructor.
Definition: fsm_soe.c:118
EtherCAT slave.
Definition: slave.h:176
void ec_fsm_soe_transfer(ec_fsm_soe_t *, ec_slave_t *, ec_soe_request_t *)
Starts to transfer an IDN to/from a slave.
Definition: fsm_soe.c:128
void(* state)(ec_fsm_soe_t *, ec_datagram_t *)
CoE state function.
Definition: fsm_soe.h:55
off_t offset
IDN data offset during fragmented write.
Definition: fsm_soe.h:59
EtherCAT datagram structure.
int ec_fsm_soe_success(const ec_fsm_soe_t *)
Returns, if the state machine terminated with success.
Definition: fsm_soe.c:185
unsigned int retries
retries upon datagram timeout
Definition: fsm_soe.h:53
ec_datagram_t * datagram
Datagram used in the previous step.
Definition: fsm_soe.h:56
unsigned long jiffies_start
Timestamp.
Definition: fsm_soe.h:57
EtherCAT SoE request structure.
ec_slave_t * slave
slave the FSM runs on
Definition: fsm_soe.h:52
int ec_fsm_soe_exec(ec_fsm_soe_t *, ec_datagram_t *)
Executes the current state of the state machine.
Definition: fsm_soe.c:150
Sercos-over-EtherCAT request.
Definition: soe_request.h:48