IgH EtherCAT Master  1.5.3
coe_emerg_ring.c File Reference

EtherCAT CoE emergency ring buffer methods. More...

Go to the source code of this file.

Functions

void ec_coe_emerg_ring_init (ec_coe_emerg_ring_t *ring, ec_slave_config_t *sc)
 Emergency ring buffer constructor. More...
 
void ec_coe_emerg_ring_clear (ec_coe_emerg_ring_t *ring)
 Emergency ring buffer destructor. More...
 
int ec_coe_emerg_ring_size (ec_coe_emerg_ring_t *ring, size_t size)
 Set the ring size. More...
 
void ec_coe_emerg_ring_push (ec_coe_emerg_ring_t *ring, const u8 *msg)
 Add a new emergency message. More...
 
int ec_coe_emerg_ring_pop (ec_coe_emerg_ring_t *ring, u8 *msg)
 Remove an emergency message from the ring. More...
 
int ec_coe_emerg_ring_clear_ring (ec_coe_emerg_ring_t *ring)
 Clear the ring. More...
 
int ec_coe_emerg_ring_overruns (ec_coe_emerg_ring_t *ring)
 Read the number of overruns. More...
 

Detailed Description

EtherCAT CoE emergency ring buffer methods.

Definition in file coe_emerg_ring.c.

Function Documentation

◆ ec_coe_emerg_ring_init()

void ec_coe_emerg_ring_init ( ec_coe_emerg_ring_t ring,
ec_slave_config_t sc 
)

Emergency ring buffer constructor.

Parameters
ringEmergency ring.
scSlave configuration.

Definition at line 46 of file coe_emerg_ring.c.

◆ ec_coe_emerg_ring_clear()

void ec_coe_emerg_ring_clear ( ec_coe_emerg_ring_t ring)

Emergency ring buffer destructor.

Parameters
ringEmergency ring.

Definition at line 63 of file coe_emerg_ring.c.

◆ ec_coe_emerg_ring_size()

int ec_coe_emerg_ring_size ( ec_coe_emerg_ring_t ring,
size_t  size 
)

Set the ring size.

Returns
Zero on success, otherwise a negative error code.
Parameters
ringEmergency ring.
sizeMaximum number of messages in the ring.

Definition at line 78 of file coe_emerg_ring.c.

◆ ec_coe_emerg_ring_push()

void ec_coe_emerg_ring_push ( ec_coe_emerg_ring_t ring,
const u8 *  msg 
)

Add a new emergency message.

Parameters
ringEmergency ring.
msgEmergency message.

Definition at line 113 of file coe_emerg_ring.c.

◆ ec_coe_emerg_ring_pop()

int ec_coe_emerg_ring_pop ( ec_coe_emerg_ring_t ring,
u8 *  msg 
)

Remove an emergency message from the ring.

Returns
Zero on success, otherwise a negative error code.
Parameters
ringEmergency ring.
msgMemory to store the emergency message.

Definition at line 135 of file coe_emerg_ring.c.

◆ ec_coe_emerg_ring_clear_ring()

int ec_coe_emerg_ring_clear_ring ( ec_coe_emerg_ring_t ring)

Clear the ring.

Returns
Zero on success, otherwise a negative error code.
Parameters
ringEmergency ring.

Definition at line 155 of file coe_emerg_ring.c.

◆ ec_coe_emerg_ring_overruns()

int ec_coe_emerg_ring_overruns ( ec_coe_emerg_ring_t ring)

Read the number of overruns.

Returns
Number of overruns.
Parameters
ringEmergency ring.

Definition at line 170 of file coe_emerg_ring.c.