domain.c File Reference


Detailed Description

EtherCAT domain methods.

Definition in file domain.c.

Go to the source code of this file.

Functions

void ec_domain_clear_field_regs (ec_domain_t *domain)
 Clears the list of the registered data fields.
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_clear (struct kobject *kobj)
 Domain destructor.
int ec_domain_reg_field (ec_domain_t *domain, ec_slave_t *slave, const ec_sync_t *sync, uint32_t field_offset, void **data_ptr)
 Registeres a data field in a domain.
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_response_count (ec_domain_t *domain, unsigned int count)
 Sets the number of responding slaves and outputs it on demand.
ec_slave_tecrt_domain_register_field (ec_domain_t *domain, const char *address, const char *vendor_name, const char *product_name, void **data_ptr, const char *field_name, unsigned int field_index, unsigned int field_count)
 Registers a data field in a domain.
int ecrt_domain_register_field_list (ec_domain_t *domain, const ec_field_init_t *fields)
 Registeres a bunch of data fields.
void ecrt_domain_queue (ec_domain_t *domain)
 Places all process data datagrams in the masters datagram queue.
void ecrt_domain_process (ec_domain_t *domain)
 Processes received process data.
int ecrt_domain_state (ec_domain_t *domain)
 Returns the state of a domain.


Function Documentation

void ec_domain_clear_field_regs ec_domain_t  ) 
 

Clears the list of the registered data fields.

Parameters:
domain  EtherCAT domain

Definition at line 179 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 341 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 83 of file domain.c.

void ec_domain_clear struct kobject *  kobj  ) 
 

Domain destructor.

Parameters:
kobj  kobject of the domain

Definition at line 116 of file domain.c.

int ec_domain_reg_field ec_domain_t domain,
ec_slave_t slave,
const ec_sync_t sync,
uint32_t  field_offset,
void **  data_ptr
 

Registeres a data field in a domain.

Returns:
0 in case of success, else < 0
Parameters:
domain  EtherCAT domain
slave  slave
sync  sync manager
field_offset  data field offset
data_ptr  pointer to the process data pointer

Definition at line 142 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 196 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 data fields.

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

Definition at line 229 of file domain.c.

void ec_domain_response_count ec_domain_t domain,
unsigned int  count
 

Sets the number of responding slaves and outputs it on demand.

This number isn't really the number of responding slaves, but the sum of the working counters of all domain datagrams. Some slaves increase the working counter by 2, some by 1.

Parameters:
domain  EtherCAT domain
count  new WC sum

Definition at line 323 of file domain.c.


Generated on Wed Aug 2 18:41:43 2006 for IgH EtherCAT master by  doxygen 1.4.6