fp@145: /****************************************************************************** fp@145: * fp@145: * $Id$ fp@145: * fp@1618: * Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH fp@1618: * fp@1618: * This file is part of the IgH EtherCAT Master. fp@1618: * fp@1618: * The IgH EtherCAT Master is free software; you can redistribute it fp@1618: * and/or modify it under the terms of the GNU General Public License fp@1618: * as published by the Free Software Foundation; version 2 of the License. fp@1618: * fp@1618: * The IgH EtherCAT Master is distributed in the hope that it will be fp@1618: * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of fp@1618: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the fp@1618: * GNU General Public License for more details. fp@1618: * fp@1618: * You should have received a copy of the GNU General Public License fp@1618: * along with the IgH EtherCAT Master; if not, write to the Free Software fp@1618: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA fp@1618: * fp@145: *****************************************************************************/ fp@145: fp@1618: /** fp@1618: \file fp@1618: Ethernet-over-EtherCAT (EoE) fp@1618: */ fp@1618: fp@1618: /*****************************************************************************/ fp@1618: fp@145: #include fp@145: fp@145: #include "../include/ecrt.h" fp@145: #include "globals.h" fp@145: #include "slave.h" fp@145: #include "command.h" fp@145: fp@145: /*****************************************************************************/ fp@145: fp@1618: /** fp@1618: State of an EoE object. fp@1618: */ fp@1618: fp@145: typedef enum fp@145: { fp@1618: EC_EOE_IDLE, /**< Idle. The next step ist to check for data. */ fp@1618: EC_EOE_CHECKING, /**< Checking frame was sent. */ fp@1618: EC_EOE_FETCHING /**< There is new data. Fetching frame was sent. */ fp@145: } fp@145: ec_eoe_state_t; fp@145: fp@145: /*****************************************************************************/ fp@145: fp@1618: /** fp@1618: Ethernet-over-EtherCAT (EoE) Object. fp@1618: The master creates one of these objects for each slave that supports the fp@1618: EoE protocol. fp@1618: */ fp@1618: fp@145: typedef struct fp@145: { fp@1618: struct list_head list; /**< list item */ fp@1618: ec_slave_t *slave; /**< pointer to the corresponding slave */ fp@1618: ec_eoe_state_t rx_state; /**< state of the state machine */ fp@145: } fp@145: ec_eoe_t; fp@145: fp@145: /*****************************************************************************/ fp@145: fp@145: void ec_eoe_init(ec_eoe_t *, ec_slave_t *); fp@145: void ec_eoe_clear(ec_eoe_t *); fp@145: void ec_eoe_run(ec_eoe_t *); fp@145: void ec_eoe_print(const ec_eoe_t *); fp@145: fp@145: /*****************************************************************************/