master/command.h
branchstable-1.0
changeset 1619 0d4119024f55
parent 1618 5cff10efb927
equal deleted inserted replaced
1618:5cff10efb927 1619:0d4119024f55
     6  *
     6  *
     7  *  This file is part of the IgH EtherCAT Master.
     7  *  This file is part of the IgH EtherCAT Master.
     8  *
     8  *
     9  *  The IgH EtherCAT Master is free software; you can redistribute it
     9  *  The IgH EtherCAT Master is free software; you can redistribute it
    10  *  and/or modify it under the terms of the GNU General Public License
    10  *  and/or modify it under the terms of the GNU General Public License
    11  *  as published by the Free Software Foundation; version 2 of the License.
    11  *  as published by the Free Software Foundation; either version 2 of the
       
    12  *  License, or (at your option) any later version.
    12  *
    13  *
    13  *  The IgH EtherCAT Master is distributed in the hope that it will be
    14  *  The IgH EtherCAT Master is distributed in the hope that it will be
    14  *  useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
    15  *  useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
    15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16  *  GNU General Public License for more details.
    17  *  GNU General Public License for more details.
    17  *
    18  *
    18  *  You should have received a copy of the GNU General Public License
    19  *  You should have received a copy of the GNU General Public License
    19  *  along with the IgH EtherCAT Master; if not, write to the Free Software
    20  *  along 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  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
       
    22  *
       
    23  *  The right to use EtherCAT Technology is granted and comes free of
       
    24  *  charge under condition of compatibility of product made by
       
    25  *  Licensee. People intending to distribute/sell products based on the
       
    26  *  code, have to sign an agreement to guarantee that products using
       
    27  *  software based on IgH EtherCAT master stay compatible with the actual
       
    28  *  EtherCAT specification (which are released themselves as an open
       
    29  *  standard) as the (only) precondition to have the right to use EtherCAT
       
    30  *  Technology, IP and trade marks.
    21  *
    31  *
    22  *****************************************************************************/
    32  *****************************************************************************/
    23 
    33 
    24 /**
    34 /**
    25    \file
    35    \file
    30 
    40 
    31 #ifndef _EC_COMMAND_H_
    41 #ifndef _EC_COMMAND_H_
    32 #define _EC_COMMAND_H_
    42 #define _EC_COMMAND_H_
    33 
    43 
    34 #include <linux/list.h>
    44 #include <linux/list.h>
       
    45 #include <linux/timex.h>
    35 
    46 
    36 #include "globals.h"
    47 #include "globals.h"
    37 
    48 
    38 /*****************************************************************************/
    49 /*****************************************************************************/
    39 
    50 
   104     size_t mem_size; /**< command \a data memory size */
   115     size_t mem_size; /**< command \a data memory size */
   105     size_t data_size; /**< size of the data in \a data */
   116     size_t data_size; /**< size of the data in \a data */
   106     uint8_t index; /**< command index (set by master) */
   117     uint8_t index; /**< command index (set by master) */
   107     uint16_t working_counter; /**< working counter */
   118     uint16_t working_counter; /**< working counter */
   108     ec_command_state_t state; /**< command state */
   119     ec_command_state_t state; /**< command state */
       
   120     cycles_t t_sent; /**< time, the commands was sent */
   109 }
   121 }
   110 ec_command_t;
   122 ec_command_t;
   111 
   123 
   112 /*****************************************************************************/
   124 /*****************************************************************************/
   113 
   125 
   114 void ec_command_init(ec_command_t *);
   126 void ec_command_init(ec_command_t *);
   115 void ec_command_clear(ec_command_t *);
   127 void ec_command_clear(ec_command_t *);
       
   128 int ec_command_prealloc(ec_command_t *, size_t);
   116 
   129 
   117 int ec_command_nprd(ec_command_t *, uint16_t, uint16_t, size_t);
   130 int ec_command_nprd(ec_command_t *, uint16_t, uint16_t, size_t);
   118 int ec_command_npwr(ec_command_t *, uint16_t, uint16_t, size_t);
   131 int ec_command_npwr(ec_command_t *, uint16_t, uint16_t, size_t);
   119 int ec_command_aprd(ec_command_t *, uint16_t, uint16_t, size_t);
   132 int ec_command_aprd(ec_command_t *, uint16_t, uint16_t, size_t);
   120 int ec_command_apwr(ec_command_t *, uint16_t, uint16_t, size_t);
   133 int ec_command_apwr(ec_command_t *, uint16_t, uint16_t, size_t);