master/ioctl.h
author Florian Pose <fp@igh-essen.com>
Fri, 04 Jul 2008 12:05:21 +0000
changeset 1091 363205c2ebaf
parent 1082 ff06c58e269c
child 1109 11ac4051db6b
permissions -rw-r--r--
Improved doc; removed BACKUP variables.
922
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     1
/******************************************************************************
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     2
 *
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     3
 *  $Id$
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     4
 *
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     5
 *  Copyright (C) 2006  Florian Pose, Ingenieurgemeinschaft IgH
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     6
 *
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     7
 *  This file is part of the IgH EtherCAT Master.
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     8
 *
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     9
 *  The IgH EtherCAT Master is free software; you can redistribute it
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    10
 *  and/or modify it under the terms of the GNU General Public License
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    11
 *  as published by the Free Software Foundation; either version 2 of the
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    12
 *  License, or (at your option) any later version.
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    13
 *
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    14
 *  The IgH EtherCAT Master is distributed in the hope that it will be
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    15
 *  useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    16
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    17
 *  GNU General Public License for more details.
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    18
 *
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    19
 *  You should have received a copy of the GNU General Public License
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    20
 *  along with the IgH EtherCAT Master; if not, write to the Free Software
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    21
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    22
 *
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    23
 *  The right to use EtherCAT Technology is granted and comes free of
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    24
 *  charge under condition of compatibility of product made by
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    25
 *  Licensee. People intending to distribute/sell products based on the
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    26
 *  code, have to sign an agreement to guarantee that products using
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    27
 *  software based on IgH EtherCAT master stay compatible with the actual
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    28
 *  EtherCAT specification (which are released themselves as an open
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    29
 *  standard) as the (only) precondition to have the right to use EtherCAT
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    30
 *  Technology, IP and trade marks.
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    31
 *
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    32
 *****************************************************************************/
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    33
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    34
/**
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    35
   \file
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    36
   EtherCAT master character device IOCTL commands.
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    37
*/
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    38
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    39
/*****************************************************************************/
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    40
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    41
#ifndef __EC_IOCTL_H__
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    42
#define __EC_IOCTL_H__
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    43
971
d169890332fe Using Linux ioctl() number generation macros.
Florian Pose <fp@igh-essen.com>
parents: 968
diff changeset
    44
#include <linux/ioctl.h>
d169890332fe Using Linux ioctl() number generation macros.
Florian Pose <fp@igh-essen.com>
parents: 968
diff changeset
    45
989
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 987
diff changeset
    46
#include "globals.h"
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 987
diff changeset
    47
971
d169890332fe Using Linux ioctl() number generation macros.
Florian Pose <fp@igh-essen.com>
parents: 968
diff changeset
    48
/*****************************************************************************/
d169890332fe Using Linux ioctl() number generation macros.
Florian Pose <fp@igh-essen.com>
parents: 968
diff changeset
    49
1082
ff06c58e269c Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents: 1079
diff changeset
    50
/** \cond */
ff06c58e269c Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents: 1079
diff changeset
    51
