├── .gitignore ├── AUTHORS ├── COPYING ├── COPYING.LESSER ├── ChangeLog ├── Doxyfile.in ├── FEATURES ├── INSTALL ├── Kbuild.in ├── Makefile.am ├── Makefile.in ├── NEWS ├── README ├── README.EoE ├── README.md ├── TODO ├── aclocal.m4 ├── autoconf ├── compile ├── config.guess ├── config.sub ├── depcomp ├── install-sh ├── ltmain.sh └── missing ├── config.h.in ├── configure ├── configure.ac ├── devices ├── 8139too-2.6.13-ethercat.c ├── 8139too-2.6.13-orig.c ├── 8139too-2.6.17-ethercat.c ├── 8139too-2.6.17-orig.c ├── 8139too-2.6.18-ethercat.c ├── 8139too-2.6.18-orig.c ├── 8139too-2.6.19-ethercat.c ├── 8139too-2.6.19-orig.c ├── 8139too-2.6.22-ethercat.c ├── 8139too-2.6.22-orig.c ├── 8139too-2.6.23-ethercat.c ├── 8139too-2.6.23-orig.c ├── 8139too-2.6.24-ethercat.c ├── 8139too-2.6.24-orig.c ├── 8139too-2.6.25-ethercat.c ├── 8139too-2.6.25-orig.c ├── 8139too-2.6.26-ethercat.c ├── 8139too-2.6.26-orig.c ├── 8139too-2.6.27-ethercat.c ├── 8139too-2.6.27-orig.c ├── 8139too-2.6.28-ethercat.c ├── 8139too-2.6.28-orig.c ├── 8139too-2.6.29-ethercat.c ├── 8139too-2.6.29-orig.c ├── 8139too-2.6.31-ethercat.c ├── 8139too-2.6.31-orig.c ├── 8139too-2.6.32-ethercat.c ├── 8139too-2.6.32-orig.c ├── 8139too-2.6.33-ethercat.c ├── 8139too-2.6.33-orig.c ├── 8139too-2.6.34-ethercat.c ├── 8139too-2.6.34-orig.c ├── 8139too-2.6.35-ethercat.c ├── 8139too-2.6.35-orig.c ├── 8139too-2.6.36-ethercat.c ├── 8139too-2.6.36-orig.c ├── 8139too-2.6.37-ethercat.c ├── 8139too-2.6.37-orig.c ├── 8139too-3.0-ethercat.c ├── 8139too-3.0-orig.c ├── 8139too-3.2-ethercat.c ├── 8139too-3.2-orig.c ├── 8139too-3.4-ethercat.c ├── 8139too-3.4-orig.c ├── Kbuild.in ├── Makefile.am ├── Makefile.in ├── e100-2.6.20-ethercat.c ├── e100-2.6.20-orig.c ├── e100-2.6.24-ethercat.c ├── e100-2.6.24-orig.c ├── e100-2.6.26-ethercat.c ├── e100-2.6.26-orig.c ├── e100-2.6.27-ethercat.c ├── e100-2.6.27-orig.c ├── e100-2.6.28-ethercat.c ├── e100-2.6.28-orig.c ├── e100-2.6.29-ethercat.c ├── e100-2.6.29-orig.c ├── e100-2.6.31-ethercat.c ├── e100-2.6.31-orig.c ├── e100-2.6.32-ethercat.c ├── e100-2.6.32-orig.c ├── e100-2.6.33-ethercat.c ├── e100-2.6.33-orig.c ├── e100-2.6.35-ethercat.c ├── e100-2.6.35-orig.c ├── e100-2.6.37-ethercat.c ├── e100-2.6.37-orig.c ├── e100-3.0-ethercat.c ├── e100-3.0-orig.c ├── e100-3.4-ethercat.c ├── e100-3.4-orig.c ├── e1000 │ ├── Kbuild.in │ ├── LICENSE │ ├── Makefile.am │ ├── Makefile.in │ ├── e1000-2.6.13-ethercat.h │ ├── e1000-2.6.13-orig.h │ ├── e1000-2.6.18-ethercat.h │ ├── e1000-2.6.18-orig.h │ ├── e1000-2.6.20-ethercat.h │ ├── e1000-2.6.20-orig.h │ ├── e1000-2.6.22-ethercat.h │ ├── e1000-2.6.22-orig.h │ ├── e1000-2.6.24-ethercat.h │ ├── e1000-2.6.24-orig.h │ ├── e1000-2.6.26-ethercat.h │ ├── e1000-2.6.26-orig.h │ ├── e1000-2.6.27-ethercat.h │ ├── e1000-2.6.27-orig.h │ ├── e1000-2.6.28-ethercat.h │ ├── e1000-2.6.28-orig.h │ ├── e1000-2.6.29-ethercat.h │ ├── e1000-2.6.29-orig.h │ ├── e1000-2.6.31-ethercat.h │ ├── e1000-2.6.31-orig.h │ ├── e1000-2.6.32-ethercat.h │ ├── e1000-2.6.32-orig.h │ ├── e1000-2.6.33-ethercat.h │ ├── e1000-2.6.33-orig.h │ ├── e1000-2.6.35-ethercat.h │ ├── e1000-2.6.35-orig.h │ ├── e1000-2.6.37-ethercat.h │ ├── e1000-2.6.37-orig.h │ ├── e1000-3.0-ethercat.h │ ├── e1000-3.0-orig.h │ ├── e1000-3.4-ethercat.h │ ├── e1000-3.4-orig.h │ ├── e1000_ethtool-2.6.13-ethercat.c │ ├── e1000_ethtool-2.6.13-orig.c │ ├── e1000_ethtool-2.6.18-ethercat.c │ ├── e1000_ethtool-2.6.18-orig.c │ ├── e1000_ethtool-2.6.20-ethercat.c │ ├── e1000_ethtool-2.6.20-orig.c │ ├── e1000_ethtool-2.6.22-ethercat.c │ ├── e1000_ethtool-2.6.22-orig.c │ ├── e1000_ethtool-2.6.24-ethercat.c │ ├── e1000_ethtool-2.6.24-orig.c │ ├── e1000_ethtool-2.6.26-ethercat.c │ ├── e1000_ethtool-2.6.26-orig.c │ ├── e1000_ethtool-2.6.27-ethercat.c │ ├── e1000_ethtool-2.6.27-orig.c │ ├── e1000_ethtool-2.6.28-ethercat.c │ ├── e1000_ethtool-2.6.28-orig.c │ ├── e1000_ethtool-2.6.29-ethercat.c │ ├── e1000_ethtool-2.6.29-orig.c │ ├── e1000_ethtool-2.6.31-ethercat.c │ ├── e1000_ethtool-2.6.31-orig.c │ ├── e1000_ethtool-2.6.32-ethercat.c │ ├── e1000_ethtool-2.6.32-orig.c │ ├── e1000_ethtool-2.6.33-ethercat.c │ ├── e1000_ethtool-2.6.33-orig.c │ ├── e1000_ethtool-2.6.35-ethercat.c │ ├── e1000_ethtool-2.6.35-orig.c │ ├── e1000_ethtool-2.6.37-ethercat.c │ ├── e1000_ethtool-2.6.37-orig.c │ ├── e1000_ethtool-3.0-ethercat.c │ ├── e1000_ethtool-3.0-orig.c │ ├── e1000_ethtool-3.4-ethercat.c │ ├── e1000_ethtool-3.4-orig.c │ ├── e1000_hw-2.6.13-ethercat.c │ ├── e1000_hw-2.6.13-ethercat.h │ ├── e1000_hw-2.6.13-orig.c │ ├── e1000_hw-2.6.13-orig.h │ ├── e1000_hw-2.6.18-ethercat.c │ ├── e1000_hw-2.6.18-ethercat.h │ ├── e1000_hw-2.6.18-orig.c │ ├── e1000_hw-2.6.18-orig.h │ ├── e1000_hw-2.6.20-ethercat.c │ ├── e1000_hw-2.6.20-ethercat.h │ ├── e1000_hw-2.6.20-orig.c │ ├── e1000_hw-2.6.20-orig.h │ ├── e1000_hw-2.6.22-ethercat.c │ ├── e1000_hw-2.6.22-ethercat.h │ ├── e1000_hw-2.6.22-orig.c │ ├── e1000_hw-2.6.22-orig.h │ ├── e1000_hw-2.6.24-ethercat.c │ ├── e1000_hw-2.6.24-ethercat.h │ ├── e1000_hw-2.6.24-orig.c │ ├── e1000_hw-2.6.24-orig.h │ ├── e1000_hw-2.6.26-ethercat.c │ ├── e1000_hw-2.6.26-ethercat.h │ ├── e1000_hw-2.6.26-orig.c │ ├── e1000_hw-2.6.26-orig.h │ ├── e1000_hw-2.6.27-ethercat.c │ ├── e1000_hw-2.6.27-ethercat.h │ ├── e1000_hw-2.6.27-orig.c │ ├── e1000_hw-2.6.27-orig.h │ ├── e1000_hw-2.6.28-ethercat.c │ ├── e1000_hw-2.6.28-ethercat.h │ ├── e1000_hw-2.6.28-orig.c │ ├── e1000_hw-2.6.28-orig.h │ ├── e1000_hw-2.6.29-ethercat.c │ ├── e1000_hw-2.6.29-ethercat.h │ ├── e1000_hw-2.6.29-orig.c │ ├── e1000_hw-2.6.29-orig.h │ ├── e1000_hw-2.6.31-ethercat.c │ ├── e1000_hw-2.6.31-ethercat.h │ ├── e1000_hw-2.6.31-orig.c │ ├── e1000_hw-2.6.31-orig.h │ ├── e1000_hw-2.6.32-ethercat.c │ ├── e1000_hw-2.6.32-ethercat.h │ ├── e1000_hw-2.6.32-orig.c │ ├── e1000_hw-2.6.32-orig.h │ ├── e1000_hw-2.6.33-ethercat.c │ ├── e1000_hw-2.6.33-ethercat.h │ ├── e1000_hw-2.6.33-orig.c │ ├── e1000_hw-2.6.33-orig.h │ ├── e1000_hw-2.6.35-ethercat.c │ ├── e1000_hw-2.6.35-ethercat.h │ ├── e1000_hw-2.6.35-orig.c │ ├── e1000_hw-2.6.35-orig.h │ ├── e1000_hw-2.6.37-ethercat.c │ ├── e1000_hw-2.6.37-ethercat.h │ ├── e1000_hw-2.6.37-orig.c │ ├── e1000_hw-2.6.37-orig.h │ ├── e1000_hw-3.0-ethercat.c │ ├── e1000_hw-3.0-ethercat.h │ ├── e1000_hw-3.0-orig.c │ ├── e1000_hw-3.0-orig.h │ ├── e1000_hw-3.4-ethercat.c │ ├── e1000_hw-3.4-ethercat.h │ ├── e1000_hw-3.4-orig.c │ ├── e1000_hw-3.4-orig.h │ ├── e1000_main-2.6.13-ethercat.c │ ├── e1000_main-2.6.13-orig.c │ ├── e1000_main-2.6.18-ethercat.c │ ├── e1000_main-2.6.18-orig.c │ ├── e1000_main-2.6.20-ethercat.c │ ├── e1000_main-2.6.20-orig.c │ ├── e1000_main-2.6.22-ethercat.c │ ├── e1000_main-2.6.22-orig.c │ ├── e1000_main-2.6.24-ethercat.c │ ├── e1000_main-2.6.24-orig.c │ ├── e1000_main-2.6.26-ethercat.c │ ├── e1000_main-2.6.26-orig.c │ ├── e1000_main-2.6.27-ethercat.c │ ├── e1000_main-2.6.27-orig.c │ ├── e1000_main-2.6.28-ethercat.c │ ├── e1000_main-2.6.28-orig.c │ ├── e1000_main-2.6.29-ethercat.c │ ├── e1000_main-2.6.29-orig.c │ ├── e1000_main-2.6.31-ethercat.c │ ├── e1000_main-2.6.31-orig.c │ ├── e1000_main-2.6.32-ethercat.c │ ├── e1000_main-2.6.32-orig.c │ ├── e1000_main-2.6.33-ethercat.c │ ├── e1000_main-2.6.33-orig.c │ ├── e1000_main-2.6.35-ethercat.c │ ├── e1000_main-2.6.35-orig.c │ ├── e1000_main-2.6.37-ethercat.c │ ├── e1000_main-2.6.37-orig.c │ ├── e1000_main-3.0-ethercat.c │ ├── e1000_main-3.0-orig.c │ ├── e1000_main-3.4-ethercat.c │ ├── e1000_main-3.4-orig.c │ ├── e1000_osdep-2.6.13-ethercat.h │ ├── e1000_osdep-2.6.13-orig.h │ ├── e1000_osdep-2.6.18-ethercat.h │ ├── e1000_osdep-2.6.18-orig.h │ ├── e1000_osdep-2.6.20-ethercat.h │ ├── e1000_osdep-2.6.20-orig.h │ ├── e1000_osdep-2.6.22-ethercat.h │ ├── e1000_osdep-2.6.22-orig.h │ ├── e1000_osdep-2.6.24-ethercat.h │ ├── e1000_osdep-2.6.24-orig.h │ ├── e1000_osdep-2.6.26-ethercat.h │ ├── e1000_osdep-2.6.26-orig.h │ ├── e1000_osdep-2.6.27-ethercat.h │ ├── e1000_osdep-2.6.27-orig.h │ ├── e1000_osdep-2.6.28-ethercat.h │ ├── e1000_osdep-2.6.28-orig.h │ ├── e1000_osdep-2.6.29-ethercat.h │ ├── e1000_osdep-2.6.29-orig.h │ ├── e1000_osdep-2.6.31-ethercat.h │ ├── e1000_osdep-2.6.31-orig.h │ ├── e1000_osdep-2.6.32-ethercat.h │ ├── e1000_osdep-2.6.32-orig.h │ ├── e1000_osdep-2.6.33-ethercat.h │ ├── e1000_osdep-2.6.33-orig.h │ ├── e1000_osdep-2.6.35-ethercat.h │ ├── e1000_osdep-2.6.35-orig.h │ ├── e1000_osdep-2.6.37-ethercat.h │ ├── e1000_osdep-2.6.37-orig.h │ ├── e1000_osdep-3.0-ethercat.h │ ├── e1000_osdep-3.0-orig.h │ ├── e1000_osdep-3.4-ethercat.h │ ├── e1000_osdep-3.4-orig.h │ ├── e1000_param-2.6.13-ethercat.c │ ├── e1000_param-2.6.13-orig.c │ ├── e1000_param-2.6.18-ethercat.c │ ├── e1000_param-2.6.18-orig.c │ ├── e1000_param-2.6.20-ethercat.c │ ├── e1000_param-2.6.20-orig.c │ ├── e1000_param-2.6.22-ethercat.c │ ├── e1000_param-2.6.22-orig.c │ ├── e1000_param-2.6.24-ethercat.c │ ├── e1000_param-2.6.24-orig.c │ ├── e1000_param-2.6.26-ethercat.c │ ├── e1000_param-2.6.26-orig.c │ ├── e1000_param-2.6.27-ethercat.c │ ├── e1000_param-2.6.27-orig.c │ ├── e1000_param-2.6.28-ethercat.c │ ├── e1000_param-2.6.28-orig.c │ ├── e1000_param-2.6.29-ethercat.c │ ├── e1000_param-2.6.29-orig.c │ ├── e1000_param-2.6.31-ethercat.c │ ├── e1000_param-2.6.31-orig.c │ ├── e1000_param-2.6.32-ethercat.c │ ├── e1000_param-2.6.32-orig.c │ ├── e1000_param-2.6.33-ethercat.c │ ├── e1000_param-2.6.33-orig.c │ ├── e1000_param-2.6.35-ethercat.c │ ├── e1000_param-2.6.35-orig.c │ ├── e1000_param-2.6.37-ethercat.c │ ├── e1000_param-2.6.37-orig.c │ ├── e1000_param-3.0-ethercat.c │ ├── e1000_param-3.0-orig.c │ ├── e1000_param-3.4-ethercat.c │ └── e1000_param-3.4-orig.c ├── e1000e │ ├── 80003es2lan-3.4-ethercat.c │ ├── 80003es2lan-3.4-orig.c │ ├── 82571-2.6.32-ethercat.c │ ├── 82571-2.6.32-orig.c │ ├── 82571-2.6.33-ethercat.c │ ├── 82571-2.6.33-orig.c │ ├── 82571-2.6.34-ethercat.c │ ├── 82571-2.6.34-orig.c │ ├── 82571-2.6.35-ethercat.c │ ├── 82571-2.6.35-orig.c │ ├── 82571-2.6.37-ethercat.c │ ├── 82571-2.6.37-orig.c │ ├── 82571-3.2-ethercat.c │ ├── 82571-3.2-orig.c │ ├── 82571-3.4-ethercat.c │ ├── 82571-3.4-orig.c │ ├── Kbuild.in │ ├── Makefile.am │ ├── Makefile.in │ ├── defines-2.6.32-ethercat.h │ ├── defines-2.6.32-orig.h │ ├── defines-2.6.33-ethercat.h │ ├── defines-2.6.33-orig.h │ ├── defines-2.6.34-ethercat.h │ ├── defines-2.6.34-orig.h │ ├── defines-2.6.35-ethercat.h │ ├── defines-2.6.35-orig.h │ ├── defines-2.6.37-ethercat.h │ ├── defines-2.6.37-orig.h │ ├── defines-3.2-ethercat.h │ ├── defines-3.2-orig.h │ ├── defines-3.4-ethercat.h │ ├── defines-3.4-orig.h │ ├── e1000-2.6.32-ethercat.h │ ├── e1000-2.6.32-orig.h │ ├── e1000-2.6.33-ethercat.h │ ├── e1000-2.6.33-orig.h │ ├── e1000-2.6.34-ethercat.h │ ├── e1000-2.6.34-orig.h │ ├── e1000-2.6.35-ethercat.h │ ├── e1000-2.6.35-orig.h │ ├── e1000-2.6.37-ethercat.h │ ├── e1000-2.6.37-orig.h │ ├── e1000-3.2-ethercat.h │ ├── e1000-3.2-orig.h │ ├── e1000-3.4-ethercat.h │ ├── e1000-3.4-orig.h │ ├── es2lan-2.6.32-ethercat.c │ ├── es2lan-2.6.32-orig.c │ ├── es2lan-2.6.33-ethercat.c │ ├── es2lan-2.6.33-orig.c │ ├── es2lan-2.6.34-ethercat.c │ ├── es2lan-2.6.34-orig.c │ ├── es2lan-2.6.35-ethercat.c │ ├── es2lan-2.6.35-orig.c │ ├── es2lan-2.6.37-ethercat.c │ ├── es2lan-2.6.37-orig.c │ ├── es2lan-3.2-ethercat.c │ ├── es2lan-3.2-orig.c │ ├── ethtool-2.6.32-ethercat.c │ ├── ethtool-2.6.32-orig.c │ ├── ethtool-2.6.33-ethercat.c │ ├── ethtool-2.6.33-orig.c │ ├── ethtool-2.6.34-ethercat.c │ ├── ethtool-2.6.34-orig.c │ ├── ethtool-2.6.35-ethercat.c │ ├── ethtool-2.6.35-orig.c │ ├── ethtool-2.6.37-ethercat.c │ ├── ethtool-2.6.37-orig.c │ ├── ethtool-3.2-ethercat.c │ ├── ethtool-3.2-orig.c │ ├── ethtool-3.4-ethercat.c │ ├── ethtool-3.4-orig.c │ ├── hw-2.6.32-ethercat.h │ ├── hw-2.6.32-orig.h │ ├── hw-2.6.33-ethercat.h │ ├── hw-2.6.33-orig.h │ ├── hw-2.6.34-ethercat.h │ ├── hw-2.6.34-orig.h │ ├── hw-2.6.35-ethercat.h │ ├── hw-2.6.35-orig.h │ ├── hw-2.6.37-ethercat.h │ ├── hw-2.6.37-orig.h │ ├── hw-3.2-ethercat.h │ ├── hw-3.2-orig.h │ ├── hw-3.4-ethercat.h │ ├── hw-3.4-orig.h │ ├── ich8lan-2.6.32-ethercat.c │ ├── ich8lan-2.6.32-orig.c │ ├── ich8lan-2.6.33-ethercat.c │ ├── ich8lan-2.6.33-orig.c │ ├── ich8lan-2.6.34-ethercat.c │ ├── ich8lan-2.6.34-orig.c │ ├── ich8lan-2.6.35-ethercat.c │ ├── ich8lan-2.6.35-orig.c │ ├── ich8lan-2.6.37-ethercat.c │ ├── ich8lan-2.6.37-orig.c │ ├── ich8lan-3.2-ethercat.c │ ├── ich8lan-3.2-orig.c │ ├── ich8lan-3.4-ethercat.c │ ├── ich8lan-3.4-orig.c │ ├── lib-2.6.32-ethercat.c │ ├── lib-2.6.32-orig.c │ ├── lib-2.6.33-ethercat.c │ ├── lib-2.6.33-orig.c │ ├── lib-2.6.34-ethercat.c │ ├── lib-2.6.34-orig.c │ ├── lib-2.6.35-ethercat.c │ ├── lib-2.6.35-orig.c │ ├── lib-2.6.37-ethercat.c │ ├── lib-2.6.37-orig.c │ ├── lib-3.2-ethercat.c │ ├── lib-3.2-orig.c │ ├── mac-3.4-ethercat.c │ ├── mac-3.4-orig.c │ ├── manage-3.4-ethercat.c │ ├── manage-3.4-orig.c │ ├── netdev-2.6.32-ethercat.c │ ├── netdev-2.6.32-orig.c │ ├── netdev-2.6.33-ethercat.c │ ├── netdev-2.6.33-orig.c │ ├── netdev-2.6.34-ethercat.c │ ├── netdev-2.6.34-orig.c │ ├── netdev-2.6.35-ethercat.c │ ├── netdev-2.6.35-orig.c │ ├── netdev-2.6.37-ethercat.c │ ├── netdev-2.6.37-orig.c │ ├── netdev-3.2-ethercat.c │ ├── netdev-3.2-orig.c │ ├── netdev-3.4-ethercat.c │ ├── netdev-3.4-orig.c │ ├── nvm-3.4-ethercat.c │ ├── nvm-3.4-orig.c │ ├── param-2.6.32-ethercat.c │ ├── param-2.6.32-orig.c │ ├── param-2.6.33-ethercat.c │ ├── param-2.6.33-orig.c │ ├── param-2.6.34-ethercat.c │ ├── param-2.6.34-orig.c │ ├── param-2.6.35-ethercat.c │ ├── param-2.6.35-orig.c │ ├── param-2.6.37-ethercat.c │ ├── param-2.6.37-orig.c │ ├── param-3.2-ethercat.c │ ├── param-3.2-orig.c │ ├── param-3.4-ethercat.c │ ├── param-3.4-orig.c │ ├── phy-2.6.32-ethercat.c │ ├── phy-2.6.32-orig.c │ ├── phy-2.6.33-ethercat.c │ ├── phy-2.6.33-orig.c │ ├── phy-2.6.34-ethercat.c │ ├── phy-2.6.34-orig.c │ ├── phy-2.6.35-ethercat.c │ ├── phy-2.6.35-orig.c │ ├── phy-2.6.37-ethercat.c │ ├── phy-2.6.37-orig.c │ ├── phy-3.2-ethercat.c │ ├── phy-3.2-orig.c │ ├── phy-3.4-ethercat.c │ └── phy-3.4-orig.c ├── ecdev.h ├── generic.c ├── r8169-2.6.24-ethercat.c ├── r8169-2.6.24-orig.c ├── r8169-2.6.27-ethercat.c ├── r8169-2.6.27-orig.c ├── r8169-2.6.28-ethercat.c ├── r8169-2.6.28-orig.c ├── r8169-2.6.29-ethercat.c ├── r8169-2.6.29-orig.c ├── r8169-2.6.31-ethercat.c ├── r8169-2.6.31-orig.c ├── r8169-2.6.32-ethercat.c ├── r8169-2.6.32-orig.c ├── r8169-2.6.33-ethercat.c ├── r8169-2.6.33-orig.c ├── r8169-2.6.35-ethercat.c ├── r8169-2.6.35-orig.c ├── r8169-2.6.36-ethercat.c ├── r8169-2.6.36-orig.c ├── r8169-2.6.37-ethercat.c ├── r8169-2.6.37-orig.c ├── r8169-3.2-ethercat.c ├── r8169-3.2-orig.c ├── r8169-3.4-ethercat.c └── r8169-3.4-orig.c ├── ethercat.spec ├── ethercat.spec.in ├── examples ├── Kbuild.in ├── Makefile.am ├── Makefile.in ├── dc_rtai │ ├── Kbuild.in │ ├── Makefile.am │ ├── Makefile.in │ └── dc_rtai_sample.c ├── dc_user │ ├── Makefile.am │ ├── Makefile.in │ ├── main.c │ ├── main_pana.c │ └── main_yas.c ├── mini │ ├── Kbuild.in │ ├── Makefile.am │ ├── Makefile.in │ ├── README │ └── mini.c ├── rtai │ ├── Kbuild.in │ ├── Makefile.am │ ├── Makefile.in │ ├── README │ └── rtai_sample.c ├── rtai_rtdm │ ├── Makefile.am │ ├── Makefile.in │ └── main.c ├── rtai_rtdm_dc │ ├── Makefile.am │ ├── Makefile.in │ └── main.c ├── tty │ ├── Kbuild.in │ ├── Makefile.am │ ├── Makefile.in │ ├── serial.c │ ├── serial.h │ └── tty.c ├── user │ ├── Makefile.am │ ├── Makefile.in │ ├── main.c │ ├── main_pana.c │ └── main_yas.c ├── xenomai │ ├── Makefile.am │ ├── Makefile.in │ └── main.c └── xenomai_posix │ ├── Makefile.am │ ├── Makefile.in │ └── main.c ├── globals.h ├── include ├── Makefile.am ├── Makefile.in ├── ecrt.h └── ectty.h ├── lib ├── Makefile.am ├── Makefile.in ├── common.c ├── domain.c ├── domain.h ├── ioctl.h ├── master.c ├── master.h ├── reg_request.c ├── reg_request.h ├── sdo_request.c ├── sdo_request.h ├── slave_config.c ├── slave_config.h ├── voe_handler.c └── voe_handler.h ├── m4 ├── Makefile.am ├── Makefile.in ├── libtool.m4 ├── ltoptions.m4 ├── ltsugar.m4 ├── ltversion.m4 └── lt~obsolete.m4 ├── master ├── Kbuild.in ├── Makefile.am ├── Makefile.in ├── cdev.c ├── cdev.h ├── coe_emerg_ring.c ├── coe_emerg_ring.h ├── datagram.c ├── datagram.h ├── datagram_pair.c ├── datagram_pair.h ├── debug.c ├── debug.h ├── device.c ├── device.h ├── domain.c ├── domain.h ├── doxygen.c ├── ethernet.c ├── ethernet.h ├── fmmu_config.c ├── fmmu_config.h ├── foe.h ├── foe_request.c ├── foe_request.h ├── fsm_change.c ├── fsm_change.h ├── fsm_coe.c ├── fsm_coe.h ├── fsm_foe.c ├── fsm_foe.h ├── fsm_master.c ├── fsm_master.h ├── fsm_pdo.c ├── fsm_pdo.h ├── fsm_pdo_entry.c ├── fsm_pdo_entry.h ├── fsm_sii.c ├── fsm_sii.h ├── fsm_slave.c ├── fsm_slave.h ├── fsm_slave_config.c ├── fsm_slave_config.h ├── fsm_slave_scan.c ├── fsm_slave_scan.h ├── fsm_soe.c ├── fsm_soe.h ├── globals.h ├── ioctl.c ├── ioctl.h ├── mailbox.c ├── mailbox.h ├── master.c ├── master.h ├── module.c ├── pdo.c ├── pdo.h ├── pdo_entry.c ├── pdo_entry.h ├── pdo_list.c ├── pdo_list.h ├── reg_request.c ├── reg_request.h ├── rtdm-ioctl.c ├── rtdm.c ├── rtdm.h ├── sdo.c ├── sdo.h ├── sdo_entry.c ├── sdo_entry.h ├── sdo_request.c ├── sdo_request.h ├── slave.c ├── slave.h ├── slave_config.c ├── slave_config.h ├── soe_errors.c ├── soe_request.c ├── soe_request.h ├── sync.c ├── sync.h ├── sync_config.c ├── sync_config.h ├── voe_handler.c └── voe_handler.h ├── revision ├── script ├── Makefile.am ├── Makefile.in ├── ethercat.conf ├── ethercat.service.in ├── ethercatctl.in ├── ifup-eoe.sh ├── init.d │ ├── Makefile.am │ ├── Makefile.in │ └── ethercat.in └── sysconfig │ ├── Makefile.am │ ├── Makefile.in │ └── ethercat ├── tool ├── Command.cpp ├── Command.h ├── CommandAlias.cpp ├── CommandAlias.h ├── CommandCStruct.cpp ├── CommandCStruct.h ├── CommandConfig.cpp ├── CommandConfig.h ├── CommandData.cpp ├── CommandData.h ├── CommandDebug.cpp ├── CommandDebug.h ├── CommandDomains.cpp ├── CommandDomains.h ├── CommandDownload.cpp ├── CommandDownload.h ├── CommandEoe.cpp ├── CommandEoe.h ├── CommandFoeRead.cpp ├── CommandFoeRead.h ├── CommandFoeWrite.cpp ├── CommandFoeWrite.h ├── CommandGraph.cpp ├── CommandGraph.h ├── CommandMaster.cpp ├── CommandMaster.h ├── CommandPdos.cpp ├── CommandPdos.h ├── CommandRegRead.cpp ├── CommandRegRead.h ├── CommandRegWrite.cpp ├── CommandRegWrite.h ├── CommandRescan.cpp ├── CommandRescan.h ├── CommandSdos.cpp ├── CommandSdos.h ├── CommandSiiRead.cpp ├── CommandSiiRead.h ├── CommandSiiWrite.cpp ├── CommandSiiWrite.h ├── CommandSlaves.cpp ├── CommandSlaves.h ├── CommandSoeRead.cpp ├── CommandSoeRead.h ├── CommandSoeWrite.cpp ├── CommandSoeWrite.h ├── CommandStates.cpp ├── CommandStates.h ├── CommandUpload.cpp ├── CommandUpload.h ├── CommandVersion.cpp ├── CommandVersion.h ├── CommandXml.cpp ├── CommandXml.h ├── DataTypeHandler.cpp ├── DataTypeHandler.h ├── FoeCommand.cpp ├── FoeCommand.h ├── Makefile.am ├── Makefile.in ├── MasterDevice.cpp ├── MasterDevice.h ├── NumberListParser.cpp ├── NumberListParser.h ├── SdoCommand.cpp ├── SdoCommand.h ├── SoeCommand.cpp ├── SoeCommand.h ├── main.cpp ├── sii_crc.cpp └── sii_crc.h └── tty ├── Kbuild.in ├── Makefile.am ├── Makefile.in ├── README └── module.c /.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o 3 | *.ko 4 | *.obj 5 | *.elf 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Libraries 12 | *.lib 13 | *.a 14 | *.la 15 | *.lo 16 | 17 | # Shared objects (inc. Windows DLLs) 18 | *.dll 19 | *.so 20 | *.so.* 21 | *.dylib 22 | 23 | # Executables 24 | *.exe 25 | *.out 26 | *.app 27 | *.i*86 28 | *.x86_64 29 | *.hex 30 | 31 | # Debug files 32 | *.dSYM/ 33 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | 2 | $Id: AUTHORS,v dda32c8294ad 2007/02/13 13:00:19 fp $ 3 | 4 | Authors: 5 | Dipl.-Ing. (FH) Florian Pose 6 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | 3 | This is the INSTALL file of the IgH EtherCAT Master. 4 | 5 | $Id: INSTALL,v 57b500c062fe 2010/03/22 14:50:51 fp $ 6 | 7 | vim: set spelllang=en spell tw=78 8 | 9 | ------------------------------------------------------------------------------- 10 | 11 | Building and installing 12 | ======================= 13 | 14 | The complete build and installation procedure is described in the respective 15 | section of the documentation available from http://etherlab.org/en/ethercat. 16 | 17 | ------------------------------------------------------------------------------- 18 | 19 | For the impatient: The procedure mainly consists of calling 20 | 21 | $ ./boostrap # to create the configure script, if downloaded from the repo 22 | 23 | $ ./configure 24 | $ make all modules 25 | 26 | ... and as root: 27 | 28 | # make modules_install install 29 | # depmod 30 | 31 | ... and linking the init script and copying the sysconfig file from $PREFIX/etc 32 | to the appropriate locations and customizing the sysconfig file. 33 | 34 | # ln -s ${PREFIX}/etc/init.d/ethercat /etc/init.d/ethercat 35 | # cp ${PREFIX}/etc/sysconfig/ethercat /etc/sysconfig/ethercat 36 | # vi /etc/sysconfig/ethercat 37 | 38 | Make sure, that the 'udev' package is installed, to automatically create the 39 | EtherCAT character devices. The character devices will be created with mode 40 | 0660 and group root by default. If you want to give normal users reading 41 | access, create a udev rule like this: 42 | 43 | # echo KERNEL==\"EtherCAT[0-9]*\", MODE=\"0664\" > /etc/udev/rules.d/99-EtherCAT.rules 44 | 45 | Now you can start the EtherCAT master: 46 | 47 | # /etc/init.d/ethercat start 48 | 49 | Have a look at the examples/ subdirectory for some application examples. 50 | 51 | Have fun! 52 | 53 | ------------------------------------------------------------------------------- 54 | -------------------------------------------------------------------------------- /Kbuild.in: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # $Id$ 4 | # 5 | # Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | # 7 | # This file is part of the IgH EtherCAT Master. 8 | # 9 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License version 2, as 11 | # published by the Free Software Foundation. 12 | # 13 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | # Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License along 19 | # with the IgH EtherCAT Master; if not, write to the Free Software 20 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | # 22 | # --- 23 | # 24 | # The license mentioned above concerns the source code only. Using the 25 | # EtherCAT technology and brand is only permitted in compliance with the 26 | # industrial property and similar rights of Beckhoff Automation GmbH. 27 | # 28 | # vi: syntax=make 29 | # 30 | #------------------------------------------------------------------------------ 31 | 32 | obj-m := examples/ master/ devices/ 33 | 34 | ifeq (@ENABLE_TTY@,1) 35 | obj-m += tty/ 36 | endif 37 | 38 | #------------------------------------------------------------------------------ 39 | -------------------------------------------------------------------------------- /README.EoE: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | 3 | $Id$ 4 | 5 | vim: spelllang=en spell tw=78 6 | 7 | ------------------------------------------------------------------------------- 8 | 9 | This file shall give additional information on how to set up a network 10 | environment with Ethernet over EtherCAT devices. 11 | 12 | A virtual network interface will appear for every EoE-capable slave. The 13 | interface naming scheme is either eoeXsY, where X is the master index and Y is 14 | the slave's ring position, or (if the slave has an alias set) eoeXaZ, where Z 15 | is the (decimal) alias address. Please provide a network configuration file for 16 | any of these interfaces. On SUSE systems, these can look like the following: 17 | 18 | /etc/sysconfig/network/ifcfg-eoe0s14: 19 | IPADDRESS=10.0.0.14/8 20 | STARTMODE=auto 21 | 22 | This will tell the ifupd to configure and open the device after it appears. 23 | 24 | If the interfaces shall be part of a network bridge, the IPADDRESS line is not 25 | necessary. Instead, copy the file script/ifup-eoe.sh to your systems if-up.d 26 | directory (on SUSE, this is /etc/sysconfig/network/if-up.d), and customize the 27 | included variables. 28 | 29 | ------------------------------------------------------------------------------- 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Igh-Ethercat-master 2 | EtherCAT Master source code 3 | http://www.etherlab.org/download/ethercat/ethercat-1.5.2.tar.bz2 4 | 5 | Based-on Igh EtherCAT master control Panasonic & Yaskawa servo motor 6 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | 3 | EtherCAT master TODO 4 | 5 | $Id: TODO,v 1f03f2543fc3 2013/02/08 19:03:37 fp $ 6 | 7 | vim700: spelllang=en spell 8 | 9 | ------------------------------------------------------------------------------- 10 | 11 | Future issues: 12 | 13 | • Remove fprintf() calls from user-space library (define return codes). 14 | • Move SII request to slave FSM. 15 | • Move SDO request to slave FSM. 16 | • Simplify slave FSM by introducing a common request state to handle external 17 | requests. 18 | * Fix link detection in generic driver. 19 | * Remove allow_scanning flag. 20 | * Check for Enable SDO Complete Access flag. 21 | * Do not output 'SDO does not exist' when querying data type. 22 | * recompile tool/CommandVersion.cpp if revision changes. 23 | * Log SoE IDNs with real name ([SP]-x-yyyy). 24 | * Only output watchdog config if not default. 25 | * Implement CompleteAccess for SDO uploads. 26 | * Output warning when send_ext() is called in illegal context. 27 | * Implement ecrt_slave_config_request_state(). 28 | * Remove default buffer size in SDO upload. 29 | * Override sync manager size? 30 | * Show Record / Array / List type of SDOs. 31 | * Distributed clocks: 32 | - Use vendor correction factors when calculating transmission delays. 33 | - Skip setting system time offset when application detached. 34 | - How to use the SYNC1 shift time? 35 | - Do not output graph, if topology calculation failed. 36 | - Check if register 0x0980 is working, to avoid clearing it when 37 | configuring. 38 | * Mailbox protocol handlers. 39 | * Mailbox state machine using toggle bits. 40 | * External memory for SDO transfers. 41 | * Move master threads, slave handlers and state machines into a user 42 | space daemon. 43 | * Allow master requesting when in ORPHANED phase 44 | * Mailbox gateway. 45 | * Separate CoE debugging. 46 | * Evaluate EEPROM contents after writing. 47 | * Optimize alignment of process data. 48 | * Interface/buffers for asynchronous domain IO. 49 | * Make scanning and configuration run parallel (each). 50 | * ethercat tool: 51 | - Add a -n (numeric) switch. 52 | - Check for unwanted options. 53 | - Fix number of digits in negative integer hex output. 54 | - Data type abbreviations. 55 | - Add -x switch for hex display. 56 | - Implement --output-file argument in foe_read. 57 | - Implement indent in 'ethercat ma' 58 | - Implement 0xXXXX:YY format for specifying SDOs. 59 | - Implement reading from stream for soe_write. 60 | - Output error after usage. 61 | * Fix bus scan hang when calling ecrt_master_deactivate(). 62 | 63 | Smaller issues: 64 | 65 | * Read out CRC counters. 66 | * Configure slave ports to automatically open on link detection. 67 | * Fix datagram errors on application loading/unloading. 68 | 69 | Less important issues: 70 | 71 | * Allow VLAN tagging. 72 | * Determine number of frames, the NIC can handle. 73 | 74 | ------------------------------------------------------------------------------- 75 | -------------------------------------------------------------------------------- /config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Debug interfaces enabled */ 4 | #undef EC_DEBUG_IF 5 | 6 | /* Debug ring enabled */ 7 | #undef EC_DEBUG_RING 8 | 9 | /* EoE support enabled */ 10 | #undef EC_EOE 11 | 12 | /* Use CPU timestamp counter */ 13 | #undef EC_HAVE_CYCLES 14 | 15 | /* Use vendor id / product code wildcards */ 16 | #undef EC_IDENT_WILDCARDS 17 | 18 | /* Max. number of Ethernet devices per master */ 19 | #undef EC_MAX_NUM_DEVICES 20 | 21 | /* Read alias adresses from register */ 22 | #undef EC_REGALIAS 23 | 24 | /* RTDM interface enabled */ 25 | #undef EC_RTDM 26 | 27 | /* Assign SII to PDI */ 28 | #undef EC_SII_ASSIGN 29 | 30 | /* Use hrtimer for scheduling */ 31 | #undef EC_USE_HRTIMER 32 | 33 | /* Define to 1 if you have the header file. */ 34 | #undef HAVE_DLFCN_H 35 | 36 | /* Define to 1 if you have the header file. */ 37 | #undef HAVE_INTTYPES_H 38 | 39 | /* Define to 1 if you have the header file. */ 40 | #undef HAVE_MEMORY_H 41 | 42 | /* Define to 1 if you have the header file. */ 43 | #undef HAVE_STDINT_H 44 | 45 | /* Define to 1 if you have the header file. */ 46 | #undef HAVE_STDLIB_H 47 | 48 | /* Define to 1 if you have the header file. */ 49 | #undef HAVE_STRINGS_H 50 | 51 | /* Define to 1 if you have the header file. */ 52 | #undef HAVE_STRING_H 53 | 54 | /* Define to 1 if you have the header file. */ 55 | #undef HAVE_SYS_STAT_H 56 | 57 | /* Define to 1 if you have the header file. */ 58 | #undef HAVE_SYS_TYPES_H 59 | 60 | /* Define to 1 if you have the header file. */ 61 | #undef HAVE_UNISTD_H 62 | 63 | /* Define to the sub-directory in which libtool stores uninstalled libraries. 64 | */ 65 | #undef LT_OBJDIR 66 | 67 | /* Define to 1 if your C compiler doesn't accept -c and -o together. */ 68 | #undef NO_MINUS_C_MINUS_O 69 | 70 | /* Name of package */ 71 | #undef PACKAGE 72 | 73 | /* Define to the address where bug reports for this package should be sent. */ 74 | #undef PACKAGE_BUGREPORT 75 | 76 | /* Define to the full name of this package. */ 77 | #undef PACKAGE_NAME 78 | 79 | /* Define to the full name and version of this package. */ 80 | #undef PACKAGE_STRING 81 | 82 | /* Define to the one symbol short name of this package. */ 83 | #undef PACKAGE_TARNAME 84 | 85 | /* Define to the home page for this package. */ 86 | #undef PACKAGE_URL 87 | 88 | /* Define to the version of this package. */ 89 | #undef PACKAGE_VERSION 90 | 91 | /* Define to 1 if you have the ANSI C header files. */ 92 | #undef STDC_HEADERS 93 | 94 | /* Version number of package */ 95 | #undef VERSION 96 | -------------------------------------------------------------------------------- /devices/8139too-2.6.13-ethercat.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nylon7/Igh-Ethercat-master/10ed5de113f5199738859a27c7359312dcad7f55/devices/8139too-2.6.13-ethercat.c -------------------------------------------------------------------------------- /devices/8139too-2.6.13-orig.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nylon7/Igh-Ethercat-master/10ed5de113f5199738859a27c7359312dcad7f55/devices/8139too-2.6.13-orig.c -------------------------------------------------------------------------------- /devices/8139too-2.6.17-ethercat.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nylon7/Igh-Ethercat-master/10ed5de113f5199738859a27c7359312dcad7f55/devices/8139too-2.6.17-ethercat.c -------------------------------------------------------------------------------- /devices/8139too-2.6.17-orig.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nylon7/Igh-Ethercat-master/10ed5de113f5199738859a27c7359312dcad7f55/devices/8139too-2.6.17-orig.c -------------------------------------------------------------------------------- /devices/8139too-2.6.18-ethercat.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nylon7/Igh-Ethercat-master/10ed5de113f5199738859a27c7359312dcad7f55/devices/8139too-2.6.18-ethercat.c -------------------------------------------------------------------------------- /devices/8139too-2.6.18-orig.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nylon7/Igh-Ethercat-master/10ed5de113f5199738859a27c7359312dcad7f55/devices/8139too-2.6.18-orig.c -------------------------------------------------------------------------------- /devices/8139too-2.6.19-ethercat.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nylon7/Igh-Ethercat-master/10ed5de113f5199738859a27c7359312dcad7f55/devices/8139too-2.6.19-ethercat.c -------------------------------------------------------------------------------- /devices/8139too-2.6.19-orig.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nylon7/Igh-Ethercat-master/10ed5de113f5199738859a27c7359312dcad7f55/devices/8139too-2.6.19-orig.c -------------------------------------------------------------------------------- /devices/8139too-2.6.22-ethercat.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nylon7/Igh-Ethercat-master/10ed5de113f5199738859a27c7359312dcad7f55/devices/8139too-2.6.22-ethercat.c -------------------------------------------------------------------------------- /devices/8139too-2.6.22-orig.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nylon7/Igh-Ethercat-master/10ed5de113f5199738859a27c7359312dcad7f55/devices/8139too-2.6.22-orig.c -------------------------------------------------------------------------------- /devices/8139too-2.6.23-ethercat.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nylon7/Igh-Ethercat-master/10ed5de113f5199738859a27c7359312dcad7f55/devices/8139too-2.6.23-ethercat.c -------------------------------------------------------------------------------- /devices/8139too-2.6.23-orig.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nylon7/Igh-Ethercat-master/10ed5de113f5199738859a27c7359312dcad7f55/devices/8139too-2.6.23-orig.c -------------------------------------------------------------------------------- /devices/Kbuild.in: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # $Id$ 4 | # 5 | # Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | # 7 | # This file is part of the IgH EtherCAT Master. 8 | # 9 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License version 2, as 11 | # published by the Free Software Foundation. 12 | # 13 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | # Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License along 19 | # with the IgH EtherCAT Master; if not, write to the Free Software 20 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | # 22 | # --- 23 | # 24 | # The license mentioned above concerns the source code only. Using the 25 | # EtherCAT technology and brand is only permitted in compliance with the 26 | # industrial property and similar rights of Beckhoff Automation GmbH. 27 | # 28 | # --- 29 | # 30 | # vim: syntax=make 31 | # 32 | #------------------------------------------------------------------------------ 33 | 34 | REV := $(shell if test -s $(src)/../revision; then \ 35 | cat $(src)/../revision; \ 36 | else \ 37 | hg id -i $(src)/.. 2>/dev/null || echo "unknown"; \ 38 | fi) 39 | 40 | ifeq (@ENABLE_GENERIC@,1) 41 | EC_GENERIC_OBJ := generic.o 42 | obj-m += ec_generic.o 43 | ec_generic-objs := $(EC_GENERIC_OBJ) 44 | CFLAGS_$(EC_GENERIC_OBJ) = -DREV=$(REV) 45 | endif 46 | 47 | ifeq (@ENABLE_8139TOO@,1) 48 | EC_8139TOO_OBJ := 8139too-@KERNEL_8139TOO@-ethercat.o 49 | obj-m += ec_8139too.o 50 | ec_8139too-objs := $(EC_8139TOO_OBJ) 51 | CFLAGS_$(EC_8139TOO_OBJ) = -DREV=$(REV) 52 | endif 53 | 54 | ifeq (@ENABLE_E100@,1) 55 | EC_E100_OBJ := e100-@KERNEL_E100@-ethercat.o 56 | obj-m += ec_e100.o 57 | ec_e100-objs := $(EC_E100_OBJ) 58 | CFLAGS_$(EC_E100_OBJ) = -DREV=$(REV) 59 | endif 60 | 61 | ifeq (@ENABLE_E1000@,1) 62 | obj-m += e1000/ 63 | endif 64 | 65 | ifeq (@ENABLE_E1000E@,1) 66 | obj-m += e1000e/ 67 | endif 68 | 69 | ifeq (@ENABLE_R8169@,1) 70 | EC_R8169_OBJ := r8169-@KERNEL_R8169@-ethercat.o 71 | obj-m += ec_r8169.o 72 | ec_r8169-objs := $(EC_R8169_OBJ) 73 | CFLAGS_$(EC_R8169_OBJ) = -DREV=$(REV) 74 | endif 75 | 76 | KBUILD_EXTRA_SYMBOLS := \ 77 | @abs_top_builddir@/$(LINUX_SYMVERS) \ 78 | @abs_top_builddir@/master/$(LINUX_SYMVERS) 79 | 80 | #------------------------------------------------------------------------------ 81 | -------------------------------------------------------------------------------- /devices/e1000/Kbuild.in: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # $Id$ 4 | # 5 | # Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | # 7 | # This file is part of the IgH EtherCAT Master. 8 | # 9 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License version 2, as 11 | # published by the Free Software Foundation. 12 | # 13 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | # Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License along 19 | # with the IgH EtherCAT Master; if not, write to the Free Software 20 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | # 22 | # --- 23 | # 24 | # The license mentioned above concerns the source code only. Using the 25 | # EtherCAT technology and brand is only permitted in compliance with the 26 | # industrial property and similar rights of Beckhoff Automation GmbH. 27 | # 28 | # --- 29 | # 30 | # vim: syntax=make 31 | # 32 | #------------------------------------------------------------------------------ 33 | 34 | TOPDIR := $(src)/../.. 35 | 36 | REV := $(shell if test -s $(TOPDIR)/revision; then \ 37 | cat $(TOPDIR)/revision; \ 38 | else \ 39 | hg id -i $(TOPDIR) 2>/dev/null || echo "unknown"; \ 40 | fi) 41 | 42 | ifeq (@ENABLE_E1000@,1) 43 | EC_E1000_OBJ := \ 44 | e1000_main-@KERNEL_E1000@-ethercat.o \ 45 | e1000_hw-@KERNEL_E1000@-ethercat.o \ 46 | e1000_ethtool-@KERNEL_E1000@-ethercat.o \ 47 | e1000_param-@KERNEL_E1000@-ethercat.o 48 | obj-m += ec_e1000.o 49 | ec_e1000-objs := $(EC_E1000_OBJ) 50 | CFLAGS_e1000_main-@KERNEL_E1000@-ethercat.o = -DREV=$(REV) 51 | endif 52 | 53 | KBUILD_EXTRA_SYMBOLS := \ 54 | @abs_top_builddir@/$(LINUX_SYMVERS) \ 55 | @abs_top_builddir@/master/$(LINUX_SYMVERS) 56 | 57 | #------------------------------------------------------------------------------ 58 | -------------------------------------------------------------------------------- /devices/e1000e/Kbuild.in: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # $Id$ 4 | # 5 | # Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | # 7 | # This file is part of the IgH EtherCAT Master. 8 | # 9 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License version 2, as 11 | # published by the Free Software Foundation. 12 | # 13 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | # Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License along 19 | # with the IgH EtherCAT Master; if not, write to the Free Software 20 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | # 22 | # --- 23 | # 24 | # The license mentioned above concerns the source code only. Using the 25 | # EtherCAT technology and brand is only permitted in compliance with the 26 | # industrial property and similar rights of Beckhoff Automation GmbH. 27 | # 28 | # --- 29 | # 30 | # vim: syntax=make 31 | # 32 | #------------------------------------------------------------------------------ 33 | 34 | TOPDIR := $(src)/../.. 35 | 36 | REV := $(shell if test -s $(TOPDIR)/revision; then \ 37 | cat $(TOPDIR)/revision; \ 38 | else \ 39 | hg id -i $(TOPDIR) 2>/dev/null || echo "unknown"; \ 40 | fi) 41 | 42 | ifeq (@ENABLE_E1000E@,1) 43 | EC_E1000E_OBJ := \ 44 | 82571-@KERNEL_E1000E@-ethercat.o \ 45 | ethtool-@KERNEL_E1000E@-ethercat.o \ 46 | ich8lan-@KERNEL_E1000E@-ethercat.o \ 47 | netdev-@KERNEL_E1000E@-ethercat.o \ 48 | param-@KERNEL_E1000E@-ethercat.o \ 49 | phy-@KERNEL_E1000E@-ethercat.o 50 | 51 | ifeq (@E1000E_LAYOUT_3_4@,1) 52 | EC_E1000E_OBJ += \ 53 | 80003es2lan-@KERNEL_E1000E@-ethercat.o \ 54 | mac-@KERNEL_E1000E@-ethercat.o \ 55 | manage-@KERNEL_E1000E@-ethercat.o \ 56 | nvm-@KERNEL_E1000E@-ethercat.o 57 | else 58 | EC_E1000E_OBJ += \ 59 | es2lan-@KERNEL_E1000E@-ethercat.o \ 60 | lib-@KERNEL_E1000E@-ethercat.o 61 | endif 62 | 63 | obj-m += ec_e1000e.o 64 | ec_e1000e-objs := $(EC_E1000E_OBJ) 65 | 66 | CFLAGS_netdev-@KERNEL_E1000E@-ethercat.o = -DREV=$(REV) 67 | endif 68 | 69 | KBUILD_EXTRA_SYMBOLS := \ 70 | @abs_top_builddir@/$(LINUX_SYMVERS) \ 71 | @abs_top_builddir@/master/$(LINUX_SYMVERS) 72 | 73 | #------------------------------------------------------------------------------ 74 | -------------------------------------------------------------------------------- /examples/Kbuild.in: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # $Id$ 4 | # 5 | # Copyright (C) 2006-2012 Florian Pose, Ingenieurgemeinschaft IgH 6 | # 7 | # This file is part of the IgH EtherCAT Master. 8 | # 9 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License version 2, as 11 | # published by the Free Software Foundation. 12 | # 13 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | # Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License along 19 | # with the IgH EtherCAT Master; if not, write to the Free Software 20 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | # 22 | # --- 23 | # 24 | # The license mentioned above concerns the source code only. Using the 25 | # EtherCAT technology and brand is only permitted in compliance with the 26 | # industrial property and similar rights of Beckhoff Automation GmbH. 27 | # 28 | # vi: syntax=make 29 | # 30 | #------------------------------------------------------------------------------ 31 | 32 | obj-m := mini/ 33 | 34 | ifeq (@ENABLE_TTY@,1) 35 | obj-m += tty/ 36 | endif 37 | 38 | ifeq (@ENABLE_RTAI@,1) 39 | obj-m += rtai/ dc_rtai/ 40 | endif 41 | 42 | #------------------------------------------------------------------------------ 43 | -------------------------------------------------------------------------------- /examples/Makefile.am: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # $Id: Makefile.am,v e93efb4af231 2012/11/20 13:35:53 fp $ 4 | # 5 | # Copyright (C) 2006-2012 Florian Pose, Ingenieurgemeinschaft IgH 6 | # 7 | # This file is part of the IgH EtherCAT Master. 8 | # 9 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License version 2, as 11 | # published by the Free Software Foundation. 12 | # 13 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | # Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License along 19 | # with the IgH EtherCAT Master; if not, write to the Free Software 20 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | # 22 | # --- 23 | # 24 | # The license mentioned above concerns the source code only. Using the 25 | # EtherCAT technology and brand is only permitted in compliance with the 26 | # industrial property and similar rights of Beckhoff Automation GmbH. 27 | # 28 | #------------------------------------------------------------------------------ 29 | 30 | SUBDIRS = 31 | 32 | if ENABLE_USERLIB 33 | SUBDIRS += \ 34 | dc_user \ 35 | user 36 | endif 37 | 38 | if ENABLE_TTY 39 | SUBDIRS += \ 40 | tty 41 | endif 42 | 43 | if ENABLE_RTDM 44 | if ENABLE_XENOMAI 45 | SUBDIRS += \ 46 | xenomai \ 47 | xenomai_posix 48 | endif 49 | 50 | if ENABLE_RTAI 51 | SUBDIRS += \ 52 | rtai_rtdm \ 53 | rtai_rtdm_dc 54 | endif 55 | endif 56 | 57 | DIST_SUBDIRS = \ 58 | dc_rtai \ 59 | dc_user \ 60 | mini \ 61 | rtai \ 62 | rtai_rtdm \ 63 | rtai_rtdm_dc \ 64 | tty \ 65 | user \ 66 | xenomai \ 67 | xenomai_posix 68 | 69 | EXTRA_DIST = \ 70 | Kbuild.in 71 | 72 | BUILT_SOURCES = \ 73 | Kbuild 74 | 75 | #------------------------------------------------------------------------------ 76 | -------------------------------------------------------------------------------- /examples/dc_rtai/Kbuild.in: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # $Id$ 4 | # 5 | # Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | # 7 | # This file is part of the IgH EtherCAT Master. 8 | # 9 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License version 2, as 11 | # published by the Free Software Foundation. 12 | # 13 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | # Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License along 19 | # with the IgH EtherCAT Master; if not, write to the Free Software 20 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | # 22 | # --- 23 | # 24 | # The license mentioned above concerns the source code only. Using the 25 | # EtherCAT technology and brand is only permitted in compliance with the 26 | # industrial property and similar rights of Beckhoff Automation GmbH. 27 | # 28 | # --- 29 | # 30 | # vi: syntax=make 31 | # 32 | #------------------------------------------------------------------------------ 33 | 34 | obj-m := ec_dc_rtai_sample.o 35 | 36 | ec_dc_rtai_sample-objs := dc_rtai_sample.o 37 | 38 | EXTRA_CFLAGS := -I@RTAI_DIR@/include 39 | 40 | KBUILD_EXTRA_SYMBOLS := \ 41 | @abs_top_builddir@/$(LINUX_SYMVERS) \ 42 | @abs_top_builddir@/master/$(LINUX_SYMVERS) 43 | 44 | #------------------------------------------------------------------------------ 45 | -------------------------------------------------------------------------------- /examples/dc_rtai/Makefile.am: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # IgH EtherCAT master module 4 | # 5 | # $Id: Makefile.am,v bc2d4bf9cbe5 2012/09/06 18:22:24 fp $ 6 | # 7 | # Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 8 | # 9 | # This file is part of the IgH EtherCAT Master. 10 | # 11 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 12 | # modify it under the terms of the GNU General Public License version 2, as 13 | # published by the Free Software Foundation. 14 | # 15 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 18 | # Public License for more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along 21 | # with the IgH EtherCAT Master; if not, write to the Free Software 22 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 23 | # 24 | # --- 25 | # 26 | # The license mentioned above concerns the source code only. Using the 27 | # EtherCAT technology and brand is only permitted in compliance with the 28 | # industrial property and similar rights of Beckhoff Automation GmbH. 29 | # 30 | #------------------------------------------------------------------------------ 31 | 32 | EXTRA_DIST = \ 33 | Kbuild.in \ 34 | dc_rtai_sample.c 35 | 36 | BUILT_SOURCES = \ 37 | Kbuild 38 | 39 | modules: 40 | $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" modules 41 | 42 | modules_install: 43 | $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" \ 44 | INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)" modules_install 45 | 46 | clean-local: 47 | $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 48 | 49 | #------------------------------------------------------------------------------ 50 | -------------------------------------------------------------------------------- /examples/dc_user/Makefile.am: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # $Id: Makefile.am,v 6a6dec6fc806 2012/09/19 17:46:58 fp $ 4 | # 5 | # Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | # 7 | # This file is part of the IgH EtherCAT Master. 8 | # 9 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License version 2, as 11 | # published by the Free Software Foundation. 12 | # 13 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | # Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License along with 19 | # the IgH EtherCAT Master; if not, write to the Free Software Foundation, 20 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | # 22 | # --- 23 | # 24 | # The license mentioned above concerns the source code only. Using the 25 | # EtherCAT technology and brand is only permitted in compliance with the 26 | # industrial property and similar rights of Beckhoff Automation GmbH. 27 | # 28 | #------------------------------------------------------------------------------ 29 | 30 | noinst_PROGRAMS = ec_dc_user_example 31 | 32 | ec_dc_user_example_SOURCES = main.c 33 | ec_dc_user_example_CFLAGS = -I$(top_srcdir)/include -Wall 34 | ec_dc_user_example_LDFLAGS = -L$(top_builddir)/lib/.libs -lethercat -lrt 35 | 36 | #------------------------------------------------------------------------------ 37 | -------------------------------------------------------------------------------- /examples/mini/Kbuild.in: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # $Id$ 4 | # 5 | # Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | # 7 | # This file is part of the IgH EtherCAT Master. 8 | # 9 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License version 2, as 11 | # published by the Free Software Foundation. 12 | # 13 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | # Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License along 19 | # with the IgH EtherCAT Master; if not, write to the Free Software 20 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | # 22 | # --- 23 | # 24 | # The license mentioned above concerns the source code only. Using the 25 | # EtherCAT technology and brand is only permitted in compliance with the 26 | # industrial property and similar rights of Beckhoff Automation GmbH. 27 | # 28 | # --- 29 | # 30 | # vi: syntax=make 31 | # 32 | #------------------------------------------------------------------------------ 33 | 34 | obj-m := ec_mini.o 35 | 36 | ec_mini-objs := mini.o 37 | 38 | KBUILD_EXTRA_SYMBOLS := \ 39 | @abs_top_builddir@/$(LINUX_SYMVERS) \ 40 | @abs_top_builddir@/master/$(LINUX_SYMVERS) 41 | 42 | #------------------------------------------------------------------------------ 43 | -------------------------------------------------------------------------------- /examples/mini/Makefile.am: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # Makefile.am 4 | # 5 | # IgH EtherCAT master module 6 | # 7 | # $Id: Makefile.am,v bc2d4bf9cbe5 2012/09/06 18:22:24 fp $ 8 | # 9 | # Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 10 | # 11 | # This file is part of the IgH EtherCAT Master. 12 | # 13 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 14 | # modify it under the terms of the GNU General Public License version 2, as 15 | # published by the Free Software Foundation. 16 | # 17 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 20 | # Public License for more details. 21 | # 22 | # You should have received a copy of the GNU General Public License along 23 | # with the IgH EtherCAT Master; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 25 | # 26 | # --- 27 | # 28 | # The license mentioned above concerns the source code only. Using the 29 | # EtherCAT technology and brand is only permitted in compliance with the 30 | # industrial property and similar rights of Beckhoff Automation GmbH. 31 | # 32 | #------------------------------------------------------------------------------ 33 | 34 | EXTRA_DIST = \ 35 | Kbuild.in \ 36 | mini.c 37 | 38 | BUILT_SOURCES = \ 39 | Kbuild 40 | 41 | modules: 42 | $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" modules 43 | 44 | modules_install: 45 | $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" \ 46 | INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)" modules_install 47 | 48 | clean-local: 49 | $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 50 | 51 | #------------------------------------------------------------------------------ 52 | -------------------------------------------------------------------------------- /examples/mini/README: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | 3 | $Id: README,v 088a61306930 2008/07/02 12:16:48 fp $ 4 | 5 | ------------------------------------------------------------------------------- 6 | 7 | This is a minimal example module for the use of the EtherCAT master realtime 8 | interface. It uses a kernel timer to generate a cyclic task. 9 | 10 | Most probably you'll have different EtherCAT slaves present. Try adjusting the 11 | section "process data" in mini.c to your bus configuration. 12 | 13 | There are some features that can be disabled by commenting out the respective 14 | defines at the head of mini.c. 15 | 16 | --- 17 | 18 | To build the example module, call: 19 | 20 | make modules 21 | 22 | To run it, call: 23 | 24 | insmod ec_mini.ko 25 | 26 | ...and watch the system logs for the outputs. 27 | 28 | ------------------------------------------------------------------------------- 29 | -------------------------------------------------------------------------------- /examples/rtai/Kbuild.in: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # $Id$ 4 | # 5 | # Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | # 7 | # This file is part of the IgH EtherCAT Master. 8 | # 9 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License version 2, as 11 | # published by the Free Software Foundation. 12 | # 13 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | # Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License along 19 | # with the IgH EtherCAT Master; if not, write to the Free Software 20 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | # 22 | # --- 23 | # 24 | # The license mentioned above concerns the source code only. Using the 25 | # EtherCAT technology and brand is only permitted in compliance with the 26 | # industrial property and similar rights of Beckhoff Automation GmbH. 27 | # 28 | # --- 29 | # 30 | # vi: syntax=make 31 | # 32 | #------------------------------------------------------------------------------ 33 | 34 | obj-m := ec_rtai_sample.o 35 | 36 | ec_rtai_sample-objs := rtai_sample.o 37 | 38 | EXTRA_CFLAGS := -I@RTAI_DIR@/include 39 | 40 | KBUILD_EXTRA_SYMBOLS := \ 41 | @abs_top_builddir@/$(LINUX_SYMVERS) \ 42 | @abs_top_builddir@/master/$(LINUX_SYMVERS) 43 | 44 | #------------------------------------------------------------------------------ 45 | -------------------------------------------------------------------------------- /examples/rtai/Makefile.am: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # IgH EtherCAT master module 4 | # 5 | # $Id: Makefile.am,v bc2d4bf9cbe5 2012/09/06 18:22:24 fp $ 6 | # 7 | # Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 8 | # 9 | # This file is part of the IgH EtherCAT Master. 10 | # 11 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 12 | # modify it under the terms of the GNU General Public License version 2, as 13 | # published by the Free Software Foundation. 14 | # 15 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 18 | # Public License for more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along 21 | # with the IgH EtherCAT Master; if not, write to the Free Software 22 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 23 | # 24 | # --- 25 | # 26 | # The license mentioned above concerns the source code only. Using the 27 | # EtherCAT technology and brand is only permitted in compliance with the 28 | # industrial property and similar rights of Beckhoff Automation GmbH. 29 | # 30 | #------------------------------------------------------------------------------ 31 | 32 | EXTRA_DIST = \ 33 | Kbuild.in \ 34 | rtai_sample.c 35 | 36 | BUILT_SOURCES = \ 37 | Kbuild 38 | 39 | modules: 40 | $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" modules 41 | 42 | modules_install: 43 | $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" \ 44 | INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)" modules_install 45 | 46 | clean-local: 47 | $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 48 | 49 | #------------------------------------------------------------------------------ 50 | -------------------------------------------------------------------------------- /examples/rtai/README: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | 3 | $Id: README,v 088a61306930 2008/07/02 12:16:48 fp $ 4 | 5 | ------------------------------------------------------------------------------- 6 | 7 | This is a minimal example module for the use of the EtherCAT master realtime 8 | interface with an RTAI thread. 9 | 10 | The module expects an RTAI installation. Configure the master sources 11 | specifying --with-rtai-dir to have the right include paths. 12 | 13 | Most probably you'll have different EtherCAT slaves present. Try adjusting the 14 | section "process data" in rtai_sample.c to your bus configuration. 15 | 16 | There are some features that can be disabled by commenting out the respective 17 | defines at the head of rtai_sample.c. 18 | 19 | --- 20 | 21 | To build the example module, call: 22 | 23 | make modules 24 | 25 | To run it, load the appropriate RTAI modules and call: 26 | 27 | insmod ec_rtai_sample.ko 28 | 29 | ...and watch the system logs for the outputs. 30 | 31 | ------------------------------------------------------------------------------- 32 | -------------------------------------------------------------------------------- /examples/rtai_rtdm/Makefile.am: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # $Id$ 4 | # 5 | # Copyright (C) 2006-2012 Florian Pose, Ingenieurgemeinschaft IgH 6 | # 7 | # This file is part of the IgH EtherCAT Master. 8 | # 9 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License version 2, as 11 | # published by the Free Software Foundation. 12 | # 13 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | # Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License along with 19 | # the IgH EtherCAT Master; if not, write to the Free Software Foundation, 20 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | # 22 | # --- 23 | # 24 | # The license mentioned above concerns the source code only. Using the 25 | # EtherCAT technology and brand is only permitted in compliance with the 26 | # industrial property and similar rights of Beckhoff Automation GmbH. 27 | # 28 | #------------------------------------------------------------------------------ 29 | 30 | noinst_PROGRAMS = ec_rtai_rtdm_example 31 | 32 | ec_rtai_rtdm_example_SOURCES = main.c 33 | 34 | ec_rtai_rtdm_example_CFLAGS = \ 35 | -Wall \ 36 | -I$(top_srcdir)/include \ 37 | $(RTAI_LXRT_CFLAGS) 38 | 39 | ec_rtai_rtdm_example_LDFLAGS = \ 40 | $(RTAI_LXRT_LDFLAGS) -llxrt -lrtdm \ 41 | -L$(top_builddir)/lib/.libs -lethercat_rtdm 42 | 43 | #------------------------------------------------------------------------------ 44 | -------------------------------------------------------------------------------- /examples/rtai_rtdm_dc/Makefile.am: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # $Id: Makefile.am,v e93efb4af231 2012/11/20 13:35:53 fp $ 4 | # 5 | # Copyright (C) 2006-2012 Florian Pose, Ingenieurgemeinschaft IgH 6 | # 7 | # This file is part of the IgH EtherCAT Master. 8 | # 9 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License version 2, as 11 | # published by the Free Software Foundation. 12 | # 13 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | # Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License along with 19 | # the IgH EtherCAT Master; if not, write to the Free Software Foundation, 20 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | # 22 | # --- 23 | # 24 | # The license mentioned above concerns the source code only. Using the 25 | # EtherCAT technology and brand is only permitted in compliance with the 26 | # industrial property and similar rights of Beckhoff Automation GmbH. 27 | # 28 | #------------------------------------------------------------------------------ 29 | 30 | noinst_PROGRAMS = ec_rtai_rtdm_dc_example 31 | 32 | ec_rtai_rtdm_dc_example_SOURCES = main.c 33 | 34 | ec_rtai_rtdm_dc_example_CFLAGS = \ 35 | -Wall \ 36 | -I$(top_srcdir)/include \ 37 | $(RTAI_LXRT_CFLAGS) 38 | 39 | ec_rtai_rtdm_dc_example_LDFLAGS = \ 40 | $(RTAI_LXRT_LDFLAGS) -llxrt -lrtdm \ 41 | -L$(top_builddir)/lib/.libs -lethercat_rtdm 42 | 43 | #------------------------------------------------------------------------------ 44 | -------------------------------------------------------------------------------- /examples/tty/Kbuild.in: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # $Id$ 4 | # 5 | # Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | # 7 | # This file is part of the IgH EtherCAT Master. 8 | # 9 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License version 2, as 11 | # published by the Free Software Foundation. 12 | # 13 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | # Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License along 19 | # with the IgH EtherCAT Master; if not, write to the Free Software 20 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | # 22 | # --- 23 | # 24 | # The license mentioned above concerns the source code only. Using the 25 | # EtherCAT technology and brand is only permitted in compliance with the 26 | # industrial property and similar rights of Beckhoff Automation GmbH. 27 | # 28 | # --- 29 | # 30 | # vi: syntax=make 31 | # 32 | #------------------------------------------------------------------------------ 33 | 34 | obj-m := ec_tty_example.o 35 | 36 | ec_tty_example-objs := \ 37 | serial.o \ 38 | tty.o 39 | 40 | CFLAGS_tty.o := -I$(src) 41 | 42 | KBUILD_EXTRA_SYMBOLS := \ 43 | @abs_top_builddir@/$(LINUX_SYMVERS) \ 44 | @abs_top_builddir@/master/$(LINUX_SYMVERS) 45 | 46 | #------------------------------------------------------------------------------ 47 | -------------------------------------------------------------------------------- /examples/tty/Makefile.am: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # Makefile.am 4 | # 5 | # IgH EtherCAT master module 6 | # 7 | # $Id: Makefile.am,v bc2d4bf9cbe5 2012/09/06 18:22:24 fp $ 8 | # 9 | # Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 10 | # 11 | # This file is part of the IgH EtherCAT Master. 12 | # 13 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 14 | # modify it under the terms of the GNU General Public License version 2, as 15 | # published by the Free Software Foundation. 16 | # 17 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 20 | # Public License for more details. 21 | # 22 | # You should have received a copy of the GNU General Public License along 23 | # with the IgH EtherCAT Master; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 25 | # 26 | # --- 27 | # 28 | # The license mentioned above concerns the source code only. Using the 29 | # EtherCAT technology and brand is only permitted in compliance with the 30 | # industrial property and similar rights of Beckhoff Automation GmbH. 31 | # 32 | #------------------------------------------------------------------------------ 33 | 34 | noinst_HEADERS = \ 35 | serial.c \ 36 | serial.h \ 37 | tty.c 38 | 39 | EXTRA_DIST = \ 40 | Kbuild.in 41 | 42 | BUILT_SOURCES = \ 43 | Kbuild 44 | 45 | modules: 46 | $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" modules 47 | 48 | modules_install: 49 | $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" \ 50 | INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)" modules_install 51 | 52 | clean-local: 53 | $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 54 | 55 | #------------------------------------------------------------------------------ 56 | -------------------------------------------------------------------------------- /examples/tty/serial.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: serial.h,v 2f362d2b6d6e 2010/01/08 12:13:50 fp $ 4 | * 5 | * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | *****************************************************************************/ 29 | 30 | int create_serial_devices(ec_master_t *, ec_domain_t *); 31 | void free_serial_devices(void); 32 | 33 | void run_serial_devices(u8 *); 34 | 35 | /*****************************************************************************/ 36 | -------------------------------------------------------------------------------- /examples/user/Makefile.am: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # $Id: Makefile.am,v 6a6dec6fc806 2012/09/19 17:46:58 fp $ 4 | # 5 | # Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | # 7 | # This file is part of the IgH EtherCAT Master. 8 | # 9 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License version 2, as 11 | # published by the Free Software Foundation. 12 | # 13 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | # Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License along with 19 | # the IgH EtherCAT Master; if not, write to the Free Software Foundation, 20 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | # 22 | # --- 23 | # 24 | # The license mentioned above concerns the source code only. Using the 25 | # EtherCAT technology and brand is only permitted in compliance with the 26 | # industrial property and similar rights of Beckhoff Automation GmbH. 27 | # 28 | #------------------------------------------------------------------------------ 29 | 30 | noinst_PROGRAMS = ec_user_example 31 | 32 | ec_user_example_SOURCES = main.c 33 | ec_user_example_CFLAGS = -I$(top_srcdir)/include -Wall 34 | ec_user_example_LDFLAGS = -L$(top_builddir)/lib/.libs -lethercat 35 | 36 | #------------------------------------------------------------------------------ 37 | -------------------------------------------------------------------------------- /examples/xenomai/Makefile.am: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # $Id$ 4 | # 5 | # Copyright (C) 2006-2012 Florian Pose, Ingenieurgemeinschaft IgH 6 | # 7 | # This file is part of the IgH EtherCAT Master. 8 | # 9 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License version 2, as 11 | # published by the Free Software Foundation. 12 | # 13 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | # Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License along with 19 | # the IgH EtherCAT Master; if not, write to the Free Software Foundation, 20 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | # 22 | # --- 23 | # 24 | # The license mentioned above concerns the source code only. Using the 25 | # EtherCAT technology and brand is only permitted in compliance with the 26 | # industrial property and similar rights of Beckhoff Automation GmbH. 27 | # 28 | #------------------------------------------------------------------------------ 29 | 30 | noinst_PROGRAMS = ec_xenomai_example 31 | 32 | ec_xenomai_example_SOURCES = main.c 33 | 34 | ec_xenomai_example_CFLAGS = \ 35 | -Wall \ 36 | -I$(top_srcdir)/include \ 37 | $(XENOMAI_NATIVE_CFLAGS) \ 38 | $(XENOMAI_RTDM_CFLAGS) 39 | 40 | ec_xenomai_example_LDFLAGS = \ 41 | -L$(top_builddir)/lib/.libs -lethercat_rtdm \ 42 | $(XENOMAI_NATIVE_LDFLAGS) \ 43 | $(XENOMAI_RTDM_LDFLAGS) 44 | 45 | #------------------------------------------------------------------------------ 46 | -------------------------------------------------------------------------------- /examples/xenomai_posix/Makefile.am: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # $Id$ 4 | # 5 | # Copyright (C) 2006-2012 Florian Pose, Ingenieurgemeinschaft IgH 6 | # 7 | # This file is part of the IgH EtherCAT Master. 8 | # 9 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License version 2, as 11 | # published by the Free Software Foundation. 12 | # 13 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | # Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License along with 19 | # the IgH EtherCAT Master; if not, write to the Free Software Foundation, 20 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | # 22 | # --- 23 | # 24 | # The license mentioned above concerns the source code only. Using the 25 | # EtherCAT technology and brand is only permitted in compliance with the 26 | # industrial property and similar rights of Beckhoff Automation GmbH. 27 | # 28 | #------------------------------------------------------------------------------ 29 | 30 | noinst_PROGRAMS = ec_xenomai_posix_example 31 | 32 | ec_xenomai_posix_example_SOURCES = main.c 33 | 34 | ec_xenomai_posix_example_CFLAGS = \ 35 | -Wall \ 36 | -I$(top_srcdir)/include \ 37 | $(XENOMAI_POSIX_CFLAGS) \ 38 | $(XENOMAI_RTDM_CFLAGS) 39 | 40 | ec_xenomai_posix_example_LDFLAGS = \ 41 | -L$(top_builddir)/lib/.libs -lethercat_rtdm \ 42 | $(XENOMAI_POSIX_LDFLAGS) \ 43 | $(XENOMAI_RTDM_LDFLAGS) 44 | 45 | #------------------------------------------------------------------------------ 46 | -------------------------------------------------------------------------------- /globals.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: globals.h,v dbc617badc33 2009/08/13 13:18:53 fp $ 4 | * 5 | * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | *****************************************************************************/ 29 | 30 | /** 31 | \file 32 | Global definitions and macros. 33 | */ 34 | 35 | /*****************************************************************************/ 36 | 37 | #ifndef __EC_GLOBALS_H__ 38 | #define __EC_GLOBALS_H__ 39 | 40 | #include "config.h" 41 | 42 | /****************************************************************************** 43 | * Overall macros 44 | *****************************************************************************/ 45 | 46 | /** Helper macro for EC_STR(), literates a macro argument. 47 | * 48 | * \param X argument to literate. 49 | */ 50 | #define EC_LIT(X) #X 51 | 52 | /** Converts a macro argument to a string. 53 | * 54 | * \param X argument to stringify. 55 | */ 56 | #define EC_STR(X) EC_LIT(X) 57 | 58 | /** Master version string 59 | */ 60 | #define EC_MASTER_VERSION VERSION " " EC_STR(REV) 61 | 62 | /*****************************************************************************/ 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /include/Makefile.am: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # Makefile.am 4 | # 5 | # IgH EtherCAT master 6 | # 7 | # $Id: Makefile.am,v bc2d4bf9cbe5 2012/09/06 18:22:24 fp $ 8 | # 9 | # Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 10 | # 11 | # This file is part of the IgH EtherCAT Master. 12 | # 13 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 14 | # modify it under the terms of the GNU General Public License version 2, as 15 | # published by the Free Software Foundation. 16 | # 17 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 20 | # Public License for more details. 21 | # 22 | # You should have received a copy of the GNU General Public License along 23 | # with the IgH EtherCAT Master; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 25 | # 26 | # --- 27 | # 28 | # The license mentioned above concerns the source code only. Using the 29 | # EtherCAT technology and brand is only permitted in compliance with the 30 | # industrial property and similar rights of Beckhoff Automation GmbH. 31 | # 32 | #------------------------------------------------------------------------------ 33 | 34 | include_HEADERS = \ 35 | ecrt.h \ 36 | ectty.h 37 | 38 | #------------------------------------------------------------------------------ 39 | -------------------------------------------------------------------------------- /lib/Makefile.am: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # $Id: Makefile.am,v 4c2e37d2237c 2013/02/12 16:30:45 fp $ 4 | # 5 | # Copyright (C) 2006-2012 Florian Pose, Ingenieurgemeinschaft IgH 6 | # 7 | # This file is part of the IgH EtherCAT master userspace library. 8 | # 9 | # The IgH EtherCAT master userspace library is free software; you can 10 | # redistribute it and/or modify it under the terms of the GNU Lesser General 11 | # Public License as published by the Free Software Foundation; version 2.1 of 12 | # the License. 13 | # 14 | # The IgH EtherCAT master userspace library is distributed in the hope that 15 | # it will be useful, but WITHOUT ANY WARRANTY; without even the implied 16 | # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU Lesser General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU Lesser General Public License 20 | # along with the IgH EtherCAT master userspace library. If not, see 21 | # . 22 | # 23 | # --- 24 | # 25 | # The license mentioned above concerns the source code only. Using the 26 | # EtherCAT technology and brand is only permitted in compliance with the 27 | # industrial property and similar rights of Beckhoff Automation GmbH. 28 | # 29 | #------------------------------------------------------------------------------ 30 | 31 | lib_LTLIBRARIES = libethercat.la 32 | 33 | #------------------------------------------------------------------------------ 34 | 35 | libethercat_la_SOURCES = \ 36 | common.c \ 37 | domain.c \ 38 | master.c \ 39 | reg_request.c \ 40 | sdo_request.c \ 41 | slave_config.c \ 42 | voe_handler.c 43 | 44 | noinst_HEADERS = \ 45 | domain.h \ 46 | ioctl.h \ 47 | master.h \ 48 | reg_request.h \ 49 | sdo_request.h \ 50 | slave_config.h \ 51 | voe_handler.h 52 | 53 | libethercat_la_CFLAGS = -fno-strict-aliasing -Wall 54 | libethercat_la_LDFLAGS = -version-info 1:0:0 55 | 56 | #------------------------------------------------------------------------------ 57 | 58 | if ENABLE_RTDM 59 | 60 | lib_LTLIBRARIES += libethercat_rtdm.la 61 | 62 | libethercat_rtdm_la_SOURCES = $(libethercat_la_SOURCES) 63 | libethercat_rtdm_la_CFLAGS = $(libethercat_la_CFLAGS) -DUSE_RTDM 64 | libethercat_rtdm_la_LDFLAGS = $(libethercat_la_LDFLAGS) 65 | 66 | if ENABLE_XENOMAI 67 | libethercat_rtdm_la_CFLAGS += $(XENOMAI_RTDM_CFLAGS) 68 | libethercat_rtdm_la_LDFLAGS += $(XENOMAI_RTDM_LDFLAGS) 69 | endif 70 | 71 | if ENABLE_RTAI 72 | libethercat_rtdm_la_CFLAGS += $(RTAI_LXRT_CFLAGS) 73 | libethercat_rtdm_la_LDFLAGS += $(RTAI_LXRT_LDFLAGS) 74 | endif 75 | 76 | endif 77 | 78 | #------------------------------------------------------------------------------ 79 | -------------------------------------------------------------------------------- /lib/domain.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: domain.h,v bc2d4bf9cbe5 2012/09/06 18:22:24 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT master userspace library. 8 | * 9 | * The IgH EtherCAT master userspace library is free software; you can 10 | * redistribute it and/or modify it under the terms of the GNU Lesser General 11 | * Public License as published by the Free Software Foundation; version 2.1 12 | * of the License. 13 | * 14 | * The IgH EtherCAT master userspace library is distributed in the hope that 15 | * it will be useful, but WITHOUT ANY WARRANTY; without even the implied 16 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with the IgH EtherCAT master userspace library. If not, see 21 | * . 22 | * 23 | * --- 24 | * 25 | * The license mentioned above concerns the source code only. Using the 26 | * EtherCAT technology and brand is only permitted in compliance with the 27 | * industrial property and similar rights of Beckhoff Automation GmbH. 28 | * 29 | *****************************************************************************/ 30 | 31 | #include "include/ecrt.h" 32 | 33 | /*****************************************************************************/ 34 | 35 | struct ec_domain { 36 | ec_domain_t *next; 37 | unsigned int index; 38 | ec_master_t *master; 39 | uint8_t *process_data; 40 | }; 41 | 42 | /*****************************************************************************/ 43 | 44 | void ec_domain_clear(ec_domain_t *); 45 | 46 | /*****************************************************************************/ 47 | -------------------------------------------------------------------------------- /lib/ioctl.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: common.c,v 572948e8b2ed 2012/07/09 08:29:15 fp $ 4 | * 5 | * Copyright (C) 2006-2012 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT master userspace library. 8 | * 9 | * The IgH EtherCAT master userspace library is free software; you can 10 | * redistribute it and/or modify it under the terms of the GNU Lesser General 11 | * Public License as published by the Free Software Foundation; version 2.1 12 | * of the License. 13 | * 14 | * The IgH EtherCAT master userspace library is distributed in the hope that 15 | * it will be useful, but WITHOUT ANY WARRANTY; without even the implied 16 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with the IgH EtherCAT master userspace library. If not, see 21 | * . 22 | * 23 | * --- 24 | * 25 | * The license mentioned above concerns the source code only. Using the 26 | * EtherCAT technology and brand is only permitted in compliance with the 27 | * industrial property and similar rights of Beckhoff Automation GmbH. 28 | * 29 | *****************************************************************************/ 30 | 31 | #ifndef __EC_LIB_IOCTL_H__ 32 | #define __EC_LIB_IOCTL_H__ 33 | 34 | /*****************************************************************************/ 35 | 36 | #ifdef USE_RTDM 37 | #include 38 | #else 39 | #include 40 | #endif 41 | 42 | /*****************************************************************************/ 43 | 44 | #include "master/ioctl.h" 45 | 46 | /*****************************************************************************/ 47 | 48 | #ifdef USE_RTDM 49 | 50 | #define ioctl rt_dev_ioctl 51 | 52 | /* rt_dev_ioctl() returns negative error code */ 53 | #define EC_IOCTL_IS_ERROR(X) ((X) < 0) 54 | #define EC_IOCTL_ERRNO(X) (-(X)) 55 | 56 | #else 57 | 58 | #define ioctl ioctl 59 | 60 | /* libc's ioctl() always returns -1 on error and sets errno */ 61 | #define EC_IOCTL_IS_ERROR(X) ((X) == -1) 62 | #define EC_IOCTL_ERRNO(X) (errno) 63 | 64 | #include 65 | 66 | #endif 67 | 68 | /*****************************************************************************/ 69 | 70 | #endif /* __EC_LIB_IOCTL_H__ */ 71 | 72 | /*****************************************************************************/ 73 | 74 | -------------------------------------------------------------------------------- /lib/master.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: master.h,v bc2d4bf9cbe5 2012/09/06 18:22:24 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT master userspace library. 8 | * 9 | * The IgH EtherCAT master userspace library is free software; you can 10 | * redistribute it and/or modify it under the terms of the GNU Lesser General 11 | * Public License as published by the Free Software Foundation; version 2.1 12 | * of the License. 13 | * 14 | * The IgH EtherCAT master userspace library is distributed in the hope that 15 | * it will be useful, but WITHOUT ANY WARRANTY; without even the implied 16 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with the IgH EtherCAT master userspace library. If not, see 21 | * . 22 | * 23 | * --- 24 | * 25 | * The license mentioned above concerns the source code only. Using the 26 | * EtherCAT technology and brand is only permitted in compliance with the 27 | * industrial property and similar rights of Beckhoff Automation GmbH. 28 | * 29 | *****************************************************************************/ 30 | 31 | #include "include/ecrt.h" 32 | 33 | /*****************************************************************************/ 34 | 35 | struct ec_master { 36 | int fd; 37 | uint8_t *process_data; 38 | size_t process_data_size; 39 | 40 | ec_domain_t *first_domain; 41 | ec_slave_config_t *first_config; 42 | }; 43 | 44 | /*****************************************************************************/ 45 | 46 | void ec_master_clear(ec_master_t *); 47 | 48 | /*****************************************************************************/ 49 | -------------------------------------------------------------------------------- /lib/reg_request.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: reg_request.h,v 2c3ccdde3919 2012/11/14 21:12:57 fp $ 4 | * 5 | * Copyright (C) 2012 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT master userspace library. 8 | * 9 | * The IgH EtherCAT master userspace library is free software; you can 10 | * redistribute it and/or modify it under the terms of the GNU Lesser General 11 | * Public License as published by the Free Software Foundation; version 2.1 12 | * of the License. 13 | * 14 | * The IgH EtherCAT master userspace library is distributed in the hope that 15 | * it will be useful, but WITHOUT ANY WARRANTY; without even the implied 16 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with the IgH EtherCAT master userspace library. If not, see 21 | * . 22 | * 23 | * --- 24 | * 25 | * The license mentioned above concerns the source code only. Using the 26 | * EtherCAT technology and brand is only permitted in compliance with the 27 | * industrial property and similar rights of Beckhoff Automation GmbH. 28 | * 29 | *****************************************************************************/ 30 | 31 | #include "include/ecrt.h" 32 | 33 | /*****************************************************************************/ 34 | 35 | struct ec_reg_request { 36 | ec_reg_request_t *next; /**< List header. */ 37 | ec_slave_config_t *config; /**< Parent slave configuration. */ 38 | unsigned int index; /**< Request index (identifier). */ 39 | uint8_t *data; /**< Data memory. */ 40 | size_t mem_size; /**< Size of \a data. */ 41 | }; 42 | 43 | /*****************************************************************************/ 44 | 45 | void ec_reg_request_clear(ec_reg_request_t *); 46 | 47 | /*****************************************************************************/ 48 | -------------------------------------------------------------------------------- /lib/sdo_request.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: sdo_request.h,v bc2d4bf9cbe5 2012/09/06 18:22:24 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT master userspace library. 8 | * 9 | * The IgH EtherCAT master userspace library is free software; you can 10 | * redistribute it and/or modify it under the terms of the GNU Lesser General 11 | * Public License as published by the Free Software Foundation; version 2.1 12 | * of the License. 13 | * 14 | * The IgH EtherCAT master userspace library is distributed in the hope that 15 | * it will be useful, but WITHOUT ANY WARRANTY; without even the implied 16 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with the IgH EtherCAT master userspace library. If not, see 21 | * . 22 | * 23 | * --- 24 | * 25 | * The license mentioned above concerns the source code only. Using the 26 | * EtherCAT technology and brand is only permitted in compliance with the 27 | * industrial property and similar rights of Beckhoff Automation GmbH. 28 | * 29 | *****************************************************************************/ 30 | 31 | #include "include/ecrt.h" 32 | 33 | /*****************************************************************************/ 34 | 35 | struct ec_sdo_request { 36 | ec_sdo_request_t *next; /**< List header. */ 37 | ec_slave_config_t *config; /**< Parent slave configuration. */ 38 | unsigned int index; /**< Request index (identifier). */ 39 | uint16_t sdo_index; /**< SDO index. */ 40 | uint8_t sdo_subindex; /**< SDO subindex. */ 41 | uint8_t *data; /**< Pointer to SDO data. */ 42 | size_t mem_size; /**< Size of SDO data memory. */ 43 | size_t data_size; /**< Size of SDO data. */ 44 | }; 45 | 46 | /*****************************************************************************/ 47 | 48 | void ec_sdo_request_clear(ec_sdo_request_t *); 49 | 50 | /*****************************************************************************/ 51 | -------------------------------------------------------------------------------- /lib/slave_config.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: slave_config.h,v 2c3ccdde3919 2012/11/14 21:12:57 fp $ 4 | * 5 | * Copyright (C) 2006-2012 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT master userspace library. 8 | * 9 | * The IgH EtherCAT master userspace library is free software; you can 10 | * redistribute it and/or modify it under the terms of the GNU Lesser General 11 | * Public License as published by the Free Software Foundation; version 2.1 12 | * of the License. 13 | * 14 | * The IgH EtherCAT master userspace library is distributed in the hope that 15 | * it will be useful, but WITHOUT ANY WARRANTY; without even the implied 16 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with the IgH EtherCAT master userspace library. If not, see 21 | * . 22 | * 23 | * --- 24 | * 25 | * The license mentioned above concerns the source code only. Using the 26 | * EtherCAT technology and brand is only permitted in compliance with the 27 | * industrial property and similar rights of Beckhoff Automation GmbH. 28 | * 29 | *****************************************************************************/ 30 | 31 | #include "include/ecrt.h" 32 | 33 | /*****************************************************************************/ 34 | 35 | struct ec_slave_config { 36 | ec_slave_config_t *next; 37 | ec_master_t *master; 38 | unsigned int index; 39 | uint16_t alias; 40 | uint16_t position; 41 | ec_sdo_request_t *first_sdo_request; 42 | ec_reg_request_t *first_reg_request; 43 | ec_voe_handler_t *first_voe_handler; 44 | }; 45 | 46 | /*****************************************************************************/ 47 | 48 | void ec_slave_config_clear(ec_slave_config_t *); 49 | 50 | /*****************************************************************************/ 51 | -------------------------------------------------------------------------------- /lib/voe_handler.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: voe_handler.h,v bc2d4bf9cbe5 2012/09/06 18:22:24 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT master userspace library. 8 | * 9 | * The IgH EtherCAT master userspace library is free software; you can 10 | * redistribute it and/or modify it under the terms of the GNU Lesser General 11 | * Public License as published by the Free Software Foundation; version 2.1 12 | * of the License. 13 | * 14 | * The IgH EtherCAT master userspace library is distributed in the hope that 15 | * it will be useful, but WITHOUT ANY WARRANTY; without even the implied 16 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with the IgH EtherCAT master userspace library. If not, see 21 | * . 22 | * 23 | * --- 24 | * 25 | * The license mentioned above concerns the source code only. Using the 26 | * EtherCAT technology and brand is only permitted in compliance with the 27 | * industrial property and similar rights of Beckhoff Automation GmbH. 28 | * 29 | *****************************************************************************/ 30 | 31 | #include "include/ecrt.h" 32 | 33 | /*****************************************************************************/ 34 | 35 | struct ec_voe_handler { 36 | ec_voe_handler_t *next; 37 | ec_slave_config_t *config; 38 | unsigned int index; 39 | size_t data_size; 40 | size_t mem_size; 41 | uint8_t *data; 42 | }; 43 | 44 | /*****************************************************************************/ 45 | 46 | void ec_voe_handler_clear(ec_voe_handler_t *); 47 | 48 | /*****************************************************************************/ 49 | -------------------------------------------------------------------------------- /m4/Makefile.am: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # $Id: Makefile.am,v bc2d4bf9cbe5 2012/09/06 18:22:24 fp $ 4 | # 5 | # Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | # 7 | # This file is part of the IgH EtherCAT Master. 8 | # 9 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License version 2, as 11 | # published by the Free Software Foundation. 12 | # 13 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | # Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License along 19 | # with the IgH EtherCAT Master; if not, write to the Free Software 20 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | # 22 | # --- 23 | # 24 | # The license mentioned above concerns the source code only. Using the 25 | # EtherCAT technology and brand is only permitted in compliance with the 26 | # industrial property and similar rights of Beckhoff Automation GmbH. 27 | # 28 | #------------------------------------------------------------------------------ 29 | 30 | 31 | 32 | #------------------------------------------------------------------------------ 33 | -------------------------------------------------------------------------------- /m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # @configure_input@ 11 | 12 | # serial 3293 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.4]) 16 | m4_define([LT_PACKAGE_REVISION], [1.3293]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.4' 20 | macro_revision='1.3293' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /master/Kbuild.in: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # $Id$ 4 | # 5 | # Copyright (C) 2006-2012 Florian Pose, Ingenieurgemeinschaft IgH 6 | # 7 | # This file is part of the IgH EtherCAT Master. 8 | # 9 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License version 2, as 11 | # published by the Free Software Foundation. 12 | # 13 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | # Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License along 19 | # with the IgH EtherCAT Master; if not, write to the Free Software 20 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | # 22 | # --- 23 | # 24 | # The license mentioned above concerns the source code only. Using the EtherCAT 25 | # technology and brand is only permitted in compliance with the industrial 26 | # property and similar rights of Beckhoff Automation GmbH. 27 | # 28 | # --- 29 | # 30 | # vi: syntax=make 31 | # 32 | #------------------------------------------------------------------------------ 33 | 34 | obj-m := ec_master.o 35 | 36 | ec_master-objs := \ 37 | cdev.o \ 38 | coe_emerg_ring.o \ 39 | datagram.o \ 40 | datagram_pair.o \ 41 | device.o \ 42 | domain.o \ 43 | fmmu_config.o \ 44 | foe_request.o \ 45 | fsm_change.o \ 46 | fsm_coe.o \ 47 | fsm_foe.o \ 48 | fsm_master.o \ 49 | fsm_pdo.o \ 50 | fsm_pdo_entry.o \ 51 | fsm_sii.o \ 52 | fsm_slave.o \ 53 | fsm_slave_config.o \ 54 | fsm_slave_scan.o \ 55 | fsm_soe.o \ 56 | ioctl.o \ 57 | mailbox.o \ 58 | master.o \ 59 | module.o \ 60 | pdo.o \ 61 | pdo_entry.o \ 62 | pdo_list.o \ 63 | reg_request.o \ 64 | sdo.o \ 65 | sdo_entry.o \ 66 | sdo_request.o \ 67 | slave.o \ 68 | slave_config.o \ 69 | soe_errors.o \ 70 | soe_request.o \ 71 | sync.o \ 72 | sync_config.o \ 73 | voe_handler.o 74 | 75 | ifeq (@ENABLE_EOE@,1) 76 | ec_master-objs += ethernet.o 77 | endif 78 | 79 | ifeq (@ENABLE_DEBUG_IF@,1) 80 | ec_master-objs += debug.o 81 | endif 82 | 83 | ifeq (@ENABLE_RTDM@,1) 84 | 85 | ec_master-objs += rtdm.o 86 | 87 | ifeq (@ENABLE_XENOMAI@, 1) 88 | CFLAGS_rtdm.o := -I@XENOMAI_DIR@/include 89 | endif 90 | 91 | ifeq (@ENABLE_RTAI@, 1) 92 | CFLAGS_rtdm.o := -I@RTAI_DIR@/include 93 | endif 94 | 95 | ec_master-objs += rtdm-ioctl.o 96 | CFLAGS_rtdm-ioctl.o := -DEC_IOCTL_RTDM 97 | 98 | endif # ENABLE_RTDM 99 | 100 | REV := $(shell if test -s $(src)/../revision; then \ 101 | cat $(src)/../revision; \ 102 | else \ 103 | hg id -i $(src)/.. 2>/dev/null || echo "unknown"; \ 104 | fi) 105 | 106 | CFLAGS_module.o := -DREV=$(REV) 107 | 108 | #------------------------------------------------------------------------------ 109 | -------------------------------------------------------------------------------- /master/cdev.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: cdev.h,v 11c0b2caa253 2009/02/24 12:51:39 fp $ 4 | * 5 | * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | *****************************************************************************/ 29 | 30 | /** 31 | \file 32 | EtherCAT master character device. 33 | */ 34 | 35 | /*****************************************************************************/ 36 | 37 | #ifndef __EC_CDEV_H__ 38 | #define __EC_CDEV_H__ 39 | 40 | #include 41 | #include 42 | 43 | #include "globals.h" 44 | 45 | /*****************************************************************************/ 46 | 47 | /** EtherCAT master character device. 48 | */ 49 | typedef struct { 50 | ec_master_t *master; /**< Master owning the device. */ 51 | struct cdev cdev; /**< Character device. */ 52 | } ec_cdev_t; 53 | 54 | /*****************************************************************************/ 55 | 56 | int ec_cdev_init(ec_cdev_t *, ec_master_t *, dev_t); 57 | void ec_cdev_clear(ec_cdev_t *); 58 | 59 | /*****************************************************************************/ 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /master/datagram_pair.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: datagram_pair.h,v ec403cf308eb 2013/02/12 14:46:43 fp $ 4 | * 5 | * Copyright (C) 2006-2012 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | *****************************************************************************/ 29 | 30 | /** 31 | \file 32 | EtherCAT datagram pair structure. 33 | */ 34 | 35 | /*****************************************************************************/ 36 | 37 | #ifndef __EC_DATAGRAM_PAIR_H__ 38 | #define __EC_DATAGRAM_PAIR_H__ 39 | 40 | #include 41 | 42 | #include "globals.h" 43 | #include "datagram.h" 44 | 45 | /*****************************************************************************/ 46 | 47 | /** Domain datagram pair. 48 | */ 49 | typedef struct { 50 | struct list_head list; /**< List header. */ 51 | ec_domain_t *domain; /**< Parent domain. */ 52 | ec_datagram_t datagrams[EC_MAX_NUM_DEVICES]; /**< Datagrams. */ 53 | #if EC_MAX_NUM_DEVICES > 1 54 | uint8_t *send_buffer; 55 | #endif 56 | unsigned int expected_working_counter; /**< Expectord working conter. */ 57 | } ec_datagram_pair_t; 58 | 59 | /*****************************************************************************/ 60 | 61 | int ec_datagram_pair_init(ec_datagram_pair_t *, ec_domain_t *, uint32_t, 62 | uint8_t *, size_t, const unsigned int []); 63 | void ec_datagram_pair_clear(ec_datagram_pair_t *); 64 | 65 | uint16_t ec_datagram_pair_process(ec_datagram_pair_t *, uint16_t[]); 66 | 67 | /*****************************************************************************/ 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /master/debug.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: debug.h,v d9cf40facbc4 2010/05/03 16:07:57 fp $ 4 | * 5 | * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | *****************************************************************************/ 29 | 30 | /** 31 | \file 32 | Network interface for debugging purposes. 33 | */ 34 | 35 | /*****************************************************************************/ 36 | 37 | #ifndef __EC_DEBUG_H__ 38 | #define __EC_DEBUG_H__ 39 | 40 | #include "../devices/ecdev.h" 41 | 42 | /*****************************************************************************/ 43 | 44 | /** Debugging network interface. 45 | */ 46 | typedef struct 47 | { 48 | ec_device_t *device; /**< Parent device. */ 49 | struct net_device *dev; /**< net_device for virtual ethernet device */ 50 | struct net_device_stats stats; /**< device statistics */ 51 | uint8_t registered; /**< net_device is opened */ 52 | uint8_t opened; /**< net_device is opened */ 53 | } 54 | ec_debug_t; 55 | 56 | /*****************************************************************************/ 57 | 58 | int ec_debug_init(ec_debug_t *, ec_device_t *, const char *); 59 | void ec_debug_clear(ec_debug_t *); 60 | void ec_debug_register(ec_debug_t *, const struct net_device *); 61 | void ec_debug_unregister(ec_debug_t *); 62 | void ec_debug_send(ec_debug_t *, const uint8_t *, size_t); 63 | 64 | #endif 65 | 66 | /*****************************************************************************/ 67 | -------------------------------------------------------------------------------- /master/fmmu_config.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: fmmu_config.h,v 11c0b2caa253 2009/02/24 12:51:39 fp $ 4 | * 5 | * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | *****************************************************************************/ 29 | 30 | /** \file 31 | * EtherCAT FMMU configuration structure. 32 | */ 33 | 34 | /*****************************************************************************/ 35 | 36 | #ifndef __EC_FMMU_CONFIG_H__ 37 | #define __EC_FMMU_CONFIG_H__ 38 | 39 | #include "globals.h" 40 | #include "sync.h" 41 | 42 | /*****************************************************************************/ 43 | 44 | /** FMMU configuration. 45 | */ 46 | typedef struct { 47 | struct list_head list; /**< List node used by domain. */ 48 | const ec_slave_config_t *sc; /**< EtherCAT slave config. */ 49 | const ec_domain_t *domain; /**< Domain. */ 50 | uint8_t sync_index; /**< Index of sync manager to use. */ 51 | ec_direction_t dir; /**< FMMU direction. */ 52 | uint32_t logical_start_address; /**< Logical start address. */ 53 | unsigned int data_size; /**< Covered PDO size. */ 54 | } ec_fmmu_config_t; 55 | 56 | /*****************************************************************************/ 57 | 58 | void ec_fmmu_config_init(ec_fmmu_config_t *, ec_slave_config_t *, 59 | ec_domain_t *, uint8_t, ec_direction_t); 60 | 61 | void ec_fmmu_config_page(const ec_fmmu_config_t *, const ec_sync_t *, 62 | uint8_t *); 63 | 64 | /*****************************************************************************/ 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /master/foe.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: foe.h,v 6d9865c37b6f 2013/02/12 16:15:09 fp $ 4 | * 5 | * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | *****************************************************************************/ 29 | 30 | /** \file 31 | * FoE defines. 32 | */ 33 | 34 | #ifndef __FOE_H__ 35 | #define __FOE_H__ 36 | 37 | /*****************************************************************************/ 38 | 39 | /** FoE error enumeration type. 40 | */ 41 | typedef enum { 42 | FOE_BUSY = 0, /**< Busy. */ 43 | FOE_READY = 1, /**< Ready. */ 44 | FOE_IDLE = 2, /**< Idle. */ 45 | FOE_WC_ERROR = 3, /**< Working counter error. */ 46 | FOE_RECEIVE_ERROR = 4, /**< Receive error. */ 47 | FOE_PROT_ERROR = 5, /**< Protocol error. */ 48 | FOE_NODATA_ERROR = 6, /**< No data error. */ 49 | FOE_PACKETNO_ERROR = 7, /**< Packet number error. */ 50 | FOE_OPCODE_ERROR = 8, /**< OpCode error. */ 51 | FOE_TIMEOUT_ERROR = 9, /**< Timeout error. */ 52 | FOE_SEND_RX_DATA_ERROR = 10, /**< Error sending received data. */ 53 | FOE_RX_DATA_ACK_ERROR = 11, /**< Error acknowledging received data. */ 54 | FOE_ACK_ERROR = 12, /**< Acknowledge error. */ 55 | FOE_MBOX_FETCH_ERROR = 13, /**< Error fetching data from mailbox. */ 56 | FOE_READ_NODATA_ERROR = 14, /**< No data while reading. */ 57 | FOE_MBOX_PROT_ERROR = 15, /**< Mailbox protocol error. */ 58 | } ec_foe_error_t; 59 | 60 | /*****************************************************************************/ 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /master/fsm_soe.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: fsm_soe.h,v 9cdd7669dc0b 2013/01/10 16:36:41 fp $ 4 | * 5 | * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | *****************************************************************************/ 29 | 30 | /** 31 | \file 32 | EtherCAT CoE state machines. 33 | */ 34 | 35 | /*****************************************************************************/ 36 | 37 | #ifndef __EC_FSM_SOE_H__ 38 | #define __EC_FSM_SOE_H__ 39 | 40 | #include "globals.h" 41 | #include "datagram.h" 42 | #include "slave.h" 43 | #include "soe_request.h" 44 | 45 | /*****************************************************************************/ 46 | 47 | typedef struct ec_fsm_soe ec_fsm_soe_t; /**< \see ec_fsm_soe */ 48 | 49 | /** Finite state machines for the Sercos over EtherCAT protocol. 50 | */ 51 | struct ec_fsm_soe { 52 | ec_slave_t *slave; /**< slave the FSM runs on */ 53 | unsigned int retries; /**< retries upon datagram timeout */ 54 | 55 | void (*state)(ec_fsm_soe_t *, ec_datagram_t *); /**< CoE state function */ 56 | ec_datagram_t *datagram; /**< Datagram used in the previous step. */ 57 | unsigned long jiffies_start; /**< Timestamp. */ 58 | ec_soe_request_t *request; /**< SoE request */ 59 | off_t offset; /**< IDN data offset during fragmented write. */ 60 | size_t fragment_size; /**< Size of the current fragment. */ 61 | }; 62 | 63 | /*****************************************************************************/ 64 | 65 | void ec_fsm_soe_init(ec_fsm_soe_t *); 66 | void ec_fsm_soe_clear(ec_fsm_soe_t *); 67 | 68 | void ec_fsm_soe_transfer(ec_fsm_soe_t *, ec_slave_t *, ec_soe_request_t *); 69 | 70 | int ec_fsm_soe_exec(ec_fsm_soe_t *, ec_datagram_t *); 71 | int ec_fsm_soe_success(const ec_fsm_soe_t *); 72 | 73 | /*****************************************************************************/ 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /master/mailbox.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: mailbox.h,v c0b4c64fcebd 2012/12/07 18:51:55 fp $ 4 | * 5 | * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | *****************************************************************************/ 29 | 30 | /** 31 | \file 32 | Mailbox functionality. 33 | */ 34 | 35 | /*****************************************************************************/ 36 | 37 | #ifndef __EC_MAILBOX_H__ 38 | #define __EC_MAILBOX_H__ 39 | 40 | #include "slave.h" 41 | 42 | /*****************************************************************************/ 43 | 44 | /** Size of the mailbox header. 45 | */ 46 | #define EC_MBOX_HEADER_SIZE 6 47 | 48 | /*****************************************************************************/ 49 | 50 | uint8_t *ec_slave_mbox_prepare_send(const ec_slave_t *, ec_datagram_t *, 51 | uint8_t, size_t); 52 | int ec_slave_mbox_prepare_check(const ec_slave_t *, ec_datagram_t *); 53 | int ec_slave_mbox_check(const ec_datagram_t *); 54 | int ec_slave_mbox_prepare_fetch(const ec_slave_t *, ec_datagram_t *); 55 | uint8_t *ec_slave_mbox_fetch(const ec_slave_t *, const ec_datagram_t *, 56 | uint8_t *, size_t *); 57 | 58 | /*****************************************************************************/ 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /master/pdo.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: pdo.h,v 2bf892fe8080 2010/02/23 14:49:12 fp $ 4 | * 5 | * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | *****************************************************************************/ 29 | 30 | /** 31 | \file 32 | EtherCAT Process data object structure. 33 | */ 34 | 35 | /*****************************************************************************/ 36 | 37 | #ifndef __EC_PDO_H__ 38 | #define __EC_PDO_H__ 39 | 40 | #include 41 | 42 | #include "globals.h" 43 | #include "pdo_entry.h" 44 | 45 | /*****************************************************************************/ 46 | 47 | /** PDO description. 48 | */ 49 | typedef struct { 50 | struct list_head list; /**< List item. */ 51 | uint16_t index; /**< PDO index. */ 52 | int8_t sync_index; /**< Assigned sync manager. \todo remove? */ 53 | char *name; /**< PDO name. */ 54 | struct list_head entries; /**< List of PDO entries. */ 55 | } ec_pdo_t; 56 | 57 | /*****************************************************************************/ 58 | 59 | void ec_pdo_init(ec_pdo_t *); 60 | int ec_pdo_init_copy(ec_pdo_t *, const ec_pdo_t *); 61 | void ec_pdo_clear(ec_pdo_t *); 62 | void ec_pdo_clear_entries(ec_pdo_t *); 63 | int ec_pdo_set_name(ec_pdo_t *, const char *); 64 | ec_pdo_entry_t *ec_pdo_add_entry(ec_pdo_t *, uint16_t, uint8_t, uint8_t); 65 | int ec_pdo_copy_entries(ec_pdo_t *, const ec_pdo_t *); 66 | int ec_pdo_equal_entries(const ec_pdo_t *, const ec_pdo_t *); 67 | unsigned int ec_pdo_entry_count(const ec_pdo_t *); 68 | const ec_pdo_entry_t *ec_pdo_find_entry_by_pos_const( 69 | const ec_pdo_t *, unsigned int); 70 | 71 | void ec_pdo_print_entries(const ec_pdo_t *); 72 | 73 | /*****************************************************************************/ 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /master/pdo_entry.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: pdo_entry.h,v 11c0b2caa253 2009/02/24 12:51:39 fp $ 4 | * 5 | * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | *****************************************************************************/ 29 | 30 | /** 31 | \file 32 | EtherCAT Process data object structure. 33 | */ 34 | 35 | /*****************************************************************************/ 36 | 37 | #ifndef __EC_PDO_ENTRY_H__ 38 | #define __EC_PDO_ENTRY_H__ 39 | 40 | #include 41 | 42 | #include "globals.h" 43 | 44 | /*****************************************************************************/ 45 | 46 | /** PDO entry description. 47 | */ 48 | typedef struct { 49 | struct list_head list; /**< list item */ 50 | uint16_t index; /**< PDO entry index */ 51 | uint8_t subindex; /**< PDO entry subindex */ 52 | char *name; /**< entry name */ 53 | uint8_t bit_length; /**< entry length in bit */ 54 | } ec_pdo_entry_t; 55 | 56 | /*****************************************************************************/ 57 | 58 | void ec_pdo_entry_init(ec_pdo_entry_t *); 59 | int ec_pdo_entry_init_copy(ec_pdo_entry_t *, const ec_pdo_entry_t *); 60 | void ec_pdo_entry_clear(ec_pdo_entry_t *); 61 | int ec_pdo_entry_set_name(ec_pdo_entry_t *, const char *); 62 | int ec_pdo_entry_equal(const ec_pdo_entry_t *, const ec_pdo_entry_t *); 63 | 64 | /*****************************************************************************/ 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /master/pdo_list.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: pdo_list.h,v 11c0b2caa253 2009/02/24 12:51:39 fp $ 4 | * 5 | * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | *****************************************************************************/ 29 | 30 | /** 31 | \file 32 | EtherCAT PDO list structure. 33 | */ 34 | 35 | /*****************************************************************************/ 36 | 37 | #ifndef __EC_PDO_LIST_H__ 38 | #define __EC_PDO_LIST_H__ 39 | 40 | #include 41 | 42 | #include "globals.h" 43 | #include "pdo.h" 44 | 45 | /*****************************************************************************/ 46 | 47 | /** EtherCAT PDO list. 48 | */ 49 | typedef struct { 50 | struct list_head list; /**< List of PDOs. */ 51 | } ec_pdo_list_t; 52 | 53 | /*****************************************************************************/ 54 | 55 | void ec_pdo_list_init(ec_pdo_list_t *); 56 | void ec_pdo_list_clear(ec_pdo_list_t *); 57 | 58 | void ec_pdo_list_clear_pdos(ec_pdo_list_t *); 59 | 60 | ec_pdo_t *ec_pdo_list_add_pdo(ec_pdo_list_t *, uint16_t); 61 | int ec_pdo_list_add_pdo_copy(ec_pdo_list_t *, const ec_pdo_t *); 62 | 63 | int ec_pdo_list_copy(ec_pdo_list_t *, const ec_pdo_list_t *); 64 | 65 | uint16_t ec_pdo_list_total_size(const ec_pdo_list_t *); 66 | int ec_pdo_list_equal(const ec_pdo_list_t *, const ec_pdo_list_t *); 67 | 68 | ec_pdo_t *ec_pdo_list_find_pdo(const ec_pdo_list_t *, uint16_t); 69 | const ec_pdo_t *ec_pdo_list_find_pdo_const(const ec_pdo_list_t *, 70 | uint16_t); 71 | const ec_pdo_t *ec_pdo_list_find_pdo_by_pos_const( 72 | const ec_pdo_list_t *, unsigned int); 73 | unsigned int ec_pdo_list_count(const ec_pdo_list_t *); 74 | 75 | void ec_pdo_list_print(const ec_pdo_list_t *); 76 | 77 | /*****************************************************************************/ 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /master/reg_request.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: reg_request.h,v ec403cf308eb 2013/02/12 14:46:43 fp $ 4 | * 5 | * Copyright (C) 2012 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | *****************************************************************************/ 29 | 30 | /** 31 | \file 32 | EtherCAT register request structure. 33 | */ 34 | 35 | /*****************************************************************************/ 36 | 37 | #ifndef __EC_REG_REQUEST_H__ 38 | #define __EC_REG_REQUEST_H__ 39 | 40 | #include 41 | 42 | #include "globals.h" 43 | 44 | /*****************************************************************************/ 45 | 46 | /** Register request. 47 | */ 48 | struct ec_reg_request { 49 | struct list_head list; /**< List item. */ 50 | size_t mem_size; /**< Size of data memory. */ 51 | uint8_t *data; /**< Pointer to data memory. */ 52 | ec_direction_t dir; /**< Direction. EC_DIR_OUTPUT means writing to the 53 | slave, EC_DIR_INPUT means reading from the slave. */ 54 | uint16_t address; /**< Register address. */ 55 | size_t transfer_size; /**< Size of the data to transfer. */ 56 | ec_internal_request_state_t state; /**< Request state. */ 57 | }; 58 | 59 | /*****************************************************************************/ 60 | 61 | int ec_reg_request_init(ec_reg_request_t *, size_t); 62 | void ec_reg_request_clear(ec_reg_request_t *); 63 | 64 | /*****************************************************************************/ 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /master/rtdm.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: rtdm.h,v 6d9865c37b6f 2013/02/12 16:15:09 fp $ 4 | * 5 | * Copyright (C) 2012 Florian Pose 6 | * 7 | * This file is part of the IgH EtherCAT master. 8 | * 9 | * The IgH EtherCAT master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License as published 11 | * by the Free Software Foundation; version 2 of the License. 12 | * 13 | * The IgH EtherCAT master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT master. If not, see . 20 | * 21 | * The license mentioned above concerns the source code only. Using the 22 | * EtherCAT technology and brand is only permitted in compliance with the 23 | * industrial property and similar rights of Beckhoff Automation GmbH. 24 | * 25 | ****************************************************************************/ 26 | 27 | /** \file 28 | * RTDM interface. 29 | */ 30 | 31 | #ifndef __EC_RTDM_H__ 32 | #define __EC_RTDM_H__ 33 | 34 | #include "../include/ecrt.h" /* ec_master_t */ 35 | 36 | /*****************************************************************************/ 37 | 38 | struct rtdm_device; 39 | 40 | /*****************************************************************************/ 41 | 42 | /** EtherCAT RTDM device. 43 | */ 44 | typedef struct ec_rtdm_dev { 45 | ec_master_t *master; /**< Master pointer. */ 46 | struct rtdm_device *dev; /**< RTDM device. */ 47 | } ec_rtdm_dev_t; 48 | 49 | /*****************************************************************************/ 50 | 51 | int ec_rtdm_dev_init(ec_rtdm_dev_t *, ec_master_t *); 52 | void ec_rtdm_dev_clear(ec_rtdm_dev_t *); 53 | 54 | /****************************************************************************/ 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /master/sdo.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: sdo.h,v 11c0b2caa253 2009/02/24 12:51:39 fp $ 4 | * 5 | * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | *****************************************************************************/ 29 | 30 | /** 31 | \file 32 | EtherCAT CANopen SDO structure. 33 | */ 34 | 35 | /*****************************************************************************/ 36 | 37 | #ifndef __EC_SDO_H__ 38 | #define __EC_SDO_H__ 39 | 40 | #include 41 | 42 | #include "globals.h" 43 | #include "sdo_entry.h" 44 | 45 | /*****************************************************************************/ 46 | 47 | /** CANopen SDO. 48 | */ 49 | struct ec_sdo { 50 | struct list_head list; /**< List item. */ 51 | ec_slave_t *slave; /**< Parent slave. */ 52 | uint16_t index; /**< SDO index. */ 53 | uint8_t object_code; /**< Object code. */ 54 | char *name; /**< SDO name. */ 55 | uint8_t max_subindex; /**< Maximum subindex. */ 56 | struct list_head entries; /**< List of entries. */ 57 | }; 58 | 59 | /*****************************************************************************/ 60 | 61 | void ec_sdo_init(ec_sdo_t *, ec_slave_t *, uint16_t); 62 | void ec_sdo_clear(ec_sdo_t *); 63 | 64 | ec_sdo_entry_t *ec_sdo_get_entry(ec_sdo_t *, uint8_t); 65 | const ec_sdo_entry_t *ec_sdo_get_entry_const(const ec_sdo_t *, uint8_t); 66 | 67 | /*****************************************************************************/ 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /master/sdo_entry.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: sdo_entry.c,v cb2188d111f3 2009/04/08 08:13:33 fp $ 4 | * 5 | * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | *****************************************************************************/ 29 | 30 | /** 31 | \file 32 | CANopen over EtherCAT SDO entry functions. 33 | */ 34 | 35 | /*****************************************************************************/ 36 | 37 | #include 38 | 39 | #include "sdo_entry.h" 40 | 41 | /*****************************************************************************/ 42 | 43 | /** Constructor. 44 | */ 45 | void ec_sdo_entry_init( 46 | ec_sdo_entry_t *entry, /**< SDO entry. */ 47 | ec_sdo_t *sdo, /**< Parent SDO. */ 48 | uint8_t subindex /**< Subindex. */ 49 | ) 50 | { 51 | entry->sdo = sdo; 52 | entry->subindex = subindex; 53 | entry->data_type = 0x0000; 54 | entry->bit_length = 0; 55 | entry->read_access[EC_SDO_ENTRY_ACCESS_PREOP] = 0; 56 | entry->read_access[EC_SDO_ENTRY_ACCESS_SAFEOP] = 0; 57 | entry->read_access[EC_SDO_ENTRY_ACCESS_OP] = 0; 58 | entry->write_access[EC_SDO_ENTRY_ACCESS_PREOP] = 0; 59 | entry->write_access[EC_SDO_ENTRY_ACCESS_SAFEOP] = 0; 60 | entry->write_access[EC_SDO_ENTRY_ACCESS_OP] = 0; 61 | entry->description = NULL; 62 | } 63 | 64 | /*****************************************************************************/ 65 | 66 | /** Destructor. 67 | */ 68 | void ec_sdo_entry_clear( 69 | ec_sdo_entry_t *entry /**< SDO entry. */ 70 | ) 71 | { 72 | 73 | if (entry->description) 74 | kfree(entry->description); 75 | } 76 | 77 | /*****************************************************************************/ 78 | -------------------------------------------------------------------------------- /master/sdo_entry.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: sdo_entry.h,v cb2188d111f3 2009/04/08 08:13:33 fp $ 4 | * 5 | * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | *****************************************************************************/ 29 | 30 | /** 31 | \file 32 | EtherCAT CANopen SDO entry structure. 33 | */ 34 | 35 | /*****************************************************************************/ 36 | 37 | #ifndef __EC_SDO_ENTRY_H__ 38 | #define __EC_SDO_ENTRY_H__ 39 | 40 | #include 41 | #include 42 | 43 | #include "globals.h" 44 | 45 | /*****************************************************************************/ 46 | 47 | struct ec_sdo; 48 | typedef struct ec_sdo ec_sdo_t; /**< \see ec_sdo. */ 49 | 50 | /*****************************************************************************/ 51 | 52 | /** CANopen SDO entry. 53 | */ 54 | typedef struct { 55 | struct list_head list; /**< List item. */ 56 | ec_sdo_t *sdo; /**< Parent SDO. */ 57 | uint8_t subindex; /**< Subindex. */ 58 | uint16_t data_type; /**< Data type. */ 59 | uint16_t bit_length; /**< Data size in bit. */ 60 | uint8_t read_access[EC_SDO_ENTRY_ACCESS_COUNT]; /**< Read access. */ 61 | uint8_t write_access[EC_SDO_ENTRY_ACCESS_COUNT]; /**< Write access. */ 62 | char *description; /**< Description. */ 63 | } ec_sdo_entry_t; 64 | 65 | /*****************************************************************************/ 66 | 67 | void ec_sdo_entry_init(ec_sdo_entry_t *, ec_sdo_t *, uint8_t); 68 | void ec_sdo_entry_clear(ec_sdo_entry_t *); 69 | 70 | /*****************************************************************************/ 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /master/sync.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: sync.h,v 4c335a1d4db0 2011/10/24 08:47:36 fp $ 4 | * 5 | * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | *****************************************************************************/ 29 | 30 | /** \file 31 | * EtherCAT sync manager. 32 | */ 33 | 34 | /*****************************************************************************/ 35 | 36 | #ifndef __EC_SYNC_H__ 37 | #define __EC_SYNC_H__ 38 | 39 | #include "globals.h" 40 | #include "pdo_list.h" 41 | #include "sync_config.h" 42 | 43 | /*****************************************************************************/ 44 | 45 | /** Sync manager. 46 | */ 47 | typedef struct { 48 | ec_slave_t *slave; /**< Slave, the sync manager belongs to. */ 49 | uint16_t physical_start_address; /**< Physical start address. */ 50 | uint16_t default_length; /**< Data length in bytes. */ 51 | uint8_t control_register; /**< Control register value. */ 52 | uint8_t enable; /**< Enable bit. */ 53 | ec_pdo_list_t pdos; /**< Current PDO assignment. */ 54 | } ec_sync_t; 55 | 56 | /*****************************************************************************/ 57 | 58 | void ec_sync_init(ec_sync_t *, ec_slave_t *); 59 | void ec_sync_init_copy(ec_sync_t *, const ec_sync_t *); 60 | void ec_sync_clear(ec_sync_t *); 61 | void ec_sync_page(const ec_sync_t *, uint8_t, uint16_t, 62 | const ec_sync_config_t *, uint8_t, uint8_t *); 63 | int ec_sync_add_pdo(ec_sync_t *, const ec_pdo_t *); 64 | ec_direction_t ec_sync_default_direction(const ec_sync_t *); 65 | 66 | /*****************************************************************************/ 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /master/sync_config.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: sync_config.c,v a864688e7de5 2009/07/27 10:48:52 fp $ 4 | * 5 | * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | *****************************************************************************/ 29 | 30 | /** \file 31 | * EtherCAT sync manager configuration methods. 32 | */ 33 | 34 | /*****************************************************************************/ 35 | 36 | #include "globals.h" 37 | #include "sync_config.h" 38 | 39 | /*****************************************************************************/ 40 | 41 | /** Constructor. 42 | */ 43 | void ec_sync_config_init( 44 | ec_sync_config_t *sync_config /**< Sync manager configuration. */ 45 | ) 46 | { 47 | sync_config->dir = EC_DIR_INVALID; 48 | sync_config->watchdog_mode = EC_WD_DEFAULT; 49 | ec_pdo_list_init(&sync_config->pdos); 50 | } 51 | 52 | /*****************************************************************************/ 53 | 54 | /** Destructor. 55 | */ 56 | void ec_sync_config_clear( 57 | ec_sync_config_t *sync_config /**< Sync manager configuration. */ 58 | ) 59 | { 60 | ec_pdo_list_clear(&sync_config->pdos); 61 | } 62 | 63 | /*****************************************************************************/ 64 | -------------------------------------------------------------------------------- /master/sync_config.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: sync_config.h,v a864688e7de5 2009/07/27 10:48:52 fp $ 4 | * 5 | * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | *****************************************************************************/ 29 | 30 | /** \file 31 | * EtherCAT sync manager. 32 | */ 33 | 34 | /*****************************************************************************/ 35 | 36 | #ifndef __EC_SYNC_CONFIG_H__ 37 | #define __EC_SYNC_CONFIG_H__ 38 | 39 | #include "globals.h" 40 | #include "pdo_list.h" 41 | 42 | /*****************************************************************************/ 43 | 44 | /** Sync manager configuration. 45 | */ 46 | typedef struct { 47 | ec_direction_t dir; /**< Sync manager direction. */ 48 | ec_watchdog_mode_t watchdog_mode; /**< Watchdog mode. */ 49 | ec_pdo_list_t pdos; /**< Current PDO assignment. */ 50 | } ec_sync_config_t; 51 | 52 | /*****************************************************************************/ 53 | 54 | void ec_sync_config_init(ec_sync_config_t *); 55 | void ec_sync_config_clear(ec_sync_config_t *); 56 | 57 | /*****************************************************************************/ 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /master/voe_handler.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: voe_handler.h,v 11c0b2caa253 2009/02/24 12:51:39 fp $ 4 | * 5 | * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | *****************************************************************************/ 29 | 30 | /** 31 | \file 32 | Vendor specific over EtherCAT protocol handler. 33 | */ 34 | 35 | /*****************************************************************************/ 36 | 37 | #ifndef __EC_VOE_HANDLER_H__ 38 | #define __EC_VOE_HANDLER_H__ 39 | 40 | #include 41 | 42 | #include "globals.h" 43 | #include "datagram.h" 44 | 45 | /*****************************************************************************/ 46 | 47 | /** Vendor specific over EtherCAT handler. 48 | */ 49 | struct ec_voe_handler { 50 | struct list_head list; /**< List item. */ 51 | ec_slave_config_t *config; /**< Parent slave configuration. */ 52 | ec_datagram_t datagram; /**< State machine datagram. */ 53 | uint32_t vendor_id; /**< Vendor ID for the header. */ 54 | uint16_t vendor_type; /**< Vendor type for the header. */ 55 | size_t data_size; /**< Size of VoE data. */ 56 | ec_direction_t dir; /**< Direction. EC_DIR_OUTPUT means writing to 57 | the slave, EC_DIR_INPUT means reading from the 58 | slave. */ 59 | void (*state)(ec_voe_handler_t *); /**< State function */ 60 | ec_internal_request_state_t request_state; /**< Handler state. */ 61 | unsigned int retries; /**< retries upon datagram timeout */ 62 | unsigned long jiffies_start; /**< Timestamp for timeout calculation. */ 63 | }; 64 | 65 | /*****************************************************************************/ 66 | 67 | int ec_voe_handler_init(ec_voe_handler_t *, ec_slave_config_t *, size_t); 68 | void ec_voe_handler_clear(ec_voe_handler_t *); 69 | size_t ec_voe_handler_mem_size(const ec_voe_handler_t *); 70 | 71 | /*****************************************************************************/ 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /revision: -------------------------------------------------------------------------------- 1 | 2eff7c993a63 2 | -------------------------------------------------------------------------------- /script/Makefile.am: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # Makefile.am 4 | # 5 | # IgH EtherCAT master 6 | # 7 | # $Id: Makefile.am,v 543ba57580af 2012/01/10 11:06:22 fp $ 8 | # 9 | # Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 10 | # 11 | # This file is part of the IgH EtherCAT Master. 12 | # 13 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 14 | # modify it under the terms of the GNU General Public License version 2, as 15 | # published by the Free Software Foundation. 16 | # 17 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 20 | # Public License for more details. 21 | # 22 | # You should have received a copy of the GNU General Public License along 23 | # with the IgH EtherCAT Master; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 25 | # 26 | # --- 27 | # 28 | # The license mentioned above concerns the source code only. Using the 29 | # EtherCAT technology and brand is only permitted in compliance with the 30 | # industrial property and similar rights of Beckhoff Automation GmbH. 31 | # 32 | #------------------------------------------------------------------------------ 33 | 34 | SUBDIRS = init.d sysconfig 35 | 36 | sbin_SCRIPTS = ethercatctl 37 | 38 | systemddir = $(libdir)/systemd/system 39 | systemd_DATA = ethercat.service 40 | 41 | dist_sysconf_DATA = ethercat.conf 42 | 43 | EXTRA_DIST = \ 44 | ethercatctl.in \ 45 | ethercat.service.in \ 46 | ifup-eoe.sh 47 | 48 | BUILT_SOURCES = \ 49 | ethercatctl \ 50 | ethercat.service 51 | 52 | #------------------------------------------------------------------------------ 53 | -------------------------------------------------------------------------------- /script/ethercat.conf: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # EtherCAT master configuration file for use with ethercatctl. 4 | # 5 | # $Id: ethercat.conf,v 71ebc81c6e43 2012/01/09 14:16:40 fp $ 6 | # 7 | #------------------------------------------------------------------------------ 8 | 9 | # 10 | # Master devices. 11 | # 12 | # The MASTER_DEVICE variable specifies the Ethernet device for a master 13 | # with index 'X'. 14 | # 15 | # Specify the MAC address (hexadecimal with colons) of the Ethernet device to 16 | # use. Example: "00:00:08:44:ab:66" 17 | # 18 | # The broadcast address "ff:ff:ff:ff:ff:ff" has a special meaning: It tells 19 | # the master to accept the first device offered by any Ethernet driver. 20 | # 21 | # The MASTER_DEVICE variables also determine, how many masters will be 22 | # created: A non-empty variable MASTER0_DEVICE will create one master, adding a 23 | # non-empty variable MASTER1_DEVICE will create a second master, and so on. 24 | # 25 | MASTER0_DEVICE="" 26 | #MASTER1_DEVICE="" 27 | 28 | # 29 | # Ethernet driver modules to use for EtherCAT operation. 30 | # 31 | # Specify a non-empty list of Ethernet drivers, that shall be used for EtherCAT 32 | # operation. 33 | # 34 | # Except for the generic Ethernet driver module, the init script will try to 35 | # unload the usual Ethernet driver modules in the list and replace them with 36 | # the EtherCAT-capable ones. If a certain (EtherCAT-capable) driver is not 37 | # found, a warning will appear. 38 | # 39 | # Possible values: 8139too, e100, e1000, e1000e, r8169, generic. Separate 40 | # multiple drivers with spaces. 41 | # 42 | # Note: The e100, e1000, e1000e and r8169 drivers are not built by default. 43 | # Enable them with the --enable- configure switches. 44 | # 45 | DEVICE_MODULES="" 46 | 47 | # 48 | # Flags for loading kernel modules. 49 | # 50 | # This can usually be left empty. Adjust this variable, if you have problems 51 | # with module loading. 52 | # 53 | #MODPROBE_FLAGS="-b" 54 | 55 | #------------------------------------------------------------------------------ 56 | -------------------------------------------------------------------------------- /script/ethercat.service.in: -------------------------------------------------------------------------------- 1 | # 2 | # EtherCAT Master Kernel Modules 3 | # 4 | 5 | [Unit] 6 | Description=EtherCAT Master Kernel Modules 7 | 8 | [Service] 9 | Type=oneshot 10 | RemainAfterExit=yes 11 | ExecStart=@prefix@/sbin/ethercatctl start 12 | ExecStop=@prefix@/sbin/ethercatctl stop 13 | 14 | [Install] 15 | WantedBy=multi-user.target 16 | -------------------------------------------------------------------------------- /script/ifup-eoe.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #------------------------------------------------------------------------------ 4 | # 5 | # $Id: ifup-eoe.sh,v bc2d4bf9cbe5 2012/09/06 18:22:24 fp $ 6 | # 7 | # Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 8 | # 9 | # This file is part of the IgH EtherCAT Master. 10 | # 11 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 12 | # modify it under the terms of the GNU General Public License version 2, as 13 | # published by the Free Software Foundation. 14 | # 15 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 18 | # Public License for more details. 19 | # 20 | # You should have received a copy of the GNU General Public License along 21 | # with the IgH EtherCAT Master; if not, write to the Free Software 22 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 23 | # 24 | # --- 25 | # 26 | # The license mentioned above concerns the source code only. Using the EtherCAT 27 | # technology and brand is only permitted in compliance with the industrial 28 | # property and similar rights of Beckhoff Automation GmbH. 29 | # 30 | # vim: expandtab 31 | # 32 | #------------------------------------------------------------------------------ 33 | 34 | # this ifup.d script adds special network interfaces to a network bridge 35 | 36 | CFGNAME=${1} 37 | IFNAME=${2} 38 | 39 | # customize here 40 | BRNAME="eoebr0" 41 | INTERFACES="" 42 | BRCTL="/sbin/brctl" 43 | LOGGER="logger -t ifup-eoe" 44 | 45 | # if the current interface in the list of interfaces to bridge? 46 | if ! echo ${INTERFACES} | grep -qw ${IFNAME}; then 47 | exit 0; 48 | fi 49 | 50 | # does the EoE bridge already exist? 51 | if ! ${BRCTL} show | grep -q "^${BRNAME}"; then 52 | ${LOGGER} Creating ${BRNAME} 53 | ${BRCTL} addbr ${BRNAME} # create it 54 | fi 55 | 56 | ${LOGGER} Adding ${IFNAME} to ${BRNAME} 57 | ip link set ${IFNAME} down 58 | ip addr flush dev ${IFNAME} 59 | ${BRCTL} addif ${BRNAME} ${IFNAME} 60 | ip link set ${IFNAME} up 61 | 62 | #------------------------------------------------------------------------------ 63 | -------------------------------------------------------------------------------- /script/init.d/Makefile.am: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # $Id: Makefile.am,v bc2d4bf9cbe5 2012/09/06 18:22:24 fp $ 4 | # 5 | # Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | # 7 | # This file is part of the IgH EtherCAT Master. 8 | # 9 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License version 2, as 11 | # published by the Free Software Foundation. 12 | # 13 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | # Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License along 19 | # with the IgH EtherCAT Master; if not, write to the Free Software 20 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | # 22 | # --- 23 | # 24 | # The license mentioned above concerns the source code only. Using the EtherCAT 25 | # technology and brand is only permitted in compliance with the industrial 26 | # property and similar rights of Beckhoff Automation GmbH. 27 | # 28 | #------------------------------------------------------------------------------ 29 | 30 | initdir = $(sysconfdir)/init.d 31 | 32 | init_SCRIPTS = ethercat 33 | 34 | EXTRA_DIST = ethercat.in 35 | 36 | BUILT_SOURCES = ethercat 37 | 38 | #------------------------------------------------------------------------------ 39 | -------------------------------------------------------------------------------- /script/sysconfig/Makefile.am: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # $Id: Makefile.am,v bc2d4bf9cbe5 2012/09/06 18:22:24 fp $ 4 | # 5 | # Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | # 7 | # This file is part of the IgH EtherCAT Master. 8 | # 9 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License version 2, as 11 | # published by the Free Software Foundation. 12 | # 13 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | # Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License along 19 | # with the IgH EtherCAT Master; if not, write to the Free Software 20 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | # 22 | # --- 23 | # 24 | # The license mentioned above concerns the source code only. Using the EtherCAT 25 | # technology and brand is only permitted in compliance with the industrial 26 | # property and similar rights of Beckhoff Automation GmbH. 27 | # 28 | #------------------------------------------------------------------------------ 29 | 30 | sysdir = $(sysconfdir)/sysconfig 31 | 32 | sys_DATA = ethercat 33 | 34 | EXTRA_DIST = ethercat 35 | 36 | #------------------------------------------------------------------------------ 37 | -------------------------------------------------------------------------------- /script/sysconfig/ethercat: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # EtherCAT master sysconfig file 4 | # 5 | # $Id$ 6 | # 7 | # vim: spelllang=en spell tw=78 8 | # 9 | #------------------------------------------------------------------------------ 10 | 11 | # 12 | # Main Ethernet devices. 13 | # 14 | # The MASTER_DEVICE variable specifies the Ethernet device for a master 15 | # with index 'X'. 16 | # 17 | # Specify the MAC address (hexadecimal with colons) of the Ethernet device to 18 | # use. Example: "00:00:08:44:ab:66" 19 | # 20 | # The broadcast address "ff:ff:ff:ff:ff:ff" has a special meaning: It tells 21 | # the master to accept the first device offered by any Ethernet driver. 22 | # 23 | # The MASTER_DEVICE variables also determine, how many masters will be 24 | # created: A non-empty variable MASTER0_DEVICE will create one master, adding a 25 | # non-empty variable MASTER1_DEVICE will create a second master, and so on. 26 | # 27 | MASTER0_DEVICE="" 28 | #MASTER1_DEVICE="" 29 | 30 | # 31 | # Backup Ethernet devices 32 | # 33 | # The MASTER_BACKUP variables specify the devices used for redundancy. They 34 | # behaves nearly the same as the MASTER_DEVICE variable, except that it 35 | # does not interpret the ff:ff:ff:ff:ff:ff address. 36 | # 37 | #MASTER0_BACKUP="" 38 | 39 | # 40 | # Ethernet driver modules to use for EtherCAT operation. 41 | # 42 | # Specify a non-empty list of Ethernet drivers, that shall be used for EtherCAT 43 | # operation. 44 | # 45 | # Except for the generic Ethernet driver module, the init script will try to 46 | # unload the usual Ethernet driver modules in the list and replace them with 47 | # the EtherCAT-capable ones. If a certain (EtherCAT-capable) driver is not 48 | # found, a warning will appear. 49 | # 50 | # Possible values: 8139too, e100, e1000, e1000e, r8169, generic. Separate 51 | # multiple drivers with spaces. 52 | # 53 | # Note: The e100, e1000, e1000e and r8169 drivers are not built by default. 54 | # Enable them with the --enable- configure switches. 55 | # 56 | DEVICE_MODULES="" 57 | 58 | # 59 | # Flags for loading kernel modules. 60 | # 61 | # This can usually be left empty. Adjust this variable, if you have problems 62 | # with module loading. 63 | # 64 | #MODPROBE_FLAGS="-b" 65 | 66 | #------------------------------------------------------------------------------ 67 | -------------------------------------------------------------------------------- /tool/CommandAlias.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandAlias.h,v 4f682084c643 2010/10/25 08:12:26 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDALIAS_H__ 31 | #define __COMMANDALIAS_H__ 32 | 33 | #include "Command.h" 34 | 35 | /****************************************************************************/ 36 | 37 | class CommandAlias: 38 | public Command 39 | { 40 | public: 41 | CommandAlias(); 42 | 43 | string helpString(const string &) const; 44 | void execute(const StringVector &); 45 | 46 | protected: 47 | void writeSlaveAlias(MasterDevice &, const ec_ioctl_slave_t &, 48 | uint16_t); 49 | }; 50 | 51 | /****************************************************************************/ 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /tool/CommandCStruct.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandCStruct.h,v 4f682084c643 2010/10/25 08:12:26 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDCSTRUCT_H__ 31 | #define __COMMANDCSTRUCT_H__ 32 | 33 | #include "Command.h" 34 | 35 | /****************************************************************************/ 36 | 37 | class CommandCStruct: 38 | public Command 39 | { 40 | public: 41 | CommandCStruct(); 42 | 43 | string helpString(const string &) const; 44 | void execute(const StringVector &); 45 | 46 | protected: 47 | void generateSlaveCStruct(MasterDevice &, const ec_ioctl_slave_t &); 48 | }; 49 | 50 | /****************************************************************************/ 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /tool/CommandConfig.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandConfig.h,v 4f682084c643 2010/10/25 08:12:26 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDCONFIG_H__ 31 | #define __COMMANDCONFIG_H__ 32 | 33 | #include 34 | using namespace std; 35 | 36 | #include "Command.h" 37 | #include "SoeCommand.h" 38 | 39 | /****************************************************************************/ 40 | 41 | class CommandConfig: 42 | public Command, 43 | public SoeCommand 44 | { 45 | public: 46 | CommandConfig(); 47 | 48 | string helpString(const string &) const; 49 | void execute(const StringVector &); 50 | 51 | protected: 52 | struct Info { 53 | string alias; 54 | string pos; 55 | string ident; 56 | string slavePos; 57 | string state; 58 | }; 59 | 60 | void showDetailedConfigs(MasterDevice &, const ConfigList &, bool); 61 | void listConfigs(MasterDevice &m, const ConfigList &, bool); 62 | }; 63 | 64 | /****************************************************************************/ 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /tool/CommandData.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandData.h,v 4f682084c643 2010/10/25 08:12:26 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDDATA_H__ 31 | #define __COMMANDDATA_H__ 32 | 33 | #include "Command.h" 34 | 35 | /****************************************************************************/ 36 | 37 | class CommandData: 38 | public Command 39 | { 40 | public: 41 | CommandData(); 42 | 43 | string helpString(const string &) const; 44 | void execute(const StringVector &); 45 | 46 | protected: 47 | void outputDomainData(MasterDevice &, const ec_ioctl_domain_t &); 48 | }; 49 | 50 | /****************************************************************************/ 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /tool/CommandDebug.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandDebug.h,v 4f682084c643 2010/10/25 08:12:26 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDDEBUG_H__ 31 | #define __COMMANDDEBUG_H__ 32 | 33 | #include "Command.h" 34 | 35 | /****************************************************************************/ 36 | 37 | class CommandDebug: 38 | public Command 39 | { 40 | public: 41 | CommandDebug(); 42 | 43 | string helpString(const string &) const; 44 | void execute(const StringVector &); 45 | }; 46 | 47 | /****************************************************************************/ 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /tool/CommandDomains.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandDomains.h,v d461b1f07296 2012/11/30 19:15:31 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDDOMAINS_H__ 31 | #define __COMMANDDOMAINS_H__ 32 | 33 | #include "Command.h" 34 | 35 | /****************************************************************************/ 36 | 37 | class CommandDomains: 38 | public Command 39 | { 40 | public: 41 | CommandDomains(); 42 | 43 | string helpString(const string &) const; 44 | void execute(const StringVector &); 45 | 46 | protected: 47 | void showDomain(MasterDevice &, const ec_ioctl_master_t &, 48 | const ec_ioctl_domain_t &, bool); 49 | }; 50 | 51 | /****************************************************************************/ 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /tool/CommandDownload.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandDownload.h,v 4f682084c643 2010/10/25 08:12:26 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDDOWNLOAD_H__ 31 | #define __COMMANDDOWNLOAD_H__ 32 | 33 | #include "SdoCommand.h" 34 | 35 | /****************************************************************************/ 36 | 37 | class CommandDownload: 38 | public SdoCommand 39 | { 40 | public: 41 | CommandDownload(); 42 | 43 | string helpString(const string &) const; 44 | void execute(const StringVector &); 45 | 46 | protected: 47 | enum {DefaultBufferSize = 1024}; 48 | }; 49 | 50 | /****************************************************************************/ 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /tool/CommandEoe.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandEoe.h,v 4f682084c643 2010/10/25 08:12:26 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDEOE_H__ 31 | #define __COMMANDEOE_H__ 32 | 33 | #include "Command.h" 34 | 35 | /****************************************************************************/ 36 | 37 | class CommandEoe: 38 | public Command 39 | { 40 | public: 41 | CommandEoe(); 42 | 43 | string helpString(const string &) const; 44 | void execute(const StringVector &); 45 | }; 46 | 47 | /****************************************************************************/ 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /tool/CommandFoeRead.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandFoeRead.h,v 4f682084c643 2010/10/25 08:12:26 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDFOEREAD_H__ 31 | #define __COMMANDFOEREAD_H__ 32 | 33 | #include "FoeCommand.h" 34 | 35 | /****************************************************************************/ 36 | 37 | class CommandFoeRead: 38 | public FoeCommand 39 | { 40 | public: 41 | CommandFoeRead(); 42 | 43 | string helpString(const string &) const; 44 | void execute(const StringVector &); 45 | }; 46 | 47 | /****************************************************************************/ 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /tool/CommandFoeWrite.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandFoeWrite.h,v 4f682084c643 2010/10/25 08:12:26 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDFOEWRITE_H__ 31 | #define __COMMANDFOEWRITE_H__ 32 | 33 | #include "FoeCommand.h" 34 | 35 | /****************************************************************************/ 36 | 37 | class CommandFoeWrite: 38 | public FoeCommand 39 | { 40 | public: 41 | CommandFoeWrite(); 42 | 43 | string helpString(const string &) const; 44 | void execute(const StringVector &); 45 | 46 | protected: 47 | void loadFoeData(ec_ioctl_slave_foe_t *, const istream &); 48 | }; 49 | 50 | /****************************************************************************/ 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /tool/CommandGraph.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandGraph.h,v 4f682084c643 2010/10/25 08:12:26 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDGRAPH_H__ 31 | #define __COMMANDGRAPH_H__ 32 | 33 | #include "Command.h" 34 | 35 | /****************************************************************************/ 36 | 37 | class CommandGraph: 38 | public Command 39 | { 40 | public: 41 | CommandGraph(); 42 | 43 | string helpString(const string &) const; 44 | void execute(const StringVector &); 45 | }; 46 | 47 | /****************************************************************************/ 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /tool/CommandMaster.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandMaster.h,v 4f682084c643 2010/10/25 08:12:26 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDMASTER_H__ 31 | #define __COMMANDMASTER_H__ 32 | 33 | #include "Command.h" 34 | 35 | /****************************************************************************/ 36 | 37 | class CommandMaster: 38 | public Command 39 | { 40 | public: 41 | CommandMaster(); 42 | 43 | string helpString(const string &) const; 44 | void execute(const StringVector &); 45 | 46 | private: 47 | enum {ColWidth = 6}; 48 | }; 49 | 50 | /****************************************************************************/ 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /tool/CommandPdos.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandPdos.h,v 960cc1bb6b4a 2012/10/24 16:21:52 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDPDOS_H__ 31 | #define __COMMANDPDOS_H__ 32 | 33 | #include "Command.h" 34 | 35 | /****************************************************************************/ 36 | 37 | class CommandPdos: 38 | public Command 39 | { 40 | public: 41 | CommandPdos(); 42 | 43 | string helpString(const string &) const; 44 | void execute(const StringVector &); 45 | 46 | protected: 47 | void listSlavePdos(MasterDevice &, const ec_ioctl_slave_t &, bool); 48 | void etherlabConfig(MasterDevice &, const ec_ioctl_slave_t &); 49 | }; 50 | 51 | /****************************************************************************/ 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /tool/CommandRegRead.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandRegRead.h,v 4f682084c643 2010/10/25 08:12:26 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDREGREAD_H__ 31 | #define __COMMANDREGREAD_H__ 32 | 33 | #include "Command.h" 34 | #include "DataTypeHandler.h" 35 | 36 | /****************************************************************************/ 37 | 38 | class CommandRegRead: 39 | public Command, 40 | public DataTypeHandler 41 | { 42 | public: 43 | CommandRegRead(); 44 | 45 | string helpString(const string &) const; 46 | void execute(const StringVector &); 47 | }; 48 | 49 | /****************************************************************************/ 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /tool/CommandRegWrite.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandRegWrite.h,v 4f682084c643 2010/10/25 08:12:26 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDREGWRITE_H__ 31 | #define __COMMANDREGWRITE_H__ 32 | 33 | #include "Command.h" 34 | #include "DataTypeHandler.h" 35 | 36 | /****************************************************************************/ 37 | 38 | class CommandRegWrite: 39 | public Command, 40 | public DataTypeHandler 41 | { 42 | public: 43 | CommandRegWrite(); 44 | 45 | string helpString(const string &) const; 46 | void execute(const StringVector &); 47 | 48 | private: 49 | void loadRegData(ec_ioctl_slave_reg_t *, const istream &); 50 | }; 51 | 52 | /****************************************************************************/ 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /tool/CommandRescan.cpp: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandRescan.cpp,v bc2d4bf9cbe5 2012/09/06 18:22:24 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | * vim: expandtab 29 | * 30 | ****************************************************************************/ 31 | 32 | #include 33 | #include 34 | using namespace std; 35 | 36 | #include "CommandRescan.h" 37 | #include "MasterDevice.h" 38 | 39 | /*****************************************************************************/ 40 | 41 | CommandRescan::CommandRescan(): 42 | Command("rescan", "Rescan the bus.") 43 | { 44 | } 45 | 46 | /*****************************************************************************/ 47 | 48 | string CommandRescan::helpString(const string &binaryBaseName) const 49 | { 50 | stringstream str; 51 | 52 | str << binaryBaseName << " " << getName() << endl 53 | << endl 54 | << getBriefDescription() << endl 55 | << endl 56 | << "Command a bus rescan. Gathered slave information will be" << endl 57 | << "forgotten and slaves will be read in again." << endl 58 | << endl; 59 | 60 | return str.str(); 61 | } 62 | 63 | /****************************************************************************/ 64 | 65 | void CommandRescan::execute(const StringVector &args) 66 | { 67 | MasterIndexList masterIndices; 68 | 69 | if (args.size() != 0) { 70 | stringstream err; 71 | err << "'" << getName() << "' takes no arguments!"; 72 | throwInvalidUsageException(err); 73 | } 74 | 75 | masterIndices = getMasterIndices(); 76 | MasterIndexList::const_iterator mi; 77 | for (mi = masterIndices.begin(); 78 | mi != masterIndices.end(); mi++) { 79 | MasterDevice m(*mi); 80 | m.open(MasterDevice::ReadWrite); 81 | m.rescan(); 82 | } 83 | } 84 | 85 | /*****************************************************************************/ 86 | -------------------------------------------------------------------------------- /tool/CommandRescan.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandRescan.h,v 4f682084c643 2010/10/25 08:12:26 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDRESCAN_H__ 31 | #define __COMMANDRESCAN_H__ 32 | 33 | #include "Command.h" 34 | 35 | /****************************************************************************/ 36 | 37 | class CommandRescan: 38 | public Command 39 | { 40 | public: 41 | CommandRescan(); 42 | 43 | string helpString(const string &) const; 44 | void execute(const StringVector &); 45 | }; 46 | 47 | /****************************************************************************/ 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /tool/CommandSdos.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandSdos.h,v 4f682084c643 2010/10/25 08:12:26 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDSDOS_H__ 31 | #define __COMMANDSDOS_H__ 32 | 33 | #include "SdoCommand.h" 34 | 35 | /****************************************************************************/ 36 | 37 | class CommandSdos: 38 | public SdoCommand 39 | { 40 | public: 41 | CommandSdos(); 42 | 43 | string helpString(const string &) const; 44 | void execute(const StringVector &); 45 | 46 | protected: 47 | void listSlaveSdos(MasterDevice &, const ec_ioctl_slave_t &, bool); 48 | }; 49 | 50 | /****************************************************************************/ 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /tool/CommandSiiRead.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandSiiRead.h,v 4f682084c643 2010/10/25 08:12:26 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDSIIREAD_H__ 31 | #define __COMMANDSIIREAD_H__ 32 | 33 | #include "Command.h" 34 | 35 | /****************************************************************************/ 36 | 37 | class CommandSiiRead: 38 | public Command 39 | { 40 | public: 41 | CommandSiiRead(); 42 | 43 | string helpString(const string &) const; 44 | void execute(const StringVector &); 45 | 46 | protected: 47 | struct CategoryName { 48 | uint16_t type; 49 | const char *name; 50 | }; 51 | static const CategoryName categoryNames[]; 52 | static const char *getCategoryName(uint16_t); 53 | }; 54 | 55 | /****************************************************************************/ 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /tool/CommandSiiWrite.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandSiiWrite.h,v 4f682084c643 2010/10/25 08:12:26 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDSIIWRITE_H__ 31 | #define __COMMANDSIIWRITE_H__ 32 | 33 | #include "Command.h" 34 | 35 | /****************************************************************************/ 36 | 37 | class CommandSiiWrite: 38 | public Command 39 | { 40 | public: 41 | CommandSiiWrite(); 42 | 43 | string helpString(const string &) const; 44 | void execute(const StringVector &); 45 | 46 | protected: 47 | void loadSiiData(ec_ioctl_slave_sii_t *, const istream &); 48 | void checkSiiData(const ec_ioctl_slave_sii_t *data); 49 | }; 50 | 51 | /****************************************************************************/ 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /tool/CommandSlaves.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandSlaves.h,v bc2d4bf9cbe5 2012/09/06 18:22:24 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDSLAVES_H__ 31 | #define __COMMANDSLAVES_H__ 32 | 33 | #include "Command.h" 34 | 35 | /****************************************************************************/ 36 | 37 | class CommandSlaves: 38 | public Command 39 | { 40 | public: 41 | CommandSlaves(); 42 | 43 | string helpString(const string &) const; 44 | void execute(const StringVector &); 45 | 46 | protected: 47 | struct Info { 48 | string pos; 49 | string alias; 50 | string relPos; 51 | string state; 52 | string flag; 53 | string name; 54 | unsigned int device; 55 | }; 56 | 57 | void listSlaves(MasterDevice &, const SlaveList &, bool); 58 | void showSlaves(MasterDevice &, const SlaveList &); 59 | 60 | static bool slaveInList( const ec_ioctl_slave_t &, const SlaveList &); 61 | }; 62 | 63 | /****************************************************************************/ 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /tool/CommandSoeRead.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandSoeRead.h,v 4f682084c643 2010/10/25 08:12:26 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDSOEREAD_H__ 31 | #define __COMMANDSOEREAD_H__ 32 | 33 | #include "SoeCommand.h" 34 | 35 | /****************************************************************************/ 36 | 37 | class CommandSoeRead: 38 | public Command, 39 | public DataTypeHandler, 40 | public SoeCommand 41 | { 42 | public: 43 | CommandSoeRead(); 44 | 45 | string helpString(const string &) const; 46 | void execute(const StringVector &); 47 | }; 48 | 49 | /****************************************************************************/ 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /tool/CommandSoeWrite.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandSoeWrite.h,v 4f682084c643 2010/10/25 08:12:26 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDSOEWRITE_H__ 31 | #define __COMMANDSOEWRITE_H__ 32 | 33 | #include "SoeCommand.h" 34 | 35 | /****************************************************************************/ 36 | 37 | class CommandSoeWrite: 38 | public Command, 39 | public DataTypeHandler, 40 | public SoeCommand 41 | { 42 | public: 43 | CommandSoeWrite(); 44 | 45 | string helpString(const string &) const; 46 | void execute(const StringVector &); 47 | }; 48 | 49 | /****************************************************************************/ 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /tool/CommandStates.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandStates.h,v 4f682084c643 2010/10/25 08:12:26 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDSTATES_H__ 31 | #define __COMMANDSTATES_H__ 32 | 33 | #include "Command.h" 34 | 35 | /****************************************************************************/ 36 | 37 | class CommandStates: 38 | public Command 39 | { 40 | public: 41 | CommandStates(); 42 | 43 | string helpString(const string &) const; 44 | void execute(const StringVector &); 45 | }; 46 | 47 | /****************************************************************************/ 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /tool/CommandUpload.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandUpload.h,v 4f682084c643 2010/10/25 08:12:26 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDUPLOAD_H__ 31 | #define __COMMANDUPLOAD_H__ 32 | 33 | #include "SdoCommand.h" 34 | 35 | /****************************************************************************/ 36 | 37 | class CommandUpload: 38 | public SdoCommand 39 | { 40 | public: 41 | CommandUpload(); 42 | 43 | string helpString(const string &) const; 44 | void execute(const StringVector &); 45 | 46 | protected: 47 | enum {DefaultBufferSize = 64 * 1024}; 48 | }; 49 | 50 | /****************************************************************************/ 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /tool/CommandVersion.cpp: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandVersion.cpp,v 4f682084c643 2010/10/25 08:12:26 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #include 31 | using namespace std; 32 | 33 | #include "CommandVersion.h" 34 | 35 | /*****************************************************************************/ 36 | 37 | CommandVersion::CommandVersion(): 38 | Command("version", "Show version information.") 39 | { 40 | } 41 | 42 | /****************************************************************************/ 43 | 44 | string CommandVersion::helpString(const string &binaryBaseName) const 45 | { 46 | stringstream str; 47 | 48 | str << binaryBaseName << " " << getName() << " [OPTIONS]" << endl 49 | << endl 50 | << getBriefDescription() << endl; 51 | 52 | return str.str(); 53 | } 54 | 55 | /****************************************************************************/ 56 | 57 | void CommandVersion::execute(const StringVector &args) 58 | { 59 | if (args.size()) { 60 | stringstream err; 61 | err << "'" << getName() << "' takes no arguments!"; 62 | throwInvalidUsageException(err); 63 | } 64 | 65 | cout << "IgH EtherCAT master " << EC_MASTER_VERSION << endl; 66 | } 67 | 68 | /*****************************************************************************/ 69 | -------------------------------------------------------------------------------- /tool/CommandVersion.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandVersion.h,v 4f682084c643 2010/10/25 08:12:26 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDVERSION_H__ 31 | #define __COMMANDVERSION_H__ 32 | 33 | #include "Command.h" 34 | 35 | /****************************************************************************/ 36 | 37 | class CommandVersion: 38 | public Command 39 | { 40 | public: 41 | CommandVersion(); 42 | 43 | string helpString(const string &) const; 44 | void execute(const StringVector &); 45 | }; 46 | 47 | /****************************************************************************/ 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /tool/CommandXml.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: CommandXml.h,v 4f682084c643 2010/10/25 08:12:26 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __COMMANDXML_H__ 31 | #define __COMMANDXML_H__ 32 | 33 | #include "Command.h" 34 | 35 | /****************************************************************************/ 36 | 37 | class CommandXml: 38 | public Command 39 | { 40 | public: 41 | CommandXml(); 42 | 43 | string helpString(const string &) const; 44 | void execute(const StringVector &); 45 | 46 | protected: 47 | void generateSlaveXml(MasterDevice &, const ec_ioctl_slave_t &, 48 | unsigned int); 49 | }; 50 | 51 | /****************************************************************************/ 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /tool/DataTypeHandler.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: DataTypeHandler.h,v 489ea0becd74 2010/03/11 13:29:43 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __DATATYPEHANDLER_H__ 31 | #define __DATATYPEHANDLER_H__ 32 | 33 | /****************************************************************************/ 34 | 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | /****************************************************************************/ 41 | 42 | class DataTypeHandler 43 | { 44 | public: 45 | DataTypeHandler(); 46 | 47 | protected: 48 | struct DataType { 49 | const char *name; 50 | uint16_t code; 51 | size_t byteSize; 52 | }; 53 | 54 | static std::string typeInfo(); 55 | 56 | static const DataType *findDataType(const std::string &); 57 | static const DataType *findDataType(uint16_t); 58 | static size_t interpretAsType(const DataType *, const std::string &, 59 | void *, size_t); 60 | 61 | class SizeException: 62 | public std::runtime_error 63 | { 64 | public: 65 | SizeException(const std::string &msg): 66 | runtime_error(msg) {} 67 | }; 68 | 69 | static void outputData(std::ostream &, const DataType *, 70 | void *, size_t); 71 | static void printRawData(ostream &, const uint8_t *, size_t); 72 | 73 | private: 74 | static const DataType dataTypes[]; 75 | }; 76 | 77 | /****************************************************************************/ 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /tool/FoeCommand.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: FoeCommand.h,v 742607c464c4 2010/02/05 09:29:47 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __FOECOMMAND_H__ 31 | #define __FOECOMMAND_H__ 32 | 33 | #include "Command.h" 34 | 35 | /****************************************************************************/ 36 | 37 | class FoeCommand: 38 | public Command 39 | { 40 | public: 41 | FoeCommand(const string &, const string &); 42 | 43 | protected: 44 | static std::string resultText(int); 45 | static std::string errorText(int); 46 | }; 47 | 48 | /****************************************************************************/ 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /tool/NumberListParser.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: NumberListParser.h,v 87de63b19e4c 2010/12/14 20:58:53 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #include 31 | using namespace std; 32 | 33 | /*****************************************************************************/ 34 | 35 | class NumberListParser 36 | { 37 | public: 38 | NumberListParser(); 39 | virtual ~NumberListParser(); 40 | 41 | typedef list List; 42 | 43 | List parse(const char *); 44 | 45 | virtual int getMax() = 0; 46 | 47 | private: 48 | int max; 49 | bool hasMax; 50 | 51 | int maximum(); 52 | 53 | static bool isNumeric(char); 54 | static unsigned int parseNumber(const char *, unsigned int *, 55 | unsigned int); 56 | static List range(unsigned int, unsigned int); 57 | }; 58 | 59 | /****************************************************************************/ 60 | -------------------------------------------------------------------------------- /tool/SdoCommand.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: SdoCommand.h,v 20748e9d2238 2010/03/05 12:39:57 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #ifndef __SDOCOMMAND_H__ 31 | #define __SDOCOMMAND_H__ 32 | 33 | #include "Command.h" 34 | #include "DataTypeHandler.h" 35 | 36 | /****************************************************************************/ 37 | 38 | class SdoCommand: 39 | public Command, 40 | public DataTypeHandler 41 | { 42 | public: 43 | SdoCommand(const string &, const string &); 44 | 45 | static const char *abortText(uint32_t); 46 | 47 | private: 48 | struct AbortMessage { 49 | uint32_t code; 50 | const char *message; 51 | }; 52 | 53 | static const AbortMessage abortMessages[]; 54 | }; 55 | 56 | /****************************************************************************/ 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /tool/SoeCommand.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: SoeCommand.h,v 23c638a81fe7 2010/10/24 06:43:44 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | * vim: expandtab 29 | * 30 | ****************************************************************************/ 31 | 32 | #ifndef __SOECOMMAND_H__ 33 | #define __SOECOMMAND_H__ 34 | 35 | #include "Command.h" 36 | #include "DataTypeHandler.h" 37 | 38 | /****************************************************************************/ 39 | 40 | class SoeCommand 41 | { 42 | protected: 43 | static uint16_t parseIdn(const string &); 44 | static std::string outputIdn(uint16_t); 45 | static std::string errorMsg(uint16_t); 46 | }; 47 | 48 | /****************************************************************************/ 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /tool/sii_crc.cpp: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: sii_crc.cpp,v 11c0b2caa253 2009/02/24 12:51:39 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #include "sii_crc.h" 31 | 32 | /*****************************************************************************/ 33 | 34 | /** Calculates the SII checksum field. 35 | * 36 | * The checksum is generated with the polynom x^8+x^2+x+1 (0x07) and an 37 | * initial value of 0xff (see IEC 61158-6-12 ch. 5.4). 38 | * 39 | * The below code was originally generated with PYCRC 40 | * http://www.tty1.net/pycrc 41 | * 42 | * ./pycrc.py --width=8 --poly=0x07 --reflect-in=0 --xor-in=0xff 43 | * --reflect-out=0 --xor-out=0 --generate c --algorithm=bit-by-bit 44 | * 45 | * \return CRC8 46 | */ 47 | uint8_t calcSiiCrc( 48 | const uint8_t *data, /**< pointer to data */ 49 | size_t length /**< number of bytes in \a data */ 50 | ) 51 | { 52 | unsigned int i; 53 | uint8_t bit, byte, crc = 0x48; 54 | 55 | while (length--) { 56 | byte = *data++; 57 | for (i = 0; i < 8; i++) { 58 | bit = crc & 0x80; 59 | crc = (crc << 1) | ((byte >> (7 - i)) & 0x01); 60 | if (bit) crc ^= 0x07; 61 | } 62 | } 63 | 64 | for (i = 0; i < 8; i++) { 65 | bit = crc & 0x80; 66 | crc <<= 1; 67 | if (bit) crc ^= 0x07; 68 | } 69 | 70 | return crc; 71 | } 72 | 73 | /*****************************************************************************/ 74 | -------------------------------------------------------------------------------- /tool/sii_crc.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * $Id: sii_crc.h,v 11c0b2caa253 2009/02/24 12:51:39 fp $ 4 | * 5 | * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH 6 | * 7 | * This file is part of the IgH EtherCAT Master. 8 | * 9 | * The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU General Public License version 2, as 11 | * published by the Free Software Foundation. 12 | * 13 | * The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | * Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License along 19 | * with the IgH EtherCAT Master; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * --- 23 | * 24 | * The license mentioned above concerns the source code only. Using the 25 | * EtherCAT technology and brand is only permitted in compliance with the 26 | * industrial property and similar rights of Beckhoff Automation GmbH. 27 | * 28 | ****************************************************************************/ 29 | 30 | #include 31 | #include 32 | 33 | uint8_t calcSiiCrc(const uint8_t *, size_t); 34 | 35 | /*****************************************************************************/ 36 | -------------------------------------------------------------------------------- /tty/Kbuild.in: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # $Id$ 4 | # 5 | # Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | # 7 | # This file is part of the IgH EtherCAT Master. 8 | # 9 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License version 2, as 11 | # published by the Free Software Foundation. 12 | # 13 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | # Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License along 19 | # with the IgH EtherCAT Master; if not, write to the Free Software 20 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | # 22 | # --- 23 | # 24 | # The license mentioned above concerns the source code only. Using the EtherCAT 25 | # technology and brand is only permitted in compliance with the industrial 26 | # property and similar rights of Beckhoff Automation GmbH. 27 | # 28 | # --- 29 | # 30 | # vi: syntax=make 31 | # 32 | #------------------------------------------------------------------------------ 33 | 34 | obj-m := ec_tty.o 35 | 36 | ec_tty-objs := \ 37 | module.o 38 | 39 | REV := $(shell if test -s $(src)/../revision; then \ 40 | cat $(src)/../revision; \ 41 | else \ 42 | hg id -i $(src)/.. 2>/dev/null || echo "unknown"; \ 43 | fi) 44 | 45 | CFLAGS_module.o := -DREV=$(REV) 46 | 47 | #------------------------------------------------------------------------------ 48 | -------------------------------------------------------------------------------- /tty/Makefile.am: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # 3 | # $Id: Makefile.am,v bc2d4bf9cbe5 2012/09/06 18:22:24 fp $ 4 | # 5 | # Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH 6 | # 7 | # This file is part of the IgH EtherCAT Master. 8 | # 9 | # The IgH EtherCAT Master is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License version 2, as 11 | # published by the Free Software Foundation. 12 | # 13 | # The IgH EtherCAT Master is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 16 | # Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License along 19 | # with the IgH EtherCAT Master; if not, write to the Free Software 20 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | # 22 | # --- 23 | # 24 | # The license mentioned above concerns the source code only. Using the 25 | # EtherCAT technology and brand is only permitted in compliance with the 26 | # industrial property and similar rights of Beckhoff Automation GmbH. 27 | # 28 | #------------------------------------------------------------------------------ 29 | 30 | # using HEADERS to enable tags target 31 | noinst_HEADERS = \ 32 | module.c 33 | 34 | EXTRA_DIST = \ 35 | Kbuild.in \ 36 | README 37 | 38 | BUILT_SOURCES = \ 39 | Kbuild 40 | 41 | modules: 42 | $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" modules 43 | 44 | modules_install: 45 | $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" \ 46 | INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)" modules_install 47 | 48 | clean-local: 49 | $(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean 50 | 51 | #------------------------------------------------------------------------------ 52 | -------------------------------------------------------------------------------- /tty/README: -------------------------------------------------------------------------------- 1 | $Id: README,v fa3f66b783c1 2009/12/09 11:42:28 fp $ 2 | 3 | vim700: spelllang=en spell 4 | 5 | Virtual TTY interface driver for EtherCAT slave supporting serial comm 6 | 7 | Quick installation guide: 8 | 9 | ./configure --with-linux-dir=/your/linux/directory --enable-tty 10 | make all modules 11 | make modules_install install 12 | rcethercat start 13 | insmod tty/ec_tty.ko 14 | insmod examples/tty/ec_tty_example.ko 15 | 16 | The default settings for the serial line are 9600 8 N 1. 17 | 18 | The tty example operates a Beckhoff EL6002 at ring position 1. For a short 19 | test, connect port X1 with a serial port via null modem cable. If a minicom is 20 | started on that port and the below command is entered, the output should be 21 | visible in minicom: 22 | 23 | echo "Hello World" > /dev/ttyEC0 24 | 25 | Have a lot of fun! 26 | --------------------------------------------------------------------------------