IgH EtherCAT Master  1.6.2
fsm_pdo.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_PDO_H__
30 #define __EC_FSM_PDO_H__
31 
32 #include "globals.h"
33 #include "datagram.h"
34 #include "fsm_coe.h"
35 #include "fsm_pdo_entry.h"
36 
37 /****************************************************************************/
38 
42 typedef struct ec_fsm_pdo ec_fsm_pdo_t;
43 
46 struct ec_fsm_pdo
47 {
56  uint8_t sync_index;
59  unsigned int pdo_pos;
60  unsigned int pdo_count;
61 };
62 
63 /****************************************************************************/
64 
67 
70 
72 int ec_fsm_pdo_success(const ec_fsm_pdo_t *);
73 
74 /****************************************************************************/
75 
76 #endif
void(* state)(ec_fsm_pdo_t *, ec_datagram_t *)
State function.
Definition: fsm_pdo.h:48
EtherCAT PDO list.
Definition: pdo_list.h:41
ec_sdo_request_t request
SDO request.
Definition: fsm_pdo.h:52
int ec_fsm_pdo_success(const ec_fsm_pdo_t *)
Get execution result.
Definition: fsm_pdo.c:180
CANopen SDO request.
Definition: sdo_request.h:40
ec_slave_t * slave
Slave the FSM runs on.
Definition: fsm_pdo.h:55
ec_pdo_t * pdo
Current PDO.
Definition: fsm_pdo.h:58
EtherCAT datagram.
Definition: datagram.h:79
ec_fsm_coe_t * fsm_coe
CoE state machine to use.
Definition: fsm_pdo.h:49
Global definitions and macros.
EtherCAT CoE state machines.
EtherCAT slave.
Definition: slave.h:168
EtherCAT PDO entry configuration state machine structures.
void ec_fsm_pdo_init(ec_fsm_pdo_t *, ec_fsm_coe_t *)
Constructor.
Definition: fsm_pdo.c:74
PDO description.
Definition: pdo.h:41
Sync manager.
Definition: sync.h:39
void ec_fsm_pdo_clear(ec_fsm_pdo_t *)
Destructor.
Definition: fsm_pdo.c:90
uint8_t sync_index
Current sync manager index.
Definition: fsm_pdo.h:56
EtherCAT datagram structure.
PDO configuration state machine.
Definition: fsm_pdo.h:46
int ec_fsm_pdo_exec(ec_fsm_pdo_t *, ec_datagram_t *)
Executes the current state of the state machine.
Definition: fsm_pdo.c:164
void ec_fsm_pdo_start_reading(ec_fsm_pdo_t *, ec_slave_t *)
Start reading the PDO configuration.
Definition: fsm_pdo.c:119
ec_sync_t * sync
Current sync manager.
Definition: fsm_pdo.h:57
unsigned int pdo_count
Number of assigned PDOs.
Definition: fsm_pdo.h:60
PDO configuration state machine.
Definition: fsm_pdo_entry.h:44
ec_fsm_pdo_entry_t fsm_pdo_entry
PDO entry state machine.
Definition: fsm_pdo.h:50
ec_pdo_list_t pdos
PDO configuration.
Definition: fsm_pdo.h:51
void ec_fsm_pdo_start_configuration(ec_fsm_pdo_t *, ec_slave_t *)
Start writing the PDO configuration.
Definition: fsm_pdo.c:132
unsigned int pdo_pos
Assignment position of current PDOs.
Definition: fsm_pdo.h:59
ec_pdo_t slave_pdo
PDO actually appearing in a slave.
Definition: fsm_pdo.h:53
Finite state machines for the CANopen over EtherCAT protocol.
Definition: fsm_coe.h:44