1079
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    52
#define EC_IOCTL_TYPE 0xa4
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    53
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    54
#define EC_IO(nr)           _IO(EC_IOCTL_TYPE, nr)
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    55
#define EC_IOR(nr, type)   _IOR(EC_IOCTL_TYPE, nr, type)
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    56
#define EC_IOW(nr, type)   _IOW(EC_IOCTL_TYPE, nr, type)
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    57
#define EC_IOWR(nr, type) _IOWR(EC_IOCTL_TYPE, nr, type)
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    58
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    59
#define EC_IOCTL_MASTER                EC_IOR(0x00, ec_ioctl_master_t)
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    60
#define EC_IOCTL_SLAVE                EC_IOWR(0x01, ec_ioctl_slave_t)
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    61
#define EC_IOCTL_SLAVE_SYNC           EC_IOWR(0x02, ec_ioctl_slave_sync_t)
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    62
#define EC_IOCTL_SLAVE_SYNC_PDO       EC_IOWR(0x03, ec_ioctl_slave_sync_pdo_t)
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    63
#define EC_IOCTL_SLAVE_SYNC_PDO_ENTRY EC_IOWR(0x04, ec_ioctl_slave_sync_pdo_entry_t)
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    64
#define EC_IOCTL_DOMAIN               EC_IOWR(0x05, ec_ioctl_domain_t)
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    65
#define EC_IOCTL_DOMAIN_FMMU          EC_IOWR(0x06, ec_ioctl_domain_fmmu_t)
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    66
#define EC_IOCTL_DOMAIN_DATA          EC_IOWR(0x07, ec_ioctl_domain_data_t)
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    67
#define EC_IOCTL_MASTER_DEBUG           EC_IO(0x08)
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    68
#define EC_IOCTL_SLAVE_STATE           EC_IOW(0x09, ec_ioctl_slave_state_t)
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    69
#define EC_IOCTL_SLAVE_SDO            EC_IOWR(0x0a, ec_ioctl_slave_sdo_t)
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    70
#define EC_IOCTL_SLAVE_SDO_ENTRY      EC_IOWR(0x0b, ec_ioctl_slave_sdo_entry_t)
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    71
#define EC_IOCTL_SLAVE_SDO_UPLOAD     EC_IOWR(0x0c, ec_ioctl_slave_sdo_upload_t)
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    72
#define EC_IOCTL_SLAVE_SDO_DOWNLOAD   EC_IOWR(0x0d, ec_ioctl_slave_sdo_download_t)
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    73
#define EC_IOCTL_SLAVE_SII_READ       EC_IOWR(0x0e, ec_ioctl_slave_sii_t)
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    74
#define EC_IOCTL_SLAVE_SII_WRITE       EC_IOW(0x0f, ec_ioctl_slave_sii_t)
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    75
#define EC_IOCTL_CONFIG               EC_IOWR(0x10, ec_ioctl_config_t)
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    76
#define EC_IOCTL_CONFIG_PDO           EC_IOWR(0x11, ec_ioctl_config_pdo_t)
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    77
#define EC_IOCTL_CONFIG_PDO_ENTRY     EC_IOWR(0x12, ec_ioctl_config_pdo_entry_t)
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
    78
#define EC_IOCTL_CONFIG_SDO           EC_IOWR(0x13, ec_ioctl_config_sdo_t)
990
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
    79
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
    80
#define EC_IOCTL_STRING_SIZE 64
978
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
    81
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
    82
/*****************************************************************************/
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
    83
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
    84
typedef struct {
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
    85
    uint32_t slave_count;
990
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
    86
    uint32_t config_count;
1001
a8eab75aa8e3 Removed EC_IOCTL_DOMAIN_COUNT.
Florian Pose <fp@igh-essen.com>
parents: 990
diff changeset
    87
    uint32_t domain_count;
1029
61ffe5f22306 Renamed master 'mode' to 'phase'.
Florian Pose <fp@igh-essen.com>
parents: 1001
diff changeset
    88
    uint8_t phase;
957
ed5ac2e83495 Replaced EC_IOCTL_SLAVE_COUNT with EC_IOCTL_MASTER; implemented
Florian Pose <fp@igh-essen.com>
parents: 956
diff changeset
    89
    struct {
ed5ac2e83495 Replaced EC_IOCTL_SLAVE_COUNT with EC_IOCTL_MASTER; implemented
Florian Pose <fp@igh-essen.com>
parents: 956
diff changeset
    90
        uint8_t address[6];
ed5ac2e83495 Replaced EC_IOCTL_SLAVE_COUNT with EC_IOCTL_MASTER; implemented
Florian Pose <fp@igh-essen.com>
parents: 956
diff changeset
    91
        uint8_t attached;
978
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
    92
        uint32_t tx_count;
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
    93
        uint32_t rx_count;
957
ed5ac2e83495 Replaced EC_IOCTL_SLAVE_COUNT with EC_IOCTL_MASTER; implemented
Florian Pose <fp@igh-essen.com>
parents: 956
diff changeset
    94
    } devices[2];
ed5ac2e83495 Replaced EC_IOCTL_SLAVE_COUNT with EC_IOCTL_MASTER; implemented
Florian Pose <fp@igh-essen.com>
parents: 956
diff changeset
    95
} ec_ioctl_master_t;
ed5ac2e83495 Replaced EC_IOCTL_SLAVE_COUNT with EC_IOCTL_MASTER; implemented
Florian Pose <fp@igh-essen.com>
parents: 956
diff changeset
    96
