IgH EtherCAT Master  1.5.3
fsm_pdo_entry.c File Reference

EtherCAT PDO mapping state machine. More...

Go to the source code of this file.

Functions

void ec_fsm_pdo_entry_read_state_start (ec_fsm_pdo_entry_t *fsm, ec_datagram_t *datagram)
 Request reading the number of mapped PDO entries. More...
 
void ec_fsm_pdo_entry_read_state_count (ec_fsm_pdo_entry_t *fsm, ec_datagram_t *datagram)
 Read number of mapped PDO entries. More...
 
void ec_fsm_pdo_entry_read_state_entry (ec_fsm_pdo_entry_t *fsm, ec_datagram_t *datagram)
 Read PDO entry information. More...
 
void ec_fsm_pdo_entry_read_action_next (ec_fsm_pdo_entry_t *fsm, ec_datagram_t *datagram)
 Read next PDO entry. More...
 
void ec_fsm_pdo_entry_conf_state_start (ec_fsm_pdo_entry_t *fsm, ec_datagram_t *datagram)
 Start PDO mapping. More...
 
void ec_fsm_pdo_entry_conf_state_zero_entry_count (ec_fsm_pdo_entry_t *fsm, ec_datagram_t *datagram)
 Set the number of mapped entries to zero. More...
 
void ec_fsm_pdo_entry_conf_state_map_entry (ec_fsm_pdo_entry_t *fsm, ec_datagram_t *datagram)
 Add a PDO entry. More...
 
void ec_fsm_pdo_entry_conf_state_set_entry_count (ec_fsm_pdo_entry_t *fsm, ec_datagram_t *datagram)
 Set the number of entries. More...
 
void ec_fsm_pdo_entry_conf_action_map (ec_fsm_pdo_entry_t *fsm, ec_datagram_t *datagram)
 Starts to add a PDO entry. More...
 
void ec_fsm_pdo_entry_state_end (ec_fsm_pdo_entry_t *fsm, ec_datagram_t *datagram)
 State: END. More...
 
void ec_fsm_pdo_entry_state_error (ec_fsm_pdo_entry_t *fsm, ec_datagram_t *datagram)
 State: ERROR. More...
 
void ec_fsm_pdo_entry_init (ec_fsm_pdo_entry_t *fsm, ec_fsm_coe_t *fsm_coe)
 Constructor. More...
 
void ec_fsm_pdo_entry_clear (ec_fsm_pdo_entry_t *fsm)
 Destructor. More...
 
void ec_fsm_pdo_entry_print (ec_fsm_pdo_entry_t *fsm)
 Print the current and desired PDO mapping. More...
 
void ec_fsm_pdo_entry_start_reading (ec_fsm_pdo_entry_t *fsm, ec_slave_t *slave, ec_pdo_t *pdo)
 Start reading a PDO's entries. More...
 
void ec_fsm_pdo_entry_start_configuration (ec_fsm_pdo_entry_t *fsm, ec_slave_t *slave, const ec_pdo_t *pdo, const ec_pdo_t *cur_pdo)
 Start PDO mapping state machine. More...
 
int ec_fsm_pdo_entry_running (const ec_fsm_pdo_entry_t *fsm)
 Get running state. More...
 
int ec_fsm_pdo_entry_exec (ec_fsm_pdo_entry_t *fsm, ec_datagram_t *datagram)
 Executes the current state. More...
 
int ec_fsm_pdo_entry_success (const ec_fsm_pdo_entry_t *fsm)
 Get execution result. More...
 
ec_pdo_entry_tec_fsm_pdo_entry_conf_next_entry (const ec_fsm_pdo_entry_t *fsm, const struct list_head *list)
 Process next PDO entry. More...
 

Detailed Description

EtherCAT PDO mapping state machine.

Definition in file fsm_pdo_entry.c.

Function Documentation

◆ ec_fsm_pdo_entry_read_state_start()

void ec_fsm_pdo_entry_read_state_start ( ec_fsm_pdo_entry_t fsm,
ec_datagram_t datagram 
)

Request reading the number of mapped PDO entries.

Parameters
fsmPDO mapping state machine.
datagramDatagram to use.

Definition at line 194 of file fsm_pdo_entry.c.

◆ ec_fsm_pdo_entry_read_state_count()

void ec_fsm_pdo_entry_read_state_count ( ec_fsm_pdo_entry_t fsm,
ec_datagram_t datagram 
)

Read number of mapped PDO entries.

Parameters
fsmfinite state machine
datagramDatagram to use.

Definition at line 211 of file fsm_pdo_entry.c.

◆ ec_fsm_pdo_entry_read_state_entry()

void ec_fsm_pdo_entry_read_state_entry ( ec_fsm_pdo_entry_t fsm,
ec_datagram_t datagram 
)

Read PDO entry information.

Parameters
fsmfinite state machine
datagramDatagram to use.

Definition at line 272 of file fsm_pdo_entry.c.

◆ ec_fsm_pdo_entry_read_action_next()

void ec_fsm_pdo_entry_read_action_next ( ec_fsm_pdo_entry_t fsm,
ec_datagram_t datagram 
)

Read next PDO entry.

Parameters
fsmfinite state machine
datagramDatagram to use.

Definition at line 249 of file fsm_pdo_entry.c.

◆ ec_fsm_pdo_entry_conf_state_start()

void ec_fsm_pdo_entry_conf_state_start ( ec_fsm_pdo_entry_t fsm,
ec_datagram_t datagram 
)

Start PDO mapping.

Parameters
fsmPDO mapping state machine.
datagramDatagram to use.

