28 #ifndef __EC_FSM_MBOX_H__ 29 #define __EC_FSM_MBOX_H__ 80 unsigned long,
unsigned long);
ec_fsm_mbox_mode_t mode
Receive mode.
ec_datagram_t * datagram
Datagram used in the last step.
EtherCAT mailbox receive state machine.
unsigned long jiffies_start
Reference time for the timeout.
Fetch the mailbox once without checking it.
EtherCAT mailbox response data.
ec_fsm_mbox_mode_t
Mode of the mailbox receive state machine.
Wait for a response until the timeout elapsed.
unsigned int retries
Retries upon datagram timeout.
Global definitions and macros.
void(* state)(ec_fsm_mbox_t *, ec_datagram_t *)
State function.
void ec_fsm_mbox_poll(ec_fsm_mbox_t *, ec_slave_t *, ec_mbox_data_t *)
Starts a single mailbox check without waiting.
ec_mbox_data_t * mbox_data
Response buffer of the protocol.
void ec_fsm_mbox_fetch_nosync(ec_fsm_mbox_t *, ec_slave_t *, ec_mbox_data_t *, unsigned long, unsigned long)
Starts a single mailbox fetch without a preceding check.
unsigned long timeout_ms
Response timeout in [ms].
void ec_fsm_mbox_receive(ec_fsm_mbox_t *, ec_slave_t *, ec_mbox_data_t *, unsigned long, unsigned long)
Starts waiting for a mailbox response.
int ec_fsm_mbox_exec(ec_fsm_mbox_t *, ec_datagram_t *)
Executes the current state of the state machine.
EtherCAT datagram structure.
int ec_fsm_mbox_holds_lock(const ec_fsm_mbox_t *)
Checks, if the state machine holds the slave's mailbox read lock.
Check the mailbox once, do not wait.
void ec_fsm_mbox_init(ec_fsm_mbox_t *)
Constructor.
void ec_fsm_mbox_clear(ec_fsm_mbox_t *)
Destructor.
ec_slave_t * slave
Slave the FSM runs on.
int result
Zero on success, otherwise a negative error code.
int ec_fsm_mbox_result(const ec_fsm_mbox_t *)
Returns the result of the terminated state machine.
void ec_fsm_mbox_abort(ec_fsm_mbox_t *)
Aborts the state machine and releases the mailbox read lock, if held.