IgH EtherCAT Master  1.5.3
mailbox.h File Reference

Mailbox functionality. More...

Go to the source code of this file.

Macros

#define EC_MBOX_HEADER_SIZE   6
 Size of the mailbox header.
 

Enumerations

enum  ec_mbox_types {
  EC_MBOX_TYPE_EOE = 0x02, EC_MBOX_TYPE_COE = 0x03, EC_MBOX_TYPE_FOE = 0x04, EC_MBOX_TYPE_SOE = 0x05,
  EC_MBOX_TYPE_VOE = 0x0f
}
 Mailbox types.
 

Functions

uint8_t * ec_slave_mbox_prepare_send (const ec_slave_t *, ec_datagram_t *, uint8_t, size_t)
 Prepares a mailbox-send datagram. More...
 
int ec_slave_mbox_prepare_check (const ec_slave_t *, ec_datagram_t *)
 Prepares a datagram for checking the mailbox state. More...
 
int ec_slave_mbox_check (const ec_datagram_t *)
 Processes a mailbox state checking datagram. More...
 
int ec_slave_mbox_prepare_fetch (const ec_slave_t *, ec_datagram_t *)
 Prepares a datagram to fetch mailbox data. More...
 
uint8_t * ec_slave_mbox_fetch (const ec_slave_t *, const ec_datagram_t *, uint8_t *, size_t *)
 Processes received mailbox data. More...
 

Detailed Description

Mailbox functionality.

Definition in file mailbox.h.

Function Documentation

◆ ec_slave_mbox_prepare_send()

uint8_t* ec_slave_mbox_prepare_send ( const ec_slave_t slave,
ec_datagram_t datagram,
uint8_t  type,
size_t  size 
)

Prepares a mailbox-send datagram.

Returns
Pointer to mailbox datagram data, or ERR_PTR() code.
Parameters
slaveslave
datagramdatagram
typemailbox protocol
sizesize of the data

Definition at line 51 of file mailbox.c.

◆ ec_slave_mbox_prepare_check()

int ec_slave_mbox_prepare_check ( const ec_slave_t slave,
ec_datagram_t datagram 
)

Prepares a datagram for checking the mailbox state.

Todo:
Determine sync manager used for receive mailbox
Returns
0 in case of success, else < 0
Parameters
slaveslave
datagramdatagram

Definition at line 96 of file mailbox.c.

◆ ec_slave_mbox_check()

int ec_slave_mbox_check ( const ec_datagram_t datagram)

Processes a mailbox state checking datagram.

Returns
0 in case of success, else < 0
Parameters
datagramdatagram

Definition at line 115 of file mailbox.c.

◆ ec_slave_mbox_prepare_fetch()

int ec_slave_mbox_prepare_fetch ( const ec_slave_t slave,
ec_datagram_t datagram 
)

Prepares a datagram to fetch mailbox data.

Returns
0 in case of success, else < 0
Parameters
slaveslave
datagramdatagram

Definition at line 127 of file mailbox.c.

◆ ec_slave_mbox_fetch()

uint8_t* ec_slave_mbox_fetch ( const ec_slave_t slave,
const ec_datagram_t datagram,
uint8_t *  type,
size_t *  size 
)

Processes received mailbox data.

Returns
Pointer to the received data, or ERR_PTR() code.
Parameters
slaveslave
datagramdatagram
typeexpected mailbox protocol
sizesize of the received data

Definition at line 165 of file mailbox.c.