|
IgH EtherCAT Master
1.7.0
|
EtherCAT CoE state machines. More...
Go to the source code of this file.
Macros | |
| #define | EC_FSM_COE_DICT_TIMEOUT 1000 |
| Maximum time in ms to wait for responses when reading out the dictionary. | |
| #define | EC_COE_DOWN_REQ_HEADER_SIZE 10 |
| CoE download request header size. | |
| #define | EC_COE_DOWN_SEG_REQ_HEADER_SIZE 3 |
| CoE download segment request header size. | |
| #define | EC_COE_DOWN_SEG_MIN_DATA_SIZE 7 |
| Minimum size of download segment. | |
| #define | DEBUG_RETRIES 0 |
| Enable debug output for CoE retries. | |
| #define | DEBUG_LONG 0 |
| Enable warning output if transfers take too long. | |
Functions | |
| void | ec_canopen_abort_msg (const ec_slave_t *slave, uint32_t abort_code) |
| Outputs an SDO abort message. | |
| int | ec_fsm_coe_check_emergency (const ec_fsm_coe_t *fsm, const uint8_t *data, size_t size) |
| Check if the received data are a CoE emergency request. | |
| int | ec_fsm_coe_prepare_dict (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| Prepare a dictionary request. | |
| int | ec_fsm_coe_dict_prepare_desc (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| Prepare an object description request. | |
| int | ec_fsm_coe_dict_prepare_entry (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| Prepare an entry description request. | |
| int | ec_fsm_coe_prepare_down_start (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| Prepare a donwnload request. | |
| void | ec_fsm_coe_down_prepare_segment_request (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| Prepare a download segment request. | |
| int | ec_fsm_coe_prepare_up (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| Prepare an upload request. | |
| void | ec_fsm_coe_up_prepare_segment_request (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| Prepare an SDO upload segment request. | |
| void | ec_fsm_coe_dict_start (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| CoE state: DICT START. | |
| void | ec_fsm_coe_dict_request (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| CoE state: DICT REQUEST. | |
| void | ec_fsm_coe_dict_response (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| CoE state: DICT RESPONSE. | |
| void | ec_fsm_coe_dict_desc_request (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| CoE state: DICT DESC REQUEST. | |
| void | ec_fsm_coe_dict_desc_response (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| CoE state: DICT DESC RESPONSE. | |
| void | ec_fsm_coe_dict_entry_request (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| CoE state: DICT ENTRY REQUEST. | |
| void | ec_fsm_coe_dict_entry_response (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| CoE state: DICT ENTRY RESPONSE. | |
| void | ec_fsm_coe_down_start (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| CoE state: DOWN START. | |
| void | ec_fsm_coe_down_request (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| CoE state: DOWN REQUEST. | |
| void | ec_fsm_coe_down_response (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| CoE state: DOWN RESPONSE. | |
| void | ec_fsm_coe_down_seg_request (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| CoE state: DOWN SEG REQUEST. | |
| void | ec_fsm_coe_down_seg_response (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| CoE state: DOWN SEG RESPONSE. | |
| void | ec_fsm_coe_up_start (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| CoE state: UP START. | |
| void | ec_fsm_coe_up_request (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| CoE state: UP REQUEST. | |
| void | ec_fsm_coe_up_response (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| CoE state: UP RESPONSE. | |
| void | ec_fsm_coe_up_seg_request (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| CoE state: UP REQUEST. | |
| void | ec_fsm_coe_up_seg_response (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| CoE state: UP SEG RESPONSE. | |
| void | ec_fsm_coe_end (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| State: END. | |
| void | ec_fsm_coe_error (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| State: ERROR. | |
| void | ec_fsm_coe_init (ec_fsm_coe_t *fsm) |
| Constructor. | |
| void | ec_fsm_coe_clear (ec_fsm_coe_t *fsm) |
| Destructor. | |
| void | ec_fsm_coe_dictionary (ec_fsm_coe_t *fsm, ec_slave_t *slave) |
| Starts reading a slaves' SDO dictionary. | |
| void | ec_fsm_coe_transfer (ec_fsm_coe_t *fsm, ec_slave_t *slave, ec_sdo_request_t *request) |
| Starts to transfer an SDO to/from a slave. | |
| int | ec_fsm_coe_exec (ec_fsm_coe_t *fsm, ec_datagram_t *datagram) |
| Executes the current state of the state machine. | |
| int | ec_fsm_coe_success (const ec_fsm_coe_t *fsm) |
| Returns, if the state machine terminated with success. | |
| void | ec_fsm_coe_abort (ec_fsm_coe_t *fsm) |
| Aborts a running transfer. | |
| static void | ec_fsm_coe_receive (ec_fsm_coe_t *fsm, ec_datagram_t *datagram, unsigned long timeout_ms, void(*state)(ec_fsm_coe_t *, ec_datagram_t *)) |
| Waits for a CoE response. | |
| static unsigned long | ec_fsm_coe_elapsed_ms (const ec_fsm_coe_t *fsm) |
| Time elapsed since the request was sent. | |
Variables | |
| const ec_code_msg_t | sdo_abort_messages [] |
| SDO abort messages. | |
EtherCAT CoE state machines.
Definition in file fsm_coe.c.
| #define EC_FSM_COE_DICT_TIMEOUT 1000 |
| #define EC_COE_DOWN_REQ_HEADER_SIZE 10 |
| #define EC_COE_DOWN_SEG_REQ_HEADER_SIZE 3 |
| #define EC_COE_DOWN_SEG_MIN_DATA_SIZE 7 |
| #define DEBUG_RETRIES 0 |
| #define DEBUG_LONG 0 |
| void ec_canopen_abort_msg | ( | const ec_slave_t * | slave, |
| uint32_t | abort_code ) |
| int ec_fsm_coe_check_emergency | ( | const ec_fsm_coe_t * | fsm, |
| const uint8_t * | data, | ||
| size_t | size ) |
| int ec_fsm_coe_prepare_dict | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| int ec_fsm_coe_dict_prepare_desc | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| int ec_fsm_coe_dict_prepare_entry | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| int ec_fsm_coe_prepare_down_start | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_coe_down_prepare_segment_request | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| int ec_fsm_coe_prepare_up | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_coe_up_prepare_segment_request | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_coe_dict_start | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_coe_dict_request | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_coe_dict_response | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_coe_dict_desc_request | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_coe_dict_desc_response | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_coe_dict_entry_request | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_coe_dict_entry_response | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_coe_down_start | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_coe_down_request | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_coe_down_response | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_coe_down_seg_request | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_coe_down_seg_response | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_coe_up_start | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_coe_up_request | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_coe_up_response | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_coe_up_seg_request | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_coe_up_seg_response | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_coe_end | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_coe_error | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| void ec_fsm_coe_init | ( | ec_fsm_coe_t * | fsm | ) |
| void ec_fsm_coe_clear | ( | ec_fsm_coe_t * | fsm | ) |
| void ec_fsm_coe_dictionary | ( | ec_fsm_coe_t * | fsm, |
| ec_slave_t * | slave ) |
| void ec_fsm_coe_transfer | ( | ec_fsm_coe_t * | fsm, |
| ec_slave_t * | slave, | ||
| ec_sdo_request_t * | request ) |
| int ec_fsm_coe_exec | ( | ec_fsm_coe_t * | fsm, |
| ec_datagram_t * | datagram ) |
| int ec_fsm_coe_success | ( | const ec_fsm_coe_t * | fsm | ) |
| void ec_fsm_coe_abort | ( | ec_fsm_coe_t * | fsm | ) |
|
static |
Waits for a CoE response.
Starts the mailbox receive state machine and executes the given response state immediately. The response state is left, as soon as a CoE response is available, or receiving failed.
| fsm | Finite state machine. |
| datagram | Datagram to use. |
| timeout_ms | Response timeout in [ms], counted from jiffies_start. |
| state | Response state. |
|
static |
| const ec_code_msg_t sdo_abort_messages[] |