author | Florian Pose <fp@igh-essen.com> |
Fri, 10 Oct 2008 07:58:48 +0000 | |
changeset 1257 | 9844ac126275 |
parent 1255 | 38b7e05b20c1 |
child 1259 | 5f9d1abbee71 |
permissions | -rw-r--r-- |
1255
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
1 |
/****************************************************************************** |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
2 |
* |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
3 |
* $Id$ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
4 |
* |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
5 |
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
6 |
* |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
7 |
* This file is part of the IgH EtherCAT Master. |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
8 |
* |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
9 |
* The IgH EtherCAT Master is free software; you can redistribute it |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
10 |
* and/or modify it under the terms of the GNU General Public License |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
11 |
* as published by the Free Software Foundation; either version 2 of the |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
12 |
* License, or (at your option) any later version. |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
13 |
* |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
14 |
* The IgH EtherCAT Master is distributed in the hope that it will be |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
15 |
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
17 |
* GNU General Public License for more details. |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
18 |
* |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
19 |
* You should have received a copy of the GNU General Public License |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
20 |
* along with the IgH EtherCAT Master; if not, write to the Free Software |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
21 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
22 |
* |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
23 |
* The right to use EtherCAT Technology is granted and comes free of |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
24 |
* charge under condition of compatibility of product made by |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
25 |
* Licensee. People intending to distribute/sell products based on the |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
26 |
* code, have to sign an agreement to guarantee that products using |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
27 |
* software based on IgH EtherCAT master stay compatible with the actual |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
28 |
* EtherCAT specification (which are released themselves as an open |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
29 |
* standard) as the (only) precondition to have the right to use EtherCAT |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
30 |
* Technology, IP and trade marks. |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
31 |
* |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
32 |
*****************************************************************************/ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
33 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
34 |
#include <stdlib.h> |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
35 |
#include <sys/ioctl.h> |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
36 |
#include <stdio.h> |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
37 |
#include <errno.h> |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
38 |
#include <string.h> |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
39 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
40 |
#include "slave_config.h" |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
41 |
#include "domain.h" |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
42 |
#include "master.h" |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
43 |
#include "master/ioctl.h" |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
44 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
45 |
/*****************************************************************************/ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
46 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
47 |
int ecrt_slave_config_sync_manager(ec_slave_config_t *sc, uint8_t sync_index, |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
48 |
ec_direction_t dir) |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
49 |
{ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
50 |
ec_ioctl_config_t data; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
51 |
unsigned int i; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
52 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
53 |
if (sync_index >= EC_MAX_SYNC_MANAGERS) |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
54 |
return -1; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
55 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
56 |
memset(&data, 0x00, sizeof(ec_ioctl_config_t)); |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
57 |
data.config_index = sc->index; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
58 |
data.syncs[sync_index].dir = dir; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
59 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
60 |
if (ioctl(sc->master->fd, EC_IOCTL_SC_SYNC, &data) == -1) { |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
61 |
fprintf(stderr, "Failed to config sync manager: %s\n", |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
62 |
strerror(errno)); |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
63 |
return -1; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
64 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
65 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
66 |
return 0; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
67 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
68 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
69 |
/*****************************************************************************/ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
70 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
71 |
int ecrt_slave_config_pdo_assign_add(ec_slave_config_t *sc, |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
72 |
uint8_t sync_index, uint16_t pdo_index) |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
73 |
{ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
74 |
ec_ioctl_config_pdo_t data; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
75 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
76 |
data.config_index = sc->index; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
77 |
data.sync_index = sync_index; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
78 |
data.index = pdo_index; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
79 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
80 |
if (ioctl(sc->master->fd, EC_IOCTL_SC_ADD_PDO, &data) == -1) { |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
81 |
fprintf(stderr, "Failed to add Pdo: %s\n", |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
82 |
strerror(errno)); |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
83 |
return -1; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
84 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
85 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
86 |
return 0; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
87 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
88 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
89 |
/*****************************************************************************/ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
90 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
91 |
void ecrt_slave_config_pdo_assign_clear(ec_slave_config_t *sc, |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
92 |
uint8_t sync_index) |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
93 |
{ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
94 |
ec_ioctl_config_pdo_t data; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
95 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
96 |
data.config_index = sc->index; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
97 |
data.sync_index = sync_index; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
98 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
99 |
if (ioctl(sc->master->fd, EC_IOCTL_SC_CLEAR_PDOS, &data) == -1) { |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
100 |
fprintf(stderr, "Failed to clear Pdos: %s\n", |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
101 |
strerror(errno)); |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
102 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
103 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
104 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
105 |
/*****************************************************************************/ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
106 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
107 |
int ecrt_slave_config_pdo_mapping_add(ec_slave_config_t *sc, |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
108 |
uint16_t pdo_index, uint16_t entry_index, uint8_t entry_subindex, |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
109 |
uint8_t entry_bit_length) |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
110 |
{ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
111 |
ec_ioctl_add_pdo_entry_t data; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
112 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
113 |
data.config_index = sc->index; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
114 |
data.pdo_index = pdo_index; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
115 |
data.entry_index = entry_index; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
116 |
data.entry_subindex = entry_subindex; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
117 |
data.entry_bit_length = entry_bit_length; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
118 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
119 |
if (ioctl(sc->master->fd, EC_IOCTL_SC_ADD_ENTRY, &data) == -1) { |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
120 |
fprintf(stderr, "Failed to add Pdo entry: %s\n", |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
121 |
strerror(errno)); |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
122 |
return -1; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
123 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
124 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
125 |
return 0; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
126 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
127 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
128 |
/*****************************************************************************/ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
129 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
130 |
void ecrt_slave_config_pdo_mapping_clear(ec_slave_config_t *sc, |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
131 |
uint16_t pdo_index) |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
132 |
{ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
133 |
ec_ioctl_config_pdo_t data; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
134 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
135 |
data.config_index = sc->index; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
136 |
data.index = pdo_index; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
137 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
138 |
if (ioctl(sc->master->fd, EC_IOCTL_SC_CLEAR_ENTRIES, &data) == -1) { |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
139 |
fprintf(stderr, "Failed to clear Pdo entries: %s\n", |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
140 |
strerror(errno)); |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
141 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
142 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
143 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
144 |
/*****************************************************************************/ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
145 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
146 |
int ecrt_slave_config_pdos(ec_slave_config_t *sc, |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
147 |
unsigned int n_syncs, const ec_sync_info_t syncs[]) |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
148 |
{ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
149 |
unsigned int i, j, k; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
150 |
const ec_sync_info_t *sync_info; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
151 |
const ec_pdo_info_t *pdo_info; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
152 |
const ec_pdo_entry_info_t *entry_info; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
153 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
154 |
if (!syncs) |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
155 |
return 0; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
156 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
157 |
for (i = 0; i < n_syncs; i++) { |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
158 |
sync_info = &syncs[i]; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
159 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
160 |
if (sync_info->index == (uint8_t) EC_END) |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
161 |
break; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
162 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
163 |
if (sync_info->index >= EC_MAX_SYNC_MANAGERS) { |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
164 |
fprintf(stderr, "Invalid sync manager index %u!\n", |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
165 |
sync_info->index); |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
166 |
return -1; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
167 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
168 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
169 |
if (ecrt_slave_config_sync_manager( |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
170 |
sc, sync_info->index, sync_info->dir)) |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
171 |
return -1; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
172 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
173 |
if (sync_info->n_pdos && sync_info->pdos) { |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
174 |
ecrt_slave_config_pdo_assign_clear(sc, sync_info->index); |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
175 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
176 |
for (j = 0; j < sync_info->n_pdos; j++) { |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
177 |
pdo_info = &sync_info->pdos[j]; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
178 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
179 |
if (ecrt_slave_config_pdo_assign_add( |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
180 |
sc, sync_info->index, pdo_info->index)) |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
181 |
return -1; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
182 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
183 |
if (pdo_info->n_entries && pdo_info->entries) { |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
184 |
ecrt_slave_config_pdo_mapping_clear(sc, pdo_info->index); |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
185 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
186 |
for (k = 0; k < pdo_info->n_entries; k++) { |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
187 |
entry_info = &pdo_info->entries[k]; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
188 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
189 |
if (ecrt_slave_config_pdo_mapping_add(sc, |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
190 |
pdo_info->index, entry_info->index, |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
191 |
entry_info->subindex, |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
192 |
entry_info->bit_length)) |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
193 |
return -1; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
194 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
195 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
196 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
197 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
198 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
199 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
200 |
return 0; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
201 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
202 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
203 |
/*****************************************************************************/ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
204 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
205 |
int ecrt_slave_config_reg_pdo_entry( |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
206 |
ec_slave_config_t *sc, |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
207 |
uint16_t index, |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
208 |
uint8_t subindex, |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
209 |
ec_domain_t *domain, |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
210 |
unsigned int *bit_position |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
211 |
) |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
212 |
{ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
213 |
ec_ioctl_reg_pdo_entry_t data; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
214 |
int ret; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
215 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
216 |
data.config_index = sc->index; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
217 |
data.entry_index = index; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
218 |
data.entry_subindex = subindex; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
219 |
data.domain_index = domain->index; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
220 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
221 |
ret = ioctl(sc->master->fd, EC_IOCTL_SC_REG_PDO_ENTRY, &data); |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
222 |
if (ret == -1) { |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
223 |
fprintf(stderr, "Failed to register Pdo entry: %s\n", |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
224 |
strerror(errno)); |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
225 |
return -2; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
226 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
227 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
228 |
if (bit_position) { |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
229 |
*bit_position = data.bit_position; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
230 |
} else { |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
231 |
if (data.bit_position) { |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
232 |
fprintf(stderr, "Pdo entry 0x%04X:%02X does not byte-align " |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
233 |
"in config %u:%u.\n", index, subindex, |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
234 |
sc->alias, sc->position); |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
235 |
return -3; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
236 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
237 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
238 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
239 |
return ret; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
240 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
241 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
242 |
/*****************************************************************************/ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
243 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
244 |
int ecrt_slave_config_sdo(ec_slave_config_t *sc, uint16_t index, |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
245 |
uint8_t subindex, const uint8_t *sdo_data, size_t size) |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
246 |
{ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
247 |
ec_ioctl_sc_sdo_t data; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
248 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
249 |
data.config_index = sc->index; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
250 |
data.index = index; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
251 |
data.subindex = subindex; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
252 |
data.data = sdo_data; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
253 |
data.size = size; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
254 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
255 |
if (ioctl(sc->master->fd, EC_IOCTL_SC_REG_PDO_ENTRY, &data) == -1) { |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
256 |
fprintf(stderr, "Failed to configure Sdo.\n"); |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
257 |
return -1; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
258 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
259 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
260 |
return 0; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
261 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
262 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
263 |
/*****************************************************************************/ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
264 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
265 |
int ecrt_slave_config_sdo8(ec_slave_config_t *sc, uint16_t index, |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
266 |
uint8_t subindex, uint8_t value) |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
267 |
{ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
268 |
uint8_t data[1]; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
269 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
270 |
EC_WRITE_U8(data, value); |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
271 |
return ecrt_slave_config_sdo(sc, index, subindex, data, 1); |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
272 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
273 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
274 |
/*****************************************************************************/ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
275 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
276 |
int ecrt_slave_config_sdo16(ec_slave_config_t *sc, uint16_t index, |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
277 |
uint8_t subindex, uint16_t value) |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
278 |
{ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
279 |
uint8_t data[2]; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
280 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
281 |
EC_WRITE_U16(data, value); |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
282 |
return ecrt_slave_config_sdo(sc, index, subindex, data, 2); |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
283 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
284 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
285 |
/*****************************************************************************/ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
286 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
287 |
int ecrt_slave_config_sdo32(ec_slave_config_t *sc, uint16_t index, |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
288 |
uint8_t subindex, uint32_t value) |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
289 |
{ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
290 |
uint8_t data[4]; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
291 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
292 |
EC_WRITE_U32(data, value); |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
293 |
return ecrt_slave_config_sdo(sc, index, subindex, data, 4); |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
294 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
295 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
296 |
/*****************************************************************************/ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
297 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
298 |
ec_sdo_request_t *ecrt_slave_config_create_sdo_request(ec_slave_config_t *sc, |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
299 |
uint16_t index, uint8_t subindex, size_t size) |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
300 |
{ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
301 |
return 0; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
302 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
303 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
304 |
/*****************************************************************************/ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
305 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
306 |
ec_voe_handler_t *ecrt_slave_config_create_voe_handler(ec_slave_config_t *sc, |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
307 |
size_t size) |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
308 |
{ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
309 |
return 0; |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
310 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
311 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
312 |
/*****************************************************************************/ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
313 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
314 |
void ecrt_slave_config_state(const ec_slave_config_t *sc, |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
315 |
ec_slave_config_state_t *state) |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
316 |
{ |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
317 |
} |
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
318 |
|
38b7e05b20c1
Added some slave configuration methods.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
319 |
/*****************************************************************************/ |