diff --git a/ec_8h.html b/ec_8h.html index dec4825..2d7ea58 100644 --- a/ec_8h.html +++ b/ec_8h.html @@ -244,9 +244,9 @@ int ec_close (ec_t *pec)  Closes ethercat master. More...
  -void ec_configure_tun (ec_t *pec, osal_uint8_t ip_address[4]) - Configures tun device of EtherCAT master, used for EoE slaves. More...
-  +int ec_configure_tun (ec_t *pec, osal_uint8_t ip_address[4]) + Configures tun device of EtherCAT master, used for EoE slaves. More...
+  void ec_configure_dc (ec_t *pec, osal_uint64_t timer, ec_dc_mode_t mode, void(*user_cb)(void *arg, int num), void *user_cb_arg)  Configures distributed clocks settings on EtherCAT master. More...
  diff --git a/ec_8h.js b/ec_8h.js index 657c912..7d16d2a 100644 --- a/ec_8h.js +++ b/ec_8h.js @@ -33,7 +33,7 @@ var ec_8h = [ "ec_close", "group__ec__group.html#ga6413bb07c5aab4165ce2c35e9cd049c4", null ], [ "ec_configure_dc", "group__ec__group.html#gafcedee35e71c5dcfda0f14d25592a6ce", null ], [ "ec_configure_pd_group", "group__ec__group.html#ga1e88c8d6db33a7ef0d20a91239afe275", null ], - [ "ec_configure_tun", "group__ec__group.html#gaa205ce61912b65369da9e3b5529ed63b", null ], + [ "ec_configure_tun", "group__ec__group.html#ga017cc10573f61b5dc4113cc77ea787a7", null ], [ "ec_create_pd_groups", "group__ec__group.html#gae6151b5238389629d06d11b89d61b7e3", null ], [ "ec_destroy_pd_groups", "group__ec__group.html#ga509683e6a8bab096be23af7d086aad29", null ], [ "ec_get_slave_count", "group__ec__group.html#gaf7a827d9da875d1481113f3291391142", null ], diff --git a/ec_8h_source.html b/ec_8h_source.html index e11a39c..cf250d4 100644 --- a/ec_8h_source.html +++ b/ec_8h_source.html @@ -236,115 +236,115 @@
