IgH EtherCAT Master  1.6.2
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 
27 /****************************************************************************/
28 
29 #ifndef __EC_COE_EMERG_RING_H__
30 #define __EC_COE_EMERG_RING_H__
31 
32 #include "globals.h"
33 
34 /****************************************************************************/
35 
38 typedef struct {
41 
42 /****************************************************************************/
43 
46 typedef struct {
50  size_t size;
52  unsigned int read_index;
53  unsigned int write_index;
54  unsigned int overruns;
56 
57 /****************************************************************************/
58 
61 
67 
68 /****************************************************************************/
69 
70 #endif
unsigned int write_index
Write index.
ec_coe_emerg_msg_t * msgs
Message ring.
size_t size
Ring size.
int ec_coe_emerg_ring_size(ec_coe_emerg_ring_t *, size_t)
Set the ring size.
void ec_coe_emerg_ring_clear(ec_coe_emerg_ring_t *)
Emergency ring buffer destructor.
EtherCAT CoE emergency ring buffer.
Global definitions and macros.
int ec_coe_emerg_ring_clear_ring(ec_coe_emerg_ring_t *)
Clear the ring.
int ec_coe_emerg_ring_overruns(const ec_coe_emerg_ring_t *)
Read the number of overruns.
EtherCAT CoE emergency message record.
void ec_coe_emerg_ring_init(ec_coe_emerg_ring_t *, ec_slave_config_t *)
Emergency ring buffer constructor.
int ec_coe_emerg_ring_pop(ec_coe_emerg_ring_t *, u8 *)
Remove an emergency message from the ring.
void ec_coe_emerg_ring_push(ec_coe_emerg_ring_t *, const u8 *)
Add a new emergency message.
unsigned int overruns
Number of overruns since last reset.
unsigned int read_index
Read index.
ec_slave_config_t * sc
Slave configuration owning the ring.
EtherCAT slave configuration.
Definition: slave_config.h:111
#define EC_COE_EMERGENCY_MSG_SIZE
Size of a CoE emergency message in byte.
Definition: ecrt.h:293