IgH EtherCAT Master  1.5.2
sync.h
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * $Id$
4 *
5 * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH
6 *
7 * This file is part of the IgH EtherCAT Master.
8 *
9 * The IgH EtherCAT Master is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License version 2, as
11 * published by the Free Software Foundation.
12 *
13 * The IgH EtherCAT Master is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
16 * Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with the IgH EtherCAT Master; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 *
22 * ---
23 *
24 * The license mentioned above concerns the source code only. Using the
25 * EtherCAT technology and brand is only permitted in compliance with the
26 * industrial property and similar rights of Beckhoff Automation GmbH.
27 *
28 *****************************************************************************/
29
34/*****************************************************************************/
35
36#ifndef __EC_SYNC_H__
37#define __EC_SYNC_H__
38
39#include "globals.h"
40#include "pdo_list.h"
41#include "sync_config.h"
42
43/*****************************************************************************/
44
47typedef struct {
50 uint16_t default_length;
52 uint8_t enable;
54} ec_sync_t;
55
56/*****************************************************************************/
57
61void ec_sync_page(const ec_sync_t *, uint8_t, uint16_t,
62 const ec_sync_config_t *, uint8_t, uint8_t *);
63int ec_sync_add_pdo(ec_sync_t *, const ec_pdo_t *);
65
66/*****************************************************************************/
67
68#endif
Global definitions and macros.
ec_direction_t
Direction type for PDO assignment functions.
Definition: ecrt.h:430
EtherCAT PDO list structure.
EtherCAT PDO list.
Definition: pdo_list.h:49
PDO description.
Definition: pdo.h:49
EtherCAT slave.
Definition: slave.h:177
Sync manager configuration.
Definition: sync_config.h:46
Sync manager.
Definition: sync.h:47
uint16_t physical_start_address
Physical start address.
Definition: sync.h:49
uint8_t enable
Enable bit.
Definition: sync.h:52
ec_slave_t * slave
Slave, the sync manager belongs to.
Definition: sync.h:48
ec_pdo_list_t pdos
Current PDO assignment.
Definition: sync.h:53
uint16_t default_length
Data length in bytes.
Definition: sync.h:50
uint8_t control_register
Control register value.
Definition: sync.h:51
void ec_sync_init(ec_sync_t *, ec_slave_t *)
Constructor.
Definition: sync.c:46
void ec_sync_init_copy(ec_sync_t *, const ec_sync_t *)
Copy constructor.
Definition: sync.c:63
int ec_sync_add_pdo(ec_sync_t *, const ec_pdo_t *)
Adds a PDO to the list of known mapped PDOs.
Definition: sync.c:153
void ec_sync_page(const ec_sync_t *, uint8_t, uint16_t, const ec_sync_config_t *, uint8_t, uint8_t *)
Initializes a sync manager configuration page.
Definition: sync.c:94
ec_direction_t ec_sync_default_direction(const ec_sync_t *)
Determines the default direction from the control register.
Definition: sync.c:167
void ec_sync_clear(ec_sync_t *)
Destructor.
Definition: sync.c:81
EtherCAT sync manager.