281 int ec_close(ec_t *pec);
282 
284 
-
289 void ec_configure_tun(ec_t *pec, osal_uint8_t ip_address[4]);
-
290 
-
292 
-
299 void ec_configure_dc(ec_t *pec, osal_uint64_t timer, ec_dc_mode_t mode,
-
300  void (*user_cb)(void *arg, int num), void *user_cb_arg);
-
301 
-
303 
-
309 int ec_create_pd_groups(ec_t *pec, osal_uint32_t pd_group_cnt);
-
310 
-
312 
-
319 void ec_configure_pd_group(ec_t *pec, osal_uint16_t group, int clock_divisor,
-
320  void (*user_cb)(void *arg, int num), void *user_cb_arg);
-
321 
-
323 
-
328 int ec_destroy_pd_groups(ec_t *pec);
-
329 
-
331 
-
341 int ec_transceive(ec_t *pec, osal_uint8_t cmd, osal_uint32_t adr,
-
342  osal_uint8_t *data, osal_size_t datalen, osal_uint16_t *wkc);
-
343 
-
345 
-
354 int ec_transmit_no_reply(ec_t *pec, osal_uint8_t cmd, osal_uint32_t adr,
-
355  osal_uint8_t *data, osal_size_t datalen);
-
356 
-
358 
-
365 int ec_set_state(ec_t *pec, ec_state_t state);
-
366 
-
367 #define ec_group_will_be_sent(pec, group) (int)((((pec)->pd_groups[(group)].divisor_cnt+1) % (pec)->pd_groups[(group)].divisor) == 0)
-
368 #define ec_group_was_sent(pec, group) (int)((pec)->pd_groups[(group)].divisor_cnt == 0)
-
369 
-
371 
-
375 int ec_send_process_data(ec_t *pec);
-
376 
-
378 
-
383 int ec_send_distributed_clocks_sync(ec_t *pec);
-
384 
-
386 
-
391 int ec_send_brd_ec_state(ec_t *pec);
-
392 
-
394 
-
398 int ec_get_slave_count(ec_t *pec);
-
399 
-
400 #ifdef __cplusplus
-
401 };
-
402 #endif
-
403 
-
405 #define ec_to_adr(ado, adp) \
-
406  ((osal_uint32_t)(adp) << 16u) | ((ado) & 0xFFFFu)
-
407 
-
409 #define ec_brd(pec, ado, data, datalen, wkc) \
-
410  ec_transceive((pec), EC_CMD_BRD, ((osal_uint32_t)(ado) << 16u), \
-
411  (osal_uint8_t *)(data), (datalen), (wkc))
-
412 
-
414 #define ec_bwr(pec, ado, data, datalen, wkc) \
-
415  ec_transceive((pec), EC_CMD_BWR, ((osal_uint32_t)(ado) << 16u), \
-
416  (osal_uint8_t *)(data), (datalen), (wkc))
-
417 
-
419 #define ec_brw(pec, ado, data, datalen, wkc) \
-
420  ec_transceive((pec), EC_CMD_BRW, ((osal_uint32_t)(ado) << 16u), \
-
421  (osal_uint8_t *)(data), (datalen), (wkc))
-
422 
-
424 #define ec_aprd(pec, adp, ado, data, datalen, wkc) \
-
425  ec_transceive((pec), EC_CMD_APRD, ((osal_uint32_t)(ado) << 16u) | \
-
426  (*(osal_uint16_t *)&(adp) & 0xFFFFu), (osal_uint8_t *)(data), (datalen), (wkc))
-
427 
-
429 #define ec_apwr(pec, adp, ado, data, datalen, wkc) \
-
430  ec_transceive((pec), EC_CMD_APWR, ((osal_uint32_t)(ado) << 16u) | \
-
431  (*(osal_uint16_t *)&(adp) & 0xFFFFu), (osal_uint8_t *)(data), (datalen), (wkc))
-
432 
-
434 #define ec_aprw(pec, adp, ado, data, datalen, wkc) \
-
435  ec_transceive((pec), EC_CMD_APRW, ((osal_uint32_t)(ado) << 16u) | \
-
436  (*(osal_uint16_t *)&(adp) & 0xFFFFu), (osal_uint8_t *)(data), (datalen), (wkc))
-
437 
-
439 #define ec_fprd(pec, adp, ado, data, datalen, wkc) \
-
440  ec_transceive((pec), EC_CMD_FPRD, ((osal_uint32_t)(ado) << 16lu) | \
-
441  (osal_uint32_t)((adp) & 0xFFFFu), (osal_uint8_t *)(data), (datalen), (wkc))
-
442 
-
444 #define ec_fpwr(pec, adp, ado, data, datalen, wkc) \
-
445  ec_transceive((pec), EC_CMD_FPWR, ((osal_uint32_t)(ado) << 16u) | \
-
446  ((adp) & 0xFFFFu), (osal_uint8_t *)(data), (datalen), (wkc))
-
447 
-
449 #define ec_fprw(pec, adp, ado, data, datalen, wkc) \
-
450  ec_transceive((pec), EC_CMD_FPRW, ((osal_uint32_t)(ado) << 16u) | \
-
451  ((adp) & 0xFFFFu), (osal_uint8_t *)(data), (datalen), (wkc))
-
452 
-
454 #define ec_frmw(pec, adp, ado, data, datalen, wkc) \
-
455  ec_transceive((pec), EC_CMD_FRMW, ((osal_uint32_t)(ado) << 16u) | \
-
456  ((adp) & 0xFFFFu), (osal_uint8_t *)(data), (datalen), (wkc))
-
457 
-
459 #define check_ret(fcn, ...) { \
-
460  if (fcn(__VA_ARGS__) != EC_OK) { \
-
461  ec_log(1, __func__, "" #fcn "(" #__VA_ARGS__ ") failed!\n"); \
-
462  } }
-
463 
-
464 #define check_ec_bwr(...) check_ret(ec_bwr, __VA_ARGS__)
-
465 #define check_ec_brd(...) check_ret(ec_brd, __VA_ARGS__)
-
466 #define check_ec_brw(...) check_ret(ec_brw, __VA_ARGS__)
-
467 
-
468 #define check_ec_apwr(...) check_ret(ec_apwr, __VA_ARGS__)
-
469 #define check_ec_aprd(...) check_ret(ec_aprd, __VA_ARGS__)
-
470 #define check_ec_aprw(...) check_ret(ec_aprw, __VA_ARGS__)
-
471 
-
472 #define check_ec_fpwr(...) check_ret(ec_fpwr, __VA_ARGS__)
-
473 #define check_ec_fprd(...) check_ret(ec_fprd, __VA_ARGS__)
-
474 #define check_ec_fprw(...) check_ret(ec_fprw, __VA_ARGS__)
-
475 #define check_ec_frmw(...) check_ret(ec_frmw, __VA_ARGS__)
-
476 
-
479 #endif // LIBETHERCAT_EC_H
-
480 
+
290 int ec_configure_tun(ec_t *pec, osal_uint8_t ip_address[4]);
+
291 
+
293 
+
300 void ec_configure_dc(ec_t *pec, osal_uint64_t timer, ec_dc_mode_t mode,
+
301  void (*user_cb)(void *arg, int num), void *user_cb_arg);
+
302 
+
304 
+
310 int ec_create_pd_groups(ec_t *pec, osal_uint32_t pd_group_cnt);
+
311 
+
313 
+
320 void ec_configure_pd_group(ec_t *pec, osal_uint16_t group, int clock_divisor,
+
321  void (*user_cb)(void *arg, int num), void *user_cb_arg);
+
322 
+
324 
+
329 int ec_destroy_pd_groups(ec_t *pec);
+
330 
+
332 
+
342 int ec_transceive(ec_t *pec, osal_uint8_t cmd, osal_uint32_t adr,
+
343  osal_uint8_t *data, osal_size_t datalen, osal_uint16_t *wkc);
+
344 
+
346 
+
355 int ec_transmit_no_reply(ec_t *pec, osal_uint8_t cmd, osal_uint32_t adr,
+
356  osal_uint8_t *data, osal_size_t datalen);
+
357 
+
359 
+
366 int ec_set_state(ec_t *pec, ec_state_t state);
+
367 
+
368 #define ec_group_will_be_sent(pec, group) (int)((((pec)->pd_groups[(group)].divisor_cnt+1) % (pec)->pd_groups[(group)].divisor) == 0)
+
369 #define ec_group_was_sent(pec, group) (int)((pec)->pd_groups[(group)].divisor_cnt == 0)
+
370 
+
372 
+
376 int ec_send_process_data(ec_t *pec);
+
377 
+
379 
+
384 int ec_send_distributed_clocks_sync(ec_t *pec);
+
385 
+
387 
+
392 int ec_send_brd_ec_state(ec_t *pec);
+
393 
+
395 
+
399 int ec_get_slave_count(ec_t *pec);
+
400 
+
401 #ifdef __cplusplus
+
402 };
+
403 #endif
+
404 
+
406 #define ec_to_adr(ado, adp) \
+
407  ((osal_uint32_t)(adp) << 16u) | ((ado) & 0xFFFFu)
+
408 
+
410 #define ec_brd(pec, ado, data, datalen, wkc) \
+
411  ec_transceive((pec), EC_CMD_BRD, ((osal_uint32_t)(ado) << 16u), \
+
412  (osal_uint8_t *)(data), (datalen), (wkc))
+
413 
+
415 #define ec_bwr(pec, ado, data, datalen, wkc) \
+
416  ec_transceive((pec), EC_CMD_BWR, ((osal_uint32_t)(ado) << 16u), \
+
417  (osal_uint8_t *)(data), (datalen), (wkc))
+
418 
+
420 #define ec_brw(pec, ado, data, datalen, wkc) \
+
421  ec_transceive((pec), EC_CMD_BRW, ((osal_uint32_t)(ado) << 16u), \
+
422  (osal_uint8_t *)(data), (datalen), (wkc))
+
423 
+
425 #define ec_aprd(pec, adp, ado, data, datalen, wkc) \
+
426  ec_transceive((pec), EC_CMD_APRD, ((osal_uint32_t)(ado) << 16u) | \
+
427  (*(osal_uint16_t *)&(adp) & 0xFFFFu), (osal_uint8_t *)(data), (datalen), (wkc))
+
428 
+
430 #define ec_apwr(pec, adp, ado, data, datalen, wkc) \
+
431  ec_transceive((pec), EC_CMD_APWR, ((osal_uint32_t)(ado) << 16u) | \
+
432  (*(osal_uint16_t *)&(adp) & 0xFFFFu), (osal_uint8_t *)(data), (datalen), (wkc))
+
433 
+
435 #define ec_aprw(pec, adp, ado, data, datalen, wkc) \
+
436  ec_transceive((pec), EC_CMD_APRW, ((osal_uint32_t)(ado) << 16u) | \
+
437  (*(osal_uint16_t *)&(adp) & 0xFFFFu), (osal_uint8_t *)(data), (datalen), (wkc))
+
438 
+
440 #define ec_fprd(pec, adp, ado, data, datalen, wkc) \
+
441  ec_transceive((pec), EC_CMD_FPRD, ((osal_uint32_t)(ado) << 16lu) | \
+
442  (osal_uint32_t)((adp) & 0xFFFFu), (osal_uint8_t *)(data), (datalen), (wkc))
+
443 
+
445 #define ec_fpwr(pec, adp, ado, data, datalen, wkc) \
+
446  ec_transceive((pec), EC_CMD_FPWR, ((osal_uint32_t)(ado) << 16u) | \
+
447  ((adp) & 0xFFFFu), (osal_uint8_t *)(data), (datalen), (wkc))
+
448 
+
450 #define ec_fprw(pec, adp, ado, data, datalen, wkc) \
+
451  ec_transceive((pec), EC_CMD_FPRW, ((osal_uint32_t)(ado) << 16u) | \
+
452  ((adp) & 0xFFFFu), (osal_uint8_t *)(data), (datalen), (wkc))
+
453 
+
455 #define ec_frmw(pec, adp, ado, data, datalen, wkc) \
+
456  ec_transceive((pec), EC_CMD_FRMW, ((osal_uint32_t)(ado) << 16u) | \
+
457  ((adp) & 0xFFFFu), (osal_uint8_t *)(data), (datalen), (wkc))
+
458 
+
460 #define check_ret(fcn, ...) { \
+
461  if (fcn(__VA_ARGS__) != EC_OK) { \
+
462  ec_log(1, __func__, "" #fcn "(" #__VA_ARGS__ ") failed!\n"); \
+
463  } }
+
464 
+
465 #define check_ec_bwr(...) check_ret(ec_bwr, __VA_ARGS__)
+
466 #define check_ec_brd(...) check_ret(ec_brd, __VA_ARGS__)
+
467 #define check_ec_brw(...) check_ret(ec_brw, __VA_ARGS__)
+
468 
+
469 #define check_ec_apwr(...) check_ret(ec_apwr, __VA_ARGS__)
+
470 #define check_ec_aprd(...) check_ret(ec_aprd, __VA_ARGS__)
+
471 #define check_ec_aprw(...) check_ret(ec_aprw, __VA_ARGS__)
+
472 
+
473 #define check_ec_fpwr(...) check_ret(ec_fpwr, __VA_ARGS__)
+
474 #define check_ec_fprd(...) check_ret(ec_fprd, __VA_ARGS__)
+
475 #define check_ec_fprw(...) check_ret(ec_fprw, __VA_ARGS__)
+
476 #define check_ec_frmw(...) check_ret(ec_frmw, __VA_ARGS__)
+
477 
+
480 #endif // LIBETHERCAT_EC_H
+
481 
common.h
ethercat master common stuff
LEC_MAX_PDLEN
#define LEC_MAX_PDLEN
Maximum process data length.
Definition: common.h:71
LEC_MAX_MBX_ENTRIES
#define LEC_MAX_MBX_ENTRIES
Maximum number of mailbox entries.
Definition: common.h:79
@@ -354,6 +354,7 @@
datagram.h
ethercat datagram
dc.h
ethercat distributed clocks support.
eeprom.h
EtherCAT eeprom access fuctions.
+
ec_configure_tun
int ec_configure_tun(ec_t *pec, osal_uint8_t ip_address[4])
Configures tun device of EtherCAT master, used for EoE slaves.
ec_send_process_data
int ec_send_process_data(ec_t *pec)
send process data with logical commands
ec_configure_pd_group
void ec_configure_pd_group(ec_t *pec, osal_uint16_t group, int clock_divisor, void(*user_cb)(void *arg, int num), void *user_cb_arg)
Configure process data group settings.
ec_t
struct ec ec_t
ethercat master structure
@@ -363,7 +364,6 @@
ec_close
int ec_close(ec_t *pec)
Closes ethercat master.
ec_send_distributed_clocks_sync
int ec_send_distributed_clocks_sync(ec_t *pec)
Send distributed clocks sync datagram.
ec_transceive
int ec_transceive(ec_t *pec, osal_uint8_t cmd, osal_uint32_t adr, osal_uint8_t *data, osal_size_t datalen, osal_uint16_t *wkc)
Syncronous ethercat read/write.
-
ec_configure_tun
void ec_configure_tun(ec_t *pec, osal_uint8_t ip_address[4])
Configures tun device of EtherCAT master, used for EoE slaves.
ec_send_brd_ec_state
int ec_send_brd_ec_state(ec_t *pec)
Send broadcast read to ec state.
ec_log
void ec_log(int lvl, const osal_char_t *pre, const osal_char_t *format,...)
EtherCAT logging function.
ec_set_state
int ec_set_state(ec_t *pec, ec_state_t state)
Set state on ethercat bus.
diff --git a/globals_e.html b/globals_e.html index f54f7fc..e73cbde 100644 --- a/globals_e.html +++ b/globals_e.html @@ -252,7 +252,7 @@

- e -