IgH EtherCAT Master  1.5.3
pdo.c File Reference

EtherCAT process data object methods. More...

Go to the source code of this file.

Functions

void ec_pdo_init (ec_pdo_t *pdo)
 PDO constructor. More...
 
int ec_pdo_init_copy (ec_pdo_t *pdo, const ec_pdo_t *other_pdo)
 PDO copy constructor. More...
 
void ec_pdo_clear (ec_pdo_t *pdo)
 PDO destructor. More...
 
void ec_pdo_clear_entries (ec_pdo_t *pdo)
 Clear PDO entry list. More...
 
int ec_pdo_set_name (ec_pdo_t *pdo, const char *name)
 Set PDO name. More...
 
ec_pdo_entry_tec_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. More...
 
int ec_pdo_copy_entries (ec_pdo_t *pdo, const ec_pdo_t *other)
 Copy PDO entries from another PDO. More...
 
int ec_pdo_equal_entries (const ec_pdo_t *pdo1, const ec_pdo_t *pdo2)
 Compares the entries of two PDOs. More...
 
unsigned int ec_pdo_entry_count (const ec_pdo_t *pdo)
 Get the number of PDO entries. More...
 
const ec_pdo_entry_tec_pdo_find_entry_by_pos_const (const ec_pdo_t *pdo, unsigned int pos)
 Finds a PDO entry via its position in the list. More...
 
void ec_pdo_print_entries (const ec_pdo_t *pdo)
 Outputs the PDOs in the list. More...
 

Detailed Description

EtherCAT process data object methods.

Definition in file pdo.c.

Function Documentation

◆ ec_pdo_init()

void ec_pdo_init ( ec_pdo_t pdo)

PDO constructor.

Parameters
pdoEtherCAT PDO

Definition at line 46 of file pdo.c.

◆ 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_clear()

void ec_pdo_clear ( ec_pdo_t pdo)

PDO destructor.

Parameters
pdoEtherCAT PDO.

Definition at line 94 of file pdo.c.

◆ ec_pdo_clear_entries()

void ec_pdo_clear_entries ( ec_pdo_t pdo)

Clear PDO entry list.

Parameters
pdoEtherCAT PDO.

Definition at line 106 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.

◆ ec_pdo_print_entries()

void ec_pdo_print_entries ( const ec_pdo_t pdo)

Outputs the PDOs in the list.

Parameters
pdoPDO.

Definition at line 299 of file pdo.c.