IgH EtherCAT Master  1.6.9
fsm_foe.h
Go to the documentation of this file.
1/*****************************************************************************
2 *
3 * Copyright (C) 2008 Olav Zarges, imc Messsysteme GmbH
4 * 2009-2012 Florian Pose <fp@igh.de>
5 *
6 * This file is part of the IgH EtherCAT Master.
7 *
8 * The IgH EtherCAT Master is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License version 2, as
10 * published by the Free Software Foundation.
11 *
12 * The IgH EtherCAT Master is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
15 * Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with the IgH EtherCAT Master; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 *
21 ****************************************************************************/
22
27
28/****************************************************************************/
29
30#ifndef __EC_FSM_FOE_H__
31#define __EC_FSM_FOE_H__
32
33#include "globals.h"
34#include "../include/ecrt.h"
35#include "datagram.h"
36#include "slave.h"
37#include "foe_request.h"
38
39/****************************************************************************/
40
41typedef struct ec_fsm_foe ec_fsm_foe_t;
42
74
75/****************************************************************************/
76
79
82
84
85/****************************************************************************/
86
87#endif
EtherCAT datagram structure.
EtherCAT master application interface.
EtherCAT FoE request structure.
struct ec_fsm_foe ec_fsm_foe_t
Definition fsm_foe.h:41
int ec_fsm_foe_success(const ec_fsm_foe_t *)
Returns, if the state machine terminated with success.
Definition fsm_foe.c:151
void ec_fsm_foe_clear(ec_fsm_foe_t *)
Destructor.
Definition fsm_foe.c:107
int ec_fsm_foe_exec(ec_fsm_foe_t *, ec_datagram_t *)
Executes the current state of the state machine.
Definition fsm_foe.c:117
void ec_fsm_foe_transfer(ec_fsm_foe_t *, ec_slave_t *, ec_foe_request_t *)
Prepares an FoE transfer.
Definition fsm_foe.c:160
void ec_fsm_foe_init(ec_fsm_foe_t *)
Constructor.
Definition fsm_foe.c:95
Global definitions and macros.
struct ec_slave ec_slave_t
Definition globals.h:310
EtherCAT slave structure.
EtherCAT datagram.
Definition datagram.h:79
FoE request.
Definition foe_request.h:42
Finite state machines for the CANopen-over-EtherCAT protocol.
Definition fsm_foe.h:45
ec_foe_request_t * request
FoE request.
Definition fsm_foe.h:54
uint8_t subindex
Current subindex.
Definition fsm_foe.h:53
uint32_t rx_last_packet
Current packet is the last to receive.
Definition fsm_foe.h:70
ec_datagram_t * datagram
Datagram used in previous step.
Definition fsm_foe.h:51
uint8_t * rx_buffer
Buffer for received data.
Definition fsm_foe.h:66
uint32_t tx_buffer_size
Size of data to transmit.
Definition fsm_foe.h:58
unsigned int retries
Retries upon datagram timeout.
Definition fsm_foe.h:47
unsigned long jiffies_start
FoE timestamp.
Definition fsm_foe.h:52
uint32_t rx_expected_packet_no
Expected receive packet number.
Definition fsm_foe.h:69
uint32_t tx_filename_len
Lenth of transmit file name.
Definition fsm_foe.h:64
uint32_t tx_packet_no
FoE packet number.
Definition fsm_foe.h:61
uint32_t rx_buffer_offset
Offset in receive buffer.
Definition fsm_foe.h:68
uint8_t * tx_filename
Name of file to transmit.
Definition fsm_foe.h:63
uint32_t tx_last_packet
Current packet is last one to send.
Definition fsm_foe.h:60
uint32_t rx_filename_len
Length of the receive file name.
Definition fsm_foe.h:72
uint32_t rx_buffer_size
Size of receive buffer.
Definition fsm_foe.h:67
uint8_t toggle
Toggle bit for segment commands.
Definition fsm_foe.h:55
ec_slave_t * slave
Slave the FSM runs on.
Definition fsm_foe.h:46
uint32_t tx_buffer_offset
Offset of data to tranmit next.
Definition fsm_foe.h:59
uint8_t * rx_filename
Name of the file to receive.
Definition fsm_foe.h:71
void(* state)(ec_fsm_foe_t *, ec_datagram_t *)
FoE state function.
Definition fsm_foe.h:49
uint32_t tx_current_size
Size of current packet to send.
Definition fsm_foe.h:62
uint8_t * tx_buffer
Buffer with data to transmit.
Definition fsm_foe.h:57