fp@628: /****************************************************************************** fp@628: * fp@628: * $Id$ fp@628: * fp@1326: * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH fp@628: * fp@628: * This file is part of the IgH EtherCAT Master. fp@628: * fp@1326: * The IgH EtherCAT Master is free software; you can redistribute it and/or fp@1326: * modify it under the terms of the GNU General Public License version 2, as fp@1326: * published by the Free Software Foundation. fp@628: * fp@1326: * The IgH EtherCAT Master is distributed in the hope that it will be useful, fp@1326: * but WITHOUT ANY WARRANTY; without even the implied warranty of fp@1326: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General fp@1326: * Public License for more details. fp@628: * fp@1326: * You should have received a copy of the GNU General Public License along fp@1326: * with the IgH EtherCAT Master; if not, write to the Free Software fp@628: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA fp@628: * fp@1363: * --- fp@1363: * fp@1363: * The license mentioned above concerns the source code only. Using the fp@1363: * EtherCAT technology and brand is only permitted in compliance with the fp@1363: * industrial property and similar rights of Beckhoff Automation GmbH. fp@628: * fp@628: *****************************************************************************/ fp@628: fp@792: /** \file fp@792: * EtherCAT sync manager. fp@792: */ fp@628: fp@628: /*****************************************************************************/ fp@628: fp@883: #ifndef __EC_SYNC_H__ fp@883: #define __EC_SYNC_H__ fp@628: fp@628: #include "globals.h" fp@879: #include "pdo_list.h" fp@1509: #include "sync_config.h" fp@628: fp@628: /*****************************************************************************/ fp@628: fp@792: /** Sync manager. fp@762: */ fp@792: typedef struct { fp@792: ec_slave_t *slave; /**< Slave, the sync manager belongs to. */ fp@792: uint16_t physical_start_address; /**< Physical start address. */ fp@1055: uint16_t default_length; /**< Data length in bytes. */ fp@792: uint8_t control_register; /**< Control register value. */ fp@792: uint8_t enable; /**< Enable bit. */ fp@1327: ec_pdo_list_t pdos; /**< Current PDO assignment. */ fp@792: } ec_sync_t; fp@628: fp@628: /*****************************************************************************/ fp@628: fp@1055: void ec_sync_init(ec_sync_t *, ec_slave_t *); fp@873: void ec_sync_init_copy(ec_sync_t *, const ec_sync_t *); fp@628: void ec_sync_clear(ec_sync_t *); fp@1509: void ec_sync_page(const ec_sync_t *, uint8_t, uint16_t, fp@2123: const ec_sync_config_t *, uint8_t, uint8_t *); fp@635: int ec_sync_add_pdo(ec_sync_t *, const ec_pdo_t *); fp@1055: ec_direction_t ec_sync_default_direction(const ec_sync_t *); fp@748: fp@628: /*****************************************************************************/ fp@628: fp@628: #endif