Definition at line 340 of file fsm_pdo_entry.c.

◆ ec_fsm_pdo_entry_conf_state_zero_entry_count()

void ec_fsm_pdo_entry_conf_state_zero_entry_count ( ec_fsm_pdo_entry_t fsm,
ec_datagram_t datagram 
)

Set the number of mapped entries to zero.

Parameters
fsmPDO mapping state machine.
datagramDatagram to use.

Definition at line 384 of file fsm_pdo_entry.c.

◆ ec_fsm_pdo_entry_conf_state_map_entry()

void ec_fsm_pdo_entry_conf_state_map_entry ( ec_fsm_pdo_entry_t fsm,
ec_datagram_t datagram 
)

Add a PDO entry.

Parameters
fsmPDO mapping state machine.
datagramDatagram to use.

Definition at line 448 of file fsm_pdo_entry.c.

◆ ec_fsm_pdo_entry_conf_state_set_entry_count()

void ec_fsm_pdo_entry_conf_state_set_entry_count ( ec_fsm_pdo_entry_t fsm,
ec_datagram_t datagram 
)

Set the number of entries.

Parameters
fsmPDO mapping state machine.
datagramDatagram to use.

Definition at line 495 of file fsm_pdo_entry.c.

◆ ec_fsm_pdo_entry_conf_action_map()

void ec_fsm_pdo_entry_conf_action_map ( ec_fsm_pdo_entry_t fsm,
ec_datagram_t datagram 
)

Starts to add a PDO entry.

Parameters
fsmPDO mapping state machine.
datagramDatagram to use.

Definition at line 419 of file fsm_pdo_entry.c.

◆ ec_fsm_pdo_entry_state_end()

void ec_fsm_pdo_entry_state_end ( ec_fsm_pdo_entry_t fsm,
ec_datagram_t datagram 
)

State: END.

Parameters
fsmPDO mapping state machine.
datagramDatagram to use.

Definition at line 534 of file fsm_pdo_entry.c.

◆ ec_fsm_pdo_entry_state_error()

void ec_fsm_pdo_entry_state_error ( ec_fsm_pdo_entry_t fsm,
ec_datagram_t datagram 
)

State: ERROR.

Parameters
fsmPDO mapping state machine.
datagramDatagram to use.

Definition at line 523 of file fsm_pdo_entry.c.

◆ ec_fsm_pdo_entry_init()

void ec_fsm_pdo_entry_init ( ec_fsm_pdo_entry_t fsm,
ec_fsm_coe_t fsm_coe 
)

Constructor.

Parameters
fsmPDO mapping state machine.
fsm_coeCoE state machine to use.

Definition at line 68 of file fsm_pdo_entry.c.

◆ ec_fsm_pdo_entry_clear()

void ec_fsm_pdo_entry_clear ( ec_fsm_pdo_entry_t fsm)

Destructor.

Parameters
fsmPDO mapping state machine.

Definition at line 81 of file fsm_pdo_entry.c.

◆ ec_fsm_pdo_entry_print()

void ec_fsm_pdo_entry_print ( ec_fsm_pdo_entry_t fsm)

Print the current and desired PDO mapping.

Parameters
fsmPDO mapping state machine.

Definition at line 92 of file fsm_pdo_entry.c.

◆ ec_fsm_pdo_entry_start_reading()

void ec_fsm_pdo_entry_start_reading ( ec_fsm_pdo_entry_t fsm,
ec_slave_t slave,
ec_pdo_t pdo 
)

Start reading a PDO's entries.

Parameters
fsmPDO mapping state machine.
slaveSlave to configure.
pdoPDO to read entries for.

Definition at line 107 of file fsm_pdo_entry.c.

◆ ec_fsm_pdo_entry_start_configuration()

void ec_fsm_pdo_entry_start_configuration ( ec_fsm_pdo_entry_t fsm,
ec_slave_t slave,
const ec_pdo_t pdo,
const ec_pdo_t cur_pdo 
)

Start PDO mapping state machine.

Parameters
fsmPDO mapping state machine.
slaveSlave to configure.
pdoPDO with the desired entries.
cur_pdoCurrent PDO mapping.

Definition at line 125 of file fsm_pdo_entry.c.

◆ ec_fsm_pdo_entry_running()

int ec_fsm_pdo_entry_running ( const ec_fsm_pdo_entry_t fsm)

Get running state.

Returns
false, if state machine has terminated
Parameters
fsmPDO mapping state machine.

Definition at line 151 of file fsm_pdo_entry.c.

◆ ec_fsm_pdo_entry_exec()

int ec_fsm_pdo_entry_exec ( ec_fsm_pdo_entry_t fsm,
ec_datagram_t datagram 
)

Executes the current state.

Returns
false, if state machine has terminated
Parameters
fsmPDO mapping state machine.
datagramDatagram to use.

Definition at line 165 of file fsm_pdo_entry.c.

◆ ec_fsm_pdo_entry_success()

int ec_fsm_pdo_entry_success ( const ec_fsm_pdo_entry_t fsm)

Get execution result.

Returns
true, if the state machine terminated gracefully
Parameters
fsmPDO mapping state machine.

Definition at line 181 of file fsm_pdo_entry.c.

◆ ec_fsm_pdo_entry_conf_next_entry()

ec_pdo_entry_t* ec_fsm_pdo_entry_conf_next_entry ( const ec_fsm_pdo_entry_t fsm,
const struct list_head *  list 
)

Process next PDO entry.

Returns
Next PDO entry, or NULL.
Parameters
fsmPDO mapping state machine.
listcurrent entry list item

Definition at line 369 of file fsm_pdo_entry.c.