globals.h File Reference


Detailed Description

Global definitions and macros.

Definition in file globals.h.

Go to the source code of this file.

Data Structures

struct  ec_code_msg_t
 Code - Message pair. More...

Defines

#define EC_MASTER_VERSION_MAIN   1
 master main version
#define EC_MASTER_VERSION_SUB   1
 master sub version (after the dot)
#define EC_MASTER_VERSION_EXTRA   "stable"
 master extra version (just a string)
#define EC_MAX_FMMUS   16
 maximum number of FMMUs per slave
#define EC_EOE_TX_QUEUE_SIZE   100
 size of the EoE tx queue
#define EC_EOE_FREQUENCY   1000
 clock frequency for the EoE state machines
#define EC_IO_TIMEOUT   500
 datagram timeout in microseconds
#define EC_FRAME_HEADER_SIZE   2
 size of an EtherCAT frame header
#define EC_DATAGRAM_HEADER_SIZE   10
 size of an EtherCAT datagram header
#define EC_DATAGRAM_FOOTER_SIZE   2
 size of an EtherCAT datagram footer
#define EC_SYNC_SIZE   8
 size of a sync manager configuration page
#define EC_FMMU_SIZE   16
 size of an FMMU configuration page
#define EC_MAX_DATA_SIZE
 resulting maximum data size of a single datagram in a frame
#define EC_INFO(fmt, args...)   printk(KERN_INFO "EtherCAT: " fmt, ##args)
 Convenience macro for printing EtherCAT-specific information to syslog.
#define EC_ERR(fmt, args...)   printk(KERN_ERR "EtherCAT ERROR: " fmt, ##args)
 Convenience macro for printing EtherCAT-specific errors to syslog.
#define EC_WARN(fmt, args...)   printk(KERN_WARNING "EtherCAT WARNING: " fmt, ##args)
 Convenience macro for printing EtherCAT-specific warnings to syslog.
#define EC_DBG(fmt, args...)   printk(KERN_DEBUG "EtherCAT DEBUG: " fmt, ##args)
 Convenience macro for printing EtherCAT debug messages to syslog.
#define EC_LIT(X)   #X
 Helper macro for EC_STR(), literates a macro argument.
#define EC_STR(X)   EC_LIT(X)
 Converts a macro argument to a string.
#define EC_SYSFS_READ_ATTR(NAME)
 Convenience macro for defining read-only SysFS attributes.
#define EC_SYSFS_READ_WRITE_ATTR(NAME)
 Convenience macro for defining read-write SysFS attributes.

Functions

void ec_print_data (const uint8_t *, size_t)
 Outputs frame contents for debugging purposes.
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 *)
 Prints slave states in clear text.


Define Documentation

#define EC_MAX_DATA_SIZE
 

Value:

resulting maximum data size of a single datagram in a frame

Definition at line 91 of file globals.h.

#define EC_INFO fmt,
args...   )     printk(KERN_INFO "EtherCAT: " fmt, ##args)
 

Convenience macro for printing EtherCAT-specific information to syslog.

This will print the message in fmt with a prefixed "EtherCAT: ".

Parameters:
fmt format string (like in printf())
args arguments (optional)

Definition at line 103 of file globals.h.

#define EC_ERR fmt,
args...   )     printk(KERN_ERR "EtherCAT ERROR: " fmt, ##args)
 

Convenience macro for printing EtherCAT-specific errors to syslog.

This will print the message in fmt with a prefixed "EtherCAT ERROR: ".

Parameters:
fmt format string (like in printf())
args arguments (optional)

Definition at line 113 of file globals.h.

#define EC_WARN fmt,
args...   )     printk(KERN_WARNING "EtherCAT WARNING: " fmt, ##args)
 

Convenience macro for printing EtherCAT-specific warnings to syslog.

This will print the message in fmt with a prefixed "EtherCAT WARNING: ".

Parameters:
fmt format string (like in printf())
args arguments (optional)

Definition at line 123 of file globals.h.

#define EC_DBG fmt,
args...   )     printk(KERN_DEBUG "EtherCAT DEBUG: " fmt, ##args)
 

Convenience macro for printing EtherCAT debug messages to syslog.

This will print the message in fmt with a prefixed "EtherCAT DEBUG: ".

Parameters:
fmt format string (like in printf())
args arguments (optional)

Definition at line 133 of file globals.h.

#define EC_LIT  )     #X
 

Helper macro for EC_STR(), literates a macro argument.

Parameters:
X argument to literate.

Definition at line 141 of file globals.h.

#define EC_STR  )     EC_LIT(X)
 

Converts a macro argument to a string.

Parameters:
X argument to stringify.

Definition at line 148 of file globals.h.

#define EC_SYSFS_READ_ATTR NAME   ) 
 

Value:

static struct attribute attr_##NAME = { \
        .name = EC_STR(NAME), .owner = THIS_MODULE, .mode = S_IRUGO \
    }
Convenience macro for defining read-only SysFS attributes.

This results in creating a static variable called attr_NAME. The SysFS file will be world-readable.

Parameters:
NAME name of the attribute to create.

Definition at line 157 of file globals.h.

#define EC_SYSFS_READ_WRITE_ATTR NAME   ) 
 

Value:

static struct attribute attr_##NAME = { \
        .name = EC_STR(NAME), .owner = THIS_MODULE, .mode = S_IRUGO | S_IWUSR \
    }
Convenience macro for defining read-write SysFS attributes.

This results in creating a static variable called attr_NAME. The SysFS file will be word-readable plus owner-writable.

Parameters:
NAME name of the attribute to create.

Definition at line 169 of file globals.h.


Generated on Fri Sep 1 14:56:57 2006 for IgH EtherCAT master by  doxygen 1.4.6