在使用一个库的时候,可以先了解相关变量的定义,函数。
/** *主站状态
*函数ecrt_master_state()的输出参数
* \see ecrt_master_state().
*/
typedef struct {
unsigned int slaves_responding; /**所有以太网设备上响应slave的总数。 */
unsigned int al_states : 4; /**所有从站应用层状态
状态使用低4位编码
如果一位被置位,意味着至少1个
总线上的从站在响应。
state:
- Bit 0: \a INIT初始化
- Bit 1: \a PREOP预操作
- Bit 2: \a SAFEOP安全操作
- Bit 3: \a OP */操作
unsigned int link_up : 1; /**< \为真,则至少一个网络连接上
up. */
} ec_master_state_t;
/** Master state.
*主站状态
* This is used for the output parameter of ecrt_master_state().
*函数ecrt_master_state()的输出参数
* \see ecrt_master_state().
*/
typedef struct {
unsigned int slaves_responding; /**< Sum of responding slaves on all
Ethernet devices.所有以太网设备上响应slave的总数。 */
unsigned int al_states : 4; /**< Application-layer states of all slaves.所有从站应用层状态
The states are coded in the lower 4 bits.状态使用低4位编码
If a bit is set, it means that at least one如果一位被置位,意味着至少1个
slave in the bus is in the corresponding总线上的从站在响应。
state:
- Bit 0: \a INIT初始化
- Bit 1: \a PREOP预操作
- Bit 2: \a SAFEOP安全操作
- Bit 3: \a OP */操作
unsigned int link_up : 1; /**< \a true, if at least one Ethernet link is为真,则至少一个网络连接上
up. */
} ec_master_state_t;