IgH EtherCAT Master  1.5.3
pdo.h File Reference

EtherCAT Process data object structure. More...

Go to the source code of this file.

Data Structures

struct  ec_pdo_t
 PDO description. More...
 

Functions

void ec_pdo_init (ec_pdo_t *)
 PDO constructor.
 
int ec_pdo_init_copy (ec_pdo_t *, const ec_pdo_t *)
 PDO copy constructor. More...
 
void ec_pdo_clear (ec_pdo_t *)
 PDO destructor.
 
void ec_pdo_clear_entries (ec_pdo_t *)
 Clear PDO entry list.
 
int ec_pdo_set_name (ec_pdo_t *, const char *)
 Set PDO name. More...
 
ec_pdo_entry_tec_pdo_add_entry (ec_pdo_t *, uint16_t, uint8_t, uint8_t)
 Add a new PDO entry to the configuration. More...
 
int ec_pdo_copy_entries (ec_pdo_t *, const ec_pdo_t *)
 Copy PDO entries from another PDO. More...
 
int ec_pdo_equal_entries (const ec_pdo_t *, const ec_pdo_t *)
 Compares the entries of two PDOs. More...
 
unsigned int ec_pdo_entry_count (const ec_pdo_t *)
 Get the number of PDO entries. More...
 
const ec_pdo_entry_tec_pdo_find_entry_by_pos_const (const ec_pdo_t *, unsigned int)
 Finds a PDO entry via its position in the list. More...
 
void ec_pdo_print_entries (const ec_pdo_t *)
 Outputs the PDOs in the list.
 

Detailed Description

EtherCAT Process data object structure.

Definition in file pdo.h.

Function Documentation

◆ ec_pdo_init_copy()

int ec_pdo_init_copy ( ec_pdo_t pdo,
const ec_pdo_t other_pdo 
)

PDO copy constructor.

Return values
0Success.
<0Error code.
Parameters
pdoPDO to create.
other_pdoPDO to copy from.

Definition at line 62 of file pdo.c.

◆ ec_pdo_set_name()

int ec_pdo_set_name ( ec_pdo_t pdo,
const char *  name 
)

Set PDO name.

Return values
0Success.
<0Error code.
Parameters
pdoPDO.
nameNew name.

Definition at line 125 of file pdo.c.

◆ ec_pdo_add_entry()

ec_pdo_entry_t* ec_pdo_add_entry ( ec_pdo_t pdo,
uint16_t  index,
uint8_t  subindex,
uint8_t  bit_length 
)

Add a new PDO entry to the configuration.

Return values
Pointerto the added entry, otherwise a ERR_PTR() code.
Parameters
pdoPDO.
indexNew entry's index.
subindexNew entry's subindex.
bit_lengthNew entry's bit length.

Definition at line 157 of file pdo.c.

◆ ec_pdo_copy_entries()

int ec_pdo_copy_entries ( ec_pdo_t pdo,
const ec_pdo_t other 
)

Copy PDO entries from another PDO.

Return values
0Success.
<0Error code.
Parameters
pdoPDO whos entries shall be replaced.
otherPdo with entries to copy.

Definition at line 186 of file pdo.c.

◆ ec_pdo_equal_entries()

int ec_pdo_equal_entries ( const ec_pdo_t pdo1,
const ec_pdo_t pdo2 
)

Compares the entries of two PDOs.

Return values
1The entries of the given PDOs are equal.
0The entries of the given PDOs differ.
Parameters
pdo1First PDO.
pdo2Second PDO.

Definition at line 222 of file pdo.c.

◆ ec_pdo_entry_count()

unsigned int ec_pdo_entry_count ( const ec_pdo_t pdo)

Get the number of PDO entries.

Returns
Number of PDO entries.
Parameters
pdoPDO.

Definition at line 257 of file pdo.c.

◆ ec_pdo_find_entry_by_pos_const()

const ec_pdo_entry_t* ec_pdo_find_entry_by_pos_const ( const ec_pdo_t pdo,
unsigned int  pos 
)

Finds a PDO entry via its position in the list.

Const version.

Returns
Search result, or NULL.
Parameters
pdoPDO.
posPosition in the list.

Definition at line 279 of file pdo.c.