27#ifndef __EC_MASTER_GLOBALS_H__
28#define __EC_MASTER_GLOBALS_H__
30#include "../globals.h"
38#define EC_IO_TIMEOUT 500
44#define EC_BYTE_TRANSMISSION_TIME_NS 80
47#define EC_FSM_RETRIES 3
51#define EC_WAIT_SDO_DICT 3
54#define EC_STATE_STRING_SIZE 32
57#define EC_MAX_SII_SIZE 4096
60#define EC_RATE_COUNT 3
67#define EC_FRAME_HEADER_SIZE 2
70#define EC_DATAGRAM_HEADER_SIZE 10
73#define EC_DATAGRAM_FOOTER_SIZE 2
79#define EC_MAX_DATA_SIZE (ETH_DATA_LEN - EC_FRAME_HEADER_SIZE \
80 - EC_DATAGRAM_HEADER_SIZE - EC_DATAGRAM_FOOTER_SIZE)
83#define EC_MBOX_HEADER_SIZE 6
86#define EC_FIRST_SII_CATEGORY_OFFSET 0x40
89#define EC_SYNC_PAGE_SIZE 8
92#define EC_MAX_FMMUS 16
95#define EC_FMMU_PAGE_SIZE 16
98#define EC_SYNC_SIGNAL_COUNT 2
104#define EC_DATAGRAM_NAME_SIZE 20
110#define EC_MAX_HOSTNAME_SIZE 32
117#define EC_SLAVE_STATE_MASK 0x0F
214#define EC_INFO(fmt, args...) \
215 printk(KERN_INFO "EtherCAT: " fmt, ##args)
224#define EC_ERR(fmt, args...) \
225 printk(KERN_ERR "EtherCAT ERROR: " fmt, ##args)
234#define EC_WARN(fmt, args...) \
235 printk(KERN_WARNING "EtherCAT WARNING: " fmt, ##args)
244#define EC_DBG(fmt, args...) \
245 printk(KERN_DEBUG "EtherCAT DEBUG: " fmt, ##args)
251#define EC_ABS(X) ((X) >= 0 ? (X) : -(X))
289 EC_INT_REQUEST_QUEUED,
291 EC_INT_REQUEST_SUCCESS,
292 EC_INT_REQUEST_FAILURE
EtherCAT master application interface.
ec_slave_state_t
State of an EtherCAT slave.
@ EC_SLAVE_STATE_BOOT
Bootstrap state (mailbox communication, firmware update).
@ EC_SLAVE_STATE_PREOP
PREOP state (mailbox communication, no IO).
@ EC_SLAVE_STATE_OP
OP (mailbox communication and input/output update).
@ EC_SLAVE_STATE_SAFEOP
SAFEOP (mailbox communication and input update).
@ EC_SLAVE_STATE_UNKNOWN
unknown state
@ EC_SLAVE_STATE_INIT
INIT state (no mailbox communication, no IO).
@ EC_SLAVE_STATE_ACK_ERR
Acknowledge/Error bit (no actual state).
@ EC_SDO_ENTRY_ACCESS_PREOP
Access rights in PREOP.
@ EC_SDO_ENTRY_ACCESS_COUNT
Number of states.
@ EC_SDO_ENTRY_ACCESS_OP
Access rights in OP.
@ EC_SDO_ENTRY_ACCESS_SAFEOP
Access rights in SAFEOP.
void ec_print_data_diff(const uint8_t *, const uint8_t *, size_t)
Outputs frame contents and differences for debugging purposes.
const ec_request_state_t ec_request_state_translation_table[]
Global request state type translation table.
int ec_mac_is_zero(const uint8_t *)
unsigned int ec_master_count(void)
Get the number of masters.
ssize_t ec_mac_print(const uint8_t *, char *)
Print a MAC address to a buffer.
@ EC_MBOX_FOE
File-Access over EtherCAT.
@ EC_MBOX_COE
CANopen over EtherCAT.
@ EC_MBOX_EOE
Ethernet over EtherCAT.
@ EC_MBOX_VOE
Vendor specific.
@ EC_MBOX_SOE
Servo-Profile over EtherCAT.
@ EC_MBOX_AOE
ADS over EtherCAT.
size_t ec_state_string(uint8_t, char *, uint8_t)
Prints slave states in clear text.
ec_slave_dc_range_t
EtherCAT slave distributed clocks range.
struct ec_slave ec_slave_t
ec_master_t * ecrt_request_master_err(unsigned int)
Request a master.
char * ec_master_version_str
Version string.
const char * ec_device_names[2]
Device names.
@ EC_ORIG_EXTERNAL
External.
@ EC_ORIG_INTERNAL
Internal.
ec_device_index_t
Master devices.
@ EC_DEVICE_MAIN
Main device.
@ EC_DEVICE_BACKUP
Backup device.
ec_internal_request_state_t
Generic request state.
void ec_print_data(const uint8_t *, size_t)
Outputs frame contents for debugging purposes.
struct ec_master ec_master_t
ec_request_state_t
Request state.
const char * message
Message belonging to code.
Slave information interface CANopen over EtherCAT details flags.
uint8_t enable_sdo
Enable SDO access.
uint8_t enable_upload_at_startup
?
uint8_t enable_pdo_assign
PDO mapping configurable.
uint8_t enable_sdo_complete_access
Complete access possible.
uint8_t enable_pdo_configuration
PDO configuration possible.
uint8_t enable_sdo_info
SDO information service available.
Slave information interface general flags.
uint8_t enable_not_lrw
Slave does not support LRW.
EtherCAT slave sync signal configuration.
uint32_t cycle_time
Cycle time [ns].
int32_t shift_time
Shift time [ns].