IgH EtherCAT Master  1.5.3
sync.c File Reference

EtherCAT sync manager methods. More...

Go to the source code of this file.

Functions

void ec_sync_init (ec_sync_t *sync, ec_slave_t *slave)
 Constructor. More...
 
void ec_sync_init_copy (ec_sync_t *sync, const ec_sync_t *other)
 Copy constructor. More...
 
void ec_sync_clear (ec_sync_t *sync)
 Destructor. More...
 
void ec_sync_page (const ec_sync_t *sync, uint8_t sync_index, uint16_t data_size, const ec_sync_config_t *sync_config, uint8_t pdo_xfer, uint8_t *data)
 Initializes a sync manager configuration page. More...
 
int ec_sync_add_pdo (ec_sync_t *sync, const ec_pdo_t *pdo)
 Adds a PDO to the list of known mapped PDOs. More...
 
ec_direction_t ec_sync_default_direction (const ec_sync_t *sync)
 Determines the default direction from the control register. More...
 

Detailed Description

EtherCAT sync manager methods.

Definition in file sync.c.

Function Documentation

◆ ec_sync_init()

void ec_sync_init ( ec_sync_t sync,
ec_slave_t slave 
)

Constructor.

Parameters
syncEtherCAT sync manager.
slaveEtherCAT slave.

Definition at line 46 of file sync.c.

◆ ec_sync_init_copy()

void ec_sync_init_copy ( ec_sync_t sync,
const ec_sync_t other 
)

Copy constructor.

Parameters
syncEtherCAT sync manager.
otherSync manager to copy from.

Definition at line 63 of file sync.c.

◆ ec_sync_clear()

void ec_sync_clear ( ec_sync_t sync)

Destructor.

Parameters
syncEtherCAT sync manager.

Definition at line 81 of file sync.c.

◆ ec_sync_page()

void ec_sync_page ( const ec_sync_t sync,
uint8_t  sync_index,
uint16_t  data_size,
const ec_sync_config_t sync_config,
uint8_t  pdo_xfer,
uint8_t *  data 
)

Initializes a sync manager configuration page.

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

Parameters
syncSync manager.
sync_indexIndex of the sync manager.
data_sizeData size.
sync_configConfiguration.
pdo_xferNon-zero, if PDOs will be transferred via this sync manager.
data

Configuration memory.

Definition at line 94 of file sync.c.

◆ ec_sync_add_pdo()

int ec_sync_add_pdo ( ec_sync_t sync,
const ec_pdo_t pdo 
)

Adds a PDO to the list of known mapped PDOs.

Returns
0 on success, else < 0
Parameters
syncEtherCAT sync manager.
pdoPDO to map.

Definition at line 153 of file sync.c.

◆ ec_sync_default_direction()

ec_direction_t ec_sync_default_direction ( const ec_sync_t sync)

Determines the default direction from the control register.

Returns
Direction.
Parameters
syncEtherCAT sync manager.

Definition at line 167 of file sync.c.