IgH EtherCAT Master  1.6.2
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_PDO_H__
30 #define __EC_PDO_H__
31 
32 #include <linux/list.h>
33 
34 #include "globals.h"
35 #include "pdo_entry.h"
36 
37 /****************************************************************************/
38 
41 typedef struct {
42  struct list_head list;
43  uint16_t index;
44  int8_t sync_index;
45  char *name;
46  struct list_head entries;
47 } ec_pdo_t;
48 
49 /****************************************************************************/
50 
51 void ec_pdo_init(ec_pdo_t *);
52 int ec_pdo_init_copy(ec_pdo_t *, const ec_pdo_t *);
53 void ec_pdo_clear(ec_pdo_t *);
55 int ec_pdo_set_name(ec_pdo_t *, const char *);
56 ec_pdo_entry_t *ec_pdo_add_entry(ec_pdo_t *, uint16_t, uint8_t, uint8_t);
57 int ec_pdo_copy_entries(ec_pdo_t *, const ec_pdo_t *);
58 int ec_pdo_equal_entries(const ec_pdo_t *, const ec_pdo_t *);
59 unsigned int ec_pdo_entry_count(const ec_pdo_t *);
61  const ec_pdo_t *, unsigned int);
62 
63 void ec_pdo_print_entries(const ec_pdo_t *);
64 
65 /****************************************************************************/
66 
67 #endif
void ec_pdo_init(ec_pdo_t *)
PDO constructor.
Definition: pdo.c:38
int ec_pdo_set_name(ec_pdo_t *, const char *)
Set PDO name.
Definition: pdo.c:117
int ec_pdo_copy_entries(ec_pdo_t *, const ec_pdo_t *)
Copy PDO entries from another PDO.
Definition: pdo.c:178
Global definitions and macros.
PDO entry description.
Definition: pdo_entry.h:40
uint16_t index
PDO index.
Definition: pdo.h:43
int8_t sync_index
Assigned sync manager.
Definition: pdo.h:44
void ec_pdo_clear_entries(ec_pdo_t *)
Clear PDO entry list.
Definition: pdo.c:98
PDO description.
Definition: pdo.h:41
void ec_pdo_clear(ec_pdo_t *)
PDO destructor.
Definition: pdo.c:86
unsigned int ec_pdo_entry_count(const ec_pdo_t *)
Get the number of PDO entries.
Definition: pdo.c:249
EtherCAT Process data object structure.
int ec_pdo_equal_entries(const ec_pdo_t *, const ec_pdo_t *)
Compares the entries of two PDOs.
Definition: pdo.c:214
void ec_pdo_print_entries(const ec_pdo_t *)
Outputs the PDOs in the list.
Definition: pdo.c:291
char * name
PDO name.
Definition: pdo.h:45
int ec_pdo_init_copy(ec_pdo_t *, const ec_pdo_t *)
PDO copy constructor.
Definition: pdo.c:54
ec_pdo_entry_t * ec_pdo_add_entry(ec_pdo_t *, uint16_t, uint8_t, uint8_t)
Add a new PDO entry to the configuration.
Definition: pdo.c:149
const ec_pdo_entry_t * ec_pdo_find_entry_by_pos_const(const ec_pdo_t *, unsigned int)
Finds a PDO entry via its position in the list.
Definition: pdo.c:271