fp@54: /****************************************************************************** fp@54: * fp@54: * Oeffentliche EtherCAT-Schnittstellen fuer Echtzeitprozesse. fp@54: * fp@54: * $Id$ fp@54: * fp@54: *****************************************************************************/ fp@54: fp@54: #ifndef _ETHERCAT_RT_H_ fp@54: #define _ETHERCAT_RT_H_ fp@54: fp@54: /*****************************************************************************/ fp@54: fp@54: struct ec_master; fp@54: typedef struct ec_master ec_master_t; fp@54: fp@73: struct ec_domain; fp@73: typedef struct ec_domain ec_domain_t; fp@55: fp@55: struct ec_slave; fp@55: typedef struct ec_slave ec_slave_t; fp@55: fp@73: typedef enum fp@73: { fp@73: ec_sync, fp@73: ec_async fp@73: } fp@73: ec_domain_mode_t; fp@73: fp@73: typedef enum fp@73: { fp@73: ec_status, fp@73: ec_control, fp@73: ec_ipvalue, fp@73: ec_opvalue fp@73: } fp@73: ec_field_type_t; fp@73: fp@73: typedef struct fp@73: { fp@73: void **data; fp@73: const char *address; fp@73: const char *vendor; fp@73: const char *product; fp@73: ec_field_type_t field_type; fp@73: unsigned int field_index; fp@73: unsigned int field_count; fp@73: } fp@73: ec_field_init_t; fp@61: fp@54: /*****************************************************************************/ fp@73: // Master request functions fp@54: fp@54: ec_master_t *EtherCAT_rt_request_master(unsigned int master_index); fp@54: fp@54: void EtherCAT_rt_release_master(ec_master_t *master); fp@54: fp@73: /*****************************************************************************/ fp@73: // Master methods fp@54: fp@73: ec_domain_t *EtherCAT_rt_master_register_domain(ec_master_t *master, fp@73: ec_domain_mode_t mode, fp@73: unsigned int timeout_us); fp@61: fp@73: int EtherCAT_rt_master_activate(ec_master_t *master); fp@54: fp@73: int EtherCAT_rt_master_deactivate(ec_master_t *master); fp@54: fp@73: void EtherCAT_rt_master_debug(ec_master_t *master, int level); fp@73: void EtherCAT_rt_master_print(const ec_master_t *master); fp@56: fp@73: /*****************************************************************************/ fp@73: // Domain Methods fp@55: fp@73: ec_slave_t *EtherCAT_rt_register_slave_field(ec_domain_t *domain, fp@73: const char *address, fp@73: const char *vendor_name, fp@73: const char *product_name, fp@73: void **data_ptr, fp@73: ec_field_type_t field_type, fp@73: unsigned int field_index, fp@73: unsigned int field_count); fp@73: fp@73: int EtherCAT_rt_domain_xio(ec_domain_t *domain); fp@73: fp@73: /*****************************************************************************/ fp@73: // Slave Methods fp@73: fp@73: int EtherCAT_rt_canopen_sdo_write(ec_slave_t *slave, fp@77: uint16_t sdo_index, fp@77: uint8_t sdo_subindex, fp@77: uint32_t value, fp@77: size_t size); fp@61: fp@61: /*****************************************************************************/ fp@61: fp@54: #endif