IgH EtherCAT Master  1.6.2
fsm_sii.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_SII_H__
30 #define __EC_FSM_SII_H__
31 
32 #include "globals.h"
33 #include "datagram.h"
34 #include "slave.h"
35 
36 /****************************************************************************/
37 
40 typedef enum {
44 
45 /****************************************************************************/
46 
47 typedef struct ec_fsm_sii ec_fsm_sii_t;
53 struct ec_fsm_sii
54 {
57  unsigned int retries;
59  void (*state)(ec_fsm_sii_t *);
60  uint16_t word_offset;
62  uint8_t value[4];
63  unsigned long jiffies_start;
64  uint8_t check_once_more;
65 };
66 
67 /****************************************************************************/
68 
71 
73  uint16_t, ec_fsm_sii_addressing_t);
74 void ec_fsm_sii_write(ec_fsm_sii_t *, ec_slave_t *, uint16_t,
75  const uint16_t *, ec_fsm_sii_addressing_t);
76 
79 
80 /****************************************************************************/
81 
82 #endif
unsigned long jiffies_start
Start timestamp.
Definition: fsm_sii.h:63
Slave information interface FSM.
Definition: fsm_sii.h:53
ec_fsm_sii_addressing_t
SII access addressing mode.
Definition: fsm_sii.h:40
EtherCAT slave structure.
void ec_fsm_sii_clear(ec_fsm_sii_t *)
Destructor.
Definition: fsm_sii.c:80
uint16_t word_offset
input: word offset in SII
Definition: fsm_sii.h:60
EtherCAT datagram.
Definition: datagram.h:79
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:108
Global definitions and macros.
unsigned int retries
retries upon datagram timeout
Definition: fsm_sii.h:57
EtherCAT slave.
Definition: slave.h:168
void(* state)(ec_fsm_sii_t *)
SII state function.
Definition: fsm_sii.h:59
Use configured addresses.
Definition: fsm_sii.h:42
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:90
int ec_fsm_sii_success(ec_fsm_sii_t *)
Returns, if the master startup state machine terminated with success.
Definition: fsm_sii.c:144
int ec_fsm_sii_exec(ec_fsm_sii_t *)
Executes the SII state machine.
Definition: fsm_sii.c:129
EtherCAT datagram structure.
uint8_t check_once_more
one more try after timeout
Definition: fsm_sii.h:64
void ec_fsm_sii_init(ec_fsm_sii_t *, ec_datagram_t *)
Constructor.
Definition: fsm_sii.c:66
ec_slave_t * slave
slave the FSM runs on
Definition: fsm_sii.h:55
ec_fsm_sii_addressing_t mode
reading via APRD or NPRD
Definition: fsm_sii.h:61
Use auto-increment addressing.
Definition: fsm_sii.h:41
ec_datagram_t * datagram
datagram used in the state machine
Definition: fsm_sii.h:56
uint8_t value[4]
raw SII value (32bit)
Definition: fsm_sii.h:62