master/sdo.h
author Florian Pose <fp@igh-essen.com>
Thu, 06 Sep 2012 14:47:42 +0200
branchredundancy
changeset 2418 8cbb68315d29
parent 1363 11c0b2caa253
permissions -rw-r--r--
Fixed all mangled hg keywords.
409
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     1
/******************************************************************************
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     2
 *
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     3
 *  $Id$
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     4
 *
1326
ef907b0b5125 merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents: 992
diff changeset
     5
 *  Copyright (C) 2006-2008  Florian Pose, Ingenieurgemeinschaft IgH
409
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     6
 *
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     7
 *  This file is part of the IgH EtherCAT Master.
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     8
 *
1326
ef907b0b5125 merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents: 992
diff changeset
     9
 *  The IgH EtherCAT Master is free software; you can redistribute it and/or
ef907b0b5125 merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents: 992
diff changeset
    10
 *  modify it under the terms of the GNU General Public License version 2, as
ef907b0b5125 merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents: 992
diff changeset
    11
 *  published by the Free Software Foundation.
409
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    12
 *
1326
ef907b0b5125 merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents: 992
diff changeset
    13
 *  The IgH EtherCAT Master is distributed in the hope that it will be useful,
ef907b0b5125 merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents: 992
diff changeset
    14
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
ef907b0b5125 merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents: 992
diff changeset
    15
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
ef907b0b5125 merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents: 992
diff changeset
    16
 *  Public License for more details.
409
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    17
 *
1326
ef907b0b5125 merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents: 992
diff changeset
    18
 *  You should have received a copy of the GNU General Public License along
ef907b0b5125 merge -c1603 branches/stable-1.4: Changed licence headers to avoid conflicts with the GPL; restricted licence to GPLv2 only.
Florian Pose <fp@igh-essen.com>
parents: 992
diff changeset
    19
 *  with the IgH EtherCAT Master; if not, write to the Free Software
409
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    20
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    21
 *
1363
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1327
diff changeset
    22
 *  ---
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1327
diff changeset
    23
 *
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1327
diff changeset
    24
 *  The license mentioned above concerns the source code only. Using the
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1327
diff changeset
    25
 *  EtherCAT technology and brand is only permitted in compliance with the
11c0b2caa253 Improved and added license headers.
Florian Pose <fp@igh-essen.com>
parents: 1327
diff changeset
    26
 *  industrial property and similar rights of Beckhoff Automation GmbH.
409
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    27
 *
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    28
 *****************************************************************************/
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    29
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    30
/**
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    31
   \file
1327
4d179b06dd3c merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents: 1326
diff changeset
    32
   EtherCAT CANopen SDO structure.
409
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    33
*/
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    34
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    35
/*****************************************************************************/
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    36
847
92266462d411 Saparated ec_sdo_t, ec_sdo_entry_t and ec_sdo_request_t.
Florian Pose <fp@igh-essen.com>
parents: 831
diff changeset
    37
#ifndef __EC_SDO_H__
92266462d411 Saparated ec_sdo_t, ec_sdo_entry_t and ec_sdo_request_t.
Florian Pose <fp@igh-essen.com>
parents: 831
diff changeset
    38
#define __EC_SDO_H__
409
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    39
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    40
#include <linux/list.h>
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    41
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    42
#include "globals.h"
847
92266462d411 Saparated ec_sdo_t, ec_sdo_entry_t and ec_sdo_request_t.
Florian Pose <fp@igh-essen.com>
parents: 831
diff changeset
    43
#include "sdo_entry.h"
409
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    44
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    45
/*****************************************************************************/
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    46
1327
4d179b06dd3c merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents: 1326
diff changeset
    47
/** CANopen SDO.
831
ded9519c8d6e Reading of Pdo mapping via CoE during scan.
Florian Pose <fp@igh-essen.com>
parents: 814
diff changeset
    48
 */
ded9519c8d6e Reading of Pdo mapping via CoE during scan.
Florian Pose <fp@igh-essen.com>
parents: 814
diff changeset
    49
struct ec_sdo {
962
ea83a7aab57a Renamed subindices to max_subindex.
Florian Pose <fp@igh-essen.com>
parents: 854
diff changeset
    50
    struct list_head list; /**< List item. */
ea83a7aab57a Renamed subindices to max_subindex.
Florian Pose <fp@igh-essen.com>
parents: 854
diff changeset
    51
    ec_slave_t *slave; /**< Parent slave. */
1327
4d179b06dd3c merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents: 1326
diff changeset
    52
    uint16_t index; /**< SDO index. */
962
ea83a7aab57a Renamed subindices to max_subindex.
Florian Pose <fp@igh-essen.com>
parents: 854
diff changeset
    53
    uint8_t object_code; /**< Object code. */
1327
4d179b06dd3c merge -c1604 branches/stable-1.4: Fixed spelling of EtherCAT terms.
Florian Pose <fp@igh-essen.com>
parents: 1326
diff changeset
    54
    char *name; /**< SDO name. */
962
ea83a7aab57a Renamed subindices to max_subindex.
Florian Pose <fp@igh-essen.com>
parents: 854
diff changeset
    55
    uint8_t max_subindex; /**< Maximum subindex. */
ea83a7aab57a Renamed subindices to max_subindex.
Florian Pose <fp@igh-essen.com>
parents: 854
diff changeset
    56
    struct list_head entries; /**< List of entries. */
740
68d83b45dfa2 Added ec_slave_get_sdo() and ec_sdo_get_entry().
Florian Pose <fp@igh-essen.com>
parents: 739
diff changeset
    57
};
409
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    58
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    59
/*****************************************************************************/
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    60
992
50a44cbd30af Removed kobjects from sdo and slave.
Florian Pose <fp@igh-essen.com>
parents: 963
diff changeset
    61
void ec_sdo_init(ec_sdo_t *, ec_slave_t *, uint16_t);
50a44cbd30af Removed kobjects from sdo and slave.
Florian Pose <fp@igh-essen.com>
parents: 963
diff changeset
    62
void ec_sdo_clear(ec_sdo_t *);
847
92266462d411 Saparated ec_sdo_t, ec_sdo_entry_t and ec_sdo_request_t.
Florian Pose <fp@igh-essen.com>
parents: 831
diff changeset
    63
740
68d83b45dfa2 Added ec_slave_get_sdo() and ec_sdo_get_entry().
Florian Pose <fp@igh-essen.com>
parents: 739
diff changeset
    64
ec_sdo_entry_t *ec_sdo_get_entry(ec_sdo_t *, uint8_t);
963
01702c78fe0a Added ec_sdo_get_entry_const().
Florian Pose <fp@igh-essen.com>
parents: 962
diff changeset
    65
const ec_sdo_entry_t *ec_sdo_get_entry_const(const ec_sdo_t *, uint8_t);
448
e4b76dc7910c FIX: Introduced destroy() functions for kobject-derived classes and thus fixed memory leak.
Florian Pose <fp@igh-essen.com>
parents: 430
diff changeset
    66
409
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    67
/*****************************************************************************/
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    68
bc4c852e1b93 Implemented fetching of SDO dictionary.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    69
#endif