ed5ac2e83495 Replaced EC_IOCTL_SLAVE_COUNT with EC_IOCTL_MASTER; implemented
Florian Pose <fp@igh-essen.com>
parents: 956
diff changeset
    97
/*****************************************************************************/
ed5ac2e83495 Replaced EC_IOCTL_SLAVE_COUNT with EC_IOCTL_MASTER; implemented
Florian Pose <fp@igh-essen.com>
parents: 956
diff changeset
    98
935
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
    99
typedef struct {
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   100
    // input
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   101
    uint16_t position;
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   102
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   103
    // outputs
922
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   104
    uint32_t vendor_id;
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   105
    uint32_t product_code;
938
5b936e8e39fa Added 'xml' command to generate a slave description file from a real
Florian Pose <fp@igh-essen.com>
parents: 935
diff changeset
   106
    uint32_t revision_number;
5b936e8e39fa Added 'xml' command to generate a slave description file from a real
Florian Pose <fp@igh-essen.com>
parents: 935
diff changeset
   107
    uint32_t serial_number;
922
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   108
    uint16_t alias;
989
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 987
diff changeset
   109
    uint16_t rx_mailbox_offset;
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 987
diff changeset
   110
    uint16_t rx_mailbox_size;
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 987
diff changeset
   111
    uint16_t tx_mailbox_offset;
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 987
diff changeset
   112
    uint16_t tx_mailbox_size;
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 987
diff changeset
   113
    uint16_t mailbox_protocols;
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 987
diff changeset
   114
    uint8_t has_general_category;
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 987
diff changeset
   115
    ec_sii_coe_details_t coe_details;
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 987
diff changeset
   116
    ec_sii_general_flags_t general_flags;
816663ca9370 Slave information via 'ethercat slave'.
Florian Pose <fp@igh-essen.com>
parents: 987
diff changeset
   117
    int16_t current_on_ebus;
922
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   118
    uint8_t state;
987
3c9090138140 Display error flag in 'ethercat ls'; cleaned up usage of error flag;
Florian Pose <fp@igh-essen.com>
parents: 980
diff changeset
   119
    uint8_t error_flag;
935
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   120
    uint8_t sync_count;
965
1aee4aa1def3 Implemented Sdo dictionary info via 'ethercat sdos'.
Florian Pose <fp@igh-essen.com>
parents: 960
diff changeset
   121
    uint16_t sdo_count;
978
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   122
    uint32_t sii_nwords;
990
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   123
    char name[EC_IOCTL_STRING_SIZE];
935
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   124
} ec_ioctl_slave_t;
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   125
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   126
/*****************************************************************************/
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   127
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   128
typedef struct {
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   129
    // inputs
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   130
    uint16_t slave_position;
978
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   131
    uint32_t sync_index;
935
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   132
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   133
    // outputs
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   134
    uint16_t physical_start_address;
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   135
    uint16_t default_size;
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   136
    uint8_t control_register;
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   137
    uint8_t enable;
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   138
    uint8_t assign_source;
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   139
    uint8_t pdo_count;
1079
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
   140
} ec_ioctl_slave_sync_t;
935
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   141
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   142
/*****************************************************************************/
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   143
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   144
typedef struct {
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   145
    // inputs
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   146
    uint16_t slave_position;
978
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   147
    uint32_t sync_index;
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   148
    uint32_t pdo_pos;
935
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   149
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   150
    // outputs
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   151
    uint16_t index;
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   152
    uint8_t entry_count;
990
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   153
    int8_t name[EC_IOCTL_STRING_SIZE];
1079
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
   154
} ec_ioctl_slave_sync_pdo_t;
935
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   155
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   156
/*****************************************************************************/
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   157
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   158
typedef struct {
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   159
    // inputs
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   160
    uint16_t slave_position;
978
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   161
    uint32_t sync_index;
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   162
    uint32_t pdo_pos;
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   163
    uint32_t entry_pos;
935
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   164
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   165
    // outputs
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   166
    uint16_t index;
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   167
    uint8_t subindex;
b954e9d91ea5 Added 'pdos' command to ethercat tool.
Florian Pose <fp@igh-essen.com>
parents: 922
diff changeset
   168
    uint8_t bit_length;
990
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   169
    int8_t name[EC_IOCTL_STRING_SIZE];
1079
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
   170
} ec_ioctl_slave_sync_pdo_entry_t;
922
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   171
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   172
/*****************************************************************************/
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   173
948
1cfab7161491 Implemented domain command.
Florian Pose <fp@igh-essen.com>
parents: 938
diff changeset
   174
