master/fsm_soe.h
changeset 1831 1875b9fea0ba
child 1865 c6c8b457bb40
equal deleted inserted replaced
1830:ef09f0ea0c4c 1831:1875b9fea0ba
       
     1 /******************************************************************************
       
     2  *
       
     3  *  $Id$
       
     4  *
       
     5  *  Copyright (C) 2006-2008  Florian Pose, Ingenieurgemeinschaft IgH
       
     6  *
       
     7  *  This file is part of the IgH EtherCAT Master.
       
     8  *
       
     9  *  The IgH EtherCAT Master is free software; you can redistribute it and/or
       
    10  *  modify it under the terms of the GNU General Public License version 2, as
       
    11  *  published by the Free Software Foundation.
       
    12  *
       
    13  *  The IgH EtherCAT Master is distributed in the hope that it will be useful,
       
    14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
       
    16  *  Public License for more details.
       
    17  *
       
    18  *  You should have received a copy of the GNU General Public License along
       
    19  *  with the IgH EtherCAT Master; if not, write to the Free Software
       
    20  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
       
    21  *
       
    22  *  ---
       
    23  *
       
    24  *  The license mentioned above concerns the source code only. Using the
       
    25  *  EtherCAT technology and brand is only permitted in compliance with the
       
    26  *  industrial property and similar rights of Beckhoff Automation GmbH.
       
    27  *
       
    28  *****************************************************************************/
       
    29 
       
    30 /**
       
    31    \file
       
    32    EtherCAT CoE state machines.
       
    33 */
       
    34 
       
    35 /*****************************************************************************/
       
    36 
       
    37 #ifndef __EC_FSM_SOE_H__
       
    38 #define __EC_FSM_SOE_H__
       
    39 
       
    40 #include "globals.h"
       
    41 #include "datagram.h"
       
    42 #include "slave.h"
       
    43 #include "soe_request.h"
       
    44 
       
    45 /*****************************************************************************/
       
    46 
       
    47 typedef struct ec_fsm_soe ec_fsm_soe_t; /**< \see ec_fsm_soe */
       
    48 
       
    49 /** Finite state machines for the Sercos over EtherCAT protocol.
       
    50  */
       
    51 struct ec_fsm_soe {
       
    52     ec_slave_t *slave; /**< slave the FSM runs on */
       
    53     ec_datagram_t *datagram; /**< datagram used in the state machine */
       
    54     unsigned int retries; /**< retries upon datagram timeout */
       
    55 
       
    56     void (*state)(ec_fsm_soe_t *); /**< CoE state function */
       
    57     unsigned long jiffies_start; /**< CoE timestamp. */
       
    58     ec_soe_request_t *request; /**< SoE request */
       
    59 };
       
    60 
       
    61 /*****************************************************************************/
       
    62 
       
    63 void ec_fsm_soe_init(ec_fsm_soe_t *, ec_datagram_t *);
       
    64 void ec_fsm_soe_clear(ec_fsm_soe_t *);
       
    65 
       
    66 void ec_fsm_soe_transfer(ec_fsm_soe_t *, ec_slave_t *, ec_soe_request_t *);
       
    67 
       
    68 int ec_fsm_soe_exec(ec_fsm_soe_t *);
       
    69 int ec_fsm_soe_success(ec_fsm_soe_t *);
       
    70 
       
    71 /*****************************************************************************/
       
    72 
       
    73 #endif