53 * necessary due to alias/position addressing. |
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 |
|
59 * ecrt_domain_external_memory(). |
59 * - Replaced the process data pointers in the Pdo entry registration |
60 * - Replaced the process data pointers in the Pdo entry registration |
60 * functions with a process data offset, that is now returned by |
61 * functions with a process data offset, that is now returned by |
61 * ecrt_slave_config_reg_pdo_entry(). This was necessary for the external |
62 * ecrt_slave_config_reg_pdo_entry(). This was necessary for the external |
62 * domain memory. An additional advantage is, that the returned offset value |
63 * domain memory. An additional advantage is, that the returned offset value |
63 * is directly usable. The domain's process data offset can be retrieved |
64 * is directly usable. If the domain's process data is allocated internally, |
64 * with ecrt_domain_data(). |
65 * the start address can be retrieved with ecrt_domain_data(). |
65 * - Replaced ecrt_slave_pdo_mapping/add/clear() with |
66 * - Replaced ecrt_slave_pdo_mapping/add/clear() with |
66 * ecrt_slave_config_mapping() that is now able to specify Pdo mapping and |
67 * ecrt_slave_config_mapping() that is now able to specify Pdo mapping and |
67 * Pdo configuration. Pdo entries mapped in this way can now immediately be |
68 * Pdo configuration. Pdo entries mapped in this way can now immediately be |
68 * registered. The Pdo mapping and the configuration are described with the |
69 * registered. The Pdo mapping and the configuration are described with the |
69 * new data types ec_pdo_info_t and ec_pdo_entry_info_t. |
70 * new data types ec_pdo_info_t and ec_pdo_entry_info_t. |
239 uint16_t position; /**< Slave position. */ |
240 uint16_t position; /**< Slave position. */ |
240 uint32_t vendor_id; /**< Slave vendor ID. */ |
241 uint32_t vendor_id; /**< Slave vendor ID. */ |
241 uint32_t product_code; /**< Slave product code. */ |
242 uint32_t product_code; /**< Slave product code. */ |
242 uint16_t index; /**< Pdo entry index. */ |
243 uint16_t index; /**< Pdo entry index. */ |
243 uint8_t subindex; /**< Pdo entry subindex. */ |
244 uint8_t subindex; /**< Pdo entry subindex. */ |
244 uint8_t *offset; /**< Pointer to a variable to store the Pdo's |
245 unsigned int *offset; /**< Pointer to a variable to store the Pdo's |
245 offset in the process data. */ |
246 offset in the process data. */ |
246 } ec_pdo_entry_reg_t; |
247 } ec_pdo_entry_reg_t; |
247 |
248 |
248 /****************************************************************************** |
249 /****************************************************************************** |
249 * Global functions |
250 * Global functions |
501 */ |
502 */ |
502 size_t ecrt_domain_size( |
503 size_t ecrt_domain_size( |
503 ec_domain_t *domain /**< Domain. */ |
504 ec_domain_t *domain /**< Domain. */ |
504 ); |
505 ); |
505 |
506 |
506 /** Provide memory to store the domain's process data. |
507 /** Provide external memory to store the domain's process data. |
507 * |
508 * |
508 * Call this after all Pdo entries have been registered. Since interface |
509 * Call this after all Pdo entries have been registered and before activating |
509 * version 1.4, you'll have to provide an external memory for the domain |
510 * the master. |
510 * process data. |
511 * |
511 * |
512 * The size of the allocated memory must be at least ecrt_domain_size(), after |
512 * The size of the allocated memory must be at least the return value of |
513 * all Pdo entries have been registered. |
513 * ecrt_domain_size(), after all Pdo entries have been registered. |
514 */ |
514 */ |
515 void ecrt_domain_external_memory( |
515 void ecrt_domain_memory( |
|
516 ec_domain_t *domain, /**< Domain. */ |
516 ec_domain_t *domain, /**< Domain. */ |
517 uint8_t *memory /**< Address of the memory to store the process |
517 uint8_t *memory /**< Address of the memory to store the process |
518 data in. */ |
518 data in. */ |
|
519 ); |
|
520 |
|
521 /** Returns the domain's process data. |
|
522 * |
|
523 * If external memory was provided with ecrt_domain_external_memory(), the |
|
524 * returned pointer will contain the address of that memory. Otherwise it will |
|
525 * point to the internally allocated memory. |
|
526 * |
|
527 * \return Pointer to the process data memory. |
|
528 */ |
|
529 uint8_t *ecrt_domain_data( |
|
530 ec_domain_t *domain /**< Domain. */ |
519 ); |
531 ); |
520 |
532 |
521 /** Processes received datagrams. |
533 /** Processes received datagrams. |
522 * |
534 * |
523 * \todo doc |
535 * \todo doc |