typedef struct {
1cfab7161491 Implemented domain command.
Florian Pose <fp@igh-essen.com>
parents: 938
diff changeset
   175
    // inputs
978
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   176
	uint32_t index;
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   177
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   178
    // outputs
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   179
	uint32_t data_size;
948
1cfab7161491 Implemented domain command.
Florian Pose <fp@igh-essen.com>
parents: 938
diff changeset
   180
	uint32_t logical_base_address;
1cfab7161491 Implemented domain command.
Florian Pose <fp@igh-essen.com>
parents: 938
diff changeset
   181
	uint16_t working_counter;
1cfab7161491 Implemented domain command.
Florian Pose <fp@igh-essen.com>
parents: 938
diff changeset
   182
	uint16_t expected_working_counter;
978
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   183
    uint32_t fmmu_count;
948
1cfab7161491 Implemented domain command.
Florian Pose <fp@igh-essen.com>
parents: 938
diff changeset
   184
} ec_ioctl_domain_t;
1cfab7161491 Implemented domain command.
Florian Pose <fp@igh-essen.com>
parents: 938
diff changeset
   185
1cfab7161491 Implemented domain command.
Florian Pose <fp@igh-essen.com>
parents: 938
diff changeset
   186
/*****************************************************************************/
1cfab7161491 Implemented domain command.
Florian Pose <fp@igh-essen.com>
parents: 938
diff changeset
   187
949
e424c0074c67 Implemented 'data' command.
Florian Pose <fp@igh-essen.com>
parents: 948
diff changeset
   188
typedef struct {
e424c0074c67 Implemented 'data' command.
Florian Pose <fp@igh-essen.com>
parents: 948
diff changeset
   189
    // inputs
978
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   190
	uint32_t domain_index;
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   191
	uint32_t fmmu_index;
950
8b00e63fff90 'ethercat domain' shows domain contents and process data.
Florian Pose <fp@igh-essen.com>
parents: 949
diff changeset
   192
8b00e63fff90 'ethercat domain' shows domain contents and process data.
Florian Pose <fp@igh-essen.com>
parents: 949
diff changeset
   193
    // outputs
8b00e63fff90 'ethercat domain' shows domain contents and process data.
Florian Pose <fp@igh-essen.com>
parents: 949
diff changeset
   194
    uint16_t slave_config_alias;
8b00e63fff90 'ethercat domain' shows domain contents and process data.
Florian Pose <fp@igh-essen.com>
parents: 949
diff changeset
   195
    uint16_t slave_config_position;
1055
2be8918682fa Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents: 1037
diff changeset
   196
    uint8_t sync_index;
2be8918682fa Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents: 1037
diff changeset
   197
    ec_direction_t dir;
950
8b00e63fff90 'ethercat domain' shows domain contents and process data.
Florian Pose <fp@igh-essen.com>
parents: 949
diff changeset
   198
	uint32_t logical_address;
978
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   199
    uint32_t data_size;
950
8b00e63fff90 'ethercat domain' shows domain contents and process data.
Florian Pose <fp@igh-essen.com>
parents: 949
diff changeset
   200
} ec_ioctl_domain_fmmu_t;
8b00e63fff90 'ethercat domain' shows domain contents and process data.
Florian Pose <fp@igh-essen.com>
parents: 949
diff changeset
   201
