IgH EtherCAT Master  1.5.3
pdo.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_PDO_H__
38 #define __EC_PDO_H__
39 
40 #include <linux/list.h>
41 
42 #include "globals.h"
43 #include "pdo_entry.h"
44 
45 /*****************************************************************************/
46 
49 typedef struct {
50  struct list_head list;
51  uint16_t index;
52  int8_t sync_index;
53  char *name;
54  struct list_head entries;
55 } ec_pdo_t;
56 
57 /*****************************************************************************/
58 
59 void ec_pdo_init(ec_pdo_t *);
60 int ec_pdo_init_copy(ec_pdo_t *, const ec_pdo_t *);
61 void ec_pdo_clear(ec_pdo_t *);
63 int ec_pdo_set_name(ec_pdo_t *, const char *);
64 ec_pdo_entry_t *ec_pdo_add_entry(ec_pdo_t *, uint16_t, uint8_t, uint8_t);
65 int ec_pdo_copy_entries(ec_pdo_t *, const ec_pdo_t *);
66 int ec_pdo_equal_entries(const ec_pdo_t *, const ec_pdo_t *);
67 unsigned int ec_pdo_entry_count(const ec_pdo_t *);
69  const ec_pdo_t *, unsigned int);
70 
71 void ec_pdo_print_entries(const ec_pdo_t *);
72 
73 /*****************************************************************************/
74 
75 #endif
void ec_pdo_init(ec_pdo_t *)
PDO constructor.
Definition: pdo.c:46
int ec_pdo_set_name(ec_pdo_t *, const char *)
Set PDO name.
Definition: pdo.c:125
int ec_pdo_copy_entries(ec_pdo_t *, const ec_pdo_t *)
Copy PDO entries from another PDO.
Definition: pdo.c:186
Global definitions and macros.
PDO entry description.
Definition: pdo_entry.h:48
uint16_t index
PDO index.
Definition: pdo.h:51
int8_t sync_index
Assigned sync manager.
Definition: pdo.h:52
void ec_pdo_clear_entries(ec_pdo_t *)
Clear PDO entry list.
Definition: pdo.c:106
PDO description.
Definition: pdo.h:49
void ec_pdo_clear(ec_pdo_t *)
PDO destructor.
Definition: pdo.c:94
unsigned int ec_pdo_entry_count(const ec_pdo_t *)
Get the number of PDO entries.
Definition: pdo.c:257
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:222
void ec_pdo_print_entries(const ec_pdo_t *)
Outputs the PDOs in the list.
Definition: pdo.c:299
char * name
PDO name.
Definition: pdo.h:53
int ec_pdo_init_copy(ec_pdo_t *, const ec_pdo_t *)
PDO copy constructor.
Definition: pdo.c:62
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:157
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:279