include/ecrt.h
changeset 1804 742607c464c4
parent 1611 7c49cd56f96f
child 1844 b6bd88d4806b
equal deleted inserted replaced
1803:5b04770444df 1804:742607c464c4
   215  * \see ecrt_master().
   215  * \see ecrt_master().
   216  */
   216  */
   217 typedef struct {
   217 typedef struct {
   218    unsigned int slave_count; /**< Number of slaves in the bus. */
   218    unsigned int slave_count; /**< Number of slaves in the bus. */
   219    unsigned int link_up : 1; /**< \a true, if the network link is up. */
   219    unsigned int link_up : 1; /**< \a true, if the network link is up. */
   220    uint8_t scan_busy;	/**< \a true, while the master is scanning the bus */   
   220    uint8_t scan_busy; /**< \a true, while the master is scanning the bus */   
   221    uint64_t app_time; /**< Application time. */
   221    uint64_t app_time; /**< Application time. */
   222 } ec_master_info_t;
   222 } ec_master_info_t;
   223 
   223 
   224 /*****************************************************************************/
   224 /*****************************************************************************/
   225 
   225 
   424  * For convenience, the function ecrt_request_master() can be used.
   424  * For convenience, the function ecrt_request_master() can be used.
   425  *
   425  *
   426  * \return Pointer to the opened master, otherwise \a NULL.
   426  * \return Pointer to the opened master, otherwise \a NULL.
   427  */
   427  */
   428 ec_master_t *ecrt_open_master(
   428 ec_master_t *ecrt_open_master(
   429 		unsigned int master_index /**< Index of the master to request. */
   429         unsigned int master_index /**< Index of the master to request. */
   430 		);
   430         );
   431 
   431 
   432 #endif // #ifndef __KERNEL__
   432 #endif // #ifndef __KERNEL__
   433 
   433 
   434 /** Releases a requested EtherCAT master.
   434 /** Releases a requested EtherCAT master.
   435  *
   435  *
   453  *
   453  *
   454  * \return 0 in case of success, else < 0
   454  * \return 0 in case of success, else < 0
   455  *
   455  *
   456  */
   456  */
   457 int ecrt_master_reserve(
   457 int ecrt_master_reserve(
   458 		ec_master_t *master /**< EtherCAT master */
   458         ec_master_t *master /**< EtherCAT master */
   459 		);
   459         );
   460 
   460 
   461 #endif // #ifndef __KERNEL__
   461 #endif // #ifndef __KERNEL__
   462 
   462 
   463 #ifdef __KERNEL__
   463 #ifdef __KERNEL__
   464 
   464 
   543  * \attention The pointer to this structure must point to a valid variable.
   543  * \attention The pointer to this structure must point to a valid variable.
   544  *
   544  *
   545  * \return 0 in case of success, else < 0
   545  * \return 0 in case of success, else < 0
   546  */
   546  */
   547 int ecrt_master(
   547 int ecrt_master(
   548 		ec_master_t *master, /**< EtherCAT master */
   548         ec_master_t *master, /**< EtherCAT master */
   549 		ec_master_info_t *master_info /**< Structure that will output the
   549         ec_master_info_t *master_info /**< Structure that will output the
   550 									  information */
   550                                         information */
   551 		);
   551         );
   552 
   552 
   553 /** Obtains slave information.
   553 /** Obtains slave information.
   554  *
   554  *
   555  * Tries to find the slave with the given ring position. The obtained
   555  * Tries to find the slave with the given ring position. The obtained
   556  * information is stored in a structure. No memory is allocated on the heap in
   556  * information is stored in a structure. No memory is allocated on the heap in
   698 /** Set interval between calls to ecrt_master_send
   698 /** Set interval between calls to ecrt_master_send
   699  *
   699  *
   700  */
   700  */
   701 int ecrt_master_set_send_interval(
   701 int ecrt_master_set_send_interval(
   702         ec_master_t *master, /**< EtherCAT master. */
   702         ec_master_t *master, /**< EtherCAT master. */
   703 		size_t send_interval /**< Send interval in us */
   703         size_t send_interval /**< Send interval in us */
   704         );
   704         );
   705 
   705 
   706 /** Sends all datagrams in the queue.
   706 /** Sends all datagrams in the queue.
   707  *
   707  *
   708  * This method takes all datagrams, that have been queued for transmission,
   708  * This method takes all datagrams, that have been queued for transmission,
   999  * The AssignActivate word is vendor-specific and can be taken from the XML
   999  * The AssignActivate word is vendor-specific and can be taken from the XML
  1000  * device description file (Device -> Dc -> AssignActivate). Set this to zero,
  1000  * device description file (Device -> Dc -> AssignActivate). Set this to zero,
  1001  * if the slave shall be operated without distributed clocks (default).
  1001  * if the slave shall be operated without distributed clocks (default).
  1002  */
  1002  */
  1003 void ecrt_slave_config_dc(
  1003 void ecrt_slave_config_dc(
  1004 		ec_slave_config_t *sc, /**< Slave configuration. */
  1004         ec_slave_config_t *sc, /**< Slave configuration. */
  1005         uint16_t assign_activate, /**< AssignActivate word. */
  1005         uint16_t assign_activate, /**< AssignActivate word. */
  1006         uint32_t sync0_cycle, /**< SYNC0 cycle time [ns]. */
  1006         uint32_t sync0_cycle, /**< SYNC0 cycle time [ns]. */
  1007 		uint32_t sync0_shift, /**< SYNC0 shift time [ns]. */
  1007         uint32_t sync0_shift, /**< SYNC0 shift time [ns]. */
  1008         uint32_t sync1_cycle, /**< SYNC1 cycle time [ns]. */
  1008         uint32_t sync1_cycle, /**< SYNC1 cycle time [ns]. */
  1009 		uint32_t sync1_shift /**< SYNC1 shift time [ns]. */
  1009         uint32_t sync1_shift /**< SYNC1 shift time [ns]. */
  1010 		);
  1010         );
  1011 
  1011 
  1012 /** Add an SDO configuration.
  1012 /** Add an SDO configuration.
  1013  *
  1013  *
  1014  * An SDO configuration is stored in the slave configuration object and is
  1014  * An SDO configuration is stored in the slave configuration object and is
  1015  * downloaded to the slave whenever the slave is being configured by the
  1015  * downloaded to the slave whenever the slave is being configured by the