8b00e63fff90 'ethercat domain' shows domain contents and process data.
Florian Pose <fp@igh-essen.com>
parents: 949
diff changeset
   202
/*****************************************************************************/
8b00e63fff90 'ethercat domain' shows domain contents and process data.
Florian Pose <fp@igh-essen.com>
parents: 949
diff changeset
   203
8b00e63fff90 'ethercat domain' shows domain contents and process data.
Florian Pose <fp@igh-essen.com>
parents: 949
diff changeset
   204
typedef struct {
8b00e63fff90 'ethercat domain' shows domain contents and process data.
Florian Pose <fp@igh-essen.com>
parents: 949
diff changeset
   205
    // inputs
978
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   206
	uint32_t domain_index;
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   207
    uint32_t data_size;
990
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   208
    uint8_t *target;
1079
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
   209
} ec_ioctl_domain_data_t;
949
e424c0074c67 Implemented 'data' command.
Florian Pose <fp@igh-essen.com>
parents: 948
diff changeset
   210
e424c0074c67 Implemented 'data' command.
Florian Pose <fp@igh-essen.com>
parents: 948
diff changeset
   211
/*****************************************************************************/
e424c0074c67 Implemented 'data' command.
Florian Pose <fp@igh-essen.com>
parents: 948
diff changeset
   212
960
36e460ffbb5e Request slave state(s) with 'ethercat state'; removed sysfs state file.
Florian Pose <fp@igh-essen.com>
parents: 957
diff changeset
   213
typedef struct {
36e460ffbb5e Request slave state(s) with 'ethercat state'; removed sysfs state file.
Florian Pose <fp@igh-essen.com>
parents: 957
diff changeset
   214
    // inputs
36e460ffbb5e Request slave state(s) with 'ethercat state'; removed sysfs state file.
Florian Pose <fp@igh-essen.com>
parents: 957
diff changeset
   215
	uint16_t slave_position;
36e460ffbb5e Request slave state(s) with 'ethercat state'; removed sysfs state file.
Florian Pose <fp@igh-essen.com>
parents: 957
diff changeset
   216
    uint8_t requested_state;
36e460ffbb5e Request slave state(s) with 'ethercat state'; removed sysfs state file.
Florian Pose <fp@igh-essen.com>
parents: 957
diff changeset
   217
} ec_ioctl_slave_state_t;
36e460ffbb5e Request slave state(s) with 'ethercat state'; removed sysfs state file.
Florian Pose <fp@igh-essen.com>
parents: 957
diff changeset
   218
36e460ffbb5e Request slave state(s) with 'ethercat state'; removed sysfs state file.
Florian Pose <fp@igh-essen.com>
parents: 957
diff changeset
   219
/*****************************************************************************/
36e460ffbb5e Request slave state(s) with 'ethercat state'; removed sysfs state file.
Florian Pose <fp@igh-essen.com>
parents: 957
diff changeset
   220
965
1aee4aa1def3 Implemented Sdo dictionary info via 'ethercat sdos'.
Florian Pose <fp@igh-essen.com>
parents: 960
diff changeset
   221
