master/fsm_slave.h
changeset 1583 017fa8fd9ac1
child 1597 491dea6f4fd7
equal deleted inserted replaced
1582:7273aa7deb3d 1583:017fa8fd9ac1
       
     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 slave request (SDO) state machine.
       
    33 */
       
    34 
       
    35 /*****************************************************************************/
       
    36 #ifndef __EC_FSM_SLAVE_H__
       
    37 #define __EC_FSM_SLAVE_H__
       
    38 
       
    39 #include "globals.h"
       
    40 #include "datagram.h"
       
    41 #include "sdo_request.h"
       
    42 #include "fsm_coe.h"
       
    43 
       
    44 
       
    45 typedef struct ec_fsm_slave ec_fsm_slave_t; /**< \see ec_fsm_slave */
       
    46 
       
    47 /** Finite state machine of an EtherCAT slave.
       
    48  */
       
    49 struct ec_fsm_slave {
       
    50     ec_slave_t *slave; /**< slave the FSM runs on */
       
    51     ec_datagram_t *datagram; /**< datagram used in the state machine */
       
    52 
       
    53     void (*state)(ec_fsm_slave_t *); /**< master state function */
       
    54     ec_sdo_request_t *sdo_request; /**< SDO request to process. */
       
    55 
       
    56     ec_fsm_coe_t fsm_coe; /**< CoE state machine */
       
    57 };
       
    58 
       
    59 /*****************************************************************************/
       
    60 
       
    61 void ec_fsm_slave_init(ec_fsm_slave_t *, ec_slave_t *, ec_datagram_t *);
       
    62 void ec_fsm_slave_clear(ec_fsm_slave_t *);
       
    63 
       
    64 void ec_fsm_slave_exec(ec_fsm_slave_t *);
       
    65 int ec_fsm_slave_idle(const ec_fsm_slave_t *);
       
    66 
       
    67 /*****************************************************************************/
       
    68 
       
    69 
       
    70 #endif // __EC_FSM_SLAVE_H__