master/reg_request.h
branchstable-1.5
changeset 2443 2c3ccdde3919
child 2522 ec403cf308eb
equal deleted inserted replaced
2442:86ebf18a029f 2443:2c3ccdde3919
       
     1 /******************************************************************************
       
     2  *
       
     3  *  $Id$
       
     4  *
       
     5  *  Copyright (C) 2012  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 
       
    30 /**
       
    31    \file
       
    32    EtherCAT register request structure.
       
    33 */
       
    34 
       
    35 /*****************************************************************************/
       
    36 
       
    37 #ifndef __EC_REG_REQUEST_H__
       
    38 #define __EC_REG_REQUEST_H__
       
    39 
       
    40 #include <linux/list.h>
       
    41 
       
    42 #include "globals.h"
       
    43 
       
    44 /*****************************************************************************/
       
    45 
       
    46 /** Register request.
       
    47  */
       
    48 struct ec_reg_request {
       
    49     struct list_head list; /**< List item. */
       
    50     size_t mem_size; /**< Size of data memory. */
       
    51     uint8_t *data; /**< Pointer to data memory. */
       
    52     ec_direction_t dir; /**< Direction. EC_DIR_OUTPUT means writing to the
       
    53                           slave, EC_DIR_INPUT means reading from the slave. */
       
    54     uint16_t address; /**< Register address. */
       
    55     size_t transfer_size; /*< Size of the data to transfer. */
       
    56     ec_internal_request_state_t state; /**< Request state. */
       
    57 };
       
    58 
       
    59 /*****************************************************************************/
       
    60 
       
    61 int ec_reg_request_init(ec_reg_request_t *, size_t);
       
    62 void ec_reg_request_clear(ec_reg_request_t *);
       
    63 
       
    64 /*****************************************************************************/
       
    65 
       
    66 #endif