typedef struct {
1aee4aa1def3 Implemented Sdo dictionary info via 'ethercat sdos'.
Florian Pose <fp@igh-essen.com>
parents: 960
diff changeset
   222
    // inputs
1aee4aa1def3 Implemented Sdo dictionary info via 'ethercat sdos'.
Florian Pose <fp@igh-essen.com>
parents: 960
diff changeset
   223
    uint16_t slave_position;
1aee4aa1def3 Implemented Sdo dictionary info via 'ethercat sdos'.
Florian Pose <fp@igh-essen.com>
parents: 960
diff changeset
   224
    uint16_t sdo_position;
1aee4aa1def3 Implemented Sdo dictionary info via 'ethercat sdos'.
Florian Pose <fp@igh-essen.com>
parents: 960
diff changeset
   225
1aee4aa1def3 Implemented Sdo dictionary info via 'ethercat sdos'.
Florian Pose <fp@igh-essen.com>
parents: 960
diff changeset
   226
    // outputs
1aee4aa1def3 Implemented Sdo dictionary info via 'ethercat sdos'.
Florian Pose <fp@igh-essen.com>
parents: 960
diff changeset
   227
    uint16_t sdo_index;
1aee4aa1def3 Implemented Sdo dictionary info via 'ethercat sdos'.
Florian Pose <fp@igh-essen.com>
parents: 960
diff changeset
   228
    uint8_t max_subindex;
990
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   229
    int8_t name[EC_IOCTL_STRING_SIZE];
1079
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
   230
} ec_ioctl_slave_sdo_t;
965
1aee4aa1def3 Implemented Sdo dictionary info via 'ethercat sdos'.
Florian Pose <fp@igh-essen.com>
parents: 960
diff changeset
   231
1aee4aa1def3 Implemented Sdo dictionary info via 'ethercat sdos'.
Florian Pose <fp@igh-essen.com>
parents: 960
diff changeset
   232
/*****************************************************************************/
1aee4aa1def3 Implemented Sdo dictionary info via 'ethercat sdos'.
Florian Pose <fp@igh-essen.com>
parents: 960
diff changeset
   233
1aee4aa1def3 Implemented Sdo dictionary info via 'ethercat sdos'.
Florian Pose <fp@igh-essen.com>
parents: 960
diff changeset
   234
typedef struct {
1aee4aa1def3 Implemented Sdo dictionary info via 'ethercat sdos'.
Florian Pose <fp@igh-essen.com>
parents: 960
diff changeset
   235
    // inputs
1aee4aa1def3 Implemented Sdo dictionary info via 'ethercat sdos'.
Florian Pose <fp@igh-essen.com>
parents: 960
diff changeset
   236
    uint16_t slave_position;
968
b0e894257743 Implemented sdo_upload command.
Florian Pose <fp@igh-essen.com>
parents: 965
diff changeset
   237
    int sdo_spec; // positive: index, negative: list position
965
1aee4aa1def3 Implemented Sdo dictionary info via 'ethercat sdos'.
Florian Pose <fp@igh-essen.com>
parents: 960
diff changeset
   238
    uint8_t sdo_entry_subindex;
1aee4aa1def3 Implemented Sdo dictionary info via 'ethercat sdos'.
Florian Pose <fp@igh-essen.com>
parents: 960
diff changeset
   239
1aee4aa1def3 Implemented Sdo dictionary info via 'ethercat sdos'.
Florian Pose <fp@igh-essen.com>
parents: 960
diff changeset
   240
    // outputs
1aee4aa1def3 Implemented Sdo dictionary info via 'ethercat sdos'.
Florian Pose <fp@igh-essen.com>
parents: 960
diff changeset
   241
    uint16_t data_type;
1aee4aa1def3 Implemented Sdo dictionary info via 'ethercat sdos'.
Florian Pose <fp@igh-essen.com>
parents: 960
diff changeset
   242
    uint16_t bit_length;
990
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   243
    int8_t description[EC_IOCTL_STRING_SIZE];
1079
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
   244
} ec_ioctl_slave_sdo_entry_t;
965
1aee4aa1def3 Implemented Sdo dictionary info via 'ethercat sdos'.
Florian Pose <fp@igh-essen.com>
parents: 960
diff changeset
   245
1aee4aa1def3 Implemented Sdo dictionary info via 'ethercat sdos'.
Florian Pose <fp@igh-essen.com>
parents: 960
diff changeset
   246
/*****************************************************************************/
1aee4aa1def3 Implemented Sdo dictionary info via 'ethercat sdos'.
Florian Pose <fp@igh-essen.com>
parents: 960
diff changeset
   247
968
b0e894257743 Implemented sdo_upload command.
Florian Pose <fp@igh-essen.com>
parents: 965
diff changeset
   248
