04 ethercat(IGH)全局函数

/******************************************************************************
 *04 Global functions  全局函数
 *****************************************************************************/

#ifdef __cplusplus
extern "C" {
#endif

/**01 Returns the version magic of the realtime interface.
 *返回实时接口的版本魔法。
 * \return Value of ECRT_VERSION_MAGIC() at EtherCAT master compile time.
 */
unsigned int ecrt_version_magic(void);

/**02 Requests an EtherCAT master for realtime operation.
 *请求EtherCAT主机进行实时操作。
 * Before an application can access an EtherCAT master, it has to reserve one
 * for exclusive use.
 *在应用程序访问EtherCAT主机之前,它必须为独占使用预留一台主机。
 * In userspace, this is a convenience function for ecrt_open_master() and
 * ecrt_master_reserve().
 *在用户空间中,这是一个方便的函数,用于ecrt open master()和ecrt master reserve()。我
 * This function has to be the first function an application has to call to
 * use EtherCAT. The function takes the index of the master as its argument.
 * The first master has index 0, the n-th master has index n - 1. The number
 * of masters has to be specified when loading the master module.
 *这个函数必须是应用程序使用EtherCAT必须调用的第一个函数。该函数以master的索引作为参数。
 *第一个主节点索引为0,第n个主节点索引为n- 1。加载主模块时必须指定主模块的数量。
 * \return Pointer to the reserved master, otherwise \a NULL.
 */
ec_master_t *ecrt_request_master(
        unsigned int master_index /**< Index of the master to request.主站请求索引 */
        );

#ifndef __KERNEL__

/**03 Opens an EtherCAT master for userspace access.
 *
 * This function has to be the first function an application has to call to
 * use EtherCAT. The function takes the index of the master as its argument.
 * The first master has index 0, the n-th master has index n - 1. The number
 * of masters has to be specified when loading the master module.
 *这个函数必须是应用程序使用EtherCAT必须调用的第一个函数。该函数以master的索引作为参数。
 *第一个主节点索引为0,第n个主节点索引为n -1。加载主模块时必须指定主模块的数量。
 * For convenience, the function ecrt_request_master() can be used.
 *
 * \return Pointer to the opened master, otherwise \a NULL.
 */
ec_master_t *ecrt_open_master(
        unsigned int master_index /**< Index of the master to request. 主站请求索引。*/
        );

#endif // #ifndef __KERNEL__

/**04 Releases a requested EtherCAT master.
 *•释放请求的EtherCAT主站
 * After use, a master it has to be released to make it available for other
 * applications.
 *在使用后,master必须被释放,以使其他应用程序可以使用它。
 * This method frees all created data structures. It should not be called in
 * realtime context.
 *此方法释放所有创建的数据结构。不应该在实时上下文中调用它。
 * If the master was activated, ecrt_master_deactivate() is called internally.
 */
void ecrt_release_master(
        ec_master_t *master /**< EtherCAT master主站 */
        );

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值