IgH EtherCAT Master  1.6.2
fsm_slave.c File Reference

EtherCAT slave (SDO) state machine. More...

Go to the source code of this file.

Functions

void ec_fsm_slave_state_idle (ec_fsm_slave_t *fsm, ec_datagram_t *datagram)
 Slave state: IDLE. More...
 
void ec_fsm_slave_state_ready (ec_fsm_slave_t *fsm, ec_datagram_t *datagram)
 Slave state: READY. More...
 
int ec_fsm_slave_action_process_sdo (ec_fsm_slave_t *fsm, ec_datagram_t *datagram)
 Check for pending SDO requests and process one. More...
 
void ec_fsm_slave_state_sdo_request (ec_fsm_slave_t *fsm, ec_datagram_t *datagram)
 Slave state: SDO_REQUEST. More...
 
int ec_fsm_slave_action_process_reg (ec_fsm_slave_t *fsm, ec_datagram_t *datagram)
 Check for pending register requests and process one. More...
 
void ec_fsm_slave_state_reg_request (ec_fsm_slave_t *fsm, ec_datagram_t *datagram)
 Slave state: Register request. More...
 
int ec_fsm_slave_action_process_foe (ec_fsm_slave_t *fsm, ec_datagram_t *datagram)
 Check for pending FoE requests and process one. More...
 
void ec_fsm_slave_state_foe_request (ec_fsm_slave_t *fsm, ec_datagram_t *datagram)
 Slave state: FOE REQUEST. More...
 
int ec_fsm_slave_action_process_soe (ec_fsm_slave_t *fsm, ec_datagram_t *datagram)
 Check for pending SoE requests and process one. More...
 
void ec_fsm_slave_state_soe_request (ec_fsm_slave_t *fsm, ec_datagram_t *datagram)
 Slave state: SOE_REQUEST. More...
 
int ec_fsm_slave_action_process_eoe (ec_fsm_slave_t *fsm, ec_datagram_t *datagram)
 Check for pending EoE IP parameter requests and process one. More...
 
void ec_fsm_slave_state_eoe_request (ec_fsm_slave_t *fsm, ec_datagram_t *datagram)
 Slave state: EOE_REQUEST. More...
 
void ec_fsm_slave_init (ec_fsm_slave_t *fsm, ec_slave_t *slave)
 Constructor. More...
 
void ec_fsm_slave_clear (ec_fsm_slave_t *fsm)
 Destructor. More...
 
int ec_fsm_slave_exec (ec_fsm_slave_t *fsm, ec_datagram_t *datagram)
 Executes the current state of the state machine. More...
 
void ec_fsm_slave_set_ready (ec_fsm_slave_t *fsm)
 Sets the current state of the state machine to READY. More...
 
int ec_fsm_slave_is_ready (const ec_fsm_slave_t *fsm)
 Returns, if the FSM is currently not busy and ready to execute. More...
 

Detailed Description

EtherCAT slave (SDO) state machine.

Definition in file fsm_slave.c.

Function Documentation

◆ ec_fsm_slave_state_idle()

void ec_fsm_slave_state_idle ( ec_fsm_slave_t fsm,
ec_datagram_t datagram 
)

Slave state: IDLE.

Parameters
fsmSlave state machine.
datagramDatagram to use.

Definition at line 189 of file fsm_slave.c.

◆ ec_fsm_slave_state_ready()

void ec_fsm_slave_state_ready ( ec_fsm_slave_t fsm,
ec_datagram_t datagram 
)

Slave state: READY.

Parameters
fsmSlave state machine.
datagramDatagram to use.

Definition at line 201 of file fsm_slave.c.

◆ ec_fsm_slave_action_process_sdo()

int ec_fsm_slave_action_process_sdo ( ec_fsm_slave_t fsm,
ec_datagram_t datagram 
)

Check for pending SDO requests and process one.

Returns
non-zero, if an SDO request is processed.
Parameters
fsmSlave state machine.
datagramDatagram to use.

Definition at line 240 of file fsm_slave.c.

◆ ec_fsm_slave_state_sdo_request()

void ec_fsm_slave_state_sdo_request ( ec_fsm_slave_t fsm,
ec_datagram_t datagram 
)

Slave state: SDO_REQUEST.

Parameters
fsmSlave state machine.
datagramDatagram to use.

Definition at line 290 of file fsm_slave.c.

