include/ecrt.h
changeset 612 aede068f9a74
parent 541 5a2b1658b67f
child 635 d304ef4af542
equal deleted inserted replaced
611:16498ed938f4 612:aede068f9a74
    75 
    75 
    76 struct ec_slave;
    76 struct ec_slave;
    77 typedef struct ec_slave ec_slave_t; /**< \see ec_slave */
    77 typedef struct ec_slave ec_slave_t; /**< \see ec_slave */
    78 
    78 
    79 /**
    79 /**
       
    80  * Bus status.
       
    81  */
       
    82 
       
    83 typedef enum {
       
    84     EC_BUS_FAILURE,    // some slaves offline
       
    85     EC_BUS_OK,         // all slaves online
       
    86     EC_BUS_REDUNDANCY  // bus interrupted, but redundancy active
       
    87 }
       
    88 ec_bus_status_t;
       
    89 
       
    90 /**
       
    91  * Master status.
       
    92  * This is used for the output parameter of ecrt_master_get_status().
       
    93  */
       
    94 
       
    95 typedef struct {
       
    96     ec_bus_status_t bus_status;
       
    97     unsigned int bus_tainted;
       
    98     unsigned int slaves_responding;
       
    99 }
       
   100 ec_master_status_t;
       
   101 
       
   102 /**
    80    Initialization type for PDO registrations.
   103    Initialization type for PDO registrations.
    81    This type is used as a parameter for the ec_domain_register_pdo_list()
   104    This type is used as a parameter for the ecrt_domain_register_pdo_list()
    82    function.
   105    function.
    83 */
   106 */
    84 
   107 
    85 typedef struct
   108 typedef struct
    86 {
   109 {
    93     void **data_ptr; /**< address of the process data pointer */
   116     void **data_ptr; /**< address of the process data pointer */
    94 }
   117 }
    95 ec_pdo_reg_t;
   118 ec_pdo_reg_t;
    96 
   119 
    97 /**
   120 /**
    98    Direction type for ec_domain_register_pdo_range()
   121    Direction type for ecrt_domain_register_pdo_range()
    99 */
   122 */
   100 
   123 
   101 typedef enum {EC_DIR_INPUT, EC_DIR_OUTPUT} ec_direction_t;
   124 typedef enum {EC_DIR_INPUT, EC_DIR_OUTPUT} ec_direction_t;
   102 
   125 
   103 /******************************************************************************
   126 /******************************************************************************
   125 
   148 
   126 void ecrt_master_run(ec_master_t *master);
   149 void ecrt_master_run(ec_master_t *master);
   127 
   150 
   128 ec_slave_t *ecrt_master_get_slave(const ec_master_t *, const char *);
   151 ec_slave_t *ecrt_master_get_slave(const ec_master_t *, const char *);
   129 
   152 
   130 /** \cond */
   153 void ecrt_master_get_status(const ec_master_t *master, ec_master_status_t *);
   131 int ecrt_master_state(const ec_master_t *master);
       
   132 /** \endcond */
       
   133 
   154 
   134 /******************************************************************************
   155 /******************************************************************************
   135  *  Domain Methods
   156  *  Domain Methods
   136  *****************************************************************************/
   157  *****************************************************************************/
   137 
   158