IgH EtherCAT Master
1.5.3
|
Global definitions and macros. More...
Go to the source code of this file.
Data Structures | |
struct | ec_sii_coe_details_t |
Slave information interface CANopen over EtherCAT details flags. More... | |
struct | ec_sii_general_flags_t |
Slave information interface general flags. More... | |
struct | ec_sync_signal_t |
EtherCAT slave sync signal configuration. More... | |
struct | ec_code_msg_t |
Code/Message pair. More... | |
Macros | |
#define | EC_IO_TIMEOUT 500 |
Datagram timeout in microseconds. More... | |
#define | EC_BYTE_TRANSMISSION_TIME_NS 80 |
Time to send a byte in nanoseconds. More... | |
#define | EC_FSM_RETRIES 3 |
Number of state machine retries on datagram timeout. More... | |
#define | EC_WAIT_SDO_DICT 3 |
Seconds to wait before fetching SDO dictionary after slave entered PREOP state. More... | |
#define | EC_STATE_STRING_SIZE 32 |
Minimum size of a buffer used with ec_state_string(). More... | |
#define | EC_MAX_SII_SIZE 4096 |
Maximum SII size in words, to avoid infinite reading. More... | |
#define | EC_RATE_COUNT 3 |
Number of statistic rate intervals to maintain. More... | |
#define | EC_FRAME_HEADER_SIZE 2 |
Size of an EtherCAT frame header. More... | |
#define | EC_DATAGRAM_HEADER_SIZE 10 |
Size of an EtherCAT datagram header. More... | |
#define | EC_DATAGRAM_FOOTER_SIZE 2 |
Size of an EtherCAT datagram footer. More... | |
#define | EC_ADDR_LEN 4 |
Size of the EtherCAT address field. More... | |
#define | EC_MAX_DATA_SIZE |
Resulting maximum data size of a single datagram in a frame. More... | |
#define | EC_MBOX_HEADER_SIZE 6 |
Mailbox header size. More... | |
#define | EC_FIRST_SII_CATEGORY_OFFSET 0x40 |
Word offset of first SII category. More... | |
#define | EC_SYNC_PAGE_SIZE 8 |
Size of a sync manager configuration page. More... | |
#define | EC_MAX_FMMUS 16 |
Maximum number of FMMUs per slave. More... | |
#define | EC_FMMU_PAGE_SIZE 16 |
Size of an FMMU configuration page. More... | |
#define | EC_SYNC_SIGNAL_COUNT 2 |
Number of DC sync signals. More... | |
#define | EC_DATAGRAM_NAME_SIZE 20 |
Size of the datagram description string. More... | |
#define | EC_SLAVE_STATE_MASK 0x0F |
Slave state mask. More... | |
#define | EC_INFO(fmt, args...) printk(KERN_INFO "EtherCAT: " fmt, ##args) |
Convenience macro for printing EtherCAT-specific information to syslog. More... | |
#define | EC_ERR(fmt, args...) printk(KERN_ERR "EtherCAT ERROR: " fmt, ##args) |
Convenience macro for printing EtherCAT-specific errors to syslog. More... | |
#define | EC_WARN(fmt, args...) printk(KERN_WARNING "EtherCAT WARNING: " fmt, ##args) |
Convenience macro for printing EtherCAT-specific warnings to syslog. More... | |
#define | EC_DBG(fmt, args...) printk(KERN_DEBUG "EtherCAT DEBUG: " fmt, ##args) |
Convenience macro for printing EtherCAT debug messages to syslog. More... | |
#define | EC_ABS(X) ((X) >= 0 ? (X) : -(X)) |
Absolute value. | |
Typedefs | |
typedef struct ec_slave | ec_slave_t |
Enumerations | |
enum | ec_slave_state_t { EC_SLAVE_STATE_UNKNOWN = 0x00, EC_SLAVE_STATE_INIT = 0x01, EC_SLAVE_STATE_PREOP = 0x02, EC_SLAVE_STATE_BOOT = 0x03, EC_SLAVE_STATE_SAFEOP = 0x04, EC_SLAVE_STATE_OP = 0x08, EC_SLAVE_STATE_ACK_ERR = 0x10 } |
State of an EtherCAT slave. More... | |
enum | { EC_MBOX_AOE = 0x01, EC_MBOX_EOE = 0x02, EC_MBOX_COE = 0x04, EC_MBOX_FOE = 0x08, EC_MBOX_SOE = 0x10, EC_MBOX_VOE = 0x20 } |
Supported mailbox protocols. More... | |
enum | ec_slave_dc_range_t { EC_DC_32, EC_DC_64 } |
EtherCAT slave distributed clocks range. More... | |
enum | { EC_SDO_ENTRY_ACCESS_PREOP, EC_SDO_ENTRY_ACCESS_SAFEOP, EC_SDO_ENTRY_ACCESS_OP, EC_SDO_ENTRY_ACCESS_COUNT } |
Access states for SDO entries. More... | |
enum | ec_device_index_t { EC_DEVICE_MAIN, EC_DEVICE_BACKUP } |
Master devices. More... | |
enum | ec_internal_request_state_t { EC_INT_REQUEST_INIT, EC_INT_REQUEST_QUEUED, EC_INT_REQUEST_BUSY, EC_INT_REQUEST_SUCCESS, EC_INT_REQUEST_FAILURE } |
Generic request state. More... | |
enum | ec_origin_t { EC_ORIG_INTERNAL, EC_ORIG_EXTERNAL } |
Origin type. More... | |
Functions | |
unsigned int | ec_master_count (void) |
Get the number of masters. | |
void | ec_print_data (const uint8_t *, size_t) |
Outputs frame contents for debugging purposes. More... | |
void | ec_print_data_diff (const uint8_t *, const uint8_t *, size_t) |
Outputs frame contents and differences for debugging purposes. | |
size_t | ec_state_string (uint8_t, char *, uint8_t) |
Prints slave states in clear text. More... | |
ssize_t | ec_mac_print (const uint8_t *, char *) |
Print a MAC address to a buffer. More... | |
int | ec_mac_is_zero (const uint8_t *) |
ec_master_t * | ecrt_request_master_err (unsigned int) |
Request a master. More... | |
Variables | |
const char * | ec_device_names [2] |
Device names. | |
char * | ec_master_version_str |
Version string. More... | |
const ec_request_state_t | ec_request_state_translation_table [] |
Global request state type translation table. More... | |
Global definitions and macros.
Definition in file globals.h.
#define EC_IO_TIMEOUT 500 |
#define EC_BYTE_TRANSMISSION_TIME_NS 80 |
#define EC_FSM_RETRIES 3 |
#define EC_WAIT_SDO_DICT 3 |
#define EC_STATE_STRING_SIZE 32 |
Minimum size of a buffer used with ec_state_string().
#define EC_MAX_SII_SIZE 4096 |
#define EC_RATE_COUNT 3 |
#define EC_FRAME_HEADER_SIZE 2 |
#define EC_DATAGRAM_HEADER_SIZE 10 |
#define EC_DATAGRAM_FOOTER_SIZE 2 |
#define EC_MAX_DATA_SIZE |
Resulting maximum data size of a single datagram in a frame.
#define EC_FIRST_SII_CATEGORY_OFFSET 0x40 |
#define EC_SYNC_PAGE_SIZE 8 |
#define EC_FMMU_PAGE_SIZE 16 |
#define EC_DATAGRAM_NAME_SIZE 20 |
#define EC_SLAVE_STATE_MASK 0x0F |
#define EC_INFO | ( | fmt, | |
args... | |||
) | printk(KERN_INFO "EtherCAT: " fmt, ##args) |
#define EC_ERR | ( | fmt, | |
args... | |||
) | printk(KERN_ERR "EtherCAT ERROR: " fmt, ##args) |
#define EC_WARN | ( | fmt, | |
args... | |||
) | printk(KERN_WARNING "EtherCAT WARNING: " fmt, ##args) |
#define EC_DBG | ( | fmt, | |
args... | |||
) | printk(KERN_DEBUG "EtherCAT DEBUG: " fmt, ##args) |
typedef struct ec_slave ec_slave_t |
enum ec_slave_state_t |
State of an EtherCAT slave.
anonymous enum |
enum ec_slave_dc_range_t |
anonymous enum |
enum ec_device_index_t |
Generic request state.
enum ec_origin_t |
void ec_print_data | ( | const uint8_t * | data, |
size_t | size | ||
) |
size_t ec_state_string | ( | uint8_t | states, |
char * | buffer, | ||
uint8_t | multi | ||
) |
ssize_t ec_mac_print | ( | const uint8_t * | mac, |
char * | buffer | ||
) |
int ec_mac_is_zero | ( | const uint8_t * | mac | ) |
ec_master_t* ecrt_request_master_err | ( | unsigned int | master_index | ) |
Request a master.
Same as ecrt_request_master(), but with ERR_PTR() return value.
master_index | Master index. |
const ec_request_state_t ec_request_state_translation_table[] |