106 uint16_t enable = ((sync->
enable & 0x01) || pdo_xfer)
108 && ((sync->
enable & 0x04) == 0);
113 switch (sync_config->
dir) {
136 " Ctrl 0x%02X, En %u\n",
138 data_size, control, enable);
#define EC_SLAVE_DBG(slave, level, fmt, args...)
Convenience macro for printing slave-specific debug messages to syslog.
int ec_pdo_list_copy(ec_pdo_list_t *pl, const ec_pdo_list_t *other)
Makes a deep copy of another PDO list.
EtherCAT slave structure.
void ec_pdo_list_clear(ec_pdo_list_t *pl)
PDO list destructor.
#define EC_WRITE_U8(DATA, VAL)
Write an 8-bit unsigned value to EtherCAT data.
ec_direction_t ec_sync_default_direction(const ec_sync_t *sync)
Determines the default direction from the control register.
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.
Global definitions and macros.
EtherCAT master structure.
int ec_sync_add_pdo(ec_sync_t *sync, const ec_pdo_t *pdo)
Adds a PDO to the list of known mapped PDOs.
int ec_pdo_list_add_pdo_copy(ec_pdo_list_t *pl, const ec_pdo_t *pdo)
Add the copy of an existing PDO to the list.
#define EC_WRITE_U16(DATA, VAL)
Write a 16-bit unsigned value to EtherCAT data.
ec_direction_t
Direction type for PDO assignment functions.
ec_slave_t * slave
Slave, the sync manager belongs to.
uint8_t control_register
Control register value.
Values read by the master.
ec_direction_t dir
Sync manager direction.
void ec_sync_clear(ec_sync_t *sync)
Destructor.
ec_watchdog_mode_t watchdog_mode
Watchdog mode.
uint8_t enable
Enable bit.
Sync manager configuration.
#define EC_WRITE_BIT(DATA, POS, VAL)
Write a certain bit of an EtherCAT data byte.
ec_pdo_list_t pdos
Current PDO assignment.
void ec_pdo_list_init(ec_pdo_list_t *pl)
PDO list constructor.
uint16_t physical_start_address
Physical start address.
void ec_sync_init_copy(ec_sync_t *sync, const ec_sync_t *other)
Copy constructor.
uint16_t default_length
Data length in bytes.
Values written by the master.
void ec_sync_init(ec_sync_t *sync, ec_slave_t *slave)
Constructor.
EtherCAT Process data object structure.