EtherCAT domain methods.
More...
Go to the source code of this file.
|
| void | ec_domain_clear_data (ec_domain_t *domain) |
| | Frees internally allocated memory.
|
| int | ec_domain_add_datagram_pair (ec_domain_t *domain, uint32_t logical_offset, size_t data_size, uint8_t *data, const unsigned int used[]) |
| | Allocates a domain datagram pair and appends it to the list.
|
| int | shall_count (const ec_fmmu_config_t *cur_fmmu, const ec_fmmu_config_t *first_fmmu) |
| | Domain finish helper function.
|
| void | ec_domain_init (ec_domain_t *domain, ec_master_t *master, unsigned int index) |
| | Domain constructor.
|
| void | ec_domain_clear (ec_domain_t *domain) |
| | Domain destructor.
|
| void | ec_domain_add_fmmu_config (ec_domain_t *domain, ec_fmmu_config_t *fmmu) |
| | Adds an FMMU configuration to the domain.
|
| int | ec_domain_finish (ec_domain_t *domain, uint32_t base_address) |
| | Finishes a domain.
|
| unsigned int | ec_domain_fmmu_count (const ec_domain_t *domain) |
| | Get the number of FMMU configurations of the domain.
|
| const ec_fmmu_config_t * | ec_domain_find_fmmu (const ec_domain_t *domain, unsigned int pos) |
| | Get a certain FMMU configuration via its position in the list.
|
| int | ecrt_domain_reg_pdo_entry_list (ec_domain_t *domain, const ec_pdo_entry_reg_t *regs) |
| | Registers a bunch of PDO entries for a domain.
|
| size_t | ecrt_domain_size (const ec_domain_t *domain) |
| | Returns the current size of the domain's process data.
|
| void | ecrt_domain_external_memory (ec_domain_t *domain, uint8_t *mem) |
| | Provide external memory to store the domain's process data.
|
| uint8_t * | ecrt_domain_data (const ec_domain_t *domain) |
| | Returns the domain's process data.
|
| int | ecrt_domain_process (ec_domain_t *domain) |
| | Determines the states of the domain's datagrams.
|
| int | ecrt_domain_queue (ec_domain_t *domain) |
| | (Re-)queues all domain datagrams in the master's datagram queue.
|
| int | ecrt_domain_state (const ec_domain_t *domain, ec_domain_state_t *state) |
| | Reads the state of a domain.
|
EtherCAT domain methods.
Definition in file domain.c.
◆ DEBUG_REDUNDANCY
| #define DEBUG_REDUNDANCY 0 |
Extra debug output for redundancy functions.
Definition at line 40 of file domain.c.
◆ ec_domain_clear_data()
Frees internally allocated memory.
- Parameters
-
Definition at line 105 of file domain.c.
◆ ec_domain_add_datagram_pair()
| int ec_domain_add_datagram_pair |
( |
ec_domain_t * | domain, |
|
|
uint32_t | logical_offset, |
|
|
size_t | data_size, |
|
|
uint8_t * | data, |
|
|
const unsigned int | used[] ) |
Allocates a domain datagram pair and appends it to the list.
The datagrams' types and expected working counters are determined by the number of input and output fmmus that share the datagrams.
- Return values
-
- Parameters
-
| domain | EtherCAT domain. |
| logical_offset | Logical offset. |
| data_size | Size of the data. |
| data | Process data. |
| used | Slave config counter for in/out. |
Definition at line 146 of file domain.c.
◆ shall_count()
Domain finish helper function.
Detects, if a slave configuration has already been taken into account for a datagram's expected working counter calculation.
Walks through the list of all FMMU configurations for the current datagram and ends before the current datagram.
- Returns
- Non-zero if slave connfig was already counted.
- Parameters
-
| cur_fmmu | Current FMMU with direction to search for. |
| first_fmmu | Datagram's first FMMU. |
Definition at line 194 of file domain.c.
◆ ec_domain_init()
Domain constructor.
- Parameters
-
| domain | EtherCAT domain. |
| master | Parent master. |
| index | Index. |
Definition at line 57 of file domain.c.
◆ ec_domain_clear()
Domain destructor.
- Parameters
-
Definition at line 87 of file domain.c.
◆ ec_domain_add_fmmu_config()
Adds an FMMU configuration to the domain.
- Parameters
-
| domain | EtherCAT domain. |
| fmmu | FMMU configuration. |
Definition at line 121 of file domain.c.
◆ ec_domain_finish()
| int ec_domain_finish |
( |
ec_domain_t * | domain, |
|
|
uint32_t | base_address ) |
Finishes a domain.
This allocates the necessary datagrams and writes the correct logical addresses to every configured FMMU.
An FMMU always covers a sync manager's complete logical address range and is never split itself; its configuration does not change here. If that range alone exceeds the maximum datagram size, though, it is addressed by several consecutive, disjoint datagrams that read/write the sync manager's data in multiple steps. The last of these datagrams then covers the sync manager's last byte, so that a buffer flip is triggered as usual.
- Return values
-
- Parameters
-
| domain | EtherCAT domain. |
| base_address | Logical base address. |
Definition at line 230 of file domain.c.
◆ ec_domain_fmmu_count()
| unsigned int ec_domain_fmmu_count |
( |
const ec_domain_t * | domain | ) |
|
Get the number of FMMU configurations of the domain.
Definition at line 376 of file domain.c.
◆ ec_domain_find_fmmu()
Get a certain FMMU configuration via its position in the list.
- Returns
- FMMU at position pos, or NULL.
- Parameters
-
| domain | EtherCAT domain. |
| pos | List position. |
Definition at line 394 of file domain.c.