◆ ec_fsm_slave_action_process_reg()

int ec_fsm_slave_action_process_reg ( ec_fsm_slave_t fsm,
ec_datagram_t datagram 
)

Check for pending register requests and process one.

Returns
non-zero, if a register request is processed.
Parameters
fsmSlave state machine.
datagramDatagram to use.

Definition at line 326 of file fsm_slave.c.

◆ ec_fsm_slave_state_reg_request()

void ec_fsm_slave_state_reg_request ( ec_fsm_slave_t fsm,
ec_datagram_t datagram 
)

Slave state: Register request.

Parameters
fsmSlave state machine.
datagramDatagram to use.

Definition at line 392 of file fsm_slave.c.

◆ ec_fsm_slave_action_process_foe()

int ec_fsm_slave_action_process_foe ( ec_fsm_slave_t fsm,
ec_datagram_t datagram 
)

Check for pending FoE requests and process one.

Returns
non-zero, if an FoE request is processed.
Parameters
fsmSlave state machine.
datagramDatagram to use.

Definition at line 444 of file fsm_slave.c.

◆ ec_fsm_slave_state_foe_request()

void ec_fsm_slave_state_foe_request ( ec_fsm_slave_t fsm,
ec_datagram_t datagram 
)

Slave state: FOE REQUEST.

Parameters
fsmSlave state machine.
datagramDatagram to use.

Definition at line 484 of file fsm_slave.c.

◆ ec_fsm_slave_action_process_soe()

int ec_fsm_slave_action_process_soe ( ec_fsm_slave_t fsm,
ec_datagram_t datagram 
)

Check for pending SoE requests and process one.

Returns
non-zero, if a request is processed.
Parameters
fsmSlave state machine.
datagramDatagram to use.

Definition at line 521 of file fsm_slave.c.

◆ ec_fsm_slave_state_soe_request()

void ec_fsm_slave_state_soe_request ( ec_fsm_slave_t fsm,
ec_datagram_t datagram 
)

Slave state: SOE_REQUEST.

Parameters
fsmSlave state machine.
datagramDatagram to use.

Definition at line 571 of file fsm_slave.c.

◆ ec_fsm_slave_action_process_eoe()

int ec_fsm_slave_action_process_eoe ( ec_fsm_slave_t fsm,
ec_datagram_t datagram 
)

Check for pending EoE IP parameter requests and process one.

Returns
non-zero, if a request is processed.
Parameters
fsmSlave state machine.
datagramDatagram to use.

Definition at line 608 of file fsm_slave.c.

◆ ec_fsm_slave_state_eoe_request()

void ec_fsm_slave_state_eoe_request ( ec_fsm_slave_t fsm,
ec_datagram_t datagram 
)

Slave state: EOE_REQUEST.

Parameters
fsmSlave state machine.
datagramDatagram to use.

Definition at line 658 of file fsm_slave.c.

◆ ec_fsm_slave_init()

void ec_fsm_slave_init ( ec_fsm_slave_t fsm,
ec_slave_t slave 
)

Constructor.

Parameters
fsmSlave state machine.
slaveEtherCAT slave.

Definition at line 56 of file fsm_slave.c.

◆ ec_fsm_slave_clear()

void ec_fsm_slave_clear ( ec_fsm_slave_t fsm)

Destructor.

Parameters
fsmMaster state machine.

Definition at line 87 of file fsm_slave.c.

◆ ec_fsm_slave_exec()

int ec_fsm_slave_exec ( ec_fsm_slave_t fsm,
ec_datagram_t datagram 
)

Executes the current state of the state machine.

Returns
1 if datagram was used, else 0.
Parameters
fsmSlave state machine.
datagramNew datagram to use.

Definition at line 135 of file fsm_slave.c.

◆ ec_fsm_slave_set_ready()

void ec_fsm_slave_set_ready ( ec_fsm_slave_t fsm)

Sets the current state of the state machine to READY.

Parameters
fsmSlave state machine.

Definition at line 160 of file fsm_slave.c.

◆ ec_fsm_slave_is_ready()

int ec_fsm_slave_is_ready ( const ec_fsm_slave_t fsm)

Returns, if the FSM is currently not busy and ready to execute.

Returns
Non-zero if ready.
Parameters
fsmSlave state machine.

Definition at line 176 of file fsm_slave.c.