master/slave.h
changeset 989 816663ca9370
parent 980 c07dd38243ba
child 992 50a44cbd30af
equal deleted inserted replaced
988:a47c5a3c143d 989:816663ca9370
    49 #include "globals.h"
    49 #include "globals.h"
    50 #include "datagram.h"
    50 #include "datagram.h"
    51 #include "pdo.h"
    51 #include "pdo.h"
    52 #include "sync.h"
    52 #include "sync.h"
    53 #include "sdo.h"
    53 #include "sdo.h"
    54 
       
    55 /*****************************************************************************/
       
    56 
       
    57 /** Slave state mask.
       
    58  *
       
    59  * Apply this mask to a slave state byte to get the slave state without
       
    60  * the error flag.
       
    61  */
       
    62 #define EC_SLAVE_STATE_MASK 0x0F
       
    63 
       
    64 /*****************************************************************************/
       
    65 
       
    66 /** State of an EtherCAT slave.
       
    67  */
       
    68 typedef enum {
       
    69     EC_SLAVE_STATE_UNKNOWN = 0x00,
       
    70     /**< unknown state */
       
    71     EC_SLAVE_STATE_INIT = 0x01,
       
    72     /**< INIT state (no mailbox communication, no IO) */
       
    73     EC_SLAVE_STATE_PREOP = 0x02,
       
    74     /**< PREOP state (mailbox communication, no IO) */
       
    75     EC_SLAVE_STATE_SAFEOP = 0x04,
       
    76     /**< SAFEOP (mailbox communication and input update) */
       
    77     EC_SLAVE_STATE_OP = 0x08,
       
    78     /**< OP (mailbox communication and input/output update) */
       
    79     EC_SLAVE_STATE_ACK_ERR = 0x10
       
    80     /**< Acknowledge/Error bit (no actual state) */
       
    81 } ec_slave_state_t;
       
    82 
       
    83 /*****************************************************************************/
       
    84 
       
    85 /** Supported mailbox protocols.
       
    86  */
       
    87 enum {
       
    88     EC_MBOX_AOE = 0x01, /**< ADS-over-EtherCAT */
       
    89     EC_MBOX_EOE = 0x02, /**< Ethernet-over-EtherCAT */
       
    90     EC_MBOX_COE = 0x04, /**< CANopen-over-EtherCAT */
       
    91     EC_MBOX_FOE = 0x08, /**< File-Access-over-EtherCAT */
       
    92     EC_MBOX_SOE = 0x10, /**< Servo-Profile-over-EtherCAT */
       
    93     EC_MBOX_VOE = 0x20  /**< Vendor specific */
       
    94 };
       
    95 
       
    96 /*****************************************************************************/
       
    97 
       
    98 /** Slave information interface CANopen-over-EtherCAT details flags.
       
    99  */
       
   100 typedef struct {
       
   101     uint8_t enable_sdo : 1; /**< Enable Sdo access. */
       
   102     uint8_t enable_sdo_info : 1; /**< SDO information service available. */
       
   103     uint8_t enable_pdo_assign : 1; /**< Pdo mapping configurable. */
       
   104     uint8_t enable_pdo_configuration : 1; /**< Pdo configuration possible. */
       
   105     uint8_t enable_upload_at_startup : 1; /**< ?. */
       
   106     uint8_t enable_sdo_complete_access : 1; /**< Complete access possible. */
       
   107 } ec_sii_coe_details_t;
       
   108 
       
   109 /*****************************************************************************/
       
   110 
       
   111 /** Slave information interface general flags.
       
   112  */
       
   113 typedef struct {
       
   114     uint8_t enable_safeop : 1; /**< ?. */
       
   115     uint8_t enable_not_lrw : 1; /**< Slave does not support LRW. */
       
   116 } ec_sii_general_flags_t;
       
   117 
    54 
   118 /*****************************************************************************/
    55 /*****************************************************************************/
   119 
    56 
   120 /** Slave information interface data.
    57 /** Slave information interface data.
   121  */
    58  */