|
IgH EtherCAT Master
1.7.0
|
EtherCAT SoE state machines. More...
Go to the source code of this file.
Macros | |
| #define | EC_SOE_SIZE 0x04 |
| Size of all SoE headers. | |
| #define | EC_SOE_HEADER_SIZE (EC_MBOX_HEADER_SIZE + EC_SOE_SIZE) |
| SoE header size. | |
| #define | EC_SOE_RESPONSE_TIMEOUT 1000 |
| SoE response timeout [ms]. | |
Enumerations | |
| enum | { OPCODE_READ_REQUEST = 0x01 , OPCODE_READ_RESPONSE = 0x02 , OPCODE_WRITE_REQUEST = 0x03 , OPCODE_WRITE_RESPONSE = 0x04 } |
| SoE operations. More... | |
Functions | |
| void | ec_print_soe_error (const ec_slave_t *slave, uint16_t error_code) |
| Outputs an SoE error code. | |
| void | ec_fsm_soe_print_error (ec_fsm_soe_t *fsm) |
| Output information about a failed SoE transfer. | |
| int | ec_fsm_soe_prepare_read (ec_fsm_soe_t *fsm, ec_datagram_t *datagram) |
| Prepare a read operation. | |
| void | ec_fsm_soe_write_next_fragment (ec_fsm_soe_t *fsm, ec_datagram_t *datagram) |
| Write next fragment. | |
| void | ec_fsm_soe_read_start (ec_fsm_soe_t *fsm, ec_datagram_t *datagram) |
| SoE state: READ START. | |
| void | ec_fsm_soe_read_request (ec_fsm_soe_t *fsm, ec_datagram_t *datagram) |
| SoE state: READ REQUEST. | |
| void | ec_fsm_soe_read_response (ec_fsm_soe_t *fsm, ec_datagram_t *datagram) |
| SoE state: READ RESPONSE. | |
| void | ec_fsm_soe_write_start (ec_fsm_soe_t *fsm, ec_datagram_t *datagram) |
| SoE state: WRITE START. | |
| void | ec_fsm_soe_write_request (ec_fsm_soe_t *fsm, ec_datagram_t *datagram) |
| SoE state: WRITE REQUEST. | |
| void | ec_fsm_soe_write_response (ec_fsm_soe_t *fsm, ec_datagram_t *datagram) |
| SoE state: WRITE RESPONSE. | |
| void | ec_fsm_soe_end (ec_fsm_soe_t *fsm, ec_datagram_t *datagram) |
| State: END. | |
| void | ec_fsm_soe_error (ec_fsm_soe_t *fsm, ec_datagram_t *datagram) |
| State: ERROR. | |
| void | ec_fsm_soe_init (ec_fsm_soe_t *fsm) |
| Constructor. | |
| void | ec_fsm_soe_clear (ec_fsm_soe_t *fsm) |
| Destructor. | |
| void | ec_fsm_soe_transfer (ec_fsm_soe_t *fsm, ec_slave_t *slave, ec_soe_request_t *request) |
| Starts to transfer an IDN to/from a slave. | |
| int | ec_fsm_soe_exec (ec_fsm_soe_t *fsm, ec_datagram_t *datagram) |
| Executes the current state of the state machine. | |
| int | ec_fsm_soe_success (const ec_fsm_soe_t *fsm) |
| Returns, if the state machine terminated with success. | |
| void | ec_fsm_soe_abort (ec_fsm_soe_t *fsm) |
| Aborts a running transfer. | |
| static void | ec_fsm_soe_receive (ec_fsm_soe_t *fsm, ec_datagram_t *datagram, void(*state)(ec_fsm_soe_t *, ec_datagram_t *)) |
| Waits for an SoE response. | |
| static unsigned long | ec_fsm_soe_elapsed_ms (const ec_fsm_soe_t *fsm) |
| Time elapsed since the request was sent. | |
Variables | |
| const ec_code_msg_t | soe_error_codes [] |
| SoE error codes. | |
EtherCAT SoE state machines.
Definition in file fsm_soe.c.
| #define EC_SOE_HEADER_SIZE (EC_MBOX_HEADER_SIZE + EC_SOE_SIZE) |
| #define EC_SOE_RESPONSE_TIMEOUT 1000 |
| anonymous enum |
| void ec_print_soe_error | ( | const ec_slave_t * | slave, |
| uint16_t | error_code ) |
| void ec_fsm_soe_print_error | ( | ec_fsm_soe_t * | fsm | ) |
| int ec_fsm_soe_prepare_read | ( | ec_fsm_soe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_soe_write_next_fragment | ( | ec_fsm_soe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_soe_read_start | ( | ec_fsm_soe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_soe_read_request | ( | ec_fsm_soe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_soe_read_response | ( | ec_fsm_soe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_soe_write_start | ( | ec_fsm_soe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_soe_write_request | ( | ec_fsm_soe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_soe_write_response | ( | ec_fsm_soe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_soe_end | ( | ec_fsm_soe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_soe_error | ( | ec_fsm_soe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_soe_init | ( | ec_fsm_soe_t * | fsm | ) |
| void ec_fsm_soe_clear | ( | ec_fsm_soe_t * | fsm | ) |
| void ec_fsm_soe_transfer | ( | ec_fsm_soe_t * | fsm, |
| ec_slave_t * | slave, | ||
| ec_soe_request_t * | request ) |
| int ec_fsm_soe_exec | ( | ec_fsm_soe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| int ec_fsm_soe_success | ( | const ec_fsm_soe_t * | fsm | ) |
| void ec_fsm_soe_abort | ( | ec_fsm_soe_t * | fsm | ) |
|
static |
Waits for an SoE response.
Starts the mailbox receive state machine and executes the given response state immediately. The response state is left, as soon as an SoE response is available, or receiving failed.
| fsm | Finite state machine. |
| datagram | Datagram to use. |
| state | Response state. |
|
static |
|
extern |
SoE error codes.
Definition at line 35 of file soe_errors.c.