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_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_clear (struct kobject *kobj)
 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_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 (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.
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_data_regs ec_domain_t  ) 
 

Clears the list of the data registrations.

Parameters:
domain  EtherCAT domain

Definition at line 233 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 391 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 99 of file domain.c.

void ec_domain_clear struct kobject *  kobj  ) 
 

Domain destructor.

Parameters:
kobj  kobject of the domain

Definition at line 134 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 160 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 250 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 283 of file domain.c.

void ec_domain_queue ec_domain_t domain  ) 
 

Places all process data datagrams in the masters datagram queue.

Parameters:
domain  EtherCAT domain

Definition at line 375 of file domain.c.


Generated on Fri Sep 1 14:56:56 2006 for IgH EtherCAT master by  doxygen 1.4.6