IgH EtherCAT Master  1.7.0
fsm_soe.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_SOE_H__
30 #define __EC_FSM_SOE_H__
31 
32 #include "globals.h"
33 #include "datagram.h"
34 #include "slave.h"
35 #include "fsm_mbox.h"
36 #include "soe_request.h"
37 
38 /****************************************************************************/
39 
40 typedef struct ec_fsm_soe ec_fsm_soe_t;
44 struct ec_fsm_soe {
46  unsigned int retries;
50  unsigned long jiffies_start;
53  off_t offset;
54  size_t fragment_size;
55 };
56 
57 /****************************************************************************/
58 
61 
63 
65 int ec_fsm_soe_success(const ec_fsm_soe_t *);
67 
68 /****************************************************************************/
69 
70 #endif
Finite state machines for the Sercos over EtherCAT protocol.
Definition: fsm_soe.h:44
size_t fragment_size
Size of the current fragment.
Definition: fsm_soe.h:54
EtherCAT mailbox receive state machine.
Definition: fsm_mbox.h:62
ec_soe_request_t * request
SoE request.
Definition: fsm_soe.h:52
EtherCAT slave structure.
EtherCAT datagram.
Definition: datagram.h:81
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:119
EtherCAT slave.
Definition: slave.h:170
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:130
EtherCAT mailbox receive state machine.
void(* state)(ec_fsm_soe_t *, ec_datagram_t *)
CoE state function.
Definition: fsm_soe.h:48
off_t offset
IDN data offset during fragmented write.
Definition: fsm_soe.h:53
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:187
unsigned int retries
retries upon datagram timeout
Definition: fsm_soe.h:46
void ec_fsm_soe_abort(ec_fsm_soe_t *)
Aborts a running transfer.
Definition: fsm_soe.c:199
ec_datagram_t * datagram
Datagram used in the previous step.
Definition: fsm_soe.h:49
ec_fsm_mbox_t fsm_mbox
Mailbox receive state machine.
Definition: fsm_soe.h:51
unsigned long jiffies_start
Timestamp.
Definition: fsm_soe.h:50
EtherCAT SoE request structure.
ec_slave_t * slave
slave the FSM runs on
Definition: fsm_soe.h:45
int ec_fsm_soe_exec(ec_fsm_soe_t *, ec_datagram_t *)
Executes the current state of the state machine.
Definition: fsm_soe.c:152
Sercos-over-EtherCAT request.
Definition: soe_request.h:40