fp@1831: /****************************************************************************** fp@1831: * fp@1831: * $Id$ fp@1831: * fp@1831: * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH fp@1831: * fp@1831: * This file is part of the IgH EtherCAT Master. fp@1831: * fp@1831: * The IgH EtherCAT Master is free software; you can redistribute it and/or fp@1831: * modify it under the terms of the GNU General Public License version 2, as fp@1831: * published by the Free Software Foundation. fp@1831: * fp@1831: * The IgH EtherCAT Master is distributed in the hope that it will be useful, fp@1831: * but WITHOUT ANY WARRANTY; without even the implied warranty of fp@1831: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General fp@1831: * Public License for more details. fp@1831: * fp@1831: * You should have received a copy of the GNU General Public License along fp@1831: * with the IgH EtherCAT Master; if not, write to the Free Software fp@1831: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA fp@1831: * fp@1831: * --- fp@1831: * fp@1831: * The license mentioned above concerns the source code only. Using the fp@1831: * EtherCAT technology and brand is only permitted in compliance with the fp@1831: * industrial property and similar rights of Beckhoff Automation GmbH. fp@1831: * fp@1831: *****************************************************************************/ fp@1831: fp@1831: /** fp@1831: \file fp@1831: EtherCAT SoE request structure. fp@1831: */ fp@1831: fp@1831: /*****************************************************************************/ fp@1831: fp@1831: #ifndef __EC_SOE_REQUEST_H__ fp@1831: #define __EC_SOE_REQUEST_H__ fp@1831: fp@1831: #include fp@1831: fp@1831: #include "globals.h" fp@1831: fp@1831: /*****************************************************************************/ fp@1831: fp@1831: /** Sercos-over-EtherCAT request. fp@1831: */ fp@1831: typedef struct { fp@1831: struct list_head list; /**< List item. */ fp@1952: uint8_t drive_no; /**< Drive number. */ fp@1831: uint16_t idn; /**< Sercos ID-Number. */ fp@1944: ec_al_state_t al_state; /**< AL state (only valid for IDN config). */ fp@1831: uint8_t *data; /**< Pointer to SDO data. */ fp@1831: size_t mem_size; /**< Size of SDO data memory. */ fp@1831: size_t data_size; /**< Size of SDO data. */ fp@1831: ec_direction_t dir; /**< Direction. EC_DIR_OUTPUT means writing to the fp@1831: slave, EC_DIR_INPUT means reading from the slave. */ fp@1831: ec_internal_request_state_t state; /**< Request state. */ fp@1831: unsigned long jiffies_sent; /**< Jiffies, when the upload/download fp@1831: request was sent. */ fp@1831: uint16_t error_code; /**< SoE error code. */ fp@1831: } ec_soe_request_t; fp@1831: fp@1831: /*****************************************************************************/ fp@1831: fp@1831: void ec_soe_request_init(ec_soe_request_t *); fp@1831: void ec_soe_request_clear(ec_soe_request_t *); fp@1831: fp@1843: int ec_soe_request_copy(ec_soe_request_t *, const ec_soe_request_t *); fp@1952: void ec_soe_request_set_drive_no(ec_soe_request_t *, uint8_t); fp@1831: void ec_soe_request_set_idn(ec_soe_request_t *, uint16_t); fp@1831: int ec_soe_request_alloc(ec_soe_request_t *, size_t); fp@1831: int ec_soe_request_copy_data(ec_soe_request_t *, const uint8_t *, size_t); fp@1864: int ec_soe_request_append_data(ec_soe_request_t *, const uint8_t *, size_t); fp@1831: void ec_soe_request_read(ec_soe_request_t *); fp@1831: void ec_soe_request_write(ec_soe_request_t *); fp@1831: fp@1831: /*****************************************************************************/ fp@1831: fp@1831: #endif