master.h File Reference


Detailed Description

EtherCAT master structure.

Definition in file master.h.

Go to the source code of this file.

Data Structures

struct  ec_stats_t
 Cyclic statistics. More...
struct  ec_master
 EtherCAT master. More...

Enumerations

enum  ec_master_mode_t { EC_MASTER_MODE_ORPHANED, EC_MASTER_MODE_IDLE, EC_MASTER_MODE_RUNNING }
 EtherCAT master mode.

Functions

int ec_master_init (ec_master_t *, unsigned int, unsigned int)
 Master constructor.
void ec_master_clear (struct kobject *)
 Master destructor.
void ec_master_reset (ec_master_t *)
 Resets the master.
void ec_master_idle_start (ec_master_t *)
 Starts the Idle mode.
void ec_master_idle_stop (ec_master_t *)
 Stops the Idle mode.
void ec_master_eoe_start (ec_master_t *)
 Starts Ethernet-over-EtherCAT processing for all EoE-capable slaves.
void ec_master_eoe_stop (ec_master_t *)
 Stops the Ethernet-over-EtherCAT processing.
void ec_master_receive (ec_master_t *, const uint8_t *, size_t)
 Processes a received frame.
void ec_master_queue_datagram (ec_master_t *, ec_datagram_t *)
 Places a datagram in the datagram queue.
int ec_master_simple_io (ec_master_t *, ec_datagram_t *)
 Sends a single datagram and waits for its reception.
int ec_master_bus_scan (ec_master_t *)
 Scans the EtherCAT bus for slaves.
void ec_master_clear_slaves (ec_master_t *)
 Clears all slaves.
void ec_sync_config (const ec_sync_t *, const ec_slave_t *, uint8_t *)
 Initializes a sync manager configuration page.
void ec_eeprom_sync_config (const ec_eeprom_sync_t *, const ec_slave_t *, uint8_t *)
 Initializes a sync manager configuration page with EEPROM data.
void ec_fmmu_config (const ec_fmmu_t *, const ec_slave_t *, uint8_t *)
 Initializes an FMMU configuration page.
void ec_master_output_stats (ec_master_t *)
 Output statistics in cyclic mode.


Function Documentation

int ec_master_init ec_master_t master,
unsigned int  index,
unsigned int  eoeif_count
 

Master constructor.

Returns:
0 in case of success, else < 0
Parameters:
master  EtherCAT master
index  master index
eoeif_count  number of EoE interfaces

Definition at line 101 of file master.c.

void ec_master_clear struct kobject *  kobj  ) 
 

Master destructor.

Removes all pending datagrams, clears the slave list, clears all domains and frees the device.

Parameters:
kobj  kobject of the master

Definition at line 180 of file master.c.

void ec_master_reset ec_master_t master  ) 
 

Resets the master.

Note: This function has to be called, everytime ec_master_release() is called, to free the slave list, domains etc.

Parameters:
master  EtherCAT master

Definition at line 215 of file master.c.

void ec_master_receive ec_master_t master,
const uint8_t *  frame_data,
size_t  size
 

Processes a received frame.

This function is called by the network driver for every received frame.

Returns:
0 in case of success, else < 0
Parameters:
master  EtherCAT master
frame_data  received data
size  size of the received data

Definition at line 411 of file master.c.

int ec_master_simple_io ec_master_t master,
ec_datagram_t datagram
 

Sends a single datagram and waits for its reception.

If the slave doesn't respond, the datagram is sent again.

Returns:
0 in case of success, else < 0
Parameters:
master  EtherCAT master
datagram  datagram

Definition at line 498 of file master.c.

int ec_master_bus_scan ec_master_t master  ) 
 

Scans the EtherCAT bus for slaves.

Creates a list of slave structures for further processing.

Returns:
0 in case of success, else < 0
Parameters:
master  EtherCAT master

Definition at line 542 of file master.c.

void ec_sync_config const ec_sync_t sync,
const ec_slave_t slave,
uint8_t *  data
 

Initializes a sync manager configuration page.

The referenced memory (data) must be at least EC_SYNC_SIZE bytes.

Parameters:
sync  sync manager
slave  EtherCAT slave
data  > configuration memory

Definition at line 755 of file master.c.

void ec_eeprom_sync_config const ec_eeprom_sync_t sync,
const ec_slave_t slave,
uint8_t *  data
 

Initializes a sync manager configuration page with EEPROM data.

The referenced memory (data) must be at least EC_SYNC_SIZE bytes.

Parameters:
sync  sync manager
slave  EtherCAT slave
data  > configuration memory

Definition at line 778 of file master.c.

void ec_fmmu_config const ec_fmmu_t fmmu,
const ec_slave_t slave,
uint8_t *  data
 

Initializes an FMMU configuration page.

The referenced memory (data) must be at least EC_FMMU_SIZE bytes.

Parameters:
fmmu  FMMU
slave  EtherCAT slave
data  > configuration memory

Definition at line 809 of file master.c.

void ec_master_output_stats ec_master_t master  ) 
 

Output statistics in cyclic mode.

This function outputs statistical data on demand, but not more often than necessary. The output happens at most once a second.

Parameters:
master  EtherCAT master

Definition at line 650 of file master.c.


Generated on Wed Aug 2 18:41:44 2006 for IgH EtherCAT master by  doxygen 1.4.6