author | Florian Pose <fp@igh-essen.com> |
Tue, 27 Jan 2009 14:14:37 +0000 | |
changeset 1347 | 41360ffdcb14 |
parent 1341 | 32ba7ffb6c7f |
child 1352 | 275d2fdeab48 |
permissions | -rw-r--r-- |
104
052bc82d5442
MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
1 |
/****************************************************************************** |
052bc82d5442
MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
2 |
* |
1341
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
3 |
* $Id$ |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
4 |
* |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
5 |
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
6 |
* |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
7 |
* This file is part of the IgH EtherCAT master userspace library. |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
8 |
* |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
9 |
* The IgH EtherCAT master userspace library is free software; you can |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
10 |
* redistribute it and/or modify it under the terms of the GNU Lesser General |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
11 |
* Public License as published by the Free Software Foundation; version 2.1 |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
12 |
* of the License. |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
13 |
* |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
14 |
* The IgH EtherCAT master userspace library is distributed in the hope that |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
15 |
* it will be useful, but WITHOUT ANY WARRANTY; without even the implied |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
16 |
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
17 |
* GNU Lesser General Public License for more details. |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
18 |
* |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
19 |
* You should have received a copy of the GNU Lesser General Public License |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
20 |
* along with the IgH EtherCAT master userspace library. If not, see |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
21 |
* <http://www.gnu.org/licenses/>. |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
22 |
* |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
23 |
* Using the EtherCAT technology and brand is permitted in compliance with |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
24 |
* the industrial property and similar rights of Beckhoff Automation GmbH. |
246
0bf7c769de06
Changed license headers and added EtherCAT license notice.
Florian Pose <fp@igh-essen.com>
parents:
206
diff
changeset
|
25 |
* |
104
052bc82d5442
MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
26 |
*****************************************************************************/ |
052bc82d5442
MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
27 |
|
786 | 28 |
/** \file |
29 |
* |
|
1182 | 30 |
* EtherCAT master application interface. |
31 |
* |
|
32 |
* \defgroup ApplicationInterface EtherCAT Application Interface |
|
786 | 33 |
* |
879
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
34 |
* EtherCAT interface for realtime applications. This interface is designed |
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
35 |
* for realtime modules that want to use EtherCAT. There are functions to |
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
36 |
* request a master, to map process data, to communicate with slaves via CoE |
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
37 |
* and to configure and activate the bus. |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
38 |
* |
1239
b50b93faaf3e
Used ERR_PTR() macro for return value of ecrt_request_master().
Florian Pose <fp@igh-essen.com>
parents:
1226
diff
changeset
|
39 |
* Changes in version 1.5: |
b50b93faaf3e
Used ERR_PTR() macro for return value of ecrt_request_master().
Florian Pose <fp@igh-essen.com>
parents:
1226
diff
changeset
|
40 |
* |
1313
ed15eef57d5c
Improved error case return codes of many functions.
Florian Pose <fp@igh-essen.com>
parents:
1312
diff
changeset
|
41 |
* - Changed the meaning of the negative return values of |
ed15eef57d5c
Improved error case return codes of many functions.
Florian Pose <fp@igh-essen.com>
parents:
1312
diff
changeset
|
42 |
* ecrt_slave_config_reg_pdo_entry() and ecrt_slave_config_sdo*(). |
1341
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
43 |
* - Imlemented the Vendor-specific over EtherCAT mailbox protocol. See |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
44 |
* ecrt_slave_config_create_voe_handler(). |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
45 |
* - Renamed ec_sdo_request_state_t to ec_request_state_t, because it is also |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
46 |
* used by VoE handlers. |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
47 |
* - Added ecrt_master_slave() to get information about a certain slave. |
1239
b50b93faaf3e
Used ERR_PTR() macro for return value of ecrt_request_master().
Florian Pose <fp@igh-essen.com>
parents:
1226
diff
changeset
|
48 |
* |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
49 |
* Changes in Version 1.4: |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
50 |
* |
1083
1322dc34cb37
Updated header docs, features and news file.
Florian Pose <fp@igh-essen.com>
parents:
1082
diff
changeset
|
51 |
* - Replaced ec_slave_t with ec_slave_config_t, separating the bus |
1322dc34cb37
Updated header docs, features and news file.
Florian Pose <fp@igh-essen.com>
parents:
1082
diff
changeset
|
52 |
* configuration from the actual slaves. Therefore, renamed |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
53 |
* ecrt_master_get_slave() to ecrt_master_slave_config(). |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
54 |
* - Replaced slave address string with alias and position values. See |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
55 |
* ecrt_master_slave_config(). |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
56 |
* - Removed ecrt_master_get_slave_by_pos(), because it is no longer |
807
f8bca95ab75d
Moved ecrt_domain_reg_pdo_entry() to
Florian Pose <fp@igh-essen.com>
parents:
793
diff
changeset
|
57 |
* necessary due to alias/position addressing. |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
58 |
* - Added ec_slave_config_state_t for the new method |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
59 |
* ecrt_slave_config_state(). |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
60 |
* - Process data memory for a domain can now be allocated externally. This |
842
40e27e5a8dce
Added ecrt_slave_config_pdo() and ecrt_slave_config_pdo_entry().
Florian Pose <fp@igh-essen.com>
parents:
832
diff
changeset
|
61 |
* offers the possibility to use a shared-memory region. Therefore, |
809 | 62 |
* added the domain methods ecrt_domain_size() and |
63 |
* ecrt_domain_external_memory(). |
|
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
64 |
* - PDO entry registration functions do not return a process data pointer, |
925
939f3e9bba1e
Some improvements concerning bit_position.
Florian Pose <fp@igh-essen.com>
parents:
923
diff
changeset
|
65 |
* but an offset in the domain's process data. In addition, an optional bit |
939f3e9bba1e
Some improvements concerning bit_position.
Florian Pose <fp@igh-essen.com>
parents:
923
diff
changeset
|
66 |
* position can be requested. This was necessary for the external domain |
939f3e9bba1e
Some improvements concerning bit_position.
Florian Pose <fp@igh-essen.com>
parents:
923
diff
changeset
|
67 |
* memory. An additional advantage is, that the returned offset is |
939f3e9bba1e
Some improvements concerning bit_position.
Florian Pose <fp@igh-essen.com>
parents:
923
diff
changeset
|
68 |
* immediately valid. If the domain's process data is allocated internally, |
939f3e9bba1e
Some improvements concerning bit_position.
Florian Pose <fp@igh-essen.com>
parents:
923
diff
changeset
|
69 |
* the start address can be retrieved with ecrt_domain_data(). |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
70 |
* - Replaced ecrt_slave_pdo_mapping/add/clear() with |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
71 |
* ecrt_slave_config_pdo_assign_add() to add a PDO to a sync manager's PDO |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
72 |
* assignment and ecrt_slave_config_pdo_mapping_add() to add a PDO entry to a |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
73 |
* PDO's mapping. ecrt_slave_config_pdos() is a convenience function |
879
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
74 |
* for both, that uses the new data types ec_pdo_info_t and |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
75 |
* ec_pdo_entry_info_t. PDO entries, that are mapped with these functions |
879
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
76 |
* can now immediately be registered, even if the bus is offline. |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
77 |
* - Renamed ec_bus_status_t, ec_master_status_t to ec_bus_state_t and |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
78 |
* ec_master_state_t, respectively. Renamed ecrt_master_get_status() to |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
79 |
* ecrt_master_state(), for consistency reasons. |
1083
1322dc34cb37
Updated header docs, features and news file.
Florian Pose <fp@igh-essen.com>
parents:
1082
diff
changeset
|
80 |
* - Added ec_domain_state_t and #ec_wc_state_t for a new output parameter |
832 | 81 |
* of ecrt_domain_state(). The domain state object does now contain |
82 |
* information, if the process data was exchanged completely. |
|
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
83 |
* - Former "PDO registration" meant PDO entry registration in fact, therefore |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
84 |
* renamed ec_pdo_reg_t to ec_pdo_entry_reg_t and ecrt_domain_register_pdo() |
807
f8bca95ab75d
Moved ecrt_domain_reg_pdo_entry() to
Florian Pose <fp@igh-essen.com>
parents:
793
diff
changeset
|
85 |
* to ecrt_slave_config_reg_pdo_entry(). |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
86 |
* - Removed ecrt_domain_register_pdo_range(), because it's functionality can |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
87 |
* be reached by specifying an explicit PDO assignment/mapping and |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
88 |
* registering the mapped PDO entries. |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
89 |
* - Added an SDO access interface, working with SDO requests. These can be |
864 | 90 |
* scheduled for reading and writing during realtime operation. |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
91 |
* - Exported ecrt_slave_config_sdo(), the generic SDO configuration function. |
900
f8b5c6d21705
Removed bus validation; slave configuration during realtime operation;
Florian Pose <fp@igh-essen.com>
parents:
894
diff
changeset
|
92 |
* - Removed the bus_state and bus_tainted flags from ec_master_state_t. |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
93 |
* |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
94 |
* @{ |
786 | 95 |
*/ |
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
96 |
|
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
97 |
/*****************************************************************************/ |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
98 |
|
125 | 99 |
#ifndef __ECRT_H__ |
100 |
#define __ECRT_H__ |
|
104
052bc82d5442
MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
101 |
|
1254
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
102 |
#ifdef __KERNEL__ |
104
052bc82d5442
MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
103 |
#include <asm/byteorder.h> |
110 | 104 |
#include <linux/types.h> |
105 |
#else |
|
1254
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
106 |
#include <stdlib.h> // for size_t |
110 | 107 |
#include <stdint.h> |
108 |
#endif |
|
109 |
||
779 | 110 |
/****************************************************************************** |
111 |
* Global definitions |
|
112 |
*****************************************************************************/ |
|
113 |
||
864 | 114 |
/** EtherCAT realtime interface major version number. |
758
8fa6f825eb7d
Updated Doxygen documentation.
Florian Pose <fp@igh-essen.com>
parents:
707
diff
changeset
|
115 |
*/ |
637
d5d04c868e0e
Removed ecrt_master_run(), removed datagram queueing from state
Florian Pose <fp@igh-essen.com>
parents:
635
diff
changeset
|
116 |
#define ECRT_VER_MAJOR 1 |
758
8fa6f825eb7d
Updated Doxygen documentation.
Florian Pose <fp@igh-essen.com>
parents:
707
diff
changeset
|
117 |
|
864 | 118 |
/** EtherCAT realtime interface minor version number. |
779 | 119 |
*/ |
1209 | 120 |
#define ECRT_VER_MINOR 5 |
779 | 121 |
|
864 | 122 |
/** EtherCAT realtime interface version word generator. |
779 | 123 |
*/ |
124 |
#define ECRT_VERSION(a, b) (((a) << 8) + (b)) |
|
125 |
||
864 | 126 |
/** EtherCAT realtime interface version word. |
758
8fa6f825eb7d
Updated Doxygen documentation.
Florian Pose <fp@igh-essen.com>
parents:
707
diff
changeset
|
127 |
*/ |
541
5a2b1658b67f
Introduced ECRT version magic.
Florian Pose <fp@igh-essen.com>
parents:
495
diff
changeset
|
128 |
#define ECRT_VERSION_MAGIC ECRT_VERSION(ECRT_VER_MAJOR, ECRT_VER_MINOR) |
5a2b1658b67f
Introduced ECRT version magic.
Florian Pose <fp@igh-essen.com>
parents:
495
diff
changeset
|
129 |
|
878 | 130 |
/*****************************************************************************/ |
131 |
||
1082
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
132 |
/** End of list marker. |
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
133 |
* |
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
134 |
* This can be used with ecrt_slave_config_pdos(). |
879
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
135 |
*/ |
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
136 |
#define EC_END ~0U |
878 | 137 |
|
1082
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
138 |
/** Maximum number of sync managers per slave. |
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
139 |
*/ |
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
140 |
#define EC_MAX_SYNC_MANAGERS 16 |
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
141 |
|
1341
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
142 |
/** Maximum string length. |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
143 |
* |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
144 |
* Used in ec_slave_info_t. |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
145 |
*/ |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
146 |
#define EC_MAX_STRING_LENGTH 64 |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
147 |
|
779 | 148 |
/****************************************************************************** |
149 |
* Data types |
|
150 |
*****************************************************************************/ |
|
541
5a2b1658b67f
Introduced ECRT version magic.
Florian Pose <fp@igh-essen.com>
parents:
495
diff
changeset
|
151 |
|
104
052bc82d5442
MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
152 |
struct ec_master; |
286
f3352378b4d4
Added missing documentation.
Florian Pose <fp@igh-essen.com>
parents:
276
diff
changeset
|
153 |
typedef struct ec_master ec_master_t; /**< \see ec_master */ |
104
052bc82d5442
MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
154 |
|
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
155 |
struct ec_slave_config; |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
156 |
typedef struct ec_slave_config ec_slave_config_t; /**< \see ec_slave_config */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
157 |
|
104
052bc82d5442
MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
158 |
struct ec_domain; |
286
f3352378b4d4
Added missing documentation.
Florian Pose <fp@igh-essen.com>
parents:
276
diff
changeset
|
159 |
typedef struct ec_domain ec_domain_t; /**< \see ec_domain */ |
104
052bc82d5442
MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
160 |
|
858
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
161 |
struct ec_sdo_request; |
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
162 |
typedef struct ec_sdo_request ec_sdo_request_t; /**< \see ec_sdo_request. */ |
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
163 |
|
1209 | 164 |
struct ec_voe_handler; |
165 |
typedef struct ec_voe_handler ec_voe_handler_t; /**< \see ec_voe_handler. */ |
|
166 |
||
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
167 |
/*****************************************************************************/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
168 |
|
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
169 |
/** Master state. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
170 |
* |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
171 |
* This is used for the output parameter of ecrt_master_state(). |
1020
9bf2ddf05e17
Completed ec_master_state_t and documented ec_master_state_t and
Florian Pose <fp@igh-essen.com>
parents:
1010
diff
changeset
|
172 |
* |
9bf2ddf05e17
Completed ec_master_state_t and documented ec_master_state_t and
Florian Pose <fp@igh-essen.com>
parents:
1010
diff
changeset
|
173 |
* \see ecrt_master_state(). |
612
aede068f9a74
Introduced master status, ecrt_master_get_status(), tainted flag,
Florian Pose <fp@igh-essen.com>
parents:
541
diff
changeset
|
174 |
*/ |
aede068f9a74
Introduced master status, ecrt_master_get_status(), tainted flag,
Florian Pose <fp@igh-essen.com>
parents:
541
diff
changeset
|
175 |
typedef struct { |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
176 |
unsigned int slaves_responding; /**< Number of slaves in the bus. */ |
1022
8e49b519e6ba
Implemented ecrt_slave_config_state(); minor changes in
Florian Pose <fp@igh-essen.com>
parents:
1020
diff
changeset
|
177 |
unsigned int al_states : 4; /**< Application-layer states of all slaves. |
8e49b519e6ba
Implemented ecrt_slave_config_state(); minor changes in
Florian Pose <fp@igh-essen.com>
parents:
1020
diff
changeset
|
178 |
The states are coded in the lower 4 bits. |
8e49b519e6ba
Implemented ecrt_slave_config_state(); minor changes in
Florian Pose <fp@igh-essen.com>
parents:
1020
diff
changeset
|
179 |
If a bit is set, it means that at least one |
8e49b519e6ba
Implemented ecrt_slave_config_state(); minor changes in
Florian Pose <fp@igh-essen.com>
parents:
1020
diff
changeset
|
180 |
slave in the bus is in the corresponding |
8e49b519e6ba
Implemented ecrt_slave_config_state(); minor changes in
Florian Pose <fp@igh-essen.com>
parents:
1020
diff
changeset
|
181 |
state: |
8e49b519e6ba
Implemented ecrt_slave_config_state(); minor changes in
Florian Pose <fp@igh-essen.com>
parents:
1020
diff
changeset
|
182 |
- Bit 0: \a INIT |
8e49b519e6ba
Implemented ecrt_slave_config_state(); minor changes in
Florian Pose <fp@igh-essen.com>
parents:
1020
diff
changeset
|
183 |
- Bit 1: \a PREOP |
8e49b519e6ba
Implemented ecrt_slave_config_state(); minor changes in
Florian Pose <fp@igh-essen.com>
parents:
1020
diff
changeset
|
184 |
- Bit 2: \a SAFEOP |
8e49b519e6ba
Implemented ecrt_slave_config_state(); minor changes in
Florian Pose <fp@igh-essen.com>
parents:
1020
diff
changeset
|
185 |
- Bit 3: \a OP */ |
8e49b519e6ba
Implemented ecrt_slave_config_state(); minor changes in
Florian Pose <fp@igh-essen.com>
parents:
1020
diff
changeset
|
186 |
unsigned int link_up : 1; /**< \a true, if the network link is up. */ |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
187 |
} ec_master_state_t; |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
188 |
|
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
189 |
/*****************************************************************************/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
190 |
|
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
191 |
/** Slave configuration state. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
192 |
* |
1020
9bf2ddf05e17
Completed ec_master_state_t and documented ec_master_state_t and
Florian Pose <fp@igh-essen.com>
parents:
1010
diff
changeset
|
193 |
* This is used as an output parameter of ecrt_slave_config_state(). |
9bf2ddf05e17
Completed ec_master_state_t and documented ec_master_state_t and
Florian Pose <fp@igh-essen.com>
parents:
1010
diff
changeset
|
194 |
* |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
195 |
* \see ecrt_slave_config_state(). |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
196 |
*/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
197 |
typedef struct { |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
198 |
unsigned int online : 1; /**< The slave is online. */ |
1020
9bf2ddf05e17
Completed ec_master_state_t and documented ec_master_state_t and
Florian Pose <fp@igh-essen.com>
parents:
1010
diff
changeset
|
199 |
unsigned int operational : 1; /**< The slave was brought into \a OP state |
9bf2ddf05e17
Completed ec_master_state_t and documented ec_master_state_t and
Florian Pose <fp@igh-essen.com>
parents:
1010
diff
changeset
|
200 |
using the specified configuration. */ |
1022
8e49b519e6ba
Implemented ecrt_slave_config_state(); minor changes in
Florian Pose <fp@igh-essen.com>
parents:
1020
diff
changeset
|
201 |
unsigned int al_state : 4; /**< The application-layer state of the slave. |
8e49b519e6ba
Implemented ecrt_slave_config_state(); minor changes in
Florian Pose <fp@igh-essen.com>
parents:
1020
diff
changeset
|
202 |
- 1: \a INIT |
8e49b519e6ba
Implemented ecrt_slave_config_state(); minor changes in
Florian Pose <fp@igh-essen.com>
parents:
1020
diff
changeset
|
203 |
- 2: \a PREOP |
8e49b519e6ba
Implemented ecrt_slave_config_state(); minor changes in
Florian Pose <fp@igh-essen.com>
parents:
1020
diff
changeset
|
204 |
- 4: \a SAFEOP |
8e49b519e6ba
Implemented ecrt_slave_config_state(); minor changes in
Florian Pose <fp@igh-essen.com>
parents:
1020
diff
changeset
|
205 |
- 8: \a OP |
8e49b519e6ba
Implemented ecrt_slave_config_state(); minor changes in
Florian Pose <fp@igh-essen.com>
parents:
1020
diff
changeset
|
206 |
|
8e49b519e6ba
Implemented ecrt_slave_config_state(); minor changes in
Florian Pose <fp@igh-essen.com>
parents:
1020
diff
changeset
|
207 |
Note that each state is coded in a different |
8e49b519e6ba
Implemented ecrt_slave_config_state(); minor changes in
Florian Pose <fp@igh-essen.com>
parents:
1020
diff
changeset
|
208 |
bit! */ |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
209 |
} ec_slave_config_state_t; |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
210 |
|
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
211 |
/*****************************************************************************/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
212 |
|
1341
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
213 |
/** Slave information. |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
214 |
* |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
215 |
* This is used as an output parameter of ecrt_master_slave(). |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
216 |
* |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
217 |
* \see ecrt_master_slave(). |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
218 |
*/ |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
219 |
typedef struct { |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
220 |
uint16_t position; /**< Offset of the slave in the ring. */ |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
221 |
uint32_t vendor_id; /**< Vendor-ID stored on the slave. */ |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
222 |
uint32_t product_code; /**< Product-Code stored on the slave. */ |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
223 |
uint32_t revision_number; /**< Revision-Number stored on the slave. */ |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
224 |
uint32_t serial_number; /**< Serial-Number stored on the slave. */ |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
225 |
uint16_t alias; /**< The slaves alias if not equal to 0. */ |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
226 |
int16_t current_on_ebus; |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
227 |
uint8_t al_state; /**< Current state of the slave. */ |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
228 |
uint8_t error_flag; /**< Error flag for that slave. */ |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
229 |
uint8_t sync_count; /**< Number of sync managers. */ |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
230 |
uint16_t sdo_count; /**< Number of SDO's. */ |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
231 |
char name[EC_MAX_STRING_LENGTH]; /**< Name of the slave. */ |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
232 |
} ec_slave_info_t; |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
233 |
|
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
234 |
/*****************************************************************************/ |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
235 |
|
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
236 |
/** Domain working counter interpretation. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
237 |
* |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
238 |
* This is used in ec_domain_state_t. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
239 |
*/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
240 |
typedef enum { |
925
939f3e9bba1e
Some improvements concerning bit_position.
Florian Pose <fp@igh-essen.com>
parents:
923
diff
changeset
|
241 |
EC_WC_ZERO = 0, /**< No registered process data were exchanged. */ |
939f3e9bba1e
Some improvements concerning bit_position.
Florian Pose <fp@igh-essen.com>
parents:
923
diff
changeset
|
242 |
EC_WC_INCOMPLETE, /**< Some of the registered process data were |
939f3e9bba1e
Some improvements concerning bit_position.
Florian Pose <fp@igh-essen.com>
parents:
923
diff
changeset
|
243 |
exchanged. */ |
939f3e9bba1e
Some improvements concerning bit_position.
Florian Pose <fp@igh-essen.com>
parents:
923
diff
changeset
|
244 |
EC_WC_COMPLETE /**< All registered process data were exchanged. */ |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
245 |
} ec_wc_state_t; |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
246 |
|
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
247 |
/*****************************************************************************/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
248 |
|
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
249 |
/** Domain state. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
250 |
* |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
251 |
* This is used for the output parameter of ecrt_domain_state(). |
640
16e9ad7d8e12
Added parameters for vendor ID and product code to ecrt_get_slave(); PDO
Florian Pose <fp@igh-essen.com>
parents:
637
diff
changeset
|
252 |
*/ |
16e9ad7d8e12
Added parameters for vendor ID and product code to ecrt_get_slave(); PDO
Florian Pose <fp@igh-essen.com>
parents:
637
diff
changeset
|
253 |
typedef struct { |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
254 |
unsigned int working_counter; /**< Value of the last working counter. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
255 |
ec_wc_state_t wc_state; /**< Working counter interpretation. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
256 |
} ec_domain_state_t; |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
257 |
|
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
258 |
/*****************************************************************************/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
259 |
|
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
260 |
/** Direction type for PDO assignment functions. |
779 | 261 |
*/ |
635
d304ef4af542
Implemented alternative PDO mapping configuration interface.
Florian Pose <fp@igh-essen.com>
parents:
612
diff
changeset
|
262 |
typedef enum { |
1055
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
263 |
EC_DIR_INVALID, /**< Invalid direction. Do not use this value. */ |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
264 |
EC_DIR_OUTPUT, /**< Values written by the master. */ |
1055
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
265 |
EC_DIR_INPUT, /**< Values read by the master. */ |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
266 |
EC_DIR_COUNT /**< Number of directions. For internal use only. */ |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
267 |
} ec_direction_t; |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
268 |
|
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
269 |
/*****************************************************************************/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
270 |
|
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
271 |
/** PDO entry configuration information. |
1055
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
272 |
* |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
273 |
* This is the data type of the \a entries field in ec_pdo_info_t. |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
274 |
* |
1082
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
275 |
* \see ecrt_slave_config_pdos(). |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
276 |
*/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
277 |
typedef struct { |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
278 |
uint16_t index; /**< PDO entry index. */ |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
279 |
uint8_t subindex; /**< PDO entry subindex. */ |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
280 |
uint8_t bit_length; /**< Size of the PDO entry in bit. */ |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
281 |
} ec_pdo_entry_info_t; |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
282 |
|
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
283 |
/*****************************************************************************/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
284 |
|
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
285 |
/** PDO configuration information. |
1055
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
286 |
* |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
287 |
* This is the data type of the \a pdos field in ec_sync_info_t. |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
288 |
* |
1082
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
289 |
* \see ecrt_slave_config_pdos(). |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
290 |
*/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
291 |
typedef struct { |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
292 |
uint16_t index; /**< PDO index. */ |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
293 |
unsigned int n_entries; /**< Number of PDO entries in \a entries to map. |
879
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
294 |
Zero means, that the default mapping shall be |
925
939f3e9bba1e
Some improvements concerning bit_position.
Florian Pose <fp@igh-essen.com>
parents:
923
diff
changeset
|
295 |
used (this can only be done if the slave is |
939f3e9bba1e
Some improvements concerning bit_position.
Florian Pose <fp@igh-essen.com>
parents:
923
diff
changeset
|
296 |
present at bus configuration time). */ |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
297 |
ec_pdo_entry_info_t *entries; /**< Array of PDO entries to map. Can either |
1055
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
298 |
be \a NULL, or must contain at |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
299 |
least \a n_entries values. */ |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
300 |
} ec_pdo_info_t; |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
301 |
|
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
302 |
/*****************************************************************************/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
303 |
|
1055
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
304 |
/** Sync manager configuration information. |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
305 |
* |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
306 |
* This can be use to configure multiple sync managers including the PDO |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
307 |
* assignment and PDO mapping. It is used as an input parameter type in |
1082
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
308 |
* ecrt_slave_config_pdos(). |
1055
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
309 |
*/ |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
310 |
typedef struct { |
1083
1322dc34cb37
Updated header docs, features and news file.
Florian Pose <fp@igh-essen.com>
parents:
1082
diff
changeset
|
311 |
uint8_t index; /**< Sync manager index. Must be less |
1322dc34cb37
Updated header docs, features and news file.
Florian Pose <fp@igh-essen.com>
parents:
1082
diff
changeset
|
312 |
than #EC_MAX_SYNC_MANAGERS for a valid sync manager, |
1322dc34cb37
Updated header docs, features and news file.
Florian Pose <fp@igh-essen.com>
parents:
1082
diff
changeset
|
313 |
but can also be \a 0xff to mark the end of the list. */ |
1055
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
314 |
ec_direction_t dir; /**< Sync manager direction. */ |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
315 |
unsigned int n_pdos; /**< Number of PDOs in \a pdos. */ |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
316 |
ec_pdo_info_t *pdos; /**< Array with PDOs to assign. This must contain |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
317 |
at least \a n_pdos PDOs. */ |
1055
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
318 |
} ec_sync_info_t; |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
319 |
|
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
320 |
/*****************************************************************************/ |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
321 |
|
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
322 |
/** List record type for PDO entry mass-registration. |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
323 |
* |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
324 |
* This type is used for the array parameter of the |
923
a6b51990e7e6
Changed Pdo entry registration function - return byte and bit positions
Richard Hacker <ha@igh-essen.com>
parents:
916
diff
changeset
|
325 |
* ecrt_domain_reg_pdo_entry_list() |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
326 |
*/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
327 |
typedef struct { |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
328 |
uint16_t alias; /**< Slave alias address. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
329 |
uint16_t position; /**< Slave position. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
330 |
uint32_t vendor_id; /**< Slave vendor ID. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
331 |
uint32_t product_code; /**< Slave product code. */ |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
332 |
uint16_t index; /**< PDO entry index. */ |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
333 |
uint8_t subindex; /**< PDO entry subindex. */ |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
334 |
unsigned int *offset; /**< Pointer to a variable to store the PDO entry's |
925
939f3e9bba1e
Some improvements concerning bit_position.
Florian Pose <fp@igh-essen.com>
parents:
923
diff
changeset
|
335 |
(byte-)offset in the process data. */ |
1092 | 336 |
unsigned int *bit_position; /**< Pointer to a variable to store a bit |
337 |
position (0-7) within the \a offset. Can be |
|
338 |
NULL, in which case an error is raised if the |
|
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
339 |
PDO entry does not byte-align. */ |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
340 |
} ec_pdo_entry_reg_t; |
416
4f007cd2a79d
ecrt_domain_register_pdo_range() implemented.
Florian Pose <fp@igh-essen.com>
parents:
325
diff
changeset
|
341 |
|
858
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
342 |
/*****************************************************************************/ |
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
343 |
|
1209 | 344 |
/** Request state. |
345 |
* |
|
346 |
* This is used as return type for ecrt_sdo_request_state() and |
|
347 |
* ecrt_voe_handler_state(). |
|
858
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
348 |
*/ |
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
349 |
typedef enum { |
1209 | 350 |
EC_REQUEST_UNUSED, /**< Not requested. */ |
351 |
EC_REQUEST_BUSY, /**< Request is being processed. */ |
|
352 |
EC_REQUEST_SUCCESS, /**< Request was processed successfully. */ |
|
353 |
EC_REQUEST_ERROR, /**< Request processing failed. */ |
|
354 |
} ec_request_state_t; |
|
858
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
355 |
|
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
356 |
/****************************************************************************** |
779 | 357 |
* Global functions |
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
358 |
*****************************************************************************/ |
104
052bc82d5442
MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
359 |
|
1288
bf0d42ca5aec
Wrapped c function in 'extern "C"' to make the library usable in C++
Florian Pose <fp@igh-essen.com>
parents:
1287
diff
changeset
|
360 |
#ifdef __cplusplus |
bf0d42ca5aec
Wrapped c function in 'extern "C"' to make the library usable in C++
Florian Pose <fp@igh-essen.com>
parents:
1287
diff
changeset
|
361 |
extern "C" { |
bf0d42ca5aec
Wrapped c function in 'extern "C"' to make the library usable in C++
Florian Pose <fp@igh-essen.com>
parents:
1287
diff
changeset
|
362 |
#endif |
bf0d42ca5aec
Wrapped c function in 'extern "C"' to make the library usable in C++
Florian Pose <fp@igh-essen.com>
parents:
1287
diff
changeset
|
363 |
|
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
364 |
/** Returns the version magic of the realtime interface. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
365 |
* |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
366 |
* \return Value of ECRT_VERSION_MAGIC() at EtherCAT master compile time. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
367 |
*/ |
541
5a2b1658b67f
Introduced ECRT version magic.
Florian Pose <fp@igh-essen.com>
parents:
495
diff
changeset
|
368 |
unsigned int ecrt_version_magic(void); |
5a2b1658b67f
Introduced ECRT version magic.
Florian Pose <fp@igh-essen.com>
parents:
495
diff
changeset
|
369 |
|
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
370 |
/** Requests an EtherCAT master for realtime operation. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
371 |
* |
1092 | 372 |
* Before an application can access an EtherCAT master, it has to reserve one |
373 |
* for exclusive use. |
|
374 |
* |
|
375 |
* This function has to be the first function an application has to call to |
|
376 |
* use EtherCAT. The function takes the index of the master as its argument. |
|
377 |
* The first master has index 0, the n-th master has index n - 1. The number |
|
378 |
* of masters has to be specified when loading the master module. |
|
379 |
* |
|
1312
74853e018898
Created backend versions of all API functions returing a pointer; using
Florian Pose <fp@igh-essen.com>
parents:
1288
diff
changeset
|
380 |
* \return Pointer to the reserved master, otherwise \a NULL. |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
381 |
*/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
382 |
ec_master_t *ecrt_request_master( |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
383 |
unsigned int master_index /**< Index of the master to request. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
384 |
); |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
385 |
|
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
386 |
/** Releases a requested EtherCAT master. |
1092 | 387 |
* |
388 |
* After use, a master it has to be released to make it available for other |
|
389 |
* applications. |
|
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
390 |
*/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
391 |
void ecrt_release_master( |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
392 |
ec_master_t *master /**< EtherCAT master */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
393 |
); |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
394 |
|
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
395 |
/****************************************************************************** |
779 | 396 |
* Master methods |
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
397 |
*****************************************************************************/ |
104
052bc82d5442
MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
398 |
|
1244
0b70040d3daa
No kernel handles in userspace; Domain creation.
Florian Pose <fp@igh-essen.com>
parents:
1239
diff
changeset
|
399 |
#ifdef __KERNEL__ |
0b70040d3daa
No kernel handles in userspace; Domain creation.
Florian Pose <fp@igh-essen.com>
parents:
1239
diff
changeset
|
400 |
|
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
401 |
/** Sets the locking callbacks. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
402 |
* |
1092 | 403 |
* For concurrent master access, the application has to provide a locking |
404 |
* mechanism (see section FIXME in the docs). The method takes two function |
|
405 |
* pointers and a data value as its parameters. The arbitrary \a cb_data value |
|
406 |
* will be passed as argument on every callback. Asynchronous master access |
|
407 |
* (like EoE processing) is only possible if the callbacks have been set. |
|
408 |
* |
|
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
409 |
* The request_cb function must return zero, to allow another instance |
1092 | 410 |
* (an EoE process for example) to access the master. Non-zero means, |
411 |
* that access is currently forbidden. |
|
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
412 |
*/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
413 |
void ecrt_master_callbacks( |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
414 |
ec_master_t *master, /**< EtherCAT master */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
415 |
int (*request_cb)(void *), /**< Lock request function. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
416 |
void (*release_cb)(void *), /**< Lock release function. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
417 |
void *cb_data /**< Arbitrary user data. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
418 |
); |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
419 |
|
1244
0b70040d3daa
No kernel handles in userspace; Domain creation.
Florian Pose <fp@igh-essen.com>
parents:
1239
diff
changeset
|
420 |
#endif /* __KERNEL__ */ |
0b70040d3daa
No kernel handles in userspace; Domain creation.
Florian Pose <fp@igh-essen.com>
parents:
1239
diff
changeset
|
421 |
|
1092 | 422 |
/** Creates a new process data domain. |
423 |
* |
|
424 |
* For process data exchange, at least one process data domain is needed. |
|
425 |
* This method creates a new process data domain and returns a pointer to the |
|
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
426 |
* new domain object. This object can be used for registering PDOs and |
1092 | 427 |
* exchanging them in cyclic operation. |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
428 |
* |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
429 |
* \return Pointer to the new domain on success, else NULL. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
430 |
*/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
431 |
ec_domain_t *ecrt_master_create_domain( |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
432 |
ec_master_t *master /**< EtherCAT master. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
433 |
); |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
434 |
|
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
435 |
/** Obtains a slave configuration. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
436 |
* |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
437 |
* Creates a slave configuration object for the given \a alias and \a position |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
438 |
* tuple and returns it. If a configuration with the same \a alias and \a |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
439 |
* position already exists, it will be re-used. In the latter case, the given |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
440 |
* vendor ID and product code are compared to the stored ones. On mismatch, an |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
441 |
* error message is raised and the function returns \a NULL. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
442 |
* |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
443 |
* Slaves are addressed with the \a alias and \a position parameters. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
444 |
* - If \a alias is zero, \a position is interpreted as the desired slave's |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
445 |
* ring position. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
446 |
* - If \a alias is non-zero, it matches a slave with the given alias. In this |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
447 |
* case, \a position is interpreted as ring offset, starting from the |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
448 |
* aliased slave, so a position of zero means the aliased slave itself and a |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
449 |
* positive value matches the n-th slave behind the aliased one. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
450 |
* |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
451 |
* If the slave with the given address is found during the bus configuration, |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
452 |
* its vendor ID and product code are matched against the given value. On |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
453 |
* mismatch, the slave is not configured and an error message is raised. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
454 |
* |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
455 |
* If different slave configurations are pointing to the same slave during bus |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
456 |
* configuration, a warning is raised and only the first configuration is |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
457 |
* applied. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
458 |
* |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
459 |
* \retval >0 Pointer to the slave configuration structure. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
460 |
* \retval NULL in the error case. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
461 |
*/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
462 |
ec_slave_config_t *ecrt_master_slave_config( |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
463 |
ec_master_t *master, /**< EtherCAT master */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
464 |
uint16_t alias, /**< Slave alias. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
465 |
uint16_t position, /**< Slave position. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
466 |
uint32_t vendor_id, /**< Expected vendor ID. */ |
1010
6672b86e7b10
Reverted revision number checking from r1228.
Florian Pose <fp@igh-essen.com>
parents:
1009
diff
changeset
|
467 |
uint32_t product_code /**< Expected product code. */ |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
468 |
); |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
469 |
|
1341
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
470 |
/** Obtains slave information. |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
471 |
* |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
472 |
* Tries to find the slave with the given ring position. The obtained |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
473 |
* information is stored in a structure. No memory is allocated on the heap in |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
474 |
* this function. |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
475 |
* |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
476 |
* \attention The pointer to this structure must point to a valid variable. |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
477 |
* |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
478 |
* \return 0 in case of success, else < 0 |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
479 |
*/ |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
480 |
int ecrt_master_slave( |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
481 |
ec_master_t *master, /**< EtherCAT master */ |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
482 |
uint16_t position, /**< Slave position. */ |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
483 |
ec_slave_info_t *slave_info /**< Structure that will output the |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
484 |
information */ |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
485 |
); |
32ba7ffb6c7f
Added ecrt_master_slave().
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
486 |
|
1096 | 487 |
/** Finishes the configuration phase and prepares for cyclic operation. |
879
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
488 |
* |
925
939f3e9bba1e
Some improvements concerning bit_position.
Florian Pose <fp@igh-essen.com>
parents:
923
diff
changeset
|
489 |
* This function tells the master that the configuration phase is finished and |
939f3e9bba1e
Some improvements concerning bit_position.
Florian Pose <fp@igh-essen.com>
parents:
923
diff
changeset
|
490 |
* the realtime operation will begin. The function allocates internal memory |
939f3e9bba1e
Some improvements concerning bit_position.
Florian Pose <fp@igh-essen.com>
parents:
923
diff
changeset
|
491 |
* for the domains and calculates the logical FMMU addresses for domain |
939f3e9bba1e
Some improvements concerning bit_position.
Florian Pose <fp@igh-essen.com>
parents:
923
diff
changeset
|
492 |
* members. It tells the master state machine that the bus configuration is |
939f3e9bba1e
Some improvements concerning bit_position.
Florian Pose <fp@igh-essen.com>
parents:
923
diff
changeset
|
493 |
* now to be applied. |
879
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
494 |
* |
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
495 |
* \attention After this function has been called, the realtime application is |
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
496 |
* in charge of cyclically calling ecrt_master_send() and |
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
497 |
* ecrt_master_receive() to ensure bus communication. Before calling this |
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
498 |
* function, the master thread is responsible for that, so these functions may |
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
499 |
* not be called! |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
500 |
* |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
501 |
* \return 0 in case of success, else < 0 |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
502 |
*/ |
1007 | 503 |
int ecrt_master_activate( |
504 |
ec_master_t *master /**< EtherCAT master. */ |
|
505 |
); |
|
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
506 |
|
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
507 |
/** Sends all datagrams in the queue. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
508 |
* |
1092 | 509 |
* This method takes all datagrams, that have been queued for transmission, |
510 |
* puts them into frames, and passes them to the Ethernet device for sending. |
|
511 |
* |
|
512 |
* Has to be called cyclically by the application after ecrt_master_activate() |
|
513 |
* has returned. |
|
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
514 |
*/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
515 |
void ecrt_master_send( |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
516 |
ec_master_t *master /**< EtherCAT master. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
517 |
); |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
518 |
|
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
519 |
/** Fetches received frames from the hardware and processes the datagrams. |
879
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
520 |
* |
1092 | 521 |
* Queries the network device for received frames by calling the interrupt |
522 |
* service routine. Extracts received datagrams and dispatches the results to |
|
523 |
* the datagram objects in the queue. Received datagrams, and the ones that |
|
524 |
* timed out, will be marked, and dequeued. |
|
525 |
* |
|
526 |
* Has to be called cyclically by the realtime application after |
|
879
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
527 |
* ecrt_master_activate() has returned. |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
528 |
*/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
529 |
void ecrt_master_receive( |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
530 |
ec_master_t *master /**< EtherCAT master. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
531 |
); |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
532 |
|
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
533 |
/** Reads the current master state. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
534 |
* |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
535 |
* Stores the master state information in the given \a state structure. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
536 |
*/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
537 |
void ecrt_master_state( |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
538 |
const ec_master_t *master, /**< EtherCAT master. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
539 |
ec_master_state_t *state /**< Structure to store the information. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
540 |
); |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
541 |
|
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
542 |
/****************************************************************************** |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
543 |
* Slave configuration methods |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
544 |
*****************************************************************************/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
545 |
|
1055
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
546 |
/** Configure a sync manager. |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
547 |
* |
1082
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
548 |
* Sets the direction of a sync manager. This overrides the direction bits |
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
549 |
* from the default control register from SII. |
1055
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
550 |
* |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
551 |
* \return zero on success, else non-zero |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
552 |
*/ |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
553 |
int ecrt_slave_config_sync_manager( |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
554 |
ec_slave_config_t *sc, /**< Slave configuration. */ |
1083
1322dc34cb37
Updated header docs, features and news file.
Florian Pose <fp@igh-essen.com>
parents:
1082
diff
changeset
|
555 |
uint8_t sync_index, /**< Sync manager index. Must be less |
1082
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
556 |
than #EC_MAX_SYNC_MANAGERS. */ |
1055
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
557 |
ec_direction_t dir /**< Input/Output. */ |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
558 |
); |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
559 |
|
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
560 |
/** Add a PDO to a sync manager's PDO assignment. |
879
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
561 |
* |
1082
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
562 |
* \see ecrt_slave_config_pdos() |
842
40e27e5a8dce
Added ecrt_slave_config_pdo() and ecrt_slave_config_pdo_entry().
Florian Pose <fp@igh-essen.com>
parents:
832
diff
changeset
|
563 |
* \return zero on success, else non-zero |
40e27e5a8dce
Added ecrt_slave_config_pdo() and ecrt_slave_config_pdo_entry().
Florian Pose <fp@igh-essen.com>
parents:
832
diff
changeset
|
564 |
*/ |
879
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
565 |
int ecrt_slave_config_pdo_assign_add( |
842
40e27e5a8dce
Added ecrt_slave_config_pdo() and ecrt_slave_config_pdo_entry().
Florian Pose <fp@igh-essen.com>
parents:
832
diff
changeset
|
566 |
ec_slave_config_t *sc, /**< Slave configuration. */ |
1083
1322dc34cb37
Updated header docs, features and news file.
Florian Pose <fp@igh-essen.com>
parents:
1082
diff
changeset
|
567 |
uint8_t sync_index, /**< Sync manager index. Must be less |
1322dc34cb37
Updated header docs, features and news file.
Florian Pose <fp@igh-essen.com>
parents:
1082
diff
changeset
|
568 |
than #EC_MAX_SYNC_MANAGERS. */ |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
569 |
uint16_t index /**< Index of the PDO to assign. */ |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
570 |
); |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
571 |
|
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
572 |
/** Clear a sync manager's PDO assignment. |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
573 |
* |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
574 |
* This can be called before assigning PDOs via |
1055
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
575 |
* ecrt_slave_config_pdo_assign_add(), to clear the default assignment of a |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
576 |
* sync manager. |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
577 |
* |
1082
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
578 |
* \see ecrt_slave_config_pdos() |
879
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
579 |
*/ |
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
580 |
void ecrt_slave_config_pdo_assign_clear( |
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
581 |
ec_slave_config_t *sc, /**< Slave configuration. */ |
1083
1322dc34cb37
Updated header docs, features and news file.
Florian Pose <fp@igh-essen.com>
parents:
1082
diff
changeset
|
582 |
uint8_t sync_index /**< Sync manager index. Must be less |
1322dc34cb37
Updated header docs, features and news file.
Florian Pose <fp@igh-essen.com>
parents:
1082
diff
changeset
|
583 |
than #EC_MAX_SYNC_MANAGERS. */ |
879
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
584 |
); |
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
585 |
|
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
586 |
/** Add a PDO entry to the given PDO's mapping. |
879
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
587 |
* |
1082
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
588 |
* \see ecrt_slave_config_pdos() |
842
40e27e5a8dce
Added ecrt_slave_config_pdo() and ecrt_slave_config_pdo_entry().
Florian Pose <fp@igh-essen.com>
parents:
832
diff
changeset
|
589 |
* \return zero on success, else non-zero |
40e27e5a8dce
Added ecrt_slave_config_pdo() and ecrt_slave_config_pdo_entry().
Florian Pose <fp@igh-essen.com>
parents:
832
diff
changeset
|
590 |
*/ |
879
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
591 |
int ecrt_slave_config_pdo_mapping_add( |
842
40e27e5a8dce
Added ecrt_slave_config_pdo() and ecrt_slave_config_pdo_entry().
Florian Pose <fp@igh-essen.com>
parents:
832
diff
changeset
|
592 |
ec_slave_config_t *sc, /**< Slave configuration. */ |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
593 |
uint16_t pdo_index, /**< Index of the PDO. */ |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
594 |
uint16_t entry_index, /**< Index of the PDO entry to add to the PDO's |
879
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
595 |
mapping. */ |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
596 |
uint8_t entry_subindex, /**< Subindex of the PDO entry to add to the |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
597 |
PDO's mapping. */ |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
598 |
uint8_t entry_bit_length /**< Size of the PDO entry in bit. */ |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
599 |
); |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
600 |
|
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
601 |
/** Clear the mapping of a given PDO. |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
602 |
* |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
603 |
* This can be called before mapping PDO entries via |
879
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
604 |
* ecrt_slave_config_pdo_mapping_add(), to clear the default mapping. |
1055
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
605 |
* |
1082
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
606 |
* \see ecrt_slave_config_pdos() |
879
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
607 |
*/ |
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
608 |
void ecrt_slave_config_pdo_mapping_clear( |
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
609 |
ec_slave_config_t *sc, /**< Slave configuration. */ |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
610 |
uint16_t pdo_index /**< Index of the PDO. */ |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
611 |
); |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
612 |
|
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
613 |
/** Specify a complete PDO configuration. |
879
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
614 |
* |
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
615 |
* This function is a convenience wrapper for the functions |
1055
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
616 |
* ecrt_slave_config_sync_manager(), ecrt_slave_config_pdo_assign_clear(), |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
617 |
* ecrt_slave_config_pdo_assign_add(), ecrt_slave_config_pdo_mapping_clear() |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
618 |
* and ecrt_slave_config_pdo_mapping_add(), that are better suitable for |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
619 |
* automatic code generation. |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
620 |
* |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
621 |
* The following example shows, how to specify a complete configuration, |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
622 |
* including the PDO mappings. With this information, the master is able to |
879
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
623 |
* reserve the complete process data, even if the slave is not present at |
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
624 |
* configuration time: |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
625 |
* |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
626 |
* \code |
1082
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
627 |
* ec_pdo_entry_info_t el3162_channel1[] = { |
842
40e27e5a8dce
Added ecrt_slave_config_pdo() and ecrt_slave_config_pdo_entry().
Florian Pose <fp@igh-essen.com>
parents:
832
diff
changeset
|
628 |
* {0x3101, 1, 8}, // status |
40e27e5a8dce
Added ecrt_slave_config_pdo() and ecrt_slave_config_pdo_entry().
Florian Pose <fp@igh-essen.com>
parents:
832
diff
changeset
|
629 |
* {0x3101, 2, 16} // value |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
630 |
* }; |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
631 |
* |
1082
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
632 |
* ec_pdo_entry_info_t el3162_channel2[] = { |
842
40e27e5a8dce
Added ecrt_slave_config_pdo() and ecrt_slave_config_pdo_entry().
Florian Pose <fp@igh-essen.com>
parents:
832
diff
changeset
|
633 |
* {0x3102, 1, 8}, // status |
40e27e5a8dce
Added ecrt_slave_config_pdo() and ecrt_slave_config_pdo_entry().
Florian Pose <fp@igh-essen.com>
parents:
832
diff
changeset
|
634 |
* {0x3102, 2, 16} // value |
40e27e5a8dce
Added ecrt_slave_config_pdo() and ecrt_slave_config_pdo_entry().
Florian Pose <fp@igh-essen.com>
parents:
832
diff
changeset
|
635 |
* }; |
40e27e5a8dce
Added ecrt_slave_config_pdo() and ecrt_slave_config_pdo_entry().
Florian Pose <fp@igh-essen.com>
parents:
832
diff
changeset
|
636 |
* |
1082
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
637 |
* ec_pdo_info_t el3162_pdos[] = { |
1055
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
638 |
* {0x1A00, 2, el3162_channel1}, |
1082
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
639 |
* {0x1A01, 2, el3162_channel2} |
842
40e27e5a8dce
Added ecrt_slave_config_pdo() and ecrt_slave_config_pdo_entry().
Florian Pose <fp@igh-essen.com>
parents:
832
diff
changeset
|
640 |
* }; |
40e27e5a8dce
Added ecrt_slave_config_pdo() and ecrt_slave_config_pdo_entry().
Florian Pose <fp@igh-essen.com>
parents:
832
diff
changeset
|
641 |
* |
1082
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
642 |
* ec_sync_info_t el3162_syncs[] = { |
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
643 |
* {2, EC_DIR_OUTPUT}, |
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
644 |
* {3, EC_DIR_INPUT, 2, el3162_pdos}, |
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
645 |
* {0xff} |
1055
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
646 |
* }; |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
647 |
* |
1082
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
648 |
* if (ecrt_slave_config_pdos(sc_ana_in, EC_END, el3162_syncs)) { |
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
649 |
* // handle error |
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
650 |
* } |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
651 |
* \endcode |
879
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
652 |
* |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
653 |
* The next example shows, how to configure the PDO assignment only. The |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
654 |
* entries for each assigned PDO are taken from the PDO's default mapping. |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
655 |
* Please note, that PDO entry registration will fail, if the PDO |
879
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
656 |
* configuration is left empty and the slave is offline. |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
657 |
* |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
658 |
* \code |
1082
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
659 |
* ec_pdo_info_t pdos[] = { |
1055
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
660 |
* {0x1600}, // Channel 1 |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
661 |
* {0x1601} // Channel 2 |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
662 |
* }; |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
663 |
* |
1082
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
664 |
* ec_sync_info_t syncs[] = { |
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
665 |
* {3, EC_DIR_INPUT, 2, pdos}, |
1055
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
666 |
* }; |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
667 |
* |
1082
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
668 |
* if (ecrt_slave_config_pdos(slave_config_ana_in, 1, syncs)) { |
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
669 |
* // handle error |
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
670 |
* } |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
671 |
* \endcode |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
672 |
* |
1055
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
673 |
* Processing of \a syncs will stop, if |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
674 |
* - the number of processed items reaches \a n_syncs, or |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
675 |
* - the \a index member of an ec_sync_info_t item is 0xff. In this case, |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
676 |
* \a n_syncs should set to a number greater than the number of list items; |
879
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
878
diff
changeset
|
677 |
* using EC_END is recommended. |
878 | 678 |
* |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
679 |
* \return zero on success, else non-zero |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
680 |
*/ |
1082
ff06c58e269c
Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents:
1055
diff
changeset
|
681 |
int ecrt_slave_config_pdos( |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
682 |
ec_slave_config_t *sc, /**< Slave configuration. */ |
1055
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
683 |
unsigned int n_syncs, /**< Number of sync manager configurations in |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
684 |
\a syncs. */ |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
685 |
const ec_sync_info_t syncs[] /**< Array of sync manager |
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
1022
diff
changeset
|
686 |
configurations. */ |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
687 |
); |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
688 |
|
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
689 |
/** Registers a PDO entry for process data exchange in a domain. |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
690 |
* |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
691 |
* Searches the assigned PDOs for the given PDO entry. An error is raised, if |
925
939f3e9bba1e
Some improvements concerning bit_position.
Florian Pose <fp@igh-essen.com>
parents:
923
diff
changeset
|
692 |
* the given entry is not mapped. Otherwise, the corresponding sync manager |
939f3e9bba1e
Some improvements concerning bit_position.
Florian Pose <fp@igh-essen.com>
parents:
923
diff
changeset
|
693 |
* and FMMU configurations are provided for slave configuration and the |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
694 |
* respective sync manager's assigned PDOs are appended to the given domain, |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
695 |
* if not already done. The offset of the requested PDO entry's data inside |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
696 |
* the domain's process data is returned. Optionally, the PDO entry bit |
925
939f3e9bba1e
Some improvements concerning bit_position.
Florian Pose <fp@igh-essen.com>
parents:
923
diff
changeset
|
697 |
* position (0-7) can be retrieved via the \a bit_position output parameter. |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
698 |
* This pointer may be \a NULL, in this case an error is raised if the PDO |
925
939f3e9bba1e
Some improvements concerning bit_position.
Florian Pose <fp@igh-essen.com>
parents:
923
diff
changeset
|
699 |
* entry does not byte-align. |
842
40e27e5a8dce
Added ecrt_slave_config_pdo() and ecrt_slave_config_pdo_entry().
Florian Pose <fp@igh-essen.com>
parents:
832
diff
changeset
|
700 |
* |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
701 |
* \retval >=0 Success: Offset of the PDO entry's process data. |
1313
ed15eef57d5c
Improved error case return codes of many functions.
Florian Pose <fp@igh-essen.com>
parents:
1312
diff
changeset
|
702 |
* \retval <0 Error code. |
807
f8bca95ab75d
Moved ecrt_domain_reg_pdo_entry() to
Florian Pose <fp@igh-essen.com>
parents:
793
diff
changeset
|
703 |
*/ |
f8bca95ab75d
Moved ecrt_domain_reg_pdo_entry() to
Florian Pose <fp@igh-essen.com>
parents:
793
diff
changeset
|
704 |
int ecrt_slave_config_reg_pdo_entry( |
f8bca95ab75d
Moved ecrt_domain_reg_pdo_entry() to
Florian Pose <fp@igh-essen.com>
parents:
793
diff
changeset
|
705 |
ec_slave_config_t *sc, /**< Slave configuration. */ |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
706 |
uint16_t entry_index, /**< Index of the PDO entry to register. */ |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
707 |
uint8_t entry_subindex, /**< Subindex of the PDO entry to register. */ |
923
a6b51990e7e6
Changed Pdo entry registration function - return byte and bit positions
Richard Hacker <ha@igh-essen.com>
parents:
916
diff
changeset
|
708 |
ec_domain_t *domain, /**< Domain. */ |
925
939f3e9bba1e
Some improvements concerning bit_position.
Florian Pose <fp@igh-essen.com>
parents:
923
diff
changeset
|
709 |
unsigned int *bit_position /**< Optional address if bit addressing |
923
a6b51990e7e6
Changed Pdo entry registration function - return byte and bit positions
Richard Hacker <ha@igh-essen.com>
parents:
916
diff
changeset
|
710 |
is desired */ |
916
db73994fbdac
Added bitwise Pdo registration.
Florian Pose <fp@igh-essen.com>
parents:
900
diff
changeset
|
711 |
); |
db73994fbdac
Added bitwise Pdo registration.
Florian Pose <fp@igh-essen.com>
parents:
900
diff
changeset
|
712 |
|
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
713 |
/** Add an SDO configuration. |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
714 |
* |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
715 |
* An SDO configuration is stored in the slave configuration object and is |
893
d921fff3d6e2
Exported ecrt_slave_config_sdo(); added documentation.
Florian Pose <fp@igh-essen.com>
parents:
886
diff
changeset
|
716 |
* downloaded to the slave whenever the slave is being configured by the |
d921fff3d6e2
Exported ecrt_slave_config_sdo(); added documentation.
Florian Pose <fp@igh-essen.com>
parents:
886
diff
changeset
|
717 |
* master. This usually happens once on master activation, but can be repeated |
d921fff3d6e2
Exported ecrt_slave_config_sdo(); added documentation.
Florian Pose <fp@igh-essen.com>
parents:
886
diff
changeset
|
718 |
* subsequently, for example after the slave's power supply failed. |
d921fff3d6e2
Exported ecrt_slave_config_sdo(); added documentation.
Florian Pose <fp@igh-essen.com>
parents:
886
diff
changeset
|
719 |
* |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
720 |
* \attention The SDOs for PDO assignment (\p 0x1C10 - \p 0x1C2F) and PDO |
1104
9e7fe258495e
Added attention to ecrt_slave_config_sdo().
Florian Pose <fp@igh-essen.com>
parents:
1096
diff
changeset
|
721 |
* mapping (\p 0x1600 - \p 0x17FF and \p 0x1A00 - \p 0x1BFF) should not be |
9e7fe258495e
Added attention to ecrt_slave_config_sdo().
Florian Pose <fp@igh-essen.com>
parents:
1096
diff
changeset
|
722 |
* configured with this function, because they are part of the slave |
9e7fe258495e
Added attention to ecrt_slave_config_sdo().
Florian Pose <fp@igh-essen.com>
parents:
1096
diff
changeset
|
723 |
* configuration done by the master. Please use ecrt_slave_config_pdos() and |
9e7fe258495e
Added attention to ecrt_slave_config_sdo().
Florian Pose <fp@igh-essen.com>
parents:
1096
diff
changeset
|
724 |
* friends instead. |
9e7fe258495e
Added attention to ecrt_slave_config_sdo().
Florian Pose <fp@igh-essen.com>
parents:
1096
diff
changeset
|
725 |
* |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
726 |
* This is the generic function for adding an SDO configuration. Please note |
893
d921fff3d6e2
Exported ecrt_slave_config_sdo(); added documentation.
Florian Pose <fp@igh-essen.com>
parents:
886
diff
changeset
|
727 |
* that the this function does not do any endianess correction. If |
d921fff3d6e2
Exported ecrt_slave_config_sdo(); added documentation.
Florian Pose <fp@igh-essen.com>
parents:
886
diff
changeset
|
728 |
* datatype-specific functions are needed (that automatically correct the |
d921fff3d6e2
Exported ecrt_slave_config_sdo(); added documentation.
Florian Pose <fp@igh-essen.com>
parents:
886
diff
changeset
|
729 |
* endianess), have a look at ecrt_slave_config_sdo8(), |
d921fff3d6e2
Exported ecrt_slave_config_sdo(); added documentation.
Florian Pose <fp@igh-essen.com>
parents:
886
diff
changeset
|
730 |
* ecrt_slave_config_sdo16() and ecrt_slave_config_sdo32(). |
d921fff3d6e2
Exported ecrt_slave_config_sdo(); added documentation.
Florian Pose <fp@igh-essen.com>
parents:
886
diff
changeset
|
731 |
* |
1313
ed15eef57d5c
Improved error case return codes of many functions.
Florian Pose <fp@igh-essen.com>
parents:
1312
diff
changeset
|
732 |
* \retval 0 Success. |
ed15eef57d5c
Improved error case return codes of many functions.
Florian Pose <fp@igh-essen.com>
parents:
1312
diff
changeset
|
733 |
* \retval <0 Error code. |
893
d921fff3d6e2
Exported ecrt_slave_config_sdo(); added documentation.
Florian Pose <fp@igh-essen.com>
parents:
886
diff
changeset
|
734 |
*/ |
d921fff3d6e2
Exported ecrt_slave_config_sdo(); added documentation.
Florian Pose <fp@igh-essen.com>
parents:
886
diff
changeset
|
735 |
int ecrt_slave_config_sdo( |
d921fff3d6e2
Exported ecrt_slave_config_sdo(); added documentation.
Florian Pose <fp@igh-essen.com>
parents:
886
diff
changeset
|
736 |
ec_slave_config_t *sc, /**< Slave configuration. */ |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
737 |
uint16_t index, /**< Index of the SDO to configure. */ |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
738 |
uint8_t subindex, /**< Subindex of the SDO to configure. */ |
893
d921fff3d6e2
Exported ecrt_slave_config_sdo(); added documentation.
Florian Pose <fp@igh-essen.com>
parents:
886
diff
changeset
|
739 |
const uint8_t *data, /**< Pointer to the data. */ |
d921fff3d6e2
Exported ecrt_slave_config_sdo(); added documentation.
Florian Pose <fp@igh-essen.com>
parents:
886
diff
changeset
|
740 |
size_t size /**< Size of the \a data. */ |
d921fff3d6e2
Exported ecrt_slave_config_sdo(); added documentation.
Florian Pose <fp@igh-essen.com>
parents:
886
diff
changeset
|
741 |
); |
d921fff3d6e2
Exported ecrt_slave_config_sdo(); added documentation.
Florian Pose <fp@igh-essen.com>
parents:
886
diff
changeset
|
742 |
|
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
743 |
/** Add a configuration value for an 8-bit SDO. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
744 |
* |
893
d921fff3d6e2
Exported ecrt_slave_config_sdo(); added documentation.
Florian Pose <fp@igh-essen.com>
parents:
886
diff
changeset
|
745 |
* \see ecrt_slave_config_sdo(). |
1313
ed15eef57d5c
Improved error case return codes of many functions.
Florian Pose <fp@igh-essen.com>
parents:
1312
diff
changeset
|
746 |
* |
ed15eef57d5c
Improved error case return codes of many functions.
Florian Pose <fp@igh-essen.com>
parents:
1312
diff
changeset
|
747 |
* \retval 0 Success. |
ed15eef57d5c
Improved error case return codes of many functions.
Florian Pose <fp@igh-essen.com>
parents:
1312
diff
changeset
|
748 |
* \retval <0 Error code. |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
749 |
*/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
750 |
int ecrt_slave_config_sdo8( |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
751 |
ec_slave_config_t *sc, /**< Slave configuration */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
752 |
uint16_t sdo_index, /**< Index of the SDO to configure. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
753 |
uint8_t sdo_subindex, /**< Subindex of the SDO to configure. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
754 |
uint8_t value /**< Value to set. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
755 |
); |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
756 |
|
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
757 |
/** Add a configuration value for a 16-bit SDO. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
758 |
* |
893
d921fff3d6e2
Exported ecrt_slave_config_sdo(); added documentation.
Florian Pose <fp@igh-essen.com>
parents:
886
diff
changeset
|
759 |
* \see ecrt_slave_config_sdo(). |
1313
ed15eef57d5c
Improved error case return codes of many functions.
Florian Pose <fp@igh-essen.com>
parents:
1312
diff
changeset
|
760 |
* |
ed15eef57d5c
Improved error case return codes of many functions.
Florian Pose <fp@igh-essen.com>
parents:
1312
diff
changeset
|
761 |
* \retval 0 Success. |
ed15eef57d5c
Improved error case return codes of many functions.
Florian Pose <fp@igh-essen.com>
parents:
1312
diff
changeset
|
762 |
* \retval <0 Error code. |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
763 |
*/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
764 |
int ecrt_slave_config_sdo16( |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
765 |
ec_slave_config_t *sc, /**< Slave configuration */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
766 |
uint16_t sdo_index, /**< Index of the SDO to configure. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
767 |
uint8_t sdo_subindex, /**< Subindex of the SDO to configure. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
768 |
uint16_t value /**< Value to set. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
769 |
); |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
770 |
|
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
771 |
/** Add a configuration value for a 32-bit SDO. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
772 |
* |
893
d921fff3d6e2
Exported ecrt_slave_config_sdo(); added documentation.
Florian Pose <fp@igh-essen.com>
parents:
886
diff
changeset
|
773 |
* \see ecrt_slave_config_sdo(). |
1313
ed15eef57d5c
Improved error case return codes of many functions.
Florian Pose <fp@igh-essen.com>
parents:
1312
diff
changeset
|
774 |
* |
ed15eef57d5c
Improved error case return codes of many functions.
Florian Pose <fp@igh-essen.com>
parents:
1312
diff
changeset
|
775 |
* \retval 0 Success. |
ed15eef57d5c
Improved error case return codes of many functions.
Florian Pose <fp@igh-essen.com>
parents:
1312
diff
changeset
|
776 |
* \retval <0 Error code. |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
777 |
*/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
778 |
int ecrt_slave_config_sdo32( |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
779 |
ec_slave_config_t *sc, /**< Slave configuration */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
780 |
uint16_t sdo_index, /**< Index of the SDO to configure. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
781 |
uint8_t sdo_subindex, /**< Subindex of the SDO to configure. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
782 |
uint32_t value /**< Value to set. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
783 |
); |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
784 |
|
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
785 |
/** Create an SDO request to exchange SDOs during realtime operation. |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
786 |
* |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
787 |
* The created SDO request object is freed automatically when the master is |
858
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
788 |
* released. |
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
789 |
*/ |
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
790 |
ec_sdo_request_t *ecrt_slave_config_create_sdo_request( |
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
791 |
ec_slave_config_t *sc, /**< Slave configuration. */ |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
792 |
uint16_t index, /**< SDO index. */ |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
793 |
uint8_t subindex, /**< SDO subindex. */ |
858
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
794 |
size_t size /**< Data size to reserve. */ |
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
795 |
); |
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
796 |
|
1209 | 797 |
/** Create an VoE handler to exchange vendor-specific data during realtime |
798 |
* operation. |
|
799 |
* |
|
1267 | 800 |
* The number of VoE handlers per slave configuration is not limited, but |
801 |
* usually it is enough to create one for sending and one for receiving, if |
|
802 |
* both can be done simultaneously. |
|
803 |
* |
|
1209 | 804 |
* The created VoE handler object is freed automatically when the master is |
805 |
* released. |
|
806 |
*/ |
|
807 |
ec_voe_handler_t *ecrt_slave_config_create_voe_handler( |
|
808 |
ec_slave_config_t *sc, /**< Slave configuration. */ |
|
809 |
size_t size /**< Data size to reserve. */ |
|
810 |
); |
|
811 |
||
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
812 |
/** Outputs the state of the slave configuration. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
813 |
* |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
814 |
* Stores the state information in the given \a state structure. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
815 |
*/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
816 |
void ecrt_slave_config_state( |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
817 |
const ec_slave_config_t *sc, /**< Slave configuration */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
818 |
ec_slave_config_state_t *state /**< State object to write to. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
819 |
); |
325
7833cf70c4f2
VERSION 1.1: New realtime interface, only state machines.
Florian Pose <fp@igh-essen.com>
parents:
288
diff
changeset
|
820 |
|
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
821 |
/****************************************************************************** |
779 | 822 |
* Domain methods |
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
823 |
*****************************************************************************/ |
104
052bc82d5442
MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
824 |
|
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
825 |
/** Registers a bunch of PDO entries for a domain. |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
826 |
* |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
827 |
* \todo doc |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
828 |
* \attention The registration array has to be terminated with an empty |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
829 |
* structure, or one with the \a index field set to zero! |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
830 |
* \return 0 on success, else non-zero. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
831 |
*/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
832 |
int ecrt_domain_reg_pdo_entry_list( |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
833 |
ec_domain_t *domain, /**< Domain. */ |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
834 |
const ec_pdo_entry_reg_t *pdo_entry_regs /**< Array of PDO |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
835 |
registrations. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
836 |
); |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
837 |
|
1258
900f1124e8f8
Memory-mapped process data.
Florian Pose <fp@igh-essen.com>
parents:
1257
diff
changeset
|
838 |
#ifdef __KERNEL__ |
900f1124e8f8
Memory-mapped process data.
Florian Pose <fp@igh-essen.com>
parents:
1257
diff
changeset
|
839 |
|
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
840 |
/** Returns the current size of the domain's process data. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
841 |
* |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
842 |
* \return Size of the process data image. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
843 |
*/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
844 |
size_t ecrt_domain_size( |
1257
9844ac126275
Made ecrt_domain_size() const.
Florian Pose <fp@igh-essen.com>
parents:
1256
diff
changeset
|
845 |
const ec_domain_t *domain /**< Domain. */ |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
846 |
); |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
847 |
|
809 | 848 |
/** Provide external memory to store the domain's process data. |
849 |
* |
|
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
850 |
* Call this after all PDO entries have been registered and before activating |
809 | 851 |
* the master. |
852 |
* |
|
853 |
* The size of the allocated memory must be at least ecrt_domain_size(), after |
|
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
854 |
* all PDO entries have been registered. |
809 | 855 |
*/ |
856 |
void ecrt_domain_external_memory( |
|
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
857 |
ec_domain_t *domain, /**< Domain. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
858 |
uint8_t *memory /**< Address of the memory to store the process |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
859 |
data in. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
860 |
); |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
861 |
|
1248
3cc16b60a571
External memory only in kernel space.
Florian Pose <fp@igh-essen.com>
parents:
1244
diff
changeset
|
862 |
#endif /* __KERNEL__ */ |
3cc16b60a571
External memory only in kernel space.
Florian Pose <fp@igh-essen.com>
parents:
1244
diff
changeset
|
863 |
|
809 | 864 |
/** Returns the domain's process data. |
865 |
* |
|
1258
900f1124e8f8
Memory-mapped process data.
Florian Pose <fp@igh-essen.com>
parents:
1257
diff
changeset
|
866 |
* - In kernel context: If external memory was provided with |
900f1124e8f8
Memory-mapped process data.
Florian Pose <fp@igh-essen.com>
parents:
1257
diff
changeset
|
867 |
* ecrt_domain_external_memory(), the returned pointer will contain the |
900f1124e8f8
Memory-mapped process data.
Florian Pose <fp@igh-essen.com>
parents:
1257
diff
changeset
|
868 |
* address of that memory. Otherwise it will point to the internally allocated |
900f1124e8f8
Memory-mapped process data.
Florian Pose <fp@igh-essen.com>
parents:
1257
diff
changeset
|
869 |
* memory. In the latter case, this method may not be called before |
900f1124e8f8
Memory-mapped process data.
Florian Pose <fp@igh-essen.com>
parents:
1257
diff
changeset
|
870 |
* ecrt_master_activate(). |
900f1124e8f8
Memory-mapped process data.
Florian Pose <fp@igh-essen.com>
parents:
1257
diff
changeset
|
871 |
* |
900f1124e8f8
Memory-mapped process data.
Florian Pose <fp@igh-essen.com>
parents:
1257
diff
changeset
|
872 |
* - In userspace context: This method has to be called after |
900f1124e8f8
Memory-mapped process data.
Florian Pose <fp@igh-essen.com>
parents:
1257
diff
changeset
|
873 |
* ecrt_master_activate() to get the mapped domain process data memory. |
1256 | 874 |
* |
809 | 875 |
* \return Pointer to the process data memory. |
876 |
*/ |
|
877 |
uint8_t *ecrt_domain_data( |
|
878 |
ec_domain_t *domain /**< Domain. */ |
|
879 |
); |
|
880 |
||
886 | 881 |
/** Determines the states of the domain's datagrams. |
882 |
* |
|
883 |
* Evaluates the working counters of the received datagrams and outputs |
|
884 |
* statistics, if necessary. This must be called after ecrt_master_receive() |
|
885 |
* is expected to receive the domain datagrams in order to make |
|
886 |
* ecrt_domain_state() return the result of the last process data exchange. |
|
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
887 |
*/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
888 |
void ecrt_domain_process( |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
889 |
ec_domain_t *domain /**< Domain. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
890 |
); |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
891 |
|
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
892 |
/** (Re-)queues all domain datagrams in the master's datagram queue. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
893 |
* |
886 | 894 |
* Call this function to mark the domain's datagrams for exchanging at the |
895 |
* next call of ecrt_master_send(). |
|
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
896 |
*/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
897 |
void ecrt_domain_queue( |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
898 |
ec_domain_t *domain /**< Domain. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
899 |
); |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
900 |
|
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
901 |
/** Reads the state of a domain. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
902 |
* |
886 | 903 |
* Stores the domain state in the given \a state structure. |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
904 |
*/ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
905 |
void ecrt_domain_state( |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
906 |
const ec_domain_t *domain, /**< Domain. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
907 |
ec_domain_state_t *state /**< Pointer to a state object to store the |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
908 |
information. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
909 |
); |
635
d304ef4af542
Implemented alternative PDO mapping configuration interface.
Florian Pose <fp@igh-essen.com>
parents:
612
diff
changeset
|
910 |
|
858
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
911 |
/***************************************************************************** |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
912 |
* SDO request methods. |
858
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
913 |
****************************************************************************/ |
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
914 |
|
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
915 |
/** Set the timeout for an SDO request. |
858
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
916 |
* |
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
917 |
* If the request cannot be processed in the specified time, if will be marked |
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
918 |
* as failed. |
1113 | 919 |
* |
920 |
* The timeout is permanently stored in the request object and is valid until |
|
921 |
* the next call of this method. |
|
858
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
922 |
*/ |
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
923 |
void ecrt_sdo_request_timeout( |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
924 |
ec_sdo_request_t *req, /**< SDO request. */ |
880 | 925 |
uint32_t timeout /**< Timeout in milliseconds. Zero means no |
926 |
timeout. */ |
|
858
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
927 |
); |
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
928 |
|
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
929 |
/** Access to the SDO request's data. |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
930 |
* |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
931 |
* This function returns a pointer to the request's internal SDO data memory. |
868 | 932 |
* |
933 |
* - After a read operation was successful, integer data can be evaluated using |
|
934 |
* the EC_READ_*() macros as usual. Example: |
|
935 |
* \code |
|
936 |
* uint16_t value = EC_READ_U16(ecrt_sdo_request_data(sdo))); |
|
937 |
* \endcode |
|
938 |
* - If a write operation shall be triggered, the data have to be written to |
|
939 |
* the internal memory. Use the EC_WRITE_*() macros, if you are writing |
|
940 |
* integer data. Be sure, that the data fit into the memory. The memory size |
|
941 |
* is a parameter of ecrt_slave_config_create_sdo_request(). |
|
942 |
* \code |
|
943 |
* EC_WRITE_U16(ecrt_sdo_request_data(sdo), 0xFFFF); |
|
944 |
* \endcode |
|
945 |
* |
|
864 | 946 |
* \attention The return value can be invalid during a read operation, because |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
947 |
* the internal SDO data memory could be re-allocated if the read SDO data do |
864 | 948 |
* not fit inside. |
858
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
949 |
* |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
950 |
* \return Pointer to the internal SDO data memory. |
858
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
951 |
*/ |
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
952 |
uint8_t *ecrt_sdo_request_data( |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
953 |
ec_sdo_request_t *req /**< SDO request. */ |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
954 |
); |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
955 |
|
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
956 |
/** Returns the current SDO data size. |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
957 |
* |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
958 |
* When the SDO request is created, the data size is set to the size of the |
869
6c2f4130ed46
Added ecrt_sdo_request_data_size().
Florian Pose <fp@igh-essen.com>
parents:
868
diff
changeset
|
959 |
* reserved memory. After a read operation the size is set to the size of the |
6c2f4130ed46
Added ecrt_sdo_request_data_size().
Florian Pose <fp@igh-essen.com>
parents:
868
diff
changeset
|
960 |
* read data. The size is not modified in any other situation. |
6c2f4130ed46
Added ecrt_sdo_request_data_size().
Florian Pose <fp@igh-essen.com>
parents:
868
diff
changeset
|
961 |
* |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
962 |
* \return SDO data size in bytes. |
869
6c2f4130ed46
Added ecrt_sdo_request_data_size().
Florian Pose <fp@igh-essen.com>
parents:
868
diff
changeset
|
963 |
*/ |
6c2f4130ed46
Added ecrt_sdo_request_data_size().
Florian Pose <fp@igh-essen.com>
parents:
868
diff
changeset
|
964 |
size_t ecrt_sdo_request_data_size( |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
965 |
const ec_sdo_request_t *req /**< SDO request. */ |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
966 |
); |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
967 |
|
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
968 |
/** Get the current state of the SDO request. |
858
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
969 |
* |
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
970 |
* \return Request state. |
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
971 |
*/ |
1209 | 972 |
ec_request_state_t ecrt_sdo_request_state( |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
973 |
const ec_sdo_request_t *req /**< SDO request. */ |
858
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
974 |
); |
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
975 |
|
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
976 |
/** Schedule an SDO write operation. |
864 | 977 |
* |
978 |
* \attention This method may not be called while ecrt_sdo_request_state() |
|
979 |
* returns EC_SDO_REQUEST_BUSY. |
|
858
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
980 |
*/ |
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
981 |
void ecrt_sdo_request_write( |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
982 |
ec_sdo_request_t *req /**< SDO request. */ |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
983 |
); |
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
984 |
|
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
985 |
/** Schedule an SDO read operation. |
864 | 986 |
* |
987 |
* \attention This method may not be called while ecrt_sdo_request_state() |
|
988 |
* returns EC_SDO_REQUEST_BUSY. |
|
858
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
989 |
* |
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
990 |
* \attention After calling this function, the return value of |
864 | 991 |
* ecrt_sdo_request_data() must be considered as invalid while |
992 |
* ecrt_sdo_request_state() returns EC_SDO_REQUEST_BUSY. |
|
858
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
993 |
*/ |
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
994 |
void ecrt_sdo_request_read( |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
995 |
ec_sdo_request_t *req /**< SDO request. */ |
858
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
996 |
); |
69122084d066
Basic reading realtime Sdo access working.
Florian Pose <fp@igh-essen.com>
parents:
851
diff
changeset
|
997 |
|
1209 | 998 |
/***************************************************************************** |
999 |
* VoE handler methods. |
|
1000 |
****************************************************************************/ |
|
1001 |
||
1226
afb189516fcf
Introduced ecrt_voe_handler_received_header(); renamed
Florian Pose <fp@igh-essen.com>
parents:
1218
diff
changeset
|
1002 |
/** Sets the VoE header for future send operations. |
1218 | 1003 |
* |
1004 |
* A VoE message shall contain a 4-byte vendor ID, followed by a 2-byte vendor |
|
1267 | 1005 |
* type at as header. These numbers can be set with this function. The values |
1006 |
* are valid and will be used for future send operations until the next call |
|
1007 |
* of this method. |
|
1218 | 1008 |
*/ |
1226
afb189516fcf
Introduced ecrt_voe_handler_received_header(); renamed
Florian Pose <fp@igh-essen.com>
parents:
1218
diff
changeset
|
1009 |
void ecrt_voe_handler_send_header( |
1218 | 1010 |
ec_voe_handler_t *voe, /**< VoE handler. */ |
1011 |
uint32_t vendor_id, /**< Vendor ID. */ |
|
1012 |
uint16_t vendor_type /**< Vendor-specific type. */ |
|
1013 |
); |
|
1014 |
||
1226
afb189516fcf
Introduced ecrt_voe_handler_received_header(); renamed
Florian Pose <fp@igh-essen.com>
parents:
1218
diff
changeset
|
1015 |
/** Reads the header data of a received VoE message. |
afb189516fcf
Introduced ecrt_voe_handler_received_header(); renamed
Florian Pose <fp@igh-essen.com>
parents:
1218
diff
changeset
|
1016 |
* |
1267 | 1017 |
* This method can be used to get the received VoE header information after a |
1018 |
* read operation has succeeded. |
|
1226
afb189516fcf
Introduced ecrt_voe_handler_received_header(); renamed
Florian Pose <fp@igh-essen.com>
parents:
1218
diff
changeset
|
1019 |
* |
afb189516fcf
Introduced ecrt_voe_handler_received_header(); renamed
Florian Pose <fp@igh-essen.com>
parents:
1218
diff
changeset
|
1020 |
* The header information is stored at the memory given by the pointer |
afb189516fcf
Introduced ecrt_voe_handler_received_header(); renamed
Florian Pose <fp@igh-essen.com>
parents:
1218
diff
changeset
|
1021 |
* parameters. |
afb189516fcf
Introduced ecrt_voe_handler_received_header(); renamed
Florian Pose <fp@igh-essen.com>
parents:
1218
diff
changeset
|
1022 |
*/ |
afb189516fcf
Introduced ecrt_voe_handler_received_header(); renamed
Florian Pose <fp@igh-essen.com>
parents:
1218
diff
changeset
|
1023 |
void ecrt_voe_handler_received_header( |
afb189516fcf
Introduced ecrt_voe_handler_received_header(); renamed
Florian Pose <fp@igh-essen.com>
parents:
1218
diff
changeset
|
1024 |
const ec_voe_handler_t *voe, /**< VoE handler. */ |
afb189516fcf
Introduced ecrt_voe_handler_received_header(); renamed
Florian Pose <fp@igh-essen.com>
parents:
1218
diff
changeset
|
1025 |
uint32_t *vendor_id, /**< Vendor ID. */ |
afb189516fcf
Introduced ecrt_voe_handler_received_header(); renamed
Florian Pose <fp@igh-essen.com>
parents:
1218
diff
changeset
|
1026 |
uint16_t *vendor_type /**< Vendor-specific type. */ |
afb189516fcf
Introduced ecrt_voe_handler_received_header(); renamed
Florian Pose <fp@igh-essen.com>
parents:
1218
diff
changeset
|
1027 |
); |
afb189516fcf
Introduced ecrt_voe_handler_received_header(); renamed
Florian Pose <fp@igh-essen.com>
parents:
1218
diff
changeset
|
1028 |
|
1209 | 1029 |
/** Access to the VoE handler's data. |
1030 |
* |
|
1267 | 1031 |
* This function returns a pointer to the VoE handler's internal memory, that |
1032 |
* points to the actual VoE data right after the VoE header (see |
|
1033 |
* ecrt_voe_handler_send_header()). |
|
1209 | 1034 |
* |
1035 |
* - After a read operation was successful, the memory contains the received |
|
1036 |
* data. The size of the received data can be determined via |
|
1037 |
* ecrt_voe_handler_data_size(). |
|
1267 | 1038 |
* - Before a write operation is triggered, the data have to be written to the |
1039 |
* internal memory. Be sure, that the data fit into the memory. The reserved |
|
1209 | 1040 |
* memory size is a parameter of ecrt_slave_config_create_voe_handler(). |
1041 |
* |
|
1267 | 1042 |
* \attention The returned pointer is not necessarily persistent: After a read |
1043 |
* operation, the internal memory may have been reallocated. This can be |
|
1044 |
* avoided by reserving enough memory via the \a size parameter of |
|
1045 |
* ecrt_slave_config_create_voe_handler(). |
|
1046 |
* |
|
1209 | 1047 |
* \return Pointer to the internal memory. |
1048 |
*/ |
|
1049 |
uint8_t *ecrt_voe_handler_data( |
|
1050 |
ec_voe_handler_t *voe /**< VoE handler. */ |
|
1051 |
); |
|
1052 |
||
1053 |
/** Returns the current data size. |
|
1054 |
* |
|
1218 | 1055 |
* The data size is the size of the VoE data without the header (see |
1226
afb189516fcf
Introduced ecrt_voe_handler_received_header(); renamed
Florian Pose <fp@igh-essen.com>
parents:
1218
diff
changeset
|
1056 |
* ecrt_voe_handler_send_header()). |
1218 | 1057 |
* |
1209 | 1058 |
* When the VoE handler is created, the data size is set to the size of the |
1059 |
* reserved memory. At a write operation, the data size is set to the number |
|
1060 |
* of bytes to write. After a read operation the size is set to the size of |
|
1061 |
* the read data. The size is not modified in any other situation. |
|
1062 |
* |
|
1063 |
* \return Data size in bytes. |
|
1064 |
*/ |
|
1065 |
size_t ecrt_voe_handler_data_size( |
|
1066 |
const ec_voe_handler_t *voe /**< VoE handler. */ |
|
1067 |
); |
|
1068 |
||
1069 |
/** Start a VoE write operation. |
|
1070 |
* |
|
1071 |
* After this function has been called, the ecrt_voe_handler_execute() method |
|
1226
afb189516fcf
Introduced ecrt_voe_handler_received_header(); renamed
Florian Pose <fp@igh-essen.com>
parents:
1218
diff
changeset
|
1072 |
* must be called in every bus cycle as long as it returns EC_REQUEST_BUSY. No |
afb189516fcf
Introduced ecrt_voe_handler_received_header(); renamed
Florian Pose <fp@igh-essen.com>
parents:
1218
diff
changeset
|
1073 |
* other operation may be started while the handler is busy. |
1209 | 1074 |
*/ |
1075 |
void ecrt_voe_handler_write( |
|
1076 |
ec_voe_handler_t *voe, /**< VoE handler. */ |
|
1218 | 1077 |
size_t size /**< Number of bytes to write (without the VoE header). */ |
1209 | 1078 |
); |
1079 |
||
1080 |
/** Start a VoE read operation. |
|
1081 |
* |
|
1082 |
* After this function has been called, the ecrt_voe_handler_execute() method |
|
1226
afb189516fcf
Introduced ecrt_voe_handler_received_header(); renamed
Florian Pose <fp@igh-essen.com>
parents:
1218
diff
changeset
|
1083 |
* must be called in every bus cycle as long as it returns EC_REQUEST_BUSY. No |
afb189516fcf
Introduced ecrt_voe_handler_received_header(); renamed
Florian Pose <fp@igh-essen.com>
parents:
1218
diff
changeset
|
1084 |
* other operation may be started while the handler is busy. |
1209 | 1085 |
* |
1267 | 1086 |
* The state machine queries the slave's send mailbox for new data to be send |
1087 |
* to the master. If no data appear within the EC_VOE_RESPONSE_TIMEOUT |
|
1088 |
* (defined in master/voe_handler.c), the operation fails. |
|
1089 |
* |
|
1209 | 1090 |
* On success, the size of the read data can be determined via |
1226
afb189516fcf
Introduced ecrt_voe_handler_received_header(); renamed
Florian Pose <fp@igh-essen.com>
parents:
1218
diff
changeset
|
1091 |
* ecrt_voe_handler_data_size(), while the VoE header of the received data |
afb189516fcf
Introduced ecrt_voe_handler_received_header(); renamed
Florian Pose <fp@igh-essen.com>
parents:
1218
diff
changeset
|
1092 |
* can be retrieved with ecrt_voe_handler_received_header(). |
1209 | 1093 |
*/ |
1094 |
void ecrt_voe_handler_read( |
|
1095 |
ec_voe_handler_t *voe /**< VoE handler. */ |
|
1096 |
); |
|
1097 |
||
1314
b3d06a8807b3
Included ecrt_voe_handler_read_nosync()-Patch by Mathias Weber.
Florian Pose <fp@igh-essen.com>
parents:
1313
diff
changeset
|
1098 |
/** Start a VoE read operation without querying the sync manager status. |
b3d06a8807b3
Included ecrt_voe_handler_read_nosync()-Patch by Mathias Weber.
Florian Pose <fp@igh-essen.com>
parents:
1313
diff
changeset
|
1099 |
* |
b3d06a8807b3
Included ecrt_voe_handler_read_nosync()-Patch by Mathias Weber.
Florian Pose <fp@igh-essen.com>
parents:
1313
diff
changeset
|
1100 |
* After this function has been called, the ecrt_voe_handler_execute() method |
b3d06a8807b3
Included ecrt_voe_handler_read_nosync()-Patch by Mathias Weber.
Florian Pose <fp@igh-essen.com>
parents:
1313
diff
changeset
|
1101 |
* must be called in every bus cycle as long as it returns EC_REQUEST_BUSY. No |
b3d06a8807b3
Included ecrt_voe_handler_read_nosync()-Patch by Mathias Weber.
Florian Pose <fp@igh-essen.com>
parents:
1313
diff
changeset
|
1102 |
* other operation may be started while the handler is busy. |
b3d06a8807b3
Included ecrt_voe_handler_read_nosync()-Patch by Mathias Weber.
Florian Pose <fp@igh-essen.com>
parents:
1313
diff
changeset
|
1103 |
* |
b3d06a8807b3
Included ecrt_voe_handler_read_nosync()-Patch by Mathias Weber.
Florian Pose <fp@igh-essen.com>
parents:
1313
diff
changeset
|
1104 |
* The state machine queries the slave by sending an empty mailbox. The slave |
b3d06a8807b3
Included ecrt_voe_handler_read_nosync()-Patch by Mathias Weber.
Florian Pose <fp@igh-essen.com>
parents:
1313
diff
changeset
|
1105 |
* fills its data to the master in this mailbox. If no data appear within the |
b3d06a8807b3
Included ecrt_voe_handler_read_nosync()-Patch by Mathias Weber.
Florian Pose <fp@igh-essen.com>
parents:
1313
diff
changeset
|
1106 |
* EC_VOE_RESPONSE_TIMEOUT (defined in master/voe_handler.c), the operation |
b3d06a8807b3
Included ecrt_voe_handler_read_nosync()-Patch by Mathias Weber.
Florian Pose <fp@igh-essen.com>
parents:
1313
diff
changeset
|
1107 |
* fails. |
b3d06a8807b3
Included ecrt_voe_handler_read_nosync()-Patch by Mathias Weber.
Florian Pose <fp@igh-essen.com>
parents:
1313
diff
changeset
|
1108 |
* |
b3d06a8807b3
Included ecrt_voe_handler_read_nosync()-Patch by Mathias Weber.
Florian Pose <fp@igh-essen.com>
parents:
1313
diff
changeset
|
1109 |
* On success, the size of the read data can be determined via |
b3d06a8807b3
Included ecrt_voe_handler_read_nosync()-Patch by Mathias Weber.
Florian Pose <fp@igh-essen.com>
parents:
1313
diff
changeset
|
1110 |
* ecrt_voe_handler_data_size(), while the VoE header of the received data |
b3d06a8807b3
Included ecrt_voe_handler_read_nosync()-Patch by Mathias Weber.
Florian Pose <fp@igh-essen.com>
parents:
1313
diff
changeset
|
1111 |
* can be retrieved with ecrt_voe_handler_received_header(). |
b3d06a8807b3
Included ecrt_voe_handler_read_nosync()-Patch by Mathias Weber.
Florian Pose <fp@igh-essen.com>
parents:
1313
diff
changeset
|
1112 |
*/ |
b3d06a8807b3
Included ecrt_voe_handler_read_nosync()-Patch by Mathias Weber.
Florian Pose <fp@igh-essen.com>
parents:
1313
diff
changeset
|
1113 |
void ecrt_voe_handler_read_nosync( |
b3d06a8807b3
Included ecrt_voe_handler_read_nosync()-Patch by Mathias Weber.
Florian Pose <fp@igh-essen.com>
parents:
1313
diff
changeset
|
1114 |
ec_voe_handler_t *voe /**< VoE handler. */ |
b3d06a8807b3
Included ecrt_voe_handler_read_nosync()-Patch by Mathias Weber.
Florian Pose <fp@igh-essen.com>
parents:
1313
diff
changeset
|
1115 |
); |
b3d06a8807b3
Included ecrt_voe_handler_read_nosync()-Patch by Mathias Weber.
Florian Pose <fp@igh-essen.com>
parents:
1313
diff
changeset
|
1116 |
|
1209 | 1117 |
/** Execute the handler. |
1118 |
* |
|
1119 |
* This method executes the VoE handler. It has to be called in every bus cycle |
|
1120 |
* as long as it returns EC_REQUEST_BUSY. |
|
1121 |
* |
|
1122 |
* \return Handler state. |
|
1123 |
*/ |
|
1124 |
ec_request_state_t ecrt_voe_handler_execute( |
|
1125 |
ec_voe_handler_t *voe /**< VoE handler. */ |
|
1126 |
); |
|
1127 |
||
1288
bf0d42ca5aec
Wrapped c function in 'extern "C"' to make the library usable in C++
Florian Pose <fp@igh-essen.com>
parents:
1287
diff
changeset
|
1128 |
/*****************************************************************************/ |
bf0d42ca5aec
Wrapped c function in 'extern "C"' to make the library usable in C++
Florian Pose <fp@igh-essen.com>
parents:
1287
diff
changeset
|
1129 |
|
bf0d42ca5aec
Wrapped c function in 'extern "C"' to make the library usable in C++
Florian Pose <fp@igh-essen.com>
parents:
1287
diff
changeset
|
1130 |
#ifdef __cplusplus |
bf0d42ca5aec
Wrapped c function in 'extern "C"' to make the library usable in C++
Florian Pose <fp@igh-essen.com>
parents:
1287
diff
changeset
|
1131 |
} |
bf0d42ca5aec
Wrapped c function in 'extern "C"' to make the library usable in C++
Florian Pose <fp@igh-essen.com>
parents:
1287
diff
changeset
|
1132 |
#endif |
bf0d42ca5aec
Wrapped c function in 'extern "C"' to make the library usable in C++
Florian Pose <fp@igh-essen.com>
parents:
1287
diff
changeset
|
1133 |
|
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1134 |
/****************************************************************************** |
779 | 1135 |
* Bitwise read/write macros |
1136 |
*****************************************************************************/ |
|
1137 |
||
1138 |
/** Read a certain bit of an EtherCAT data byte. |
|
894
440c43d56b33
Improved EC_WRITE macros by replacing in-situ conversions
Florian Pose <fp@igh-essen.com>
parents:
893
diff
changeset
|
1139 |
* |
640
16e9ad7d8e12
Added parameters for vendor ID and product code to ecrt_get_slave(); PDO
Florian Pose <fp@igh-essen.com>
parents:
637
diff
changeset
|
1140 |
* \param DATA EtherCAT data pointer |
16e9ad7d8e12
Added parameters for vendor ID and product code to ecrt_get_slave(); PDO
Florian Pose <fp@igh-essen.com>
parents:
637
diff
changeset
|
1141 |
* \param POS bit position |
16e9ad7d8e12
Added parameters for vendor ID and product code to ecrt_get_slave(); PDO
Florian Pose <fp@igh-essen.com>
parents:
637
diff
changeset
|
1142 |
*/ |
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1143 |
#define EC_READ_BIT(DATA, POS) ((*((uint8_t *) (DATA)) >> (POS)) & 0x01) |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1144 |
|
779 | 1145 |
/** Write a certain bit of an EtherCAT data byte. |
894
440c43d56b33
Improved EC_WRITE macros by replacing in-situ conversions
Florian Pose <fp@igh-essen.com>
parents:
893
diff
changeset
|
1146 |
* |
640
16e9ad7d8e12
Added parameters for vendor ID and product code to ecrt_get_slave(); PDO
Florian Pose <fp@igh-essen.com>
parents:
637
diff
changeset
|
1147 |
* \param DATA EtherCAT data pointer |
16e9ad7d8e12
Added parameters for vendor ID and product code to ecrt_get_slave(); PDO
Florian Pose <fp@igh-essen.com>
parents:
637
diff
changeset
|
1148 |
* \param POS bit position |
16e9ad7d8e12
Added parameters for vendor ID and product code to ecrt_get_slave(); PDO
Florian Pose <fp@igh-essen.com>
parents:
637
diff
changeset
|
1149 |
* \param VAL new bit value |
16e9ad7d8e12
Added parameters for vendor ID and product code to ecrt_get_slave(); PDO
Florian Pose <fp@igh-essen.com>
parents:
637
diff
changeset
|
1150 |
*/ |
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1151 |
#define EC_WRITE_BIT(DATA, POS, VAL) \ |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1152 |
do { \ |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1153 |
if (VAL) *((uint8_t *) (DATA)) |= (1 << (POS)); \ |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1154 |
else *((uint8_t *) (DATA)) &= ~(1 << (POS)); \ |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1155 |
} while (0) |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1156 |
|
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1157 |
/****************************************************************************** |
1254
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1158 |
* Byte-swapping functions for user space |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1159 |
*****************************************************************************/ |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1160 |
|
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1161 |
#ifndef __KERNEL__ |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1162 |
|
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1163 |
#if __BYTE_ORDER == __LITTLE_ENDIAN |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1164 |
|
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1165 |
#define le16_to_cpu(x) x |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1166 |
#define le32_to_cpu(x) x |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1167 |
|
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1168 |
#define cpu_to_le16(x) x |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1169 |
#define cpu_to_le32(x) x |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1170 |
|
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1171 |
#elif __BYTE_ORDER == __BIG_ENDIAN |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1172 |
|
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1173 |
#define swap16(x) \ |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1174 |
((uint16_t)( \ |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1175 |
(((uint16_t)(x) & 0x00ffU) << 8) | \ |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1176 |
(((uint16_t)(x) & 0xff00U) >> 8) )) |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1177 |
#define swap32(x) \ |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1178 |
((uint32_t)( \ |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1179 |
(((uint32_t)(x) & 0x000000ffUL) << 24) | \ |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1180 |
(((uint32_t)(x) & 0x0000ff00UL) << 8) | \ |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1181 |
(((uint32_t)(x) & 0x00ff0000UL) >> 8) | \ |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1182 |
(((uint32_t)(x) & 0xff000000UL) >> 24) )) |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1183 |
|
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1184 |
#define le16_to_cpu(x) swap16(x) |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1185 |
#define le32_to_cpu(x) swap32(x) |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1186 |
|
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1187 |
#define cpu_to_le16(x) swap16(x) |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1188 |
#define cpu_to_le32(x) swap32(x) |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1189 |
|
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1190 |
#endif |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1191 |
|
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1192 |
#define le16_to_cpup(x) le16_to_cpu(*((uint16_t *)(x))) |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1193 |
#define le32_to_cpup(x) le32_to_cpu(*((uint32_t *)(x))) |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1194 |
|
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1195 |
#endif /* ifndef __KERNEL__ */ |
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1196 |
|
c19d273a9e76
Moved byteorder macros to ecrt.h.
Florian Pose <fp@igh-essen.com>
parents:
1248
diff
changeset
|
1197 |
/****************************************************************************** |
779 | 1198 |
* Read macros |
1199 |
*****************************************************************************/ |
|
1200 |
||
1201 |
/** Read an 8-bit unsigned value from EtherCAT data. |
|
894
440c43d56b33
Improved EC_WRITE macros by replacing in-situ conversions
Florian Pose <fp@igh-essen.com>
parents:
893
diff
changeset
|
1202 |
* |
779 | 1203 |
* \return EtherCAT data value |
1204 |
*/ |
|
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1205 |
#define EC_READ_U8(DATA) \ |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1206 |
((uint8_t) *((uint8_t *) (DATA))) |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1207 |
|
779 | 1208 |
/** Read an 8-bit signed value from EtherCAT data. |
894
440c43d56b33
Improved EC_WRITE macros by replacing in-situ conversions
Florian Pose <fp@igh-essen.com>
parents:
893
diff
changeset
|
1209 |
* |
779 | 1210 |
* \param DATA EtherCAT data pointer |
1211 |
* \return EtherCAT data value |
|
1212 |
*/ |
|
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1213 |
#define EC_READ_S8(DATA) \ |
288 | 1214 |
((int8_t) *((uint8_t *) (DATA))) |
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1215 |
|
779 | 1216 |
/** Read a 16-bit unsigned value from EtherCAT data. |
894
440c43d56b33
Improved EC_WRITE macros by replacing in-situ conversions
Florian Pose <fp@igh-essen.com>
parents:
893
diff
changeset
|
1217 |
* |
779 | 1218 |
* \param DATA EtherCAT data pointer |
1219 |
* \return EtherCAT data value |
|
1220 |
*/ |
|
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1221 |
#define EC_READ_U16(DATA) \ |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1222 |
((uint16_t) le16_to_cpup((void *) (DATA))) |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1223 |
|
779 | 1224 |
/** Read a 16-bit signed value from EtherCAT data. |
894
440c43d56b33
Improved EC_WRITE macros by replacing in-situ conversions
Florian Pose <fp@igh-essen.com>
parents:
893
diff
changeset
|
1225 |
* |
779 | 1226 |
* \param DATA EtherCAT data pointer |
1227 |
* \return EtherCAT data value |
|
1228 |
*/ |
|
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1229 |
#define EC_READ_S16(DATA) \ |
288 | 1230 |
((int16_t) le16_to_cpup((void *) (DATA))) |
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1231 |
|
779 | 1232 |
/** Read a 32-bit unsigned value from EtherCAT data. |
894
440c43d56b33
Improved EC_WRITE macros by replacing in-situ conversions
Florian Pose <fp@igh-essen.com>
parents:
893
diff
changeset
|
1233 |
* |
779 | 1234 |
* \param DATA EtherCAT data pointer |
1235 |
* \return EtherCAT data value |
|
1236 |
*/ |
|
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1237 |
#define EC_READ_U32(DATA) \ |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1238 |
((uint32_t) le32_to_cpup((void *) (DATA))) |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1239 |
|
779 | 1240 |
/** Read a 32-bit signed value from EtherCAT data. |
894
440c43d56b33
Improved EC_WRITE macros by replacing in-situ conversions
Florian Pose <fp@igh-essen.com>
parents:
893
diff
changeset
|
1241 |
* |
779 | 1242 |
* \param DATA EtherCAT data pointer |
1243 |
* \return EtherCAT data value |
|
1244 |
*/ |
|
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1245 |
#define EC_READ_S32(DATA) \ |
288 | 1246 |
((int32_t) le32_to_cpup((void *) (DATA))) |
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1247 |
|
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1248 |
/****************************************************************************** |
779 | 1249 |
* Write macros |
1250 |
*****************************************************************************/ |
|
1251 |
||
1252 |
/** Write an 8-bit unsigned value to EtherCAT data. |
|
894
440c43d56b33
Improved EC_WRITE macros by replacing in-situ conversions
Florian Pose <fp@igh-essen.com>
parents:
893
diff
changeset
|
1253 |
* |
779 | 1254 |
* \param DATA EtherCAT data pointer |
1255 |
* \param VAL new value |
|
1256 |
*/ |
|
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1257 |
#define EC_WRITE_U8(DATA, VAL) \ |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1258 |
do { \ |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1259 |
*((uint8_t *)(DATA)) = ((uint8_t) (VAL)); \ |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1260 |
} while (0) |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1261 |
|
779 | 1262 |
/** Write an 8-bit signed value to EtherCAT data. |
894
440c43d56b33
Improved EC_WRITE macros by replacing in-situ conversions
Florian Pose <fp@igh-essen.com>
parents:
893
diff
changeset
|
1263 |
* |
779 | 1264 |
* \param DATA EtherCAT data pointer |
1265 |
* \param VAL new value |
|
1266 |
*/ |
|
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1267 |
#define EC_WRITE_S8(DATA, VAL) EC_WRITE_U8(DATA, VAL) |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1268 |
|
779 | 1269 |
/** Write a 16-bit unsigned value to EtherCAT data. |
894
440c43d56b33
Improved EC_WRITE macros by replacing in-situ conversions
Florian Pose <fp@igh-essen.com>
parents:
893
diff
changeset
|
1270 |
* |
779 | 1271 |
* \param DATA EtherCAT data pointer |
1272 |
* \param VAL new value |
|
1273 |
*/ |
|
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1274 |
#define EC_WRITE_U16(DATA, VAL) \ |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1275 |
do { \ |
894
440c43d56b33
Improved EC_WRITE macros by replacing in-situ conversions
Florian Pose <fp@igh-essen.com>
parents:
893
diff
changeset
|
1276 |
*((uint16_t *) (DATA)) = cpu_to_le16((uint16_t) (VAL)); \ |
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1277 |
} while (0) |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1278 |
|
779 | 1279 |
/** Write a 16-bit signed value to EtherCAT data. |
894
440c43d56b33
Improved EC_WRITE macros by replacing in-situ conversions
Florian Pose <fp@igh-essen.com>
parents:
893
diff
changeset
|
1280 |
* |
779 | 1281 |
* \param DATA EtherCAT data pointer |
1282 |
* \param VAL new value |
|
1283 |
*/ |
|
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1284 |
#define EC_WRITE_S16(DATA, VAL) EC_WRITE_U16(DATA, VAL) |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1285 |
|
779 | 1286 |
/** Write a 32-bit unsigned value to EtherCAT data. |
894
440c43d56b33
Improved EC_WRITE macros by replacing in-situ conversions
Florian Pose <fp@igh-essen.com>
parents:
893
diff
changeset
|
1287 |
* |
779 | 1288 |
* \param DATA EtherCAT data pointer |
1289 |
* \param VAL new value |
|
1290 |
*/ |
|
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1291 |
#define EC_WRITE_U32(DATA, VAL) \ |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1292 |
do { \ |
894
440c43d56b33
Improved EC_WRITE macros by replacing in-situ conversions
Florian Pose <fp@igh-essen.com>
parents:
893
diff
changeset
|
1293 |
*((uint32_t *) (DATA)) = cpu_to_le32((uint32_t) (VAL)); \ |
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1294 |
} while (0) |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1295 |
|
779 | 1296 |
/** Write a 32-bit signed value to EtherCAT data. |
894
440c43d56b33
Improved EC_WRITE macros by replacing in-situ conversions
Florian Pose <fp@igh-essen.com>
parents:
893
diff
changeset
|
1297 |
* |
779 | 1298 |
* \param DATA EtherCAT data pointer |
1299 |
* \param VAL new value |
|
1300 |
*/ |
|
199
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1301 |
#define EC_WRITE_S32(DATA, VAL) EC_WRITE_U32(DATA, VAL) |
04ecf40fc2e9
Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents:
197
diff
changeset
|
1302 |
|
104
052bc82d5442
MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
1303 |
/*****************************************************************************/ |
052bc82d5442
MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
1304 |
|
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
1305 |
/** @} */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
786
diff
changeset
|
1306 |
|
104
052bc82d5442
MERGE branches/async -> trunk (alle Unterschiede ?bernommen)
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
1307 |
#endif |