master/globals.h
branchstable-1.0
changeset 1617 9f83a343ae75
parent 195 674071846ee3
child 1618 5cff10efb927
equal deleted inserted replaced
1616:f009a710e8a3 1617:9f83a343ae75
    11 #ifndef _EC_GLOBALS_
    11 #ifndef _EC_GLOBALS_
    12 #define _EC_GLOBALS_
    12 #define _EC_GLOBALS_
    13 
    13 
    14 #include <linux/types.h>
    14 #include <linux/types.h>
    15 
    15 
    16 /*****************************************************************************/
    16 /******************************************************************************
       
    17  *  EtherCAT master
       
    18  *****************************************************************************/
    17 
    19 
    18 // EtherCAT-Protokoll
    20 #define EC_MASTER_VERSION_MAIN  1
    19 #define EC_MAX_FRAME_SIZE 1500 /**< maximum size of an EtherCAT frame (without
    21 #define EC_MASTER_VERSION_SUB   0
    20                                 header and CRC) */
    22 #define EC_MASTER_VERSION_EXTRA "stable"
    21 #define EC_MIN_FRAME_SIZE 46 /** ... minimum size */
    23 
    22 #define EC_FRAME_HEADER_SIZE 2 /**< size of an EtherCAT frame header */
    24 /** maximum number of FMMUs per slave */
    23 #define EC_COMMAND_HEADER_SIZE 10 /**< size of an EtherCAT command header */
    25 #define EC_MAX_FMMUS 16
    24 #define EC_COMMAND_FOOTER_SIZE 2 /**< size of an EtherCAT command footer */
    26 
    25 #define EC_SYNC_SIZE 8 /**< size of a sync manager configuration page */
    27 /******************************************************************************
    26 #define EC_FMMU_SIZE 16 /**< size of an FMMU configuration page */
    28  *  EtherCAT protocol
    27 #define EC_MAX_FMMUS 16 /**< maximum number of FMMUs per slave */
    29  *****************************************************************************/
    28 #define EC_MAX_DATA_SIZE (EC_MAX_FRAME_SIZE \
    30 
    29                           - EC_FRAME_HEADER_SIZE \
    31 /** maximum size of an EtherCAT frame (without header and CRC) */
    30                           - EC_COMMAND_HEADER_SIZE \
    32 #define EC_MAX_FRAME_SIZE 1500
    31                           - EC_COMMAND_FOOTER_SIZE) /**< maximum data size of a
    33 
    32                                                        single command */
    34 /** ... minimum size */
       
    35 #define EC_MIN_FRAME_SIZE 46
       
    36 
       
    37 /** size of an EtherCAT frame header */
       
    38 #define EC_FRAME_HEADER_SIZE 2
       
    39 
       
    40 /** size of an EtherCAT command header */
       
    41 #define EC_COMMAND_HEADER_SIZE 10
       
    42 
       
    43 /** size of an EtherCAT command footer */
       
    44 #define EC_COMMAND_FOOTER_SIZE 2
       
    45 
       
    46 /** size of a sync manager configuration page */
       
    47 #define EC_SYNC_SIZE 8
       
    48 
       
    49 /** size of an FMMU configuration page */
       
    50 #define EC_FMMU_SIZE 16
       
    51 
       
    52 /** resulting maximum data size of a single command in a frame */
       
    53 #define EC_MAX_DATA_SIZE (EC_MAX_FRAME_SIZE - EC_FRAME_HEADER_SIZE \
       
    54                           - EC_COMMAND_HEADER_SIZE - EC_COMMAND_FOOTER_SIZE)
    33 
    55 
    34 /*****************************************************************************/
    56 /*****************************************************************************/
    35 
    57 
    36 #define EC_INFO(fmt, args...) \
    58 #define EC_INFO(fmt, args...) \
    37     printk(KERN_INFO "EtherCAT: " fmt, ##args)
    59     printk(KERN_INFO "EtherCAT: " fmt, ##args)