typedef struct {
b0e894257743 Implemented sdo_upload command.
Florian Pose <fp@igh-essen.com>
parents: 965
diff changeset
   249
    // inputs
b0e894257743 Implemented sdo_upload command.
Florian Pose <fp@igh-essen.com>
parents: 965
diff changeset
   250
    uint16_t slave_position;
b0e894257743 Implemented sdo_upload command.
Florian Pose <fp@igh-essen.com>
parents: 965
diff changeset
   251
    uint16_t sdo_index;
b0e894257743 Implemented sdo_upload command.
Florian Pose <fp@igh-essen.com>
parents: 965
diff changeset
   252
    uint8_t sdo_entry_subindex;
978
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   253
    uint32_t target_size;
968
b0e894257743 Implemented sdo_upload command.
Florian Pose <fp@igh-essen.com>
parents: 965
diff changeset
   254
    uint8_t *target;
b0e894257743 Implemented sdo_upload command.
Florian Pose <fp@igh-essen.com>
parents: 965
diff changeset
   255
b0e894257743 Implemented sdo_upload command.
Florian Pose <fp@igh-essen.com>
parents: 965
diff changeset
   256
    // outputs
978
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   257
    uint32_t data_size;
1037
59f191c9185b Store abort code in sdo request; output it in user space; added some
Florian Pose <fp@igh-essen.com>
parents: 1029
diff changeset
   258
    uint32_t abort_code;
1079
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
   259
} ec_ioctl_slave_sdo_upload_t;
968
b0e894257743 Implemented sdo_upload command.
Florian Pose <fp@igh-essen.com>
parents: 965
diff changeset
   260
b0e894257743 Implemented sdo_upload command.
Florian Pose <fp@igh-essen.com>
parents: 965
diff changeset
   261
/*****************************************************************************/
b0e894257743 Implemented sdo_upload command.
Florian Pose <fp@igh-essen.com>
parents: 965
diff changeset
   262
974
5868944a6456 Implemented Sdo download via ethercat command.
Florian Pose <fp@igh-essen.com>
parents: 971
diff changeset
   263
typedef struct {
5868944a6456 Implemented Sdo download via ethercat command.
Florian Pose <fp@igh-essen.com>
parents: 971
diff changeset
   264
    // inputs
5868944a6456 Implemented Sdo download via ethercat command.
Florian Pose <fp@igh-essen.com>
parents: 971
diff changeset
   265
    uint16_t slave_position;
5868944a6456 Implemented Sdo download via ethercat command.
Florian Pose <fp@igh-essen.com>
parents: 971
diff changeset
   266
    uint16_t sdo_index;
5868944a6456 Implemented Sdo download via ethercat command.
Florian Pose <fp@igh-essen.com>
parents: 971
diff changeset
   267
    uint8_t sdo_entry_subindex;
978
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   268
    uint32_t data_size;
974
5868944a6456 Implemented Sdo download via ethercat command.
Florian Pose <fp@igh-essen.com>
parents: 971
diff changeset
   269
    uint8_t *data;
1037
59f191c9185b Store abort code in sdo request; output it in user space; added some
Florian Pose <fp@igh-essen.com>
parents: 1029
diff changeset
   270
59f191c9185b Store abort code in sdo request; output it in user space; added some
Florian Pose <fp@igh-essen.com>
parents: 1029
diff changeset
   271
    // outputs
59f191c9185b Store abort code in sdo request; output it in user space; added some
Florian Pose <fp@igh-essen.com>
parents: 1029
diff changeset
   272
    uint32_t abort_code;
1079
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
   273
} ec_ioctl_slave_sdo_download_t;
974
5868944a6456 Implemented Sdo download via ethercat command.
Florian Pose <fp@igh-essen.com>
parents: 971
diff changeset
   274
5868944a6456 Implemented Sdo download via ethercat command.
Florian Pose <fp@igh-essen.com>
parents: 971
diff changeset
   275
/*****************************************************************************/
5868944a6456 Implemented Sdo download via ethercat command.
Florian Pose <fp@igh-essen.com>
parents: 971
diff changeset
   276
