IgH EtherCAT Master  1.7.0
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
26
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
44
45/****************************************************************************/
46
47typedef struct ec_fsm_sii ec_fsm_sii_t;
48
52
67
68/****************************************************************************/
69
72
74 uint16_t, ec_fsm_sii_addressing_t);
75void ec_fsm_sii_write(ec_fsm_sii_t *, ec_slave_t *, uint16_t,
76 const uint16_t *, ec_fsm_sii_addressing_t);
77
80
81/****************************************************************************/
82
83#endif
EtherCAT datagram structure.
int ec_fsm_sii_success(ec_fsm_sii_t *fsm)
Returns, if the master startup state machine terminated with success.
Definition fsm_sii.c:146
void ec_fsm_sii_clear(ec_fsm_sii_t *fsm)
Destructor.
Definition fsm_sii.c:81
int ec_fsm_sii_exec(ec_fsm_sii_t *fsm)
Executes the SII state machine.
Definition fsm_sii.c:131
void ec_fsm_sii_read(ec_fsm_sii_t *fsm, ec_slave_t *slave, uint16_t word_offset, ec_fsm_sii_addressing_t mode)
Initializes the SII read state machine.
Definition fsm_sii.c:91
void ec_fsm_sii_write(ec_fsm_sii_t *fsm, ec_slave_t *slave, uint16_t word_offset, const uint16_t *value, ec_fsm_sii_addressing_t mode)
Initializes the SII write state machine.
Definition fsm_sii.c:110
void ec_fsm_sii_init(ec_fsm_sii_t *fsm, ec_datagram_t *datagram)
Constructor.
Definition fsm_sii.c:66
struct ec_fsm_sii ec_fsm_sii_t
Definition fsm_sii.h:47
ec_fsm_sii_addressing_t
SII access addressing mode.
Definition fsm_sii.h:40
@ EC_FSM_SII_USE_CONFIGURED_ADDRESS
Use configured addresses.
Definition fsm_sii.h:42
@ EC_FSM_SII_USE_INCREMENT_ADDRESS
Use auto-increment addressing.
Definition fsm_sii.h:41
Global definitions and macros.
struct ec_slave ec_slave_t
Definition globals.h:315
EtherCAT slave structure.
EtherCAT datagram.
Definition datagram.h:81
Slave information interface FSM.
Definition fsm_sii.h:54
ec_datagram_t * datagram
datagram used in the state machine
Definition fsm_sii.h:56
unsigned int retries
retries upon datagram timeout
Definition fsm_sii.h:57
ec_slave_t * slave
slave the FSM runs on
Definition fsm_sii.h:55
uint8_t check_once_more
one more try after timeout
Definition fsm_sii.h:65
void(*) state(ec_fsm_sii_t *)
SII state function.
Definition fsm_sii.h:59
unsigned long jiffies_start
Start timestamp.
Definition fsm_sii.h:64
uint8_t value[8]
raw SII value (32 bit / 64 bit)
Definition fsm_sii.h:62
ec_fsm_sii_addressing_t mode
reading via APRD or NPRD
Definition fsm_sii.h:61
unsigned int read_word_count
Number of words that have been read.
Definition fsm_sii.h:63
uint16_t word_offset
input: word offset in SII
Definition fsm_sii.h:60