Configuration module for EtherCAT master. More...
#include <stdio.h>#include <string.h>#include "osal.h"#include "oshw.h"#include "ethercattype.h"#include "ethercatbase.h"#include "ethercatmain.h"#include "ethercatcoe.h"#include "ethercatsoe.h"#include "ethercatconfig.h"#include "ethercatconfiglist.h"
Go to the source code of this file.
Classes | |
| struct | ec_configlist_t |
| struct | ecx_mapt_t |
Macros | |
| #define | EC_DEFAULTDOSM0 0x00010044 |
| #define | EC_DEFAULTMBXSM0 0x00010026 |
| #define | EC_DEFAULTMBXSM1 0x00010022 |
Variables | |
| ecx_mapt_t | ecx_mapt [EC_MAX_MAPT] |
Configuration module for EtherCAT master.
After successful initialisation with ec_init() or ec_init_redundant() the slaves can be auto configured with this module.
Definition in file ethercatconfig.c.
| #define EC_DEFAULTDOSM0 0x00010044 |
standard SM0 flags configuration for digital output slaves
Definition at line 77 of file ethercatconfig.c.
| #define EC_DEFAULTMBXSM0 0x00010026 |
standard SM0 flags configuration for mailbox slaves
Definition at line 73 of file ethercatconfig.c.
| #define EC_DEFAULTMBXSM1 0x00010022 |
standard SM1 flags configuration for mailbox slaves
Definition at line 75 of file ethercatconfig.c.
| int ec_config | ( | uint8 | usetable, |
| void * | pIOmap | ||
| ) |
Enumerate / map and init all slaves.
| [in] | usetable | = TRUE when using configtable to init slaves, FALSE otherwise |
| [out] | pIOmap | = pointer to IOmap |
Definition at line 1665 of file ethercatconfig.c.
| int ec_config_init | ( | uint8 | usetable | ) |
Enumerate and init all slaves.
| [in] | usetable | = TRUE when using configtable to init slaves, FALSE otherwise |
Definition at line 1606 of file ethercatconfig.c.
| int ec_config_map | ( | void * | pIOmap | ) |
Map all PDOs from slaves to IOmap with Outputs/Inputs in sequential order (legacy SOEM way).
| [out] | pIOmap | = pointer to IOmap |
Definition at line 1643 of file ethercatconfig.c.
| int ec_config_map_group | ( | void * | pIOmap, |
| uint8 | group | ||
| ) |
Map all PDOs in one group of slaves to IOmap with Outputs/Inputs in sequential order (legacy SOEM way).
| [out] | pIOmap | = pointer to IOmap |
| [in] | group | = group to map, 0 = all groups |
Definition at line 1619 of file ethercatconfig.c.
| int ec_config_overlap | ( | uint8 | usetable, |
| void * | pIOmap | ||
| ) |
Enumerate / map and init all slaves.
| [in] | usetable | = TRUE when using configtable to init slaves, FALSE otherwise |
| [out] | pIOmap | = pointer to IOmap |
Definition at line 1682 of file ethercatconfig.c.
| int ec_config_overlap_map | ( | void * | pIOmap | ) |
Map all PDOs from slaves to IOmap with Outputs/Inputs overlapping. NOTE: Must use this for TI ESC when using LRW.
| [out] | pIOmap | = pointer to IOmap |
Definition at line 1654 of file ethercatconfig.c.
| int ec_config_overlap_map_group | ( | void * | pIOmap, |
| uint8 | group | ||
| ) |
Map all PDOs in one group of slaves to IOmap with Outputs/Inputs overlapping. NOTE: Must use this for TI ESC when using LRW.
| [out] | pIOmap | = pointer to IOmap |
| [in] | group | = group to map, 0 = all groups |
Definition at line 1632 of file ethercatconfig.c.
Find slave in standard configuration list ec_configlist[]
| [in] | man | = manufacturer |
| [in] | id | = ID |
Definition at line 86 of file ethercatconfig.c.
| int ec_reconfig_slave | ( | uint16 | slave, |
| int | timeout | ||
| ) |
Reconfigure slave.
| [in] | slave | = slave to reconfigure |
| [in] | timeout | = local timeout f.e. EC_TIMEOUTRET3 |
Definition at line 1712 of file ethercatconfig.c.
| int ec_recover_slave | ( | uint16 | slave, |
| int | timeout | ||
| ) |
Recover slave.
| [in] | slave | = slave to recover |
| [in] | timeout | = local timeout f.e. EC_TIMEOUTRET3 |
Definition at line 1700 of file ethercatconfig.c.
|
static |
Definition at line 896 of file ethercatconfig.c.
|
static |
Definition at line 1034 of file ethercatconfig.c.
|
static |
Definition at line 844 of file ethercatconfig.c.
|
static |
Definition at line 182 of file ethercatconfig.c.
| int ecx_config_init | ( | ecx_contextt * | context, |
| uint8 | usetable | ||
| ) |
Enumerate and init all slaves.
| [in] | context | = context struct |
| [in] | usetable | = TRUE when using configtable to init slaves, FALSE otherwise |
Definition at line 308 of file ethercatconfig.c.
| int ecx_config_map_group | ( | ecx_contextt * | context, |
| void * | pIOmap, | ||
| uint8 | group | ||
| ) |
Map all PDOs in one group of slaves to IOmap with Outputs/Inputs in sequential order (legacy SOEM way).
| [in] | context | = context struct |
| [out] | pIOmap | = pointer to IOmap |
| [in] | group | = group to map, 0 = all groups |
Definition at line 1172 of file ethercatconfig.c.
| int ecx_config_overlap_map_group | ( | ecx_contextt * | context, |
| void * | pIOmap, | ||
| uint8 | group | ||
| ) |
Map all PDOs in one group of slaves to IOmap with Outputs/Inputs overlapping. NOTE: Must use this for TI ESC when using LRW.
| [in] | context | = context struct |
| [out] | pIOmap | = pointer to IOmap |
| [in] | group | = group to map, 0 = all groups |
Definition at line 1350 of file ethercatconfig.c.
| int ecx_detect_slaves | ( | ecx_contextt * | context | ) |
Definition at line 119 of file ethercatconfig.c.
|
static |
Definition at line 833 of file ethercatconfig.c.
| void ecx_init_context | ( | ecx_contextt * | context | ) |
Definition at line 103 of file ethercatconfig.c.
|
static |
Definition at line 610 of file ethercatconfig.c.
|
static |
Definition at line 258 of file ethercatconfig.c.
|
static |
Definition at line 641 of file ethercatconfig.c.
|
static |
Definition at line 695 of file ethercatconfig.c.
|
static |
Definition at line 742 of file ethercatconfig.c.
| int ecx_reconfig_slave | ( | ecx_contextt * | context, |
| uint16 | slave, | ||
| int | timeout | ||
| ) |
Reconfigure slave.
| [in] | context | = context struct |
| [in] | slave | = slave to reconfigure |
| [in] | timeout | = local timeout f.e. EC_TIMEOUTRET3 |
Definition at line 1551 of file ethercatconfig.c.
| int ecx_recover_slave | ( | ecx_contextt * | context, |
| uint16 | slave, | ||
| int | timeout | ||
| ) |
Recover slave.
| [in] | context | = context struct |
| [in] | slave | = slave to recover |
| [in] | timeout | = local timeout f.e. EC_TIMEOUTRET3 |
Definition at line 1488 of file ethercatconfig.c.
|
static |
Definition at line 151 of file ethercatconfig.c.
| ecx_mapt_t ecx_mapt[EC_MAX_MAPT] |
Definition at line 34 of file ethercatconfig.c.