IgH EtherCAT Master  1.6.9
coe_emerg_ring.h
Go to the documentation of this file.
1/*****************************************************************************
2 *
3 * Copyright (C) 2012 Florian Pose, Ingenieurgemeinschaft IgH
4 *
5 * This file is part of the IgH EtherCAT Master.
6 *
7 * The IgH EtherCAT Master is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License version 2, as
9 * published by the Free Software Foundation.
10 *
11 * The IgH EtherCAT Master is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
14 * Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with the IgH EtherCAT Master; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 *
20 ****************************************************************************/
21
26
27/****************************************************************************/
28
29#ifndef __EC_COE_EMERG_RING_H__
30#define __EC_COE_EMERG_RING_H__
31
32#include "globals.h"
33
34/****************************************************************************/
35
41
42/****************************************************************************/
43
46typedef struct {
48
50 size_t size;
51
52 unsigned int read_index;
53 unsigned int write_index;
54 unsigned int overruns;
56
57/****************************************************************************/
58
61
67
68/****************************************************************************/
69
70#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(const 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:293
struct ec_slave_config ec_slave_config_t
Definition ecrt.h:303
EtherCAT CoE emergency message record.
u8 data[EC_COE_EMERGENCY_MSG_SIZE]
Message data.
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.