48 * from the requested bus configuration. Therefore, renamed |
48 * from the requested bus configuration. Therefore, renamed |
49 * ecrt_master_get_slave() to ecrt_master_slave_config(). |
49 * ecrt_master_get_slave() to ecrt_master_slave_config(). |
50 * - Replaced slave address string with alias and position values. See |
50 * - Replaced slave address string with alias and position values. See |
51 * ecrt_master_slave_config(). |
51 * ecrt_master_slave_config(). |
52 * - Removed ecrt_master_get_slave_by_pos(), because it is no longer |
52 * - Removed ecrt_master_get_slave_by_pos(), because it is no longer |
53 * necessary (alias/position, slave configurations). |
53 * necessary due to alias/position addressing. |
54 * - Added ec_slave_config_state_t for the new method |
54 * - Added ec_slave_config_state_t for the new method |
55 * ecrt_slave_config_state(). |
55 * ecrt_slave_config_state(). |
56 * - Process data memory for a domain can now be allocated externally. This |
56 * - Process data memory for a domain can now be allocated externally. This |
57 * offers the possibility to use a shared-memory-region. Therefore, |
57 * offers the possibility to use a shared-memory-region. Therefore, |
58 * added the domain methods ecrt_domain_size() and ecrt_domain_memory(). |
58 * added the domain methods ecrt_domain_size() and ecrt_domain_memory(). |
59 * - Replaced the process data pointers in the Pdo entry registration |
59 * - Replaced the process data pointers in the Pdo entry registration |
60 * functions with a process data offset, that is now returned by |
60 * functions with a process data offset, that is now returned by |
61 * ecrt_domain_reg_pdo_entry(). This was necessary for the external |
61 * ecrt_slave_config_reg_pdo_entry(). This was necessary for the external |
62 * domain memory. An additional advantage is, that the returned offset value |
62 * domain memory. An additional advantage is, that the returned offset value |
63 * is directly usable. |
63 * is directly usable. The domain's process data offset can be retrieved |
|
64 * with ecrt_domain_data(). |
64 * - Replaced ecrt_slave_pdo_mapping/add/clear() with |
65 * - Replaced ecrt_slave_pdo_mapping/add/clear() with |
65 * ecrt_slave_config_mapping() that is now able to specify Pdo mapping and |
66 * ecrt_slave_config_mapping() that is now able to specify Pdo mapping and |
66 * Pdo configuration. Pdo entries mapped in this way can now immediately be |
67 * Pdo configuration. Pdo entries mapped in this way can now immediately be |
67 * registered. The Pdo mapping and the configuration are described with the |
68 * registered. The Pdo mapping and the configuration are described with the |
68 * new data types ec_pdo_info_t and ec_pdo_entry_info_t. |
69 * new data types ec_pdo_info_t and ec_pdo_entry_info_t. |
71 * ecrt_master_state(), for consistency reasons. |
72 * ecrt_master_state(), for consistency reasons. |
72 * - Added ec_domain_state_t and ec_wc_state_t for a new output parameter |
73 * - Added ec_domain_state_t and ec_wc_state_t for a new output parameter |
73 * of ecrt_domain_state(). |
74 * of ecrt_domain_state(). |
74 * - Former "Pdo registration" meant Pdo entry registration in fact, therefore |
75 * - Former "Pdo registration" meant Pdo entry registration in fact, therefore |
75 * renamed ec_pdo_reg_t to ec_pdo_entry_reg_t and ecrt_domain_register_pdo() |
76 * renamed ec_pdo_reg_t to ec_pdo_entry_reg_t and ecrt_domain_register_pdo() |
76 * to ecrt_domain_reg_pdo_entry(). |
77 * to ecrt_slave_config_reg_pdo_entry(). |
77 * - Removed ecrt_domain_register_pdo_range(), because it's functionality can |
78 * - Removed ecrt_domain_register_pdo_range(), because it's functionality can |
78 * be reached by specifying an explicit Pdo mapping and registering those |
79 * be reached by specifying an explicit Pdo mapping and registering those |
79 * Pdo entries. |
80 * Pdo entries. |
80 * |
81 * |
81 * @{ |
82 * @{ |
413 ec_slave_config_t *sc, /**< Slave configuration. */ |
414 ec_slave_config_t *sc, /**< Slave configuration. */ |
414 unsigned int n_entries, /**< Number of Pdos in \a pdos to map. */ |
415 unsigned int n_entries, /**< Number of Pdos in \a pdos to map. */ |
415 const ec_pdo_info_t pdos[] /**< List with Pdo mapping. */ |
416 const ec_pdo_info_t pdos[] /**< List with Pdo mapping. */ |
416 ); |
417 ); |
417 |
418 |
|
419 /** Registers a Pdo entry of the given slave configuration at a domain. |
|
420 * |
|
421 * Searches the mapping and the Pdo configurations for the given Pdo entry. If |
|
422 * found, the curresponding sync manager/FMMU is added to the domain and the |
|
423 * offset of the Pdo entry's data in the domain process data is returned. |
|
424 * |
|
425 * \retval >=0 Offset of the Pdo entry's process data. |
|
426 * \retval -1 Pdo entry not found. |
|
427 * \retval -2 Failed to register Pdo entry. |
|
428 */ |
|
429 int ecrt_slave_config_reg_pdo_entry( |
|
430 ec_slave_config_t *sc, /**< Slave configuration. */ |
|
431 uint16_t entry_index, /**< Index of the Pdo entry to register. */ |
|
432 uint8_t entry_subindex, /**< Subindex of the Pdo entry to register. */ |
|
433 ec_domain_t *domain /**< Domain. */ |
|
434 ); |
|
435 |
418 /** Add a configuration value for an 8-bit SDO. |
436 /** Add a configuration value for an 8-bit SDO. |
419 * |
437 * |
420 * \todo doc |
438 * \todo doc |
421 * \return 0 in case of success, else < 0 |
439 * \return 0 in case of success, else < 0 |
422 */ |
440 */ |
462 |
480 |
463 /****************************************************************************** |
481 /****************************************************************************** |
464 * Domain methods |
482 * Domain methods |
465 *****************************************************************************/ |
483 *****************************************************************************/ |
466 |
484 |
467 /** Registers a single Pdo entry for a domain. |
|
468 * |
|
469 * \return On success, the function returns the offset in the domain's process |
|
470 * data, which can be zero or greater. On failure, it returns a value |
|
471 * less than zero. |
|
472 */ |
|
473 |
|
474 int ecrt_domain_reg_pdo_entry( |
|
475 ec_domain_t *domain, /**< Domain. */ |
|
476 ec_slave_config_t *sc, /**< Slave configuration. */ |
|
477 uint16_t entry_index, /**< Index of the Pdo entry to register. */ |
|
478 uint8_t entry_subindex /**< Subindex of the Pdo entry to register. */ |
|
479 ); |
|
480 |
|
481 /** Registers a bunch of Pdo entries for a domain. |
485 /** Registers a bunch of Pdo entries for a domain. |
482 * |
486 * |
483 * \todo doc |
487 * \todo doc |
484 * \attention The registration array has to be terminated with an empty |
488 * \attention The registration array has to be terminated with an empty |
485 * structure, or one with the \a index field set to zero! |
489 * structure, or one with the \a index field set to zero! |