IgH EtherCAT Master  1.5.2
ethernet.h File Reference

Ethernet over EtherCAT (EoE) More...

Go to the source code of this file.

Data Structures

struct  ec_eoe
 Ethernet over EtherCAT (EoE) handler. More...
 

Typedefs

typedef struct ec_eoe ec_eoe_t
 

Enumerations

enum  {
  EC_EOE_TYPE_FRAME_FRAG = 0x00, EC_EOE_TYPE_TIMESTAMP_RES = 0x01, EC_EOE_TYPE_INIT_REQ = 0x02, EC_EOE_TYPE_INIT_RES = 0x03,
  EC_EOE_TYPE_MACFILTER_REQ = 0x04, EC_EOE_TYPE_MACFILTER_RES = 0x05
}
 EoE frame types. More...
 

Functions

int ec_eoe_parse (const char *, int *, uint16_t *, uint16_t *)
 Parse an eoe interface from a string. More...
 
int ec_eoe_init (ec_master_t *, ec_eoe_t *, uint16_t, uint16_t)
 EoE explicit init constructor. More...
 
int ec_eoe_auto_init (ec_eoe_t *, ec_slave_t *)
 EoE auto constructor for slave. More...
 
void ec_eoe_link_slave (ec_eoe_t *, ec_slave_t *)
 EoE link slave. More...
 
void ec_eoe_clear_slave (ec_eoe_t *)
 EoE clear slave. More...
 
void ec_eoe_clear (ec_eoe_t *)
 EoE destructor. More...
 
void ec_eoe_run (ec_eoe_t *)
 Runs the EoE state machine.
 
void ec_eoe_queue (ec_eoe_t *)
 Queues the datagram, if necessary.
 
int ec_eoe_is_open (const ec_eoe_t *)
 Returns the state of the device. More...
 
int ec_eoe_is_idle (const ec_eoe_t *)
 Returns the idle state. More...
 
char * ec_eoe_name (const ec_eoe_t *)
 Returns the eoe device name. More...
 
unsigned int ec_eoe_tx_queued_frames (const ec_eoe_t *)
 

Detailed Description

Ethernet over EtherCAT (EoE)

Definition in file ethernet.h.

Typedef Documentation

◆ ec_eoe_t

typedef struct ec_eoe ec_eoe_t
See also
ec_eoe

Definition at line 63 of file ethernet.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

EoE frame types.

Enumerator
EC_EOE_TYPE_TIMESTAMP_RES 

EoE Frame Fragment Tx & Rx.

EC_EOE_TYPE_INIT_REQ 

EoE Timestamp Response.

EC_EOE_TYPE_INIT_RES 

EoE Init, Set IP Parameter Request.

EC_EOE_TYPE_MACFILTER_REQ 

EoE Init, Set IP Parameter Response.

EC_EOE_TYPE_MACFILTER_RES 

EoE Set MAC Address Filter Request.

Definition at line 52 of file ethernet.h.

Function Documentation

◆ ec_eoe_parse()

int ec_eoe_parse ( const char *  eoe,
int *  master_idx,
uint16_t *  alias,
uint16_t *  posn 
)

Parse an eoe interface from a string.

The eoe interface must match the regular expression "eoe([0-9]*)([as])([0-9]*)".

Returns
0 on success, else < 0

Definition at line 132 of file ethernet.c.

◆ ec_eoe_init()

int ec_eoe_init ( ec_master_t master,
ec_eoe_t eoe,
uint16_t  alias,
uint16_t  ring_position 
)

EoE explicit init constructor.

Initializes the EoE handler before a slave is configured, creates a net_device and registers it.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master
eoeEoE handler
aliasEtherCAT slave alias
ring_positionEtherCAT slave ring position

Definition at line 207 of file ethernet.c.

◆ ec_eoe_auto_init()

int ec_eoe_auto_init ( ec_eoe_t eoe,
ec_slave_t slave 
)

EoE auto constructor for slave.

Initializes the EoE handler, creates a net_device and registers it.

Returns
Zero on success, otherwise a negative error code.
Parameters
eoeEoE handler
slaveEtherCAT slave

Definition at line 385 of file ethernet.c.

◆ ec_eoe_link_slave()

void ec_eoe_link_slave ( ec_eoe_t eoe,
ec_slave_t slave 
)

EoE link slave.

links a slave to a handler after a slave is connected or reconfigured during a rescan.

Parameters
eoeEoE handler
slaveEtherCAT slave

Definition at line 412 of file ethernet.c.

◆ ec_eoe_clear_slave()

void ec_eoe_clear_slave ( ec_eoe_t eoe)

EoE clear slave.

delinks slave from the handler so that the EoE interface is kept if a slave get disconnected.

Parameters
eoeEoE handler

Definition at line 448 of file ethernet.c.

◆ ec_eoe_clear()

void ec_eoe_clear ( ec_eoe_t eoe)

EoE destructor.

Unregisteres the net_device and frees allocated memory.

Parameters
eoeEoE handler

Definition at line 489 of file ethernet.c.

◆ ec_eoe_is_open()

int ec_eoe_is_open ( const ec_eoe_t eoe)

Returns the state of the device.

Returns
1 if the device is "up", 0 if it is "down"
Parameters
eoeEoE handler

Definition at line 693 of file ethernet.c.

◆ ec_eoe_is_idle()

int ec_eoe_is_idle ( const ec_eoe_t eoe)

Returns the idle state.

Return values
1The device is idle.
0The device is busy.
Parameters
eoeEoE handler

Definition at line 705 of file ethernet.c.

◆ ec_eoe_name()

char* ec_eoe_name ( const ec_eoe_t eoe)

Returns the eoe device name.

Return values
thedevice name.
Parameters
eoeEoE handler

Definition at line 716 of file ethernet.c.