978
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   277
typedef struct {
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   278
    // inputs
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   279
    uint16_t slave_position;
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   280
    uint16_t offset;
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   281
    uint32_t nwords;
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   282
    uint16_t *words;
1079
ef1266652c4d Improved locking between ioctl()s and master state machine; separate
Florian Pose <fp@igh-essen.com>
parents: 1057
diff changeset
   283
} ec_ioctl_slave_sii_t;
978
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   284
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   285
/*****************************************************************************/
2962baf7e6d1 Implemented SII read.
Florian Pose <fp@igh-essen.com>
parents: 974
diff changeset
   286
990
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   287
typedef struct {
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   288
    // inputs
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   289
    uint32_t config_index;
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   290
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   291
    // outputs
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   292
    uint16_t alias;
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   293
    uint16_t position;
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   294
    uint32_t vendor_id;
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   295
    uint32_t product_code;
1055
2be8918682fa Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents: 1037
diff changeset
   296
    struct {
2be8918682fa Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents: 1037
diff changeset
   297
        ec_direction_t dir;
2be8918682fa Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents: 1037
diff changeset
   298
        uint32_t pdo_count;
1082
ff06c58e269c Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents: 1079
diff changeset
   299
    } syncs[EC_MAX_SYNC_MANAGERS];
990
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   300
    uint32_t sdo_count;
1057
435d7f36f13d Operational flag in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 1055
diff changeset
   301
    uint8_t attached    : 1,
435d7f36f13d Operational flag in 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 1055
diff changeset
   302
            operational : 1;
990
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   303
} ec_ioctl_config_t;
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   304
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   305
/*****************************************************************************/
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   306
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   307
typedef struct {
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   308
    // inputs
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   309
    uint32_t config_index;
1055
2be8918682fa Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents: 1037
diff changeset
   310
    uint8_t sync_index;
2be8918682fa Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents: 1037
diff changeset
   311
    uint16_t pdo_pos;
990
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   312
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   313
    // outputs
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   314
    uint16_t index;
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   315
    uint8_t entry_count;
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   316
    int8_t name[EC_IOCTL_STRING_SIZE];
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   317
} ec_ioctl_config_pdo_t;
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   318
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   319
/*****************************************************************************/
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   320
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   321
typedef struct {
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   322
    // inputs
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   323
    uint32_t config_index;
1055
2be8918682fa Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents: 1037
diff changeset
   324
    uint8_t sync_index;
2be8918682fa Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents: 1037
diff changeset
   325
    uint16_t pdo_pos;
2be8918682fa Store sync manager configurations in ec_slave_config_t instead of Pdo
Florian Pose <fp@igh-essen.com>
parents: 1037
diff changeset
   326
    uint8_t entry_pos;
990
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   327
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   328
    // outputs
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   329
    uint16_t index;
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   330
    uint8_t subindex;
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   331
    uint8_t bit_length;
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   332
    int8_t name[EC_IOCTL_STRING_SIZE];
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   333
} ec_ioctl_config_pdo_entry_t;
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   334
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   335
/*****************************************************************************/
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   336
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   337
typedef struct {
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   338
    // inputs
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   339
    uint32_t config_index;
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   340
    uint32_t sdo_pos;
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   341
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   342
    // outputs
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   343
    uint16_t index;
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   344
    uint8_t subindex;
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   345
    uint32_t size;
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   346
    uint8_t data[4];
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   347
} ec_ioctl_config_sdo_t;
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   348
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   349
/*****************************************************************************/
4f223f3df05a Bus configuration via 'ethercat config'.
Florian Pose <fp@igh-essen.com>
parents: 989
diff changeset
   350
1082
ff06c58e269c Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents: 1079
diff changeset
   351
/** \endcond */
ff06c58e269c Renamed ecrt_slave_config_sync_managers() to ecrt_slave_config_pdos();
Florian Pose <fp@igh-essen.com>
parents: 1079
diff changeset
   352
922
fede1d8f5b71 Added the new ethercat comman-line tool with lsec functionality.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   353
#endif