master/globals.h
changeset 989 816663ca9370
parent 883 4963e22a267a
child 1000 5746fdd1ca2e
equal deleted inserted replaced
988:a47c5a3c143d 989:816663ca9370
    97 #define EC_MAX_FMMUS 16
    97 #define EC_MAX_FMMUS 16
    98 
    98 
    99 /** Size of an FMMU configuration page. */
    99 /** Size of an FMMU configuration page. */
   100 #define EC_FMMU_PAGE_SIZE 16
   100 #define EC_FMMU_PAGE_SIZE 16
   101 
   101 
       
   102 /** Slave state mask.
       
   103  *
       
   104  * Apply this mask to a slave state byte to get the slave state without
       
   105  * the error flag.
       
   106  */
       
   107 #define EC_SLAVE_STATE_MASK 0x0F
       
   108 
       
   109 /** State of an EtherCAT slave.
       
   110  */
       
   111 typedef enum {
       
   112     EC_SLAVE_STATE_UNKNOWN = 0x00,
       
   113     /**< unknown state */
       
   114     EC_SLAVE_STATE_INIT = 0x01,
       
   115     /**< INIT state (no mailbox communication, no IO) */
       
   116     EC_SLAVE_STATE_PREOP = 0x02,
       
   117     /**< PREOP state (mailbox communication, no IO) */
       
   118     EC_SLAVE_STATE_SAFEOP = 0x04,
       
   119     /**< SAFEOP (mailbox communication and input update) */
       
   120     EC_SLAVE_STATE_OP = 0x08,
       
   121     /**< OP (mailbox communication and input/output update) */
       
   122     EC_SLAVE_STATE_ACK_ERR = 0x10
       
   123     /**< Acknowledge/Error bit (no actual state) */
       
   124 } ec_slave_state_t;
       
   125 
       
   126 /** Supported mailbox protocols.
       
   127  */
       
   128 enum {
       
   129     EC_MBOX_AOE = 0x01, /**< ADS-over-EtherCAT */
       
   130     EC_MBOX_EOE = 0x02, /**< Ethernet-over-EtherCAT */
       
   131     EC_MBOX_COE = 0x04, /**< CANopen-over-EtherCAT */
       
   132     EC_MBOX_FOE = 0x08, /**< File-Access-over-EtherCAT */
       
   133     EC_MBOX_SOE = 0x10, /**< Servo-Profile-over-EtherCAT */
       
   134     EC_MBOX_VOE = 0x20  /**< Vendor specific */
       
   135 };
       
   136 
       
   137 /** Slave information interface CANopen-over-EtherCAT details flags.
       
   138  */
       
   139 typedef struct {
       
   140     uint8_t enable_sdo : 1; /**< Enable Sdo access. */
       
   141     uint8_t enable_sdo_info : 1; /**< SDO information service available. */
       
   142     uint8_t enable_pdo_assign : 1; /**< Pdo mapping configurable. */
       
   143     uint8_t enable_pdo_configuration : 1; /**< Pdo configuration possible. */
       
   144     uint8_t enable_upload_at_startup : 1; /**< ?. */
       
   145     uint8_t enable_sdo_complete_access : 1; /**< Complete access possible. */
       
   146 } ec_sii_coe_details_t;
       
   147 
       
   148 /** Slave information interface general flags.
       
   149  */
       
   150 typedef struct {
       
   151     uint8_t enable_safeop : 1; /**< ?. */
       
   152     uint8_t enable_not_lrw : 1; /**< Slave does not support LRW. */
       
   153 } ec_sii_general_flags_t;
       
   154 
   102 /*****************************************************************************/
   155 /*****************************************************************************/
   103 
   156 
   104 /** Convenience macro for printing EtherCAT-specific information to syslog.
   157 /** Convenience macro for printing EtherCAT-specific information to syslog.
   105  *
   158  *
   106  * This will print the message in \a fmt with a prefixed "EtherCAT: ".
   159  * This will print the message in \a fmt with a prefixed "EtherCAT: ".