master/datagram.h
author Florian Pose <fp@igh-essen.com>
Wed, 02 Aug 2006 16:39:39 +0000
branchstable-1.0
changeset 1625 49d577ddcb08
parent 1624 9dc190591c0f
permissions -rw-r--r--
MERGE trunk -r490:491 -> branches/stable-1.0 (Init script bug)
1624
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     1
/******************************************************************************
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     2
 *
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     3
 *  $Id$
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     4
 *
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     5
 *  Copyright (C) 2006  Florian Pose, Ingenieurgemeinschaft IgH
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     6
 *
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     7
 *  This file is part of the IgH EtherCAT Master.
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     8
 *
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     9
 *  The IgH EtherCAT Master is free software; you can redistribute it
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    10
 *  and/or modify it under the terms of the GNU General Public License
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    11
 *  as published by the Free Software Foundation; either version 2 of the
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    12
 *  License, or (at your option) any later version.
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    13
 *
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    14
 *  The IgH EtherCAT Master is distributed in the hope that it will be
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    15
 *  useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    16
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    17
 *  GNU General Public License for more details.
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    18
 *
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    19
 *  You should have received a copy of the GNU General Public License
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    20
 *  along with the IgH EtherCAT Master; if not, write to the Free Software
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    21
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    22
 *
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    23
 *  The right to use EtherCAT Technology is granted and comes free of
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    24
 *  charge under condition of compatibility of product made by
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    25
 *  Licensee. People intending to distribute/sell products based on the
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    26
 *  code, have to sign an agreement to guarantee that products using
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    27
 *  software based on IgH EtherCAT master stay compatible with the actual
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    28
 *  EtherCAT specification (which are released themselves as an open
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    29
 *  standard) as the (only) precondition to have the right to use EtherCAT
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    30
 *  Technology, IP and trade marks.
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    31
 *
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    32
 *****************************************************************************/
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    33
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    34
/**
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    35
   \file
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    36
   EtherCAT datagram structure.
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    37
*/
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    38
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    39
/*****************************************************************************/
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    40
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    41
#ifndef _EC_DATAGRAM_H_
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    42
#define _EC_DATAGRAM_H_
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    43
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    44
#include <linux/list.h>
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    45
#include <linux/time.h>
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    46
#include <linux/timex.h>
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    47
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    48
#include "globals.h"
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    49
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    50
/*****************************************************************************/
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    51
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    52
/**
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    53
   EtherCAT datagram type.
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    54
*/
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    55
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    56
typedef enum
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    57
{
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    58
    EC_CMD_NONE = 0x00, /**< Dummy */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    59
    EC_CMD_APRD = 0x01, /**< Auto-increment physical read */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    60
    EC_CMD_APWR = 0x02, /**< Auto-increment physical write */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    61
    EC_CMD_NPRD = 0x04, /**< Node-addressed physical read */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    62
    EC_CMD_NPWR = 0x05, /**< Node-addressed physical write */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    63
    EC_CMD_BRD  = 0x07, /**< Broadcast read */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    64
    EC_CMD_BWR  = 0x08, /**< Broadcast write */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    65
    EC_CMD_LRW  = 0x0C  /**< Logical read/write */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    66
}
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    67
ec_datagram_type_t;
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    68
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    69
/**
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    70
   EtherCAT datagram state.
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    71
*/
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    72
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    73
typedef enum
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    74
{
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    75
    EC_CMD_INIT, /**< new datagram */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    76
    EC_CMD_QUEUED, /**< datagram queued by master */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    77
    EC_CMD_SENT, /**< datagram has been sent */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    78
    EC_CMD_RECEIVED, /**< datagram has been received */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    79
    EC_CMD_TIMEOUT, /**< datagram timed out */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    80
    EC_CMD_ERROR /**< error while sending/receiving */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    81
}
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    82
ec_datagram_state_t;
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    83
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    84
/*****************************************************************************/
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    85
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    86
/**
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    87
   EtherCAT address.
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    88
*/
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    89
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    90
typedef union
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    91
{
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    92
    struct
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    93
    {
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    94
        uint16_t slave; /**< configured or autoincrement address */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    95
        uint16_t mem; /**< physical memory address */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    96
    }
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    97
    physical; /**< physical address */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    98
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    99
    uint32_t logical; /**< logical address */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   100
}
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   101
ec_address_t;
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   102
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   103
/*****************************************************************************/
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   104
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   105
/**
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   106
   EtherCAT datagram.
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   107
*/
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   108
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   109
typedef struct
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   110
{
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   111
    struct list_head list; /**< needed by domain datagram lists */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   112
    struct list_head queue; /**< master datagram queue item */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   113
    ec_datagram_type_t type; /**< datagram type (APRD, BWR, etc) */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   114
    ec_address_t address; /**< receipient address */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   115
    uint8_t *data; /**< datagram data */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   116
    size_t mem_size; /**< datagram \a data memory size */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   117
    size_t data_size; /**< size of the data in \a data */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   118
    uint8_t index; /**< datagram index (set by master) */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   119
    uint16_t working_counter; /**< working counter */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   120
    ec_datagram_state_t state; /**< datagram state */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   121
    cycles_t t_sent; /**< time, the datagrams was sent */
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   122
}
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   123
ec_datagram_t;
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   124
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   125
/*****************************************************************************/
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   126
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   127
void ec_datagram_init(ec_datagram_t *);
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   128
void ec_datagram_clear(ec_datagram_t *);
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   129
int ec_datagram_prealloc(ec_datagram_t *, size_t);
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   130
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   131
int ec_datagram_nprd(ec_datagram_t *, uint16_t, uint16_t, size_t);
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   132
int ec_datagram_npwr(ec_datagram_t *, uint16_t, uint16_t, size_t);
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   133
int ec_datagram_aprd(ec_datagram_t *, uint16_t, uint16_t, size_t);
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   134
int ec_datagram_apwr(ec_datagram_t *, uint16_t, uint16_t, size_t);
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   135
int ec_datagram_brd(ec_datagram_t *, uint16_t, size_t);
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   136
int ec_datagram_bwr(ec_datagram_t *, uint16_t, size_t);
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   137
int ec_datagram_lrw(ec_datagram_t *, uint32_t, size_t);
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   138
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   139
/*****************************************************************************/
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   140
9dc190591c0f MERGE trunk -r452:489 -> stable-1.0 (datagrams, bugfixes, EEPROM info, idle mode)
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   141
#endif