fp@409: /****************************************************************************** fp@409: * fp@409: * $Id$ fp@409: * fp@1326: * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH fp@409: * fp@409: * This file is part of the IgH EtherCAT Master. fp@409: * 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@409: * 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@409: * 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@409: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA fp@409: * 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@409: * fp@409: *****************************************************************************/ fp@409: fp@409: /** fp@409: \file fp@1327: EtherCAT CANopen SDO request structure. fp@409: */ fp@409: fp@409: /*****************************************************************************/ fp@409: fp@847: #ifndef __EC_SDO_REQUEST_H__ fp@847: #define __EC_SDO_REQUEST_H__ fp@409: fp@409: #include fp@409: fp@409: #include "globals.h" fp@409: fp@409: /*****************************************************************************/ fp@409: fp@1327: /** CANopen SDO request. fp@831: */ fp@858: struct ec_sdo_request { fp@847: struct list_head list; /**< List item. */ fp@1327: uint16_t index; /**< SDO index. */ fp@1327: uint8_t subindex; /**< SDO subindex. */ fp@1327: uint8_t *data; /**< Pointer to SDO data. */ fp@1327: size_t mem_size; /**< Size of SDO data memory. */ fp@1327: size_t data_size; /**< Size of SDO data. */ fp@1526: uint8_t complete_access; /**< SDO shall be transferred completely. */ fp@1035: uint32_t issue_timeout; /**< Maximum time in ms, the processing of the fp@1035: request may take. */ fp@1035: uint32_t response_timeout; /**< Maximum time in ms, the transfer is fp@1035: retried, if the slave does not respond. */ fp@859: ec_direction_t dir; /**< Direction. EC_DIR_OUTPUT means downloading to fp@859: the slave, EC_DIR_INPUT means uploading from the fp@859: slave. */ fp@1327: ec_internal_request_state_t state; /**< SDO request state. */ fp@1035: unsigned long jiffies_start; /**< Jiffies, when the request was issued. */ fp@1035: unsigned long jiffies_sent; /**< Jiffies, when the upload/download fp@1035: request was sent. */ fp@1948: int errno; /**< Error number. */ fp@1327: uint32_t abort_code; /**< SDO request abort code. Zero on success. */ fp@858: }; fp@430: fp@430: /*****************************************************************************/ fp@430: fp@852: void ec_sdo_request_init(ec_sdo_request_t *); fp@739: void ec_sdo_request_clear(ec_sdo_request_t *); fp@739: fp@1318: int ec_sdo_request_copy(ec_sdo_request_t *, const ec_sdo_request_t *); fp@854: int ec_sdo_request_alloc(ec_sdo_request_t *, size_t); fp@854: int ec_sdo_request_copy_data(ec_sdo_request_t *, const uint8_t *, size_t); fp@880: int ec_sdo_request_timed_out(const ec_sdo_request_t *); fp@854: fp@409: /*****************************************************************************/ fp@409: fp@409: #endif