IgH EtherCAT Master  1.5.2
coe_emerg_ring.h
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * $Id$
4 *
5 * Copyright (C) 2012 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
35/*****************************************************************************/
36
37#ifndef __EC_COE_EMERG_RING_H__
38#define __EC_COE_EMERG_RING_H__
39
40#include "globals.h"
41
42/*****************************************************************************/
43
46typedef struct {
49
50/*****************************************************************************/
51
54typedef struct {
58 size_t size;
60 unsigned int read_index;
61 unsigned int write_index;
62 unsigned int overruns;
64
65/*****************************************************************************/
66
69
75
76/*****************************************************************************/
77
78#endif
void ec_coe_emerg_ring_init(ec_coe_emerg_ring_t *, ec_slave_config_t *)
Emergency ring buffer constructor.
int ec_coe_emerg_ring_overruns(ec_coe_emerg_ring_t *)
Read the number of overruns.
void ec_coe_emerg_ring_push(ec_coe_emerg_ring_t *, const u8 *)
Add a new emergency message.
int ec_coe_emerg_ring_clear_ring(ec_coe_emerg_ring_t *)
Clear the ring.
void ec_coe_emerg_ring_clear(ec_coe_emerg_ring_t *)
Emergency ring buffer destructor.
int ec_coe_emerg_ring_size(ec_coe_emerg_ring_t *, size_t)
Set the ring size.
int ec_coe_emerg_ring_pop(ec_coe_emerg_ring_t *, u8 *)
Remove an emergency message from the ring.
Global definitions and macros.
#define EC_COE_EMERGENCY_MSG_SIZE
Size of a CoE emergency message in byte.
Definition: ecrt.h:239
EtherCAT CoE emergency message record.
EtherCAT CoE emergency ring buffer.
unsigned int overruns
Number of overruns since last reset.
size_t size
Ring size.
ec_slave_config_t * sc
Slave configuration owning the ring.
unsigned int read_index
Read index.
unsigned int write_index
Write index.
ec_coe_emerg_msg_t * msgs
Message ring.
EtherCAT slave configuration.
Definition: slave_config.h:119