author | Florian Pose <fp@igh-essen.com> |
Tue, 27 Apr 2010 10:30:31 +0200 | |
changeset 1912 | d480e0439664 |
parent 1509 | a864688e7de5 |
child 2123 | 4c335a1d4db0 |
child 2149 | 98e1e773bed0 |
permissions | -rw-r--r-- |
628
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
1 |
/****************************************************************************** |
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
2 |
* |
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
3 |
* $Id$ |
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
4 |
* |
1326
ef907b0b5125
merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents:
1209
diff
changeset
|
5 |
* Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH |
628
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
6 |
* |
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
7 |
* This file is part of the IgH EtherCAT Master. |
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
8 |
* |
1326
ef907b0b5125
merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents:
1209
diff
changeset
|
9 |
* The IgH EtherCAT Master is free software; you can redistribute it and/or |
ef907b0b5125
merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents:
1209
diff
changeset
|
10 |
* modify it under the terms of the GNU General Public License version 2, as |
ef907b0b5125
merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents:
1209
diff
changeset
|
11 |
* published by the Free Software Foundation. |
628
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
12 |
* |
1326
ef907b0b5125
merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents:
1209
diff
changeset
|
13 |
* The IgH EtherCAT Master is distributed in the hope that it will be useful, |
ef907b0b5125
merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents:
1209
diff
changeset
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
ef907b0b5125
merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents:
1209
diff
changeset
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
ef907b0b5125
merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents:
1209
diff
changeset
|
16 |
* Public License for more details. |
628
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
17 |
* |
1326
ef907b0b5125
merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents:
1209
diff
changeset
|
18 |
* You should have received a copy of the GNU General Public License along |
ef907b0b5125
merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents:
1209
diff
changeset
|
19 |
* with the IgH EtherCAT Master; if not, write to the Free Software |
628
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
20 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
21 |
* |
1363
11c0b2caa253
Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
22 |
* --- |
11c0b2caa253
Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
23 |
* |
11c0b2caa253
Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
24 |
* The license mentioned above concerns the source code only. Using the |
11c0b2caa253
Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
25 |
* EtherCAT technology and brand is only permitted in compliance with the |
11c0b2caa253
Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents:
1327
diff
changeset
|
26 |
* industrial property and similar rights of Beckhoff Automation GmbH. |
628
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
27 |
* |
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
28 |
*****************************************************************************/ |
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
29 |
|
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
762
diff
changeset
|
30 |
/** \file |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
762
diff
changeset
|
31 |
* EtherCAT sync manager. |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
762
diff
changeset
|
32 |
*/ |
628
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
33 |
|
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
34 |
/*****************************************************************************/ |
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
35 |
|
883
4963e22a267a
Equalized defines against duplicated header inclusion.
Florian Pose <fp@igh-essen.com>
parents:
879
diff
changeset
|
36 |
#ifndef __EC_SYNC_H__ |
4963e22a267a
Equalized defines against duplicated header inclusion.
Florian Pose <fp@igh-essen.com>
parents:
879
diff
changeset
|
37 |
#define __EC_SYNC_H__ |
628
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
38 |
|
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
39 |
#include "globals.h" |
879
9b395c5646ab
Changed terms "Pdo mapping" -> "Pdo assignment" and "Pdo configuration"
Florian Pose <fp@igh-essen.com>
parents:
873
diff
changeset
|
40 |
#include "pdo_list.h" |
1509
a864688e7de5
Added watchdog configuration via application interface (thanks to J. Mohre).
Florian Pose <fp@igh-essen.com>
parents:
1363
diff
changeset
|
41 |
#include "sync_config.h" |
628
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
42 |
|
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
43 |
/*****************************************************************************/ |
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
44 |
|
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
762
diff
changeset
|
45 |
/** Sync manager. |
762
15214036c72a
Store PDO mapping source in sync manager.
Florian Pose <fp@igh-essen.com>
parents:
748
diff
changeset
|
46 |
*/ |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
762
diff
changeset
|
47 |
typedef struct { |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
762
diff
changeset
|
48 |
ec_slave_t *slave; /**< Slave, the sync manager belongs to. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
762
diff
changeset
|
49 |
uint16_t physical_start_address; /**< Physical start address. */ |
1055
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
883
diff
changeset
|
50 |
uint16_t default_length; /**< Data length in bytes. */ |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
762
diff
changeset
|
51 |
uint8_t control_register; /**< Control register value. */ |
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
762
diff
changeset
|
52 |
uint8_t enable; /**< Enable bit. */ |
1327
4d179b06dd3c
merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents:
1326
diff
changeset
|
53 |
ec_pdo_list_t pdos; /**< Current PDO assignment. */ |
792
3778920f61e4
Implemented most realtime interface changes for version 1.4, improved
Florian Pose <fp@igh-essen.com>
parents:
762
diff
changeset
|
54 |
} ec_sync_t; |
628
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
55 |
|
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
56 |
/*****************************************************************************/ |
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
57 |
|
1055
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
883
diff
changeset
|
58 |
void ec_sync_init(ec_sync_t *, ec_slave_t *); |
873
ec01ba291896
Fixed bug in copying sync managers. Now making a deep copy.
Florian Pose <fp@igh-essen.com>
parents:
814
diff
changeset
|
59 |
void ec_sync_init_copy(ec_sync_t *, const ec_sync_t *); |
628
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
60 |
void ec_sync_clear(ec_sync_t *); |
1509
a864688e7de5
Added watchdog configuration via application interface (thanks to J. Mohre).
Florian Pose <fp@igh-essen.com>
parents:
1363
diff
changeset
|
61 |
void ec_sync_page(const ec_sync_t *, uint8_t, uint16_t, |
a864688e7de5
Added watchdog configuration via application interface (thanks to J. Mohre).
Florian Pose <fp@igh-essen.com>
parents:
1363
diff
changeset
|
62 |
const ec_sync_config_t *, uint8_t *); |
635
d304ef4af542
Implemented alternative PDO mapping configuration interface.
Florian Pose <fp@igh-essen.com>
parents:
629
diff
changeset
|
63 |
int ec_sync_add_pdo(ec_sync_t *, const ec_pdo_t *); |
1055
2be8918682fa
Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents:
883
diff
changeset
|
64 |
ec_direction_t ec_sync_default_direction(const ec_sync_t *); |
748
6c8801bd547f
Added ec_sync_get_pdo_type().
Florian Pose <fp@igh-essen.com>
parents:
635
diff
changeset
|
65 |
|
628
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
66 |
/*****************************************************************************/ |
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
67 |
|
e94a16bc52ce
Layed out sync manager structures and methods into own files.
Florian Pose <fp@igh-essen.com>
parents:
diff
changeset
|
68 |
#endif |