IgH EtherCAT Master  1.5.3
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...
 
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 175 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 187 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 219 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 269 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 305 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 371 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 423 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 463 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 500 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 550 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 58 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 83 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 121 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 146 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 162 of file fsm_slave.c.