include/ecrt.h
changeset 1509 a864688e7de5
parent 1500 ed1a733efbc5
child 1510 88b608a1a7f3
equal deleted inserted replaced
1508:60a116ed3897 1509:a864688e7de5
    48  *   EC_TIMEVAL2NANO() macro can be used for epoch time conversion.
    48  *   EC_TIMEVAL2NANO() macro can be used for epoch time conversion.
    49  * - Improved the callback mechanism. ecrt_master_callbacks() now takes two
    49  * - Improved the callback mechanism. ecrt_master_callbacks() now takes two
    50  *   callback functions for sending and receiving datagrams.
    50  *   callback functions for sending and receiving datagrams.
    51  *   ecrt_master_send_ext() is used to execute the sending of non-application
    51  *   ecrt_master_send_ext() is used to execute the sending of non-application
    52  *   datagrams.
    52  *   datagrams.
       
    53  * - Added watchdog configuration (method ecrt_slave_config_watchdog(),
       
    54  *   #ec_watchdog_mode_t, \a watchdog_mode parameter in ec_sync_info_t and
       
    55  *   ecrt_slave_config_sync_manager()).
    53  * - Added ecrt_open_master() and ecrt_master_reserve() separation for
    56  * - Added ecrt_open_master() and ecrt_master_reserve() separation for
    54  *   userspace.
    57  *   userspace.
    55  * - Added ecrt_master() userspace interface, to get information about a
    58  * - Added ecrt_master() userspace interface, to get information about a
    56  *   master.
    59  *   master.
    57  * - Added ecrt_master_slave() to get information about a certain slave.
    60  * - Added ecrt_master_slave() to get information about a certain slave.
    59  *   let an application transfer SDOs before activating the master.
    62  *   let an application transfer SDOs before activating the master.
    60  * - Changed the meaning of the negative return values of
    63  * - Changed the meaning of the negative return values of
    61  *   ecrt_slave_config_reg_pdo_entry() and ecrt_slave_config_sdo*().
    64  *   ecrt_slave_config_reg_pdo_entry() and ecrt_slave_config_sdo*().
    62  * - Imlemented the Vendor-specific over EtherCAT mailbox protocol. See
    65  * - Imlemented the Vendor-specific over EtherCAT mailbox protocol. See
    63  *   ecrt_slave_config_create_voe_handler().
    66  *   ecrt_slave_config_create_voe_handler().
    64  * - Renamed ec_sdo_request_state_t to ec_request_state_t, because it is also
    67  * - Renamed ec_sdo_request_state_t to #ec_request_state_t, because it is also
    65  *   used by VoE handlers.
    68  *   used by VoE handlers.
    66  * - Removed 'const' from argument of ecrt_sdo_request_state(), because the
    69  * - Removed 'const' from argument of ecrt_sdo_request_state(), because the
    67  *   userspace library has to modify object internals.
    70  *   userspace library has to modify object internals.
    68  * - Added 64-bit data access macros.
    71  * - Added 64-bit data access macros.
    69  *
    72  *
   273     EC_DIR_COUNT /**< Number of directions. For internal use only. */
   276     EC_DIR_COUNT /**< Number of directions. For internal use only. */
   274 } ec_direction_t;
   277 } ec_direction_t;
   275 
   278 
   276 /*****************************************************************************/
   279 /*****************************************************************************/
   277 
   280 
       
   281 /** Watchdog mode for sync manager configuration.
       
   282  *
       
   283  * Used to specify, if a sync manager's watchdog is to be enabled.
       
   284  */
       
   285 typedef enum {
       
   286     EC_WD_DEFAULT, /**< Use the default setting of the sync manager. */
       
   287     EC_WD_ENABLE, /**< Enable the watchdog. */
       
   288     EC_WD_DISABLE, /**< Disable the watchdog. */
       
   289 } ec_watchdog_mode_t;
       
   290 
       
   291 /*****************************************************************************/
       
   292 
   278 /** PDO entry configuration information.
   293 /** PDO entry configuration information.
   279  *
   294  *
   280  * This is the data type of the \a entries field in ec_pdo_info_t.
   295  * This is the data type of the \a entries field in ec_pdo_info_t.
   281  *
   296  *
   282  * \see ecrt_slave_config_pdos().
   297  * \see ecrt_slave_config_pdos().
   320                      but can also be \a 0xff to mark the end of the list. */
   335                      but can also be \a 0xff to mark the end of the list. */
   321     ec_direction_t dir; /**< Sync manager direction. */
   336     ec_direction_t dir; /**< Sync manager direction. */
   322     unsigned int n_pdos; /**< Number of PDOs in \a pdos. */
   337     unsigned int n_pdos; /**< Number of PDOs in \a pdos. */
   323     ec_pdo_info_t *pdos; /**< Array with PDOs to assign. This must contain
   338     ec_pdo_info_t *pdos; /**< Array with PDOs to assign. This must contain
   324                             at least \a n_pdos PDOs. */
   339                             at least \a n_pdos PDOs. */
       
   340     ec_watchdog_mode_t watchdog_mode; /**< Watchdog mode. */
   325 } ec_sync_info_t;
   341 } ec_sync_info_t;
   326 
   342 
   327 /*****************************************************************************/
   343 /*****************************************************************************/
   328 
   344 
   329 /** List record type for PDO entry mass-registration.
   345 /** List record type for PDO entry mass-registration.
   707  */
   723  */
   708 int ecrt_slave_config_sync_manager(
   724 int ecrt_slave_config_sync_manager(
   709         ec_slave_config_t *sc, /**< Slave configuration. */
   725         ec_slave_config_t *sc, /**< Slave configuration. */
   710         uint8_t sync_index, /**< Sync manager index. Must be less
   726         uint8_t sync_index, /**< Sync manager index. Must be less
   711                               than #EC_MAX_SYNC_MANAGERS. */
   727                               than #EC_MAX_SYNC_MANAGERS. */
   712         ec_direction_t dir /**< Input/Output. */
   728         ec_direction_t direction, /**< Input/Output. */
       
   729         ec_watchdog_mode_t watchdog_mode /** Watchdog mode. */
       
   730         );
       
   731 
       
   732 /** Configure a slave's watchdog times.
       
   733 */	 
       
   734 void ecrt_slave_config_watchdog(
       
   735         ec_slave_config_t *sc, /**< Slave configuration. */
       
   736         uint16_t watchdog_divider, /**< Number of 40 ns intervals. Used as a
       
   737                                     base unit for all slave watchdogs. */
       
   738         uint16_t watchdog_intervals /**< Number of base intervals for process
       
   739                                       data watchdog. */
   713         );
   740         );
   714 
   741 
   715 /** Add a PDO to a sync manager's PDO assignment.
   742 /** Add a PDO to a sync manager's PDO assignment.
   716  *
   743  *
   717  * \see ecrt_slave_config_pdos()
   744  * \see ecrt_slave_config_pdos()