IgH EtherCAT Master  1.5.3
fsm_sii.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_SII_H__
38 #define __EC_FSM_SII_H__
39 
40 #include "globals.h"
41 #include "datagram.h"
42 #include "slave.h"
43 
44 /*****************************************************************************/
45 
48 typedef enum {
52 
53 /*****************************************************************************/
54 
55 typedef struct ec_fsm_sii ec_fsm_sii_t;
61 struct ec_fsm_sii
62 {
65  unsigned int retries;
67  void (*state)(ec_fsm_sii_t *);
68  uint16_t word_offset;
70  uint8_t value[4];
71  unsigned long jiffies_start;
72  uint8_t check_once_more;
73 };
74 
75 /*****************************************************************************/
76 
79 
81  uint16_t, ec_fsm_sii_addressing_t);
82 void ec_fsm_sii_write(ec_fsm_sii_t *, ec_slave_t *, uint16_t,
83  const uint16_t *, ec_fsm_sii_addressing_t);
84 
87 
88 /*****************************************************************************/
89 
90 #endif
unsigned long jiffies_start
Start timestamp.
Definition: fsm_sii.h:71
Slave information interface FSM.
Definition: fsm_sii.h:61
ec_fsm_sii_addressing_t
SII access addressing mode.
Definition: fsm_sii.h:48
EtherCAT slave structure.
void ec_fsm_sii_clear(ec_fsm_sii_t *)
Destructor.
Definition: fsm_sii.c:88
uint16_t word_offset
input: word offset in SII
Definition: fsm_sii.h:68
EtherCAT datagram.
Definition: datagram.h:87
void ec_fsm_sii_write(ec_fsm_sii_t *, ec_slave_t *, uint16_t, const uint16_t *, ec_fsm_sii_addressing_t)
Initializes the SII write state machine.
Definition: fsm_sii.c:116
Global definitions and macros.
unsigned int retries
retries upon datagram timeout
Definition: fsm_sii.h:65
EtherCAT slave.
Definition: slave.h:176
void(* state)(ec_fsm_sii_t *)
SII state function.
Definition: fsm_sii.h:67
Use configured addresses.
Definition: fsm_sii.h:50
void ec_fsm_sii_read(ec_fsm_sii_t *, ec_slave_t *, uint16_t, ec_fsm_sii_addressing_t)
Initializes the SII read state machine.
Definition: fsm_sii.c:98
int ec_fsm_sii_success(ec_fsm_sii_t *)
Returns, if the master startup state machine terminated with success.
Definition: fsm_sii.c:152
int ec_fsm_sii_exec(ec_fsm_sii_t *)
Executes the SII state machine.
Definition: fsm_sii.c:137
EtherCAT datagram structure.
uint8_t check_once_more
one more try after timeout
Definition: fsm_sii.h:72
void ec_fsm_sii_init(ec_fsm_sii_t *, ec_datagram_t *)
Constructor.
Definition: fsm_sii.c:74
ec_slave_t * slave
slave the FSM runs on
Definition: fsm_sii.h:63
ec_fsm_sii_addressing_t mode
reading via APRD or NPRD
Definition: fsm_sii.h:69
Use auto-increment addressing.
Definition: fsm_sii.h:49
ec_datagram_t * datagram
datagram used in the state machine
Definition: fsm_sii.h:64
uint8_t value[4]
raw SII value (32bit)
Definition: fsm_sii.h:70