IgH EtherCAT Master  1.5.3
fsm_slave.c
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Copyright (C) 2006-2023 Florian Pose, Ingenieurgemeinschaft IgH
4  *
5  * This file is part of the IgH EtherCAT Master.
6  *
7  * The IgH EtherCAT Master is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License version 2, as
9  * published by the Free Software Foundation.
10  *
11  * The IgH EtherCAT Master is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
14  * Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with the IgH EtherCAT Master; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19  *
20  * ---
21  *
22  * The license mentioned above concerns the source code only. Using the
23  * EtherCAT technology and brand is only permitted in compliance with the
24  * industrial property and similar rights of Beckhoff Automation GmbH.
25  *
26  *****************************************************************************/
27 
32 /*****************************************************************************/
33 
34 #include "globals.h"
35 #include "master.h"
36 #include "mailbox.h"
37 #include "slave_config.h"
38 
39 #include "fsm_slave.h"
40 
41 /*****************************************************************************/
42 
53 
54 /*****************************************************************************/
55 
59  ec_fsm_slave_t *fsm,
60  ec_slave_t *slave
61  )
62 {
63  fsm->slave = slave;
64  INIT_LIST_HEAD(&fsm->list); // mark as unlisted
65 
67  fsm->datagram = NULL;
68  fsm->sdo_request = NULL;
69  fsm->reg_request = NULL;
70  fsm->foe_request = NULL;
71  fsm->soe_request = NULL;
72 
73  // Init sub-state-machines
74  ec_fsm_coe_init(&fsm->fsm_coe);
75  ec_fsm_foe_init(&fsm->fsm_foe);
76  ec_fsm_soe_init(&fsm->fsm_soe);
77 }
78 
79 /*****************************************************************************/
80 
84  ec_fsm_slave_t *fsm
85  )
86 {
87  // signal requests that are currently in operation
88 
89  if (fsm->sdo_request) {
90  fsm->sdo_request->state = EC_INT_REQUEST_FAILURE;
91  wake_up_all(&fsm->slave->master->request_queue);
92  }
93 
94  if (fsm->reg_request) {
95  fsm->reg_request->state = EC_INT_REQUEST_FAILURE;
96  wake_up_all(&fsm->slave->master->request_queue);
97  }
98 
99  if (fsm->foe_request) {
100  fsm->foe_request->state = EC_INT_REQUEST_FAILURE;
101  wake_up_all(&fsm->slave->master->request_queue);
102  }
103 
104  if (fsm->soe_request) {
105  fsm->soe_request->state = EC_INT_REQUEST_FAILURE;
106  wake_up_all(&fsm->slave->master->request_queue);
107  }
108 
109  // clear sub-state machines
110  ec_fsm_coe_clear(&fsm->fsm_coe);
111  ec_fsm_foe_clear(&fsm->fsm_foe);
112  ec_fsm_soe_clear(&fsm->fsm_soe);
113 }
114 
115 /*****************************************************************************/
116 
122  ec_fsm_slave_t *fsm,
123  ec_datagram_t *datagram
124  )
125 {
126  int datagram_used;
127 
128  fsm->state(fsm, datagram);
129 
130  datagram_used = fsm->state != ec_fsm_slave_state_idle &&
132 
133  if (datagram_used) {
134  fsm->datagram = datagram;
135  } else {
136  fsm->datagram = NULL;
137  }
138 
139  return datagram_used;
140 }
141 
142 /*****************************************************************************/
143 
147  ec_fsm_slave_t *fsm
148  )
149 {
150  if (fsm->state == ec_fsm_slave_state_idle) {
151  EC_SLAVE_DBG(fsm->slave, 1, "Ready for requests.\n");
153  }
154 }
155 
156 /*****************************************************************************/
157 
163  const ec_fsm_slave_t *fsm
164  )
165 {
166  return fsm->state == ec_fsm_slave_state_ready;
167 }
168 
169 /******************************************************************************
170  * Slave state machine
171  *****************************************************************************/
172 
176  ec_fsm_slave_t *fsm,
177  ec_datagram_t *datagram
178  )
179 {
180  // do nothing
181 }
182 
183 /*****************************************************************************/
184 
188  ec_fsm_slave_t *fsm,
189  ec_datagram_t *datagram
190  )
191 {
192  // Check for pending external SDO requests
193  if (ec_fsm_slave_action_process_sdo(fsm, datagram)) {
194  return;
195  }
196 
197  // Check for pending external register requests
198  if (ec_fsm_slave_action_process_reg(fsm, datagram)) {
199  return;
200  }
201 
202  // Check for pending FoE requests
203  if (ec_fsm_slave_action_process_foe(fsm, datagram)) {
204  return;
205  }
206 
207  // Check for pending SoE requests
208  if (ec_fsm_slave_action_process_soe(fsm, datagram)) {
209  return;
210  }
211 }
212 
213 /*****************************************************************************/
214 
220  ec_fsm_slave_t *fsm,
221  ec_datagram_t *datagram
222  )
223 {
224  ec_slave_t *slave = fsm->slave;
225  ec_sdo_request_t *request;
226 
227  if (list_empty(&slave->sdo_requests)) {
228  return 0;
229  }
230 
231  // take the first request to be processed
232  request = list_entry(slave->sdo_requests.next, ec_sdo_request_t, list);
233  list_del_init(&request->list); // dequeue
234 
235  if (slave->current_state & EC_SLAVE_STATE_ACK_ERR) {
236  EC_SLAVE_WARN(slave, "Aborting SDO request,"
237  " slave has error flag set.\n");
238  request->state = EC_INT_REQUEST_FAILURE;
239  wake_up_all(&slave->master->request_queue);
241  return 1;
242  }
243 
244  if (slave->current_state == EC_SLAVE_STATE_INIT) {
245  EC_SLAVE_WARN(slave, "Aborting SDO request, slave is in INIT.\n");
246  request->state = EC_INT_REQUEST_FAILURE;
247  wake_up_all(&slave->master->request_queue);
249  return 1;
250  }
251 
252  fsm->sdo_request = request;
253  request->state = EC_INT_REQUEST_BUSY;
254 
255  // Found pending SDO request. Execute it!
256  EC_SLAVE_DBG(slave, 1, "Processing SDO request...\n");
257 
258  // Start SDO transfer
260  ec_fsm_coe_transfer(&fsm->fsm_coe, slave, request);
261  ec_fsm_coe_exec(&fsm->fsm_coe, datagram); // execute immediately
262  return 1;
263 }
264 
265 /*****************************************************************************/
266 
270  ec_fsm_slave_t *fsm,
271  ec_datagram_t *datagram
272  )
273 {
274  ec_slave_t *slave = fsm->slave;
275  ec_sdo_request_t *request = fsm->sdo_request;
276 
277  if (ec_fsm_coe_exec(&fsm->fsm_coe, datagram)) {
278  return;
279  }
280 
281  if (!ec_fsm_coe_success(&fsm->fsm_coe)) {
282  EC_SLAVE_ERR(slave, "Failed to process SDO request.\n");
283  request->state = EC_INT_REQUEST_FAILURE;
284  wake_up_all(&slave->master->request_queue);
285  fsm->sdo_request = NULL;
287  return;
288  }
289 
290  EC_SLAVE_DBG(slave, 1, "Finished SDO request.\n");
291 
292  // SDO request finished
293  request->state = EC_INT_REQUEST_SUCCESS;
294  wake_up_all(&slave->master->request_queue);
295  fsm->sdo_request = NULL;
297 }
298 
299 /*****************************************************************************/
300 
306  ec_fsm_slave_t *fsm,
307  ec_datagram_t *datagram
308  )
309 {
310  ec_slave_t *slave = fsm->slave;
311  ec_reg_request_t *reg;
312 
313  fsm->reg_request = NULL;
314 
315  if (slave->config) {
316  // search the first internal register request to be processed
317  list_for_each_entry(reg, &slave->config->reg_requests, list) {
318  if (reg->state == EC_INT_REQUEST_QUEUED) {
319  fsm->reg_request = reg;
320  break;
321  }
322  }
323  }
324 
325  if (!fsm->reg_request && !list_empty(&slave->reg_requests)) {
326  // take the first external request to be processed
327  fsm->reg_request =
328  list_entry(slave->reg_requests.next, ec_reg_request_t, list);
329  list_del_init(&fsm->reg_request->list); // dequeue
330  }
331 
332  if (!fsm->reg_request) { // no register request to process
333  return 0;
334  }
335 
336  if (slave->current_state & EC_SLAVE_STATE_ACK_ERR) {
337  EC_SLAVE_WARN(slave, "Aborting register request,"
338  " slave has error flag set.\n");
339  fsm->reg_request->state = EC_INT_REQUEST_FAILURE;
340  wake_up_all(&slave->master->request_queue);
341  fsm->reg_request = NULL;
343  return 1;
344  }
345 
346  // Found pending register request. Execute it!
347  EC_SLAVE_DBG(slave, 1, "Processing register request...\n");
348 
349  fsm->reg_request->state = EC_INT_REQUEST_BUSY;
350 
351  // Start register access
352  if (fsm->reg_request->dir == EC_DIR_INPUT) {
353  ec_datagram_fprd(datagram, slave->station_address,
355  ec_datagram_zero(datagram);
356  } else {
357  ec_datagram_fpwr(datagram, slave->station_address,
359  memcpy(datagram->data, fsm->reg_request->data,
360  fsm->reg_request->transfer_size);
361  }
362  datagram->device_index = slave->device_index;
364  return 1;
365 }
366 
367 /*****************************************************************************/
368 
372  ec_fsm_slave_t *fsm,
373  ec_datagram_t *datagram
374  )
375 {
376  ec_slave_t *slave = fsm->slave;
377  ec_reg_request_t *reg = fsm->reg_request;
378 
379  if (!reg) {
380  // configuration was cleared in the meantime
382  fsm->reg_request = NULL;
383  return;
384  }
385 
386  if (fsm->datagram->state != EC_DATAGRAM_RECEIVED) {
387  EC_SLAVE_ERR(slave, "Failed to receive register"
388  " request datagram: ");
390  reg->state = EC_INT_REQUEST_FAILURE;
391  wake_up_all(&slave->master->request_queue);
392  fsm->reg_request = NULL;
394  return;
395  }
396 
397  if (fsm->datagram->working_counter == 1) {
398  if (reg->dir == EC_DIR_INPUT) { // read request
399  memcpy(reg->data, fsm->datagram->data, reg->transfer_size);
400  }
401 
402  reg->state = EC_INT_REQUEST_SUCCESS;
403  EC_SLAVE_DBG(slave, 1, "Register request successful.\n");
404  } else {
405  reg->state = EC_INT_REQUEST_FAILURE;
407  EC_SLAVE_ERR(slave, "Register request failed"
408  " (working counter is %u).\n",
409  fsm->datagram->working_counter);
410  }
411 
412  wake_up_all(&slave->master->request_queue);
413  fsm->reg_request = NULL;
415 }
416 
417 /*****************************************************************************/
418 
424  ec_fsm_slave_t *fsm,
425  ec_datagram_t *datagram
426  )
427 {
428  ec_slave_t *slave = fsm->slave;
429  ec_foe_request_t *request;
430 
431  if (list_empty(&slave->foe_requests)) {
432  return 0;
433  }
434 
435  // take the first request to be processed
436  request = list_entry(slave->foe_requests.next, ec_foe_request_t, list);
437  list_del_init(&request->list); // dequeue
438 
439  if (slave->current_state & EC_SLAVE_STATE_ACK_ERR) {
440  EC_SLAVE_WARN(slave, "Aborting FoE request,"
441  " slave has error flag set.\n");
442  request->state = EC_INT_REQUEST_FAILURE;
443  wake_up_all(&slave->master->request_queue);
445  return 1;
446  }
447 
448  request->state = EC_INT_REQUEST_BUSY;
449  fsm->foe_request = request;
450 
451  EC_SLAVE_DBG(slave, 1, "Processing FoE request.\n");
452 
454  ec_fsm_foe_transfer(&fsm->fsm_foe, slave, request);
455  ec_fsm_foe_exec(&fsm->fsm_foe, datagram);
456  return 1;
457 }
458 
459 /*****************************************************************************/
460 
464  ec_fsm_slave_t *fsm,
465  ec_datagram_t *datagram
466  )
467 {
468  ec_slave_t *slave = fsm->slave;
469  ec_foe_request_t *request = fsm->foe_request;
470 
471  if (ec_fsm_foe_exec(&fsm->fsm_foe, datagram)) {
472  return;
473  }
474 
475  if (!ec_fsm_foe_success(&fsm->fsm_foe)) {
476  EC_SLAVE_ERR(slave, "Failed to handle FoE request.\n");
477  request->state = EC_INT_REQUEST_FAILURE;
478  wake_up_all(&slave->master->request_queue);
479  fsm->foe_request = NULL;
481  return;
482  }
483 
484  // finished transferring FoE
485  EC_SLAVE_DBG(slave, 1, "Successfully transferred %zu bytes of FoE"
486  " data.\n", request->data_size);
487 
488  request->state = EC_INT_REQUEST_SUCCESS;
489  wake_up_all(&slave->master->request_queue);
490  fsm->foe_request = NULL;
492 }
493 
494 /*****************************************************************************/
495 
501  ec_fsm_slave_t *fsm,
502  ec_datagram_t *datagram
503  )
504 {
505  ec_slave_t *slave = fsm->slave;
506  ec_soe_request_t *req;
507 
508  if (list_empty(&slave->soe_requests)) {
509  return 0;
510  }
511 
512  // take the first request to be processed
513  req = list_entry(slave->soe_requests.next, ec_soe_request_t, list);
514  list_del_init(&req->list); // dequeue
515 
516  if (slave->current_state & EC_SLAVE_STATE_ACK_ERR) {
517  EC_SLAVE_WARN(slave, "Aborting SoE request,"
518  " slave has error flag set.\n");
519  req->state = EC_INT_REQUEST_FAILURE;
520  wake_up_all(&slave->master->request_queue);
522  return 1;
523  }
524 
525  if (slave->current_state == EC_SLAVE_STATE_INIT) {
526  EC_SLAVE_WARN(slave, "Aborting SoE request, slave is in INIT.\n");
527  req->state = EC_INT_REQUEST_FAILURE;
528  wake_up_all(&slave->master->request_queue);
530  return 0;
531  }
532 
533  fsm->soe_request = req;
534  req->state = EC_INT_REQUEST_BUSY;
535 
536  // Found pending request. Execute it!
537  EC_SLAVE_DBG(slave, 1, "Processing SoE request...\n");
538 
539  // Start SoE transfer
541  ec_fsm_soe_transfer(&fsm->fsm_soe, slave, req);
542  ec_fsm_soe_exec(&fsm->fsm_soe, datagram); // execute immediately
543  return 1;
544 }
545 
546 /*****************************************************************************/
547 
551  ec_fsm_slave_t *fsm,
552  ec_datagram_t *datagram
553  )
554 {
555  ec_slave_t *slave = fsm->slave;
556  ec_soe_request_t *request = fsm->soe_request;
557 
558  if (ec_fsm_soe_exec(&fsm->fsm_soe, datagram)) {
559  return;
560  }
561 
562  if (!ec_fsm_soe_success(&fsm->fsm_soe)) {
563  EC_SLAVE_ERR(slave, "Failed to process SoE request.\n");
564  request->state = EC_INT_REQUEST_FAILURE;
565  wake_up_all(&slave->master->request_queue);
566  fsm->soe_request = NULL;
568  return;
569  }
570 
571  EC_SLAVE_DBG(slave, 1, "Finished SoE request.\n");
572 
573  // SoE request finished
574  request->state = EC_INT_REQUEST_SUCCESS;
575  wake_up_all(&slave->master->request_queue);
576  fsm->soe_request = NULL;
578 }
579 
580 /*****************************************************************************/
ec_internal_request_state_t state
Request state.
Definition: reg_request.h:56
void ec_fsm_slave_clear(ec_fsm_slave_t *fsm)
Destructor.
Definition: fsm_slave.c:83
int ec_fsm_foe_success(const ec_fsm_foe_t *fsm)
Returns, if the state machine terminated with success.
Definition: fsm_foe.c:159
void ec_fsm_slave_state_foe_request(ec_fsm_slave_t *, ec_datagram_t *)
Slave state: FOE REQUEST.
Definition: fsm_slave.c:463
size_t transfer_size
Size of the data to transfer.
Definition: reg_request.h:55
ec_foe_request_t * foe_request
FoE request to process.
Definition: fsm_slave.h:62
void ec_fsm_foe_clear(ec_fsm_foe_t *fsm)
Destructor.
Definition: fsm_foe.c:115
#define EC_SLAVE_DBG(slave, level, fmt, args...)
Convenience macro for printing slave-specific debug messages to syslog.
Definition: slave.h:106
ec_reg_request_t * reg_request
Register request to process.
Definition: fsm_slave.h:61
int ec_fsm_slave_is_ready(const ec_fsm_slave_t *fsm)
Returns, if the FSM is currently not busy and ready to execute.
Definition: fsm_slave.c:162
CANopen SDO request.
Definition: sdo_request.h:46
ec_slave_state_t current_state
Current application state.
Definition: slave.h:192
ec_internal_request_state_t state
SDO request state.
Definition: sdo_request.h:61
uint16_t address
Register address.
Definition: reg_request.h:54
Register request.
Definition: reg_request.h:48
#define EC_SLAVE_WARN(slave, fmt, args...)
Convenience macro for printing slave-specific warnings to syslog.
Definition: slave.h:90
EtherCAT datagram.
Definition: datagram.h:87
void ec_fsm_slave_state_soe_request(ec_fsm_slave_t *, ec_datagram_t *)
Slave state: SOE_REQUEST.
Definition: fsm_slave.c:550
ec_fsm_soe_t fsm_soe
SoE state machine.
Definition: fsm_slave.h:68
Finite state machine of an EtherCAT slave.
Definition: fsm_slave.h:54
ec_datagram_t * datagram
Previous state datagram.
Definition: fsm_slave.h:59
struct list_head reg_requests
Register access requests.
Definition: slave.h:230
uint16_t working_counter
Working counter.
Definition: datagram.h:99
int ec_fsm_slave_action_process_foe(ec_fsm_slave_t *, ec_datagram_t *)
Check for pending FoE requests and process one.
Definition: fsm_slave.c:423
void ec_fsm_foe_transfer(ec_fsm_foe_t *fsm, ec_slave_t *slave, ec_foe_request_t *request)
Prepares an FoE transfer.
Definition: fsm_foe.c:168
Acknowledge/Error bit (no actual state)
Definition: globals.h:128
int ec_fsm_coe_success(const ec_fsm_coe_t *fsm)
Returns, if the state machine terminated with success.
Definition: fsm_coe.c:262
wait_queue_head_t request_queue
Wait queue for external requests from user space.
Definition: master.h:311
ec_sdo_request_t * sdo_request
SDO request to process.
Definition: fsm_slave.h:60
int ec_fsm_slave_action_process_reg(ec_fsm_slave_t *, ec_datagram_t *)
Check for pending register requests and process one.
Definition: fsm_slave.c:305
uint16_t station_address
Configured station address.
Definition: slave.h:184
int ec_fsm_slave_action_process_soe(ec_fsm_slave_t *, ec_datagram_t *)
Check for pending SoE requests and process one.
Definition: fsm_slave.c:500
Global definitions and macros.
EtherCAT master structure.
void ec_fsm_slave_state_sdo_request(ec_fsm_slave_t *, ec_datagram_t *)
Slave state: SDO_REQUEST.
Definition: fsm_slave.c:269
EtherCAT slave.
Definition: slave.h:176
ec_slave_t * slave
slave the FSM runs on
Definition: fsm_slave.h:55
struct list_head sdo_requests
SDO access requests.
Definition: slave.h:229
void ec_datagram_zero(ec_datagram_t *datagram)
Fills the datagram payload memory with zeros.
Definition: datagram.c:178
void ec_fsm_foe_init(ec_fsm_foe_t *fsm)
Constructor.
Definition: fsm_foe.c:103
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.
Definition: fsm_soe.c:128
int ec_fsm_soe_success(const ec_fsm_soe_t *fsm)
Returns, if the state machine terminated with success.
Definition: fsm_soe.c:185
struct list_head soe_requests
SoE write requests.
Definition: slave.h:232
ec_datagram_state_t state
State.
Definition: datagram.h:100
ec_slave_config_t * config
Current configuration.
Definition: slave.h:190
struct list_head reg_requests
List of register requests.
Definition: slave_config.h:146
#define EC_SLAVE_ERR(slave, fmt, args...)
Convenience macro for printing slave-specific errors to syslog.
Definition: slave.h:76
void ec_fsm_slave_state_reg_request(ec_fsm_slave_t *, ec_datagram_t *)
Slave state: Register request.
Definition: fsm_slave.c:371
void ec_fsm_slave_set_ready(ec_fsm_slave_t *fsm)
Sets the current state of the state machine to READY.
Definition: fsm_slave.c:146
struct list_head list
List item.
Definition: soe_request.h:49
ec_soe_request_t * soe_request
SoE request to process.
Definition: fsm_slave.h:64
void ec_fsm_coe_clear(ec_fsm_coe_t *fsm)
Destructor.
Definition: fsm_coe.c:182
int ec_fsm_slave_exec(ec_fsm_slave_t *fsm, ec_datagram_t *datagram)
Executes the current state of the state machine.
Definition: fsm_slave.c:121
ec_master_t * master
Master owning the slave.
Definition: slave.h:178
int ec_datagram_fpwr(ec_datagram_t *datagram, uint16_t configured_address, uint16_t mem_address, size_t data_size)
Initializes an EtherCAT FPWR datagram.
Definition: datagram.c:298
int ec_datagram_fprd(ec_datagram_t *datagram, uint16_t configured_address, uint16_t mem_address, size_t data_size)
Initializes an EtherCAT FPRD datagram.
Definition: datagram.c:273
Values read by the master.
Definition: ecrt.h:449
ec_device_index_t device_index
Device via which the datagram shall be / was sent.
Definition: datagram.h:90
void ec_fsm_slave_state_ready(ec_fsm_slave_t *, ec_datagram_t *)
Slave state: READY.
Definition: fsm_slave.c:187
size_t data_size
Size of FoE data.
Definition: foe_request.h:54
void ec_fsm_coe_init(ec_fsm_coe_t *fsm)
Constructor.
Definition: fsm_coe.c:170
INIT state (no mailbox communication, no IO)
Definition: globals.h:118
FoE request.
Definition: foe_request.h:50
struct list_head foe_requests
FoE write requests.
Definition: slave.h:231
int ec_fsm_slave_action_process_sdo(ec_fsm_slave_t *, ec_datagram_t *)
Check for pending SDO requests and process one.
Definition: fsm_slave.c:219
int ec_fsm_foe_exec(ec_fsm_foe_t *fsm, ec_datagram_t *datagram)
Executes the current state of the state machine.
Definition: fsm_foe.c:125
void ec_datagram_print_state(const ec_datagram_t *datagram)
Prints the state of a datagram.
Definition: datagram.c:565
Mailbox functionality.
struct list_head list
Used for execution list.
Definition: fsm_slave.h:56
uint8_t * data
Pointer to data memory.
Definition: reg_request.h:51
struct list_head list
List item.
Definition: sdo_request.h:47
void ec_fsm_slave_init(ec_fsm_slave_t *fsm, ec_slave_t *slave)
Constructor.
Definition: fsm_slave.c:58
int ec_fsm_coe_exec(ec_fsm_coe_t *fsm, ec_datagram_t *datagram)
Executes the current state of the state machine.
Definition: fsm_coe.c:228
EtherCAT slave request state machine.
ec_direction_t dir
Direction.
Definition: reg_request.h:52
ec_fsm_foe_t fsm_foe
FoE state machine.
Definition: fsm_slave.h:67
void ec_fsm_soe_init(ec_fsm_soe_t *fsm)
Constructor.
Definition: fsm_soe.c:105
void ec_fsm_soe_clear(ec_fsm_soe_t *fsm)
Destructor.
Definition: fsm_soe.c:118
uint8_t * data
Datagram payload.
Definition: datagram.h:94
ec_fsm_coe_t fsm_coe
CoE state machine.
Definition: fsm_slave.h:66
EtherCAT slave configuration structure.
ec_internal_request_state_t state
FoE request state.
Definition: foe_request.h:63
ec_device_index_t device_index
Index of device the slave responds on.
Definition: slave.h:179
int ec_fsm_soe_exec(ec_fsm_soe_t *fsm, ec_datagram_t *datagram)
Executes the current state of the state machine.
Definition: fsm_soe.c:150
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.
Definition: fsm_coe.c:205
Received (dequeued).
Definition: datagram.h:78
void ec_fsm_slave_state_idle(ec_fsm_slave_t *, ec_datagram_t *)
Slave state: IDLE.
Definition: fsm_slave.c:175
struct list_head list
List item.
Definition: reg_request.h:49
void(* state)(ec_fsm_slave_t *, ec_datagram_t *)
State function.
Definition: fsm_slave.h:58
ec_internal_request_state_t state
Request state.
Definition: soe_request.h:60
Sercos-over-EtherCAT request.
Definition: soe_request.h:48
struct list_head list
List item.
Definition: foe_request.h:51