Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

domain.c File Reference


Detailed Description

EtherCAT domain methods.

Definition in file domain.c.

Go to the source code of this file.

Data Structures

struct  ec_data_reg_t
 Data registration type. More...

Functions

void ec_domain_clear (struct kobject *kobj)
 Clear and free domain.
void ec_domain_clear_data_regs (ec_domain_t *domain)
 Clears the list of the data registrations.
ssize_t ec_show_domain_attribute (struct kobject *kobj,struct attribute *attr,char *buffer)
 Formats attribute data for SysFS reading.
int ec_domain_init (ec_domain_t *domain, ec_master_t *master, unsigned int index)
 Domain constructor.
void ec_domain_destroy (ec_domain_t *domain)
 Domain destructor.
int ec_domain_reg_pdo_entry (ec_domain_t *domain, ec_slave_t *slave, const ec_sii_pdo_t *pdo, const ec_sii_pdo_entry_t *entry, void **data_ptr)
 Registeres a PDO entry.
int ec_domain_reg_pdo_range (ec_domain_t *domain, ec_slave_t *slave, ec_direction_t dir, uint16_t offset, uint16_t length, void **data_ptr)
 Registeres a PDO range.
int ec_domain_add_datagram (ec_domain_t *domain, uint32_t offset, size_t data_size)
 Allocates a process data datagram and appends it to the list.
int ec_domain_alloc (ec_domain_t *domain, uint32_t base_address)
 Creates a domain.
void ec_domain_queue_datagrams (ec_domain_t *domain)
 Places all process data datagrams in the masters datagram queue.
ec_slave_tecrt_domain_register_pdo (ec_domain_t *domain, const char *address, uint32_t vendor_id, uint32_t product_code, uint16_t pdo_index, uint8_t pdo_subindex, void **data_ptr)
 Registers a PDO in a domain.
int ecrt_domain_register_pdo_list (ec_domain_t *domain, const ec_pdo_reg_t *pdos)
 Registeres a bunch of data fields.
ec_slave_tecrt_domain_register_pdo_range (ec_domain_t *domain, const char *address, uint32_t vendor_id, uint32_t product_code, ec_direction_t direction, uint16_t offset, uint16_t length, void **data_ptr)
 Registers a PDO range in a domain.
void ecrt_domain_process (ec_domain_t *domain)
 Processes received process data and requeues the domain datagram(s).
int ecrt_domain_state (const ec_domain_t *domain)
 Returns the state of a domain.


Function Documentation

void ec_domain_clear struct kobject *  kobj  ) 
 

Clear and free domain.

This method is called by the kobject, once there are no more references to it.

Parameters:
kobj  kobject of the domain

Definition at line 165 of file domain.c.

void ec_domain_clear_data_regs ec_domain_t  ) 
 

Clears the list of the data registrations.

Parameters:
domain  EtherCAT domain

Definition at line 343 of file domain.c.

ssize_t ec_show_domain_attribute struct kobject *  kobj,
struct attribute *  attr,
char *  buffer
 

Formats attribute data for SysFS reading.

Returns:
number of bytes to read
Parameters:
kobj  kobject
attr  attribute
buffer  memory to store data in

Definition at line 501 of file domain.c.

int ec_domain_init ec_domain_t domain,
ec_master_t master,
unsigned int  index
 

Domain constructor.

Returns:
0 in case of success, else < 0
Parameters:
domain  EtherCAT domain
master  owning master
index  domain index

Definition at line 100 of file domain.c.

void ec_domain_destroy ec_domain_t domain  ) 
 

Domain destructor.

Clears and frees a domain object.

Parameters:
domain  EtherCAT domain

Definition at line 142 of file domain.c.

int ec_domain_reg_pdo_entry ec_domain_t domain,
ec_slave_t slave,
const ec_sii_pdo_t pdo,
const ec_sii_pdo_entry_t entry,
void **  data_ptr
 

Registeres a PDO entry.

Returns:
0 in case of success, else < 0
Parameters:
domain  EtherCAT domain
slave  slave
pdo  PDO
entry  PDO registration entry
data_ptr  pointer to the process data pointer

Definition at line 189 of file domain.c.

int ec_domain_reg_pdo_range ec_domain_t domain,
ec_slave_t slave,
ec_direction_t  dir,
uint16_t  offset,
uint16_t  length,
void **  data_ptr
 

Registeres a PDO range.

Returns:
0 in case of success, else < 0
Parameters:
domain  EtherCAT domain
slave  slave
dir  data direction
offset  offset
length  length
data_ptr  pointer to the process data pointer

Definition at line 266 of file domain.c.

int ec_domain_add_datagram ec_domain_t domain,
uint32_t  offset,
size_t  data_size
 

Allocates a process data datagram and appends it to the list.

Returns:
0 in case of success, else < 0
Parameters:
domain  EtherCAT domain
offset  logical offset
data_size  size of the datagram data

Definition at line 360 of file domain.c.

int ec_domain_alloc ec_domain_t domain,
uint32_t  base_address
 

Creates a domain.

Reserves domain memory, calculates the logical addresses of the corresponding FMMUs and sets the process data pointer of the registered process data.

Returns:
0 in case of success, else < 0
Parameters:
domain  EtherCAT domain
base_address  logical base address

Definition at line 393 of file domain.c.

void ec_domain_queue_datagrams ec_domain_t domain  ) 
 

Places all process data datagrams in the masters datagram queue.

Parameters:
domain  EtherCAT domain

Definition at line 485 of file domain.c.


Generated on Tue Nov 7 15:03:36 2006 for IgH EtherCAT master by  doxygen 1.4.4