include/ecrt.h
changeset 1022 8e49b519e6ba
parent 1020 9bf2ddf05e17
child 1055 2be8918682fa
equal deleted inserted replaced
1021:fa5cf205f4f0 1022:8e49b519e6ba
   155  *
   155  *
   156  * \see ecrt_master_state().
   156  * \see ecrt_master_state().
   157  */
   157  */
   158 typedef struct {
   158 typedef struct {
   159     unsigned int slaves_responding; /**< Number of slaves in the bus. */
   159     unsigned int slaves_responding; /**< Number of slaves in the bus. */
   160     uint8_t slave_states; /**< Application-layer states of all slaves.
   160     unsigned int al_states : 4; /**< Application-layer states of all slaves.
   161                             The states are coded in the lower 4 bits. If a bit
   161                                   The states are coded in the lower 4 bits.
   162                             is set, it means that at least one slave in the
   162                                   If a bit is set, it means that at least one
   163                             bus is in the corresponding state:
   163                                   slave in the bus is in the corresponding
   164                             - Bit 0: \a INIT
   164                                   state:
   165                             - Bit 1: \a PREOP
   165                                   - Bit 0: \a INIT
   166                             - Bit 2: \a SAFEOP
   166                                   - Bit 1: \a PREOP
   167                             - Bit 3: \a OP */
   167                                   - Bit 2: \a SAFEOP
   168     uint8_t link_up; /**< \a true, if the network link is up. */
   168                                   - Bit 3: \a OP */
       
   169     unsigned int link_up : 1; /**< \a true, if the network link is up. */
   169 } ec_master_state_t;
   170 } ec_master_state_t;
   170 
   171 
   171 /*****************************************************************************/
   172 /*****************************************************************************/
   172 
   173 
   173 /** Slave configuration state.
   174 /** Slave configuration state.
   175  * This is used as an output parameter of ecrt_slave_config_state().
   176  * This is used as an output parameter of ecrt_slave_config_state().
   176  * 
   177  * 
   177  * \see ecrt_slave_config_state().
   178  * \see ecrt_slave_config_state().
   178  */
   179  */
   179 typedef struct  {
   180 typedef struct  {
   180     uint8_t slave_state; /**< The application-layer state of the slave.
       
   181                            - 1: \a INIT
       
   182                            - 2: \a PREOP
       
   183                            - 4: \a SAFEOP
       
   184                            - 8: \a OP
       
   185 
       
   186                            Note that each state is coded in a different
       
   187                            bit! */
       
   188     unsigned int online : 1; /**< The slave is online. */
   181     unsigned int online : 1; /**< The slave is online. */
   189     unsigned int operational : 1; /**< The slave was brought into \a OP state
   182     unsigned int operational : 1; /**< The slave was brought into \a OP state
   190                                     using the specified configuration. */
   183                                     using the specified configuration. */
       
   184     unsigned int al_state : 4; /**< The application-layer state of the slave.
       
   185                                  - 1: \a INIT
       
   186                                  - 2: \a PREOP
       
   187                                  - 4: \a SAFEOP
       
   188                                  - 8: \a OP
       
   189 
       
   190                                  Note that each state is coded in a different
       
   191                                  bit! */
   191 } ec_slave_config_state_t;
   192 } ec_slave_config_state_t;
   192 
   193 
   193 /*****************************************************************************/
   194 /*****************************************************************************/
   194 
   195 
   195 /** Domain working counter interpretation.
   196 /** Domain working counter interpretation.