00001 /****************************************************************************** 00002 * 00003 * $Id$ 00004 * 00005 * Copyright (C) 2012 Florian Pose, Ingenieurgemeinschaft IgH 00006 * 00007 * This file is part of the IgH EtherCAT Master. 00008 * 00009 * The IgH EtherCAT Master is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU General Public License version 2, as 00011 * published by the Free Software Foundation. 00012 * 00013 * The IgH EtherCAT Master is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 00016 * Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License along 00019 * with the IgH EtherCAT Master; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00021 * 00022 * --- 00023 * 00024 * The license mentioned above concerns the source code only. Using the 00025 * EtherCAT technology and brand is only permitted in compliance with the 00026 * industrial property and similar rights of Beckhoff Automation GmbH. 00027 * 00028 *****************************************************************************/ 00029 00035 /*****************************************************************************/ 00036 00037 #ifndef __EC_COE_EMERG_RING_H__ 00038 #define __EC_COE_EMERG_RING_H__ 00039 00040 #include "globals.h" 00041 00042 /*****************************************************************************/ 00043 00046 typedef struct { 00047 u8 data[EC_COE_EMERGENCY_MSG_SIZE]; 00048 } ec_coe_emerg_msg_t; 00049 00050 /*****************************************************************************/ 00051 00054 typedef struct { 00055 ec_slave_config_t *sc; 00057 ec_coe_emerg_msg_t *msgs; 00058 size_t size; 00060 unsigned int read_index; 00061 unsigned int write_index; 00062 unsigned int overruns; 00063 } ec_coe_emerg_ring_t; 00064 00065 /*****************************************************************************/ 00066 00067 void ec_coe_emerg_ring_init(ec_coe_emerg_ring_t *, ec_slave_config_t *); 00068 void ec_coe_emerg_ring_clear(ec_coe_emerg_ring_t *); 00069 00070 int ec_coe_emerg_ring_size(ec_coe_emerg_ring_t *, size_t); 00071 void ec_coe_emerg_ring_push(ec_coe_emerg_ring_t *, const u8 *); 00072 int ec_coe_emerg_ring_pop(ec_coe_emerg_ring_t *, u8 *); 00073 int ec_coe_emerg_ring_clear_ring(ec_coe_emerg_ring_t *); 00074 int ec_coe_emerg_ring_overruns(ec_coe_emerg_ring_t *); 00075 00076 /*****************************************************************************/ 00077 00078 #endif
1.5.6