GPLv2 License and enhanced Doxygen output.

This commit is contained in:
Florian Pose
2006-04-21 12:35:17 +00:00
parent 2e17997172
commit b3389cee9f
39 changed files with 1402 additions and 216 deletions

View File

@@ -1,10 +1,10 @@
#---------------------------------------------------------------------------
#
# Doxyfile 1.4.4
# Doxyfile 1.4.4
#
# IgH EtherCAT-Treiber
# IgH EtherCAT driver
#
# $Id$
# $Id$
#
#---------------------------------------------------------------------------
@@ -25,7 +25,7 @@
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
PROJECT_NAME = EtherCAT
PROJECT_NAME = "IgH EtherCAT master"
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
@@ -38,7 +38,7 @@ PROJECT_NUMBER = 1.0
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
OUTPUT_DIRECTORY = doc
OUTPUT_DIRECTORY = documentation/doxygen-output
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
# 4096 sub-directories (in 2 levels) under the output directory of each output
@@ -59,7 +59,7 @@ CREATE_SUBDIRS = NO
# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish,
# Swedish, and Ukrainian.
OUTPUT_LANGUAGE = German
OUTPUT_LANGUAGE = English
# This tag can be used to specify the encoding used in the generated output.
# The encoding is not always determined by the language that is chosen,
@@ -185,7 +185,7 @@ SEPARATE_MEMBER_PAGES = NO
# The TAB_SIZE tag can be used to set the number of spaces in a tab.
# Doxygen uses this value to replace tabs by spaces in code fragments.
TAB_SIZE = 3
TAB_SIZE = 4
# This tag can be used to specify a number of aliases that acts
# as commands in the documentation. An alias has the form "name=value".
@@ -227,7 +227,7 @@ SUBGROUPING = YES
# Private class members and static file members will be hidden unless
# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
EXTRACT_ALL = YES
EXTRACT_ALL = NO
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
# will be included in the documentation.
@@ -258,14 +258,14 @@ EXTRACT_LOCAL_METHODS = YES
# various overviews, but no documentation section is generated.
# This option has no effect if EXTRACT_ALL is enabled.
HIDE_UNDOC_MEMBERS = YES
HIDE_UNDOC_MEMBERS = NO
# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
# undocumented classes that are normally visible in the class hierarchy.
# If set to NO (the default) these classes will be included in the various
# overviews. This option has no effect if EXTRACT_ALL is enabled.
HIDE_UNDOC_CLASSES = YES
HIDE_UNDOC_CLASSES = NO
# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
# friend (class|struct|union) declarations.
@@ -432,7 +432,7 @@ WARN_IF_DOC_ERROR = YES
# wrong or incomplete parameter documentation, but not about the absence of
# documentation.
WARN_NO_PARAMDOC = NO
WARN_NO_PARAMDOC = YES
# The WARN_FORMAT tag determines the format of the warning messages that
# doxygen can produce. The string should contain the $file, $line, and $text

340
LICENSE Normal file
View File

@@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@@ -4,6 +4,23 @@
#
# $Id$
#
# Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
#
# This file is part of the IgH EtherCAT Master.
#
# The IgH EtherCAT Master is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2 of the License.
#
# The IgH EtherCAT Master is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the IgH EtherCAT Master; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
#------------------------------------------------------------------------------
ifneq ($(KERNELRELEASE),)

47
README
View File

@@ -1,11 +1,20 @@
-------------------------------------------------------------------------------
This is the README file of the IgH EtherCAT Master.
$Id$
Contents:
1) General Information
2) Requirements
3) Building and Installing
4) Realtime & Tuning
5) License
-------------------------------------------------------------------------------
General Information
===================
1) General Information
======================
This is an Open-Source EtherCAT master implementation for Linux 2.6.
@@ -23,8 +32,8 @@ http://igh-essen.com
-------------------------------------------------------------------------------
Requirements
============
2) Requirements
===============
1) Software requirements
@@ -39,8 +48,8 @@ implemented soon.
-------------------------------------------------------------------------------
Building and installing
=======================
3) Building and installing
==========================
1) Create a copy of the configuration template:
@@ -66,8 +75,8 @@ Building and installing
-------------------------------------------------------------------------------
Realtime & Tuning
=================
4) Realtime & Tuning
====================
Realtime patches for the Linux kernel are supported, but not required. The
realtime processing has to be done by the calling module (see API
@@ -78,3 +87,25 @@ To avoid frame timeouts, deactivating DMA access for hard drives is
recommented (hdparm -d0 <DEV>).
-------------------------------------------------------------------------------
5) License
==========
Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
This file is part of the IgH EtherCAT Master.
The IgH EtherCAT Master is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2 of the License.
The IgH EtherCAT Master is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the IgH EtherCAT Master; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-------------------------------------------------------------------------------

View File

@@ -4,21 +4,26 @@
*
* EtherCAT driver for RTL8139-compatible NICs.
*
* Authors: Florian Pose <fp@igh-essen.com>
* Wilhelm Hagemeister <hm@igh-essen.com>
* $Id$
*
* $Date$
* $Author$
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
*
* (C) Copyright IgH 2006
* Ingenieurgemeinschaft IgH
* Heinz-Bäcker Str. 34
* D-45356 Essen
* Tel.: +49 201/61 99 31
* Fax.: +49 201/61 98 36
* E-mail: sp@igh-essen.com
* This file is part of the IgH EtherCAT Master.
*
******************************************************************************/
* The IgH EtherCAT Master is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*
* The IgH EtherCAT Master is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
/*
8139too.c: A RealTek RTL-8139 Fast Ethernet driver for Linux.

View File

@@ -6,6 +6,23 @@
#
# $Id$
#
# Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
#
# This file is part of the IgH EtherCAT Master.
#
# The IgH EtherCAT Master is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2 of the License.
#
# The IgH EtherCAT Master is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the IgH EtherCAT Master; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
#------------------------------------------------------------------------------
ifneq ($(KERNELRELEASE),)

View File

@@ -4,6 +4,23 @@
*
* $Id$
*
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
*
* This file is part of the IgH EtherCAT Master.
*
* The IgH EtherCAT Master is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*
* The IgH EtherCAT Master is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#ifndef _ETHERCAT_DEVICE_H_

View File

@@ -6,6 +6,23 @@
#
# $Id$
#
# Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
#
# This file is part of the IgH EtherCAT Master.
#
# The IgH EtherCAT Master is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2 of the License.
#
# The IgH EtherCAT Master is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the IgH EtherCAT Master; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
#------------------------------------------------------------------------------
CONFIGFILE=/etc/sysconfig/ethercat

View File

@@ -4,6 +4,23 @@
*
* $Id$
*
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
*
* This file is part of the IgH EtherCAT Master.
*
* The IgH EtherCAT Master is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*
* The IgH EtherCAT Master is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#ifndef __ECRT_H__

View File

@@ -6,6 +6,23 @@
#
# $Id$
#
# Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
#
# This file is part of the IgH EtherCAT Master.
#
# The IgH EtherCAT Master is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2 of the License.
#
# The IgH EtherCAT Master is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the IgH EtherCAT Master; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
#------------------------------------------------------------------------------
CONFIGFILE=/etc/sysconfig/ethercat

View File

@@ -6,6 +6,23 @@
#
# $Id$
#
# Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
#
# This file is part of the IgH EtherCAT Master.
#
# The IgH EtherCAT Master is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2 of the License.
#
# The IgH EtherCAT Master is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the IgH EtherCAT Master; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
#------------------------------------------------------------------------------
ifneq ($(KERNELRELEASE),)

View File

@@ -6,6 +6,23 @@
*
* $Id$
*
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
*
* This file is part of the IgH EtherCAT Master.
*
* The IgH EtherCAT Master is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*
* The IgH EtherCAT Master is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#include <linux/delay.h>
@@ -30,7 +47,8 @@ const ec_code_msg_t sdo_abort_messages[];
/**
Reads 32 bit of a CANopen SDO in expedited mode.
\return 0 in case of success, else < 0
*/
\ingroup Slave
*/
int ec_slave_sdo_read_exp(ec_slave_t *slave, /**< EtherCAT slave */
uint16_t sdo_index, /**< SDO index */
@@ -79,13 +97,14 @@ int ec_slave_sdo_read_exp(ec_slave_t *slave, /**< EtherCAT slave */
/**
Writes a CANopen SDO using expedited mode.
\return 0 in case of success, else < 0
*/
\ingroup Slave
*/
int ec_slave_sdo_write_exp(ec_slave_t *slave, /**< EtherCAT slave */
uint16_t sdo_index, /**< SDO index */
uint8_t sdo_subindex, /**< SDO subindex */
const uint8_t *sdo_data, /**< new value */
size_t size
size_t size /**< Data size in bytes (1 - 4) */
)
{
uint8_t *data;
@@ -138,9 +157,9 @@ int ec_slave_sdo_write_exp(ec_slave_t *slave, /**< EtherCAT slave */
/**
Reads a CANopen SDO in normal mode.
\return 0 in case of success, else < 0
\ingroup Slave
\todo size
*/
*/
int ecrt_slave_sdo_read(ec_slave_t *slave, /**< EtherCAT slave */
uint16_t sdo_index, /**< SDO index */
@@ -209,6 +228,7 @@ int ecrt_slave_sdo_read(ec_slave_t *slave, /**< EtherCAT slave */
/**
Fetches the SDO dictionary of a slave.
\return 0 in case of success, else < 0
\ingroup Slave
*/
int ec_slave_fetch_sdo_list(ec_slave_t *slave /**< EtherCAT slave */)
@@ -291,6 +311,7 @@ int ec_slave_fetch_sdo_list(ec_slave_t *slave /**< EtherCAT slave */)
/**
Fetches the SDO descriptions for the known SDOs.
\return 0 in case of success, else < 0
\ingroup Slave
*/
int ec_slave_fetch_sdo_descriptions(ec_slave_t *slave /**< EtherCAT slave */)
@@ -369,6 +390,7 @@ int ec_slave_fetch_sdo_descriptions(ec_slave_t *slave /**< EtherCAT slave */)
/**
Fetches all entries (subindices) to an SDO.
\return 0 in case of success, else < 0
\ingroup Slave
*/
int ec_slave_fetch_sdo_entries(ec_slave_t *slave, /**< EtherCAT slave */
@@ -516,7 +538,8 @@ const ec_code_msg_t sdo_abort_messages[] = {
Reads an 8-bit SDO in expedited mode.
See ec_slave_sdo_read_exp()
\return 0 in case of success, else < 0
*/
\ingroup Slave
*/
int ecrt_slave_sdo_read_exp8(ec_slave_t *slave, /**< EtherCAT slave */
uint16_t sdo_index, /**< SDO index */
@@ -536,7 +559,8 @@ int ecrt_slave_sdo_read_exp8(ec_slave_t *slave, /**< EtherCAT slave */
Reads a 16-bit SDO in expedited mode.
See ec_slave_sdo_read_exp()
\return 0 in case of success, else < 0
*/
\ingroup Slave
*/
int ecrt_slave_sdo_read_exp16(ec_slave_t *slave, /**< EtherCAT slave */
uint16_t sdo_index, /**< SDO index */
@@ -556,7 +580,8 @@ int ecrt_slave_sdo_read_exp16(ec_slave_t *slave, /**< EtherCAT slave */
Reads a 32-bit SDO in expedited mode.
See ec_slave_sdo_read_exp()
\return 0 in case of success, else < 0
*/
\ingroup Slave
*/
int ecrt_slave_sdo_read_exp32(ec_slave_t *slave, /**< EtherCAT slave */
uint16_t sdo_index, /**< SDO index */
@@ -575,7 +600,8 @@ int ecrt_slave_sdo_read_exp32(ec_slave_t *slave, /**< EtherCAT slave */
/**
Writes an 8-bit SDO in expedited mode.
\return 0 in case of success, else < 0
*/
\ingroup Slave
*/
int ecrt_slave_sdo_write_exp8(ec_slave_t *slave, /**< EtherCAT slave */
uint16_t sdo_index, /**< SDO index */
@@ -591,7 +617,8 @@ int ecrt_slave_sdo_write_exp8(ec_slave_t *slave, /**< EtherCAT slave */
/**
Writes a 16-bit SDO in expedited mode.
\return 0 in case of success, else < 0
*/
\ingroup Slave
*/
int ecrt_slave_sdo_write_exp16(ec_slave_t *slave, /**< EtherCAT slave */
uint16_t sdo_index, /**< SDO index */
@@ -609,7 +636,8 @@ int ecrt_slave_sdo_write_exp16(ec_slave_t *slave, /**< EtherCAT slave */
/**
Writes a 32-bit SDO in expedited mode.
\return 0 in case of success, else < 0
*/
\ingroup Slave
*/
int ecrt_slave_sdo_write_exp32(ec_slave_t *slave, /**< EtherCAT slave */
uint16_t sdo_index, /**< SDO index */

View File

@@ -6,6 +6,23 @@
*
* $Id$
*
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
*
* This file is part of the IgH EtherCAT Master.
*
* The IgH EtherCAT Master is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*
* The IgH EtherCAT Master is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#include <linux/slab.h>
@@ -32,9 +49,10 @@
/**
Command constructor.
\ingroup Command
*/
void ec_command_init(ec_command_t *command)
void ec_command_init(ec_command_t *command /**< EtherCAT command */)
{
command->type = EC_CMD_NONE;
command->address.logical = 0x00000000;
@@ -50,9 +68,10 @@ void ec_command_init(ec_command_t *command)
/**
Command destructor.
\ingroup Command
*/
void ec_command_clear(ec_command_t *command)
void ec_command_clear(ec_command_t *command /**< EtherCAT command */)
{
if (command->data) kfree(command->data);
}
@@ -61,10 +80,14 @@ void ec_command_clear(ec_command_t *command)
/**
Allocates command data memory.
If the allocated memory is already larger than requested, nothing ist done.
\return 0 in case of success, else < 0
\ingroup Command
*/
int ec_command_prealloc(ec_command_t *command, size_t size)
int ec_command_prealloc(ec_command_t *command, /**< EtherCAT command */
size_t size /**< New size in bytes */
)
{
if (size <= command->mem_size) return 0;
@@ -89,6 +112,7 @@ int ec_command_prealloc(ec_command_t *command, size_t size)
Initializes an EtherCAT NPRD command.
Node-adressed physical read.
\return 0 in case of success, else < 0
\ingroup Command
*/
int ec_command_nprd(ec_command_t *command,
@@ -117,6 +141,7 @@ int ec_command_nprd(ec_command_t *command,
Initializes an EtherCAT NPWR command.
Node-adressed physical write.
\return 0 in case of success, else < 0
\ingroup Command
*/
int ec_command_npwr(ec_command_t *command,
@@ -145,6 +170,7 @@ int ec_command_npwr(ec_command_t *command,
Initializes an EtherCAT APRD command.
Autoincrement physical read.
\return 0 in case of success, else < 0
\ingroup Command
*/
int ec_command_aprd(ec_command_t *command,
@@ -170,6 +196,7 @@ int ec_command_aprd(ec_command_t *command,
Initializes an EtherCAT APWR command.
Autoincrement physical write.
\return 0 in case of success, else < 0
\ingroup Command
*/
int ec_command_apwr(ec_command_t *command,
@@ -195,6 +222,7 @@ int ec_command_apwr(ec_command_t *command,
Initializes an EtherCAT BRD command.
Broadcast read.
\return 0 in case of success, else < 0
\ingroup Command
*/
int ec_command_brd(ec_command_t *command,
@@ -218,6 +246,7 @@ int ec_command_brd(ec_command_t *command,
Initializes an EtherCAT BWR command.
Broadcast write.
\return 0 in case of success, else < 0
\ingroup Command
*/
int ec_command_bwr(ec_command_t *command,
@@ -241,6 +270,7 @@ int ec_command_bwr(ec_command_t *command,
Initializes an EtherCAT LRW command.
Logical read write.
\return 0 in case of success, else < 0
\ingroup Command
*/
int ec_command_lrw(ec_command_t *command,

View File

@@ -6,6 +6,23 @@
*
* $Id$
*
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
*
* This file is part of the IgH EtherCAT Master.
*
* The IgH EtherCAT Master is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*
* The IgH EtherCAT Master is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#ifndef _EC_COMMAND_H_
@@ -17,6 +34,16 @@
/*****************************************************************************/
/**
\defgroup Command EtherCAT command
Data types and functions for EtherCAT commands.
An EtherCAT command is sent and received using the ec_command_t data type.
It is passed to the master, which handles commands in a queue.
\{
*/
/*****************************************************************************/
/**
EtherCAT command type.
*/
@@ -89,6 +116,8 @@ typedef struct
}
ec_command_t;
/** \} */
/*****************************************************************************/
void ec_command_init(ec_command_t *);

View File

@@ -6,6 +6,23 @@
*
* $Id$
*
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
*
* This file is part of the IgH EtherCAT Master.
*
* The IgH EtherCAT Master is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*
* The IgH EtherCAT Master is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#include <linux/module.h>
@@ -22,6 +39,7 @@
/**
Device constructor.
\return 0 in case of success, else < 0
\ingroup Device
*/
int ec_device_init(ec_device_t *device, /**< EtherCAT device */
@@ -62,6 +80,7 @@ int ec_device_init(ec_device_t *device, /**< EtherCAT device */
/**
EtherCAT device destuctor.
\ingroup Device
*/
void ec_device_clear(ec_device_t *device /**< EtherCAT device */)
@@ -75,6 +94,7 @@ void ec_device_clear(ec_device_t *device /**< EtherCAT device */)
/**
Opens the EtherCAT device.
\return 0 in case of success, else < 0
\ingroup Device
*/
int ec_device_open(ec_device_t *device /**< EtherCAT device */)
@@ -106,6 +126,7 @@ int ec_device_open(ec_device_t *device /**< EtherCAT device */)
/**
Stops the EtherCAT device.
\return 0 in case of success, else < 0
\ingroup Device
*/
int ec_device_close(ec_device_t *device /**< EtherCAT device */)
@@ -130,6 +151,7 @@ int ec_device_close(ec_device_t *device /**< EtherCAT device */)
/**
Returns a pointer to the device's transmit memory.
\return pointer to the TX socket buffer
\ingroup Device
*/
uint8_t *ec_device_tx_data(ec_device_t *device /**< EtherCAT device */)
@@ -143,6 +165,7 @@ uint8_t *ec_device_tx_data(ec_device_t *device /**< EtherCAT device */)
Sends the content of the transmit socket buffer.
Cuts the socket buffer content to the (now known) size, and calls the
start_xmit() function of the assigned net_device.
\ingroup Device
*/
void ec_device_send(ec_device_t *device, /**< EtherCAT device */
@@ -168,6 +191,7 @@ void ec_device_send(ec_device_t *device, /**< EtherCAT device */
/**
Calls the interrupt service routine of the assigned net_device.
\ingroup Device
*/
void ec_device_call_isr(ec_device_t *device /**< EtherCAT device */)
@@ -182,6 +206,7 @@ void ec_device_call_isr(ec_device_t *device /**< EtherCAT device */)
/**
Accepts a received frame.
Forwards the received data to the master.
\ingroup Device
*/
void ecdev_receive(ec_device_t *device, /**< EtherCAT device */
@@ -201,6 +226,7 @@ void ecdev_receive(ec_device_t *device, /**< EtherCAT device */
/**
Sets a new link state.
\ingroup Device
*/
void ecdev_link_state(ec_device_t *device, /**< EtherCAT device */

View File

@@ -6,6 +6,23 @@
*
* $Id$
*
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
*
* This file is part of the IgH EtherCAT Master.
*
* The IgH EtherCAT Master is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*
* The IgH EtherCAT Master is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#ifndef _EC_DEVICE_H_
@@ -19,6 +36,16 @@
/*****************************************************************************/
/**
\defgroup Device EtherCAT device
Data types and functions for EtherCAT devices.
An EtherCAT device is the connection from an EtherCAT master to a network
interface card.
\{
*/
/*****************************************************************************/
/**
EtherCAT device.
@@ -37,6 +64,8 @@ struct ec_device
uint8_t link_state; /**< device link state */
};
/** \} */
/*****************************************************************************/
int ec_device_init(ec_device_t *, ec_master_t *, struct net_device *,

View File

@@ -6,6 +6,23 @@
*
* $Id$
*
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
*
* This file is part of the IgH EtherCAT Master.
*
* The IgH EtherCAT Master is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*
* The IgH EtherCAT Master is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#include "globals.h"
@@ -42,6 +59,7 @@ static struct kobj_type ktype_ec_domain = {
/**
Domain constructor.
\return 0 in case of success, else < 0
\ingroup Domain
*/
int ec_domain_init(ec_domain_t *domain, /**< EtherCAT domain */
@@ -75,6 +93,7 @@ int ec_domain_init(ec_domain_t *domain, /**< EtherCAT domain */
/**
Domain destructor.
\ingroup Domain
*/
void ec_domain_clear(struct kobject *kobj /**< kobject of the domain */)
@@ -101,6 +120,7 @@ void ec_domain_clear(struct kobject *kobj /**< kobject of the domain */)
/**
Registeres a data field in a domain.
\return 0 in case of success, else < 0
\ingroup Domain
*/
int ec_domain_reg_field(ec_domain_t *domain, /**< EtherCAT domain */
@@ -138,6 +158,7 @@ int ec_domain_reg_field(ec_domain_t *domain, /**< EtherCAT domain */
/**
Clears the list of the registered data fields.
\ingroup Domain
*/
void ec_domain_clear_field_regs(ec_domain_t *domain /**< EtherCAT domain */)
@@ -155,6 +176,7 @@ void ec_domain_clear_field_regs(ec_domain_t *domain /**< EtherCAT domain */)
/**
Allocates a process data command and appends it to the list.
\return 0 in case of success, else < 0
\ingroup Domain
*/
int ec_domain_add_command(ec_domain_t *domain, /**< EtherCAT domain */
@@ -188,6 +210,7 @@ int ec_domain_add_command(ec_domain_t *domain, /**< EtherCAT domain */
corresponding FMMUs and sets the process data pointer of the registered
data fields.
\return 0 in case of success, else < 0
\ingroup Domain
*/
int ec_domain_alloc(ec_domain_t *domain, /**< EtherCAT domain */
@@ -281,6 +304,7 @@ int ec_domain_alloc(ec_domain_t *domain, /**< EtherCAT domain */
This number isn't really the number of responding slaves, but the sum of
the working counters of all domain commands. Some slaves increase the
working counter by 2, some by 1.
\ingroup Domain
*/
void ec_domain_response_count(ec_domain_t *domain, /**< EtherCAT domain */
@@ -299,6 +323,7 @@ void ec_domain_response_count(ec_domain_t *domain, /**< EtherCAT domain */
/**
Formats attribute data for SysFS reading.
\return number of bytes to read
\ingroup Domain
*/
ssize_t ec_show_domain_attribute(struct kobject *kobj, /**< kobject */
@@ -327,6 +352,7 @@ ssize_t ec_show_domain_attribute(struct kobject *kobj, /**< kobject */
- If \a field_count is greater then 1, it is assumed that \a data_ptr
is an array of the respective size.
\return pointer to the slave on success, else NULL
\ingroup Domain
*/
ec_slave_t *ecrt_domain_register_field(ec_domain_t *domain,
@@ -418,6 +444,7 @@ ec_slave_t *ecrt_domain_register_field(ec_domain_t *domain,
Registeres a bunch of data fields.
Caution! The list has to be terminated with a NULL structure ({})!
\return 0 in case of success, else < 0
\ingroup Domain
*/
int ecrt_domain_register_field_list(ec_domain_t *domain,
@@ -443,6 +470,7 @@ int ecrt_domain_register_field_list(ec_domain_t *domain,
/**
Places all process data commands in the masters command queue.
\ingroup Domain
*/
void ecrt_domain_queue(ec_domain_t *domain /**< EtherCAT domain */)
@@ -458,6 +486,7 @@ void ecrt_domain_queue(ec_domain_t *domain /**< EtherCAT domain */)
/**
Processes received process data.
\ingroup Domain
*/
void ecrt_domain_process(ec_domain_t *domain /**< EtherCAT domain */)
@@ -481,6 +510,7 @@ void ecrt_domain_process(ec_domain_t *domain /**< EtherCAT domain */)
/**
Returns the state of a domain.
\return 0 if all commands were received, else -1.
\ingroup Domain
*/
int ecrt_domain_state(ec_domain_t *domain /**< EtherCAT domain */)

View File

@@ -6,6 +6,23 @@
*
* $Id$
*
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
*
* This file is part of the IgH EtherCAT Master.
*
* The IgH EtherCAT Master is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*
* The IgH EtherCAT Master is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#ifndef _EC_DOMAIN_H_
@@ -20,6 +37,15 @@
/*****************************************************************************/
/**
\defgroup Domain EtherCAT domain
Data types and methods for EtherCAT domains.
A domain handles process data IO with a group of slaves.
\{
*/
/*****************************************************************************/
/**
Data field registration type.
*/
@@ -55,6 +81,8 @@ struct ec_domain
struct list_head field_regs; /**< data field registrations */
};
/** \} */
/*****************************************************************************/
int ec_domain_init(ec_domain_t *, ec_master_t *, unsigned int);

54
master/doxygen.c Normal file
View File

@@ -0,0 +1,54 @@
/******************************************************************************
*
* d o x y g e n . c
*
* Just for the doxygen mainpage.
*
* $Id$
*
*****************************************************************************/
/**
\mainpage The IgH EtherCAT master
\section sec_docs Documentation
You will find the code documentation in the modules section.
There is an external API documentation for the realtime interface.
For information how to build and install, see the README file.
\section sec_contact Contact
\verbatim
Florian Pose <fp@igh-essen.com>
Ingenieurgemeinschaft IgH
Heinz-Baecker-Str. 34
D-45356 Essen
http://igh-essen.com
\endverbatim
\section sec_license License
\verbatim
Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
This file is part of the IgH EtherCAT Master.
The IgH EtherCAT Master is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2 of the License.
The IgH EtherCAT Master is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the IgH EtherCAT Master; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\endverbatim
*/
/*****************************************************************************/

View File

@@ -6,6 +6,23 @@
*
* $Id$
*
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
*
* This file is part of the IgH EtherCAT Master.
*
* The IgH EtherCAT Master is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*
* The IgH EtherCAT Master is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#include "../include/ecrt.h"
@@ -17,6 +34,10 @@
/*****************************************************************************/
/**
\ingroup EoE
*/
void ec_eoe_init(ec_eoe_t *eoe, ec_slave_t *slave)
{
eoe->slave = slave;
@@ -25,12 +46,20 @@ void ec_eoe_init(ec_eoe_t *eoe, ec_slave_t *slave)
/*****************************************************************************/
/**
\ingroup EoE
*/
void ec_eoe_clear(ec_eoe_t *eoe)
{
}
/*****************************************************************************/
/**
\ingroup EoE
*/
void ec_eoe_run(ec_eoe_t *eoe)
{
uint8_t *data;
@@ -110,6 +139,10 @@ void ec_eoe_run(ec_eoe_t *eoe)
/*****************************************************************************/
/**
\ingroup EoE
*/
void ec_eoe_print(const ec_eoe_t *eoe)
{
EC_INFO(" EoE slave %i\n", eoe->slave->ring_position);

View File

@@ -6,6 +6,23 @@
*
* $Id$
*
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
*
* This file is part of the IgH EtherCAT Master.
*
* The IgH EtherCAT Master is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*
* The IgH EtherCAT Master is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#include <linux/list.h>
@@ -17,24 +34,44 @@
/*****************************************************************************/
/**
\defgroup EoE EtherCAT-over-Ethernet (EoE)
Data types and functions for Ethernet-over-EtherCAT.
\{
*/
/*****************************************************************************/
/**
State of an EoE object.
*/
typedef enum
{
EC_EOE_IDLE,
EC_EOE_CHECKING,
EC_EOE_FETCHING
EC_EOE_IDLE, /**< Idle. The next step ist to check for data. */
EC_EOE_CHECKING, /**< Checking frame was sent. */
EC_EOE_FETCHING /**< There is new data. Fetching frame was sent. */
}
ec_eoe_state_t;
/*****************************************************************************/
/**
Ethernet-over-EtherCAT (EoE) Object.
The master creates one of these objects for each slave that supports the
EoE protocol.
*/
typedef struct
{
struct list_head list;
ec_slave_t *slave;
ec_eoe_state_t rx_state;
struct list_head list; /**< list item */
ec_slave_t *slave; /**< pointer to the corresponding slave */
ec_eoe_state_t rx_state; /**< state of the state machine */
}
ec_eoe_t;
/** \} */
/*****************************************************************************/
void ec_eoe_init(ec_eoe_t *, ec_slave_t *);

View File

@@ -6,6 +6,23 @@
*
* $Id$
*
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
*
* This file is part of the IgH EtherCAT Master.
*
* The IgH EtherCAT Master is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*
* The IgH EtherCAT Master is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#ifndef _EC_GLOBALS_
@@ -17,8 +34,13 @@
* EtherCAT master
*****************************************************************************/
/** master main version */
#define EC_MASTER_VERSION_MAIN 1
/** master sub version (after the dot) */
#define EC_MASTER_VERSION_SUB 0
/** master extra version (just a string) */
#define EC_MASTER_VERSION_EXTRA "trunk"
/** maximum number of FMMUs per slave */
@@ -31,7 +53,7 @@
/** maximum size of an EtherCAT frame (without header and CRC) */
#define EC_MAX_FRAME_SIZE 1500
/** ... minimum size */
/** minimum size of an EtherCAT frame (without header and CRC) */
#define EC_MIN_FRAME_SIZE 46
/** size of an EtherCAT frame header */

View File

@@ -6,6 +6,23 @@
*
* $Id$
*
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
*
* This file is part of the IgH EtherCAT Master.
*
* The IgH EtherCAT Master is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*
* The IgH EtherCAT Master is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#include <linux/slab.h>
@@ -20,6 +37,7 @@
/**
Prepares a mailbox-send command.
\return pointer to mailbox command data
\ingroup Slave
*/
uint8_t *ec_slave_mbox_prepare_send(ec_slave_t *slave, /**< slave */
@@ -60,6 +78,7 @@ uint8_t *ec_slave_mbox_prepare_send(ec_slave_t *slave, /**< slave */
/**
Prepares a command for checking the mailbox state.
\return 0 in case of success, else < 0
\ingroup Slave
*/
int ec_slave_mbox_prepare_check(ec_slave_t *slave /**< slave */)
@@ -78,6 +97,7 @@ int ec_slave_mbox_prepare_check(ec_slave_t *slave /**< slave */)
/**
Processes a mailbox state checking command.
\return 0 in case of success, else < 0
\ingroup Slave
*/
int ec_slave_mbox_check(const ec_slave_t *slave /**< slave */)
@@ -90,6 +110,7 @@ int ec_slave_mbox_check(const ec_slave_t *slave /**< slave */)
/**
Prepares a command to fetch mailbox data.
\return 0 in case of success, else < 0
\ingroup Slave
*/
int ec_slave_mbox_prepare_fetch(ec_slave_t *slave /**< slave */)
@@ -107,6 +128,7 @@ int ec_slave_mbox_prepare_fetch(ec_slave_t *slave /**< slave */)
/**
Processes received mailbox data.
\return pointer to the received data
\ingroup Slave
*/
uint8_t *ec_slave_mbox_fetch(ec_slave_t *slave, /**< slave */
@@ -139,6 +161,7 @@ uint8_t *ec_slave_mbox_fetch(ec_slave_t *slave, /**< slave */
/**
Sends a mailbox command and waits for its reception.
\return pointer to the received data
\ingroup Slave
*/
uint8_t *ec_slave_mbox_simple_io(ec_slave_t *slave, /**< slave */
@@ -165,6 +188,7 @@ uint8_t *ec_slave_mbox_simple_io(ec_slave_t *slave, /**< slave */
/**
Waits for the reception of a mailbox command.
\return pointer to the received data
\ingroup Slave
*/
uint8_t *ec_slave_mbox_simple_receive(ec_slave_t *slave, /**< slave */

View File

@@ -6,6 +6,23 @@
*
* $Id$
*
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
*
* This file is part of the IgH EtherCAT Master.
*
* The IgH EtherCAT Master is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*
* The IgH EtherCAT Master is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#ifndef _EC_MAILBOX_H_

View File

@@ -6,6 +6,23 @@
*
* $Id$
*
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
*
* This file is part of the IgH EtherCAT Master.
*
* The IgH EtherCAT Master is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*
* The IgH EtherCAT Master is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#include <linux/module.h>
@@ -56,6 +73,7 @@ static struct kobj_type ktype_ec_master = {
/**
Master constructor.
\return 0 in case of success, else < 0
\ingroup Master
*/
int ec_master_init(ec_master_t *master, /**< EtherCAT master */
@@ -101,6 +119,7 @@ int ec_master_init(ec_master_t *master, /**< EtherCAT master */
Master destructor.
Removes all pending commands, clears the slave list, clears all domains
and frees the device.
\ingroup Master
*/
void ec_master_clear(struct kobject *kobj /**< kobject of the master */)
@@ -130,6 +149,7 @@ void ec_master_clear(struct kobject *kobj /**< kobject of the master */)
Resets the master.
Note: This function has to be called, everytime ec_master_release() is
called, to free the slave list, domains etc.
\ingroup Master
*/
void ec_master_reset(ec_master_t *master /**< EtherCAT master */)
@@ -190,6 +210,7 @@ void ec_master_reset(ec_master_t *master /**< EtherCAT master */)
/**
Places a command in the command queue.
\ingroup Master
*/
void ec_master_queue_command(ec_master_t *master, /**< EtherCAT master */
@@ -217,6 +238,7 @@ void ec_master_queue_command(ec_master_t *master, /**< EtherCAT master */
/**
Sends the commands in the queue.
\return 0 in case of success, else < 0
\ingroup Master
*/
void ec_master_send_commands(ec_master_t *master /**< EtherCAT master */)
@@ -318,6 +340,7 @@ void ec_master_send_commands(ec_master_t *master /**< EtherCAT master */)
Processes a received frame.
This function is called by the network driver for every received frame.
\return 0 in case of success, else < 0
\ingroup Master
*/
void ec_master_receive(ec_master_t *master, /**< EtherCAT master */
@@ -405,6 +428,7 @@ void ec_master_receive(ec_master_t *master, /**< EtherCAT master */
Sends a single command and waits for its reception.
If the slave doesn't respond, the command is sent again.
\return 0 in case of success, else < 0
\ingroup Master
*/
int ec_master_simple_io(ec_master_t *master, /**< EtherCAT master */
@@ -449,6 +473,7 @@ int ec_master_simple_io(ec_master_t *master, /**< EtherCAT master */
Scans the EtherCAT bus for slaves.
Creates a list of slave structures for further processing.
\return 0 in case of success, else < 0
\ingroup Master
*/
int ec_master_bus_scan(ec_master_t *master /**< EtherCAT master */)
@@ -572,6 +597,7 @@ int ec_master_bus_scan(ec_master_t *master /**< EtherCAT master */)
Output statistics in cyclic mode.
This function outputs statistical data on demand, but not more often than
necessary. The output happens at most once a second.
\ingroup Master
*/
void ec_master_output_stats(ec_master_t *master /**< EtherCAT master */)
@@ -607,6 +633,7 @@ void ec_master_output_stats(ec_master_t *master /**< EtherCAT master */)
/**
Starts the Free-Run mode.
\ingroup Master
*/
void ec_master_freerun_start(ec_master_t *master /**< EtherCAT master */)
@@ -639,6 +666,7 @@ void ec_master_freerun_start(ec_master_t *master /**< EtherCAT master */)
/**
Stops the Free-Run mode.
\ingroup Master
*/
void ec_master_freerun_stop(ec_master_t *master /**< EtherCAT master */)
@@ -655,6 +683,7 @@ void ec_master_freerun_stop(ec_master_t *master /**< EtherCAT master */)
/**
Free-Run mode function.
\ingroup Master
*/
void ec_master_freerun(unsigned long data /**< private timer data = master */)
@@ -677,116 +706,10 @@ void ec_master_freerun(unsigned long data /**< private timer data = master */)
/*****************************************************************************/
/**
Translates an ASCII coded bus-address to a slave pointer.
These are the valid addressing schemes:
- \a "X" = the X. slave on the bus,
- \a "X:Y" = the Y. slave after the X. branch (bus coupler),
- \a "#X" = the slave with alias X,
- \a "#X:Y" = the Y. slave after the branch (bus coupler) with alias X.
X and Y are zero-based indices and may be provided in hexadecimal or octal
notation (with respective prefix).
\return pointer to the slave on success, else NULL
*/
ec_slave_t *ecrt_master_get_slave(const ec_master_t *master, /**< Master */
const char *address /**< address string */
)
{
unsigned long first, second;
char *remainder, *remainder2;
unsigned int alias_requested, alias_found;
ec_slave_t *alias_slave = NULL, *slave;
if (!address || address[0] == 0) return NULL;
alias_requested = 0;
if (address[0] == '#') {
alias_requested = 1;
address++;
}
first = simple_strtoul(address, &remainder, 0);
if (remainder == address) {
EC_ERR("Slave address \"%s\" - First number empty!\n", address);
return NULL;
}
if (alias_requested) {
alias_found = 0;
list_for_each_entry(alias_slave, &master->slaves, list) {
if (alias_slave->sii_alias == first) {
alias_found = 1;
break;
}
}
if (!alias_found) {
EC_ERR("Slave address \"%s\" - Alias not found!\n", address);
return NULL;
}
}
if (!remainder[0]) { // absolute position
if (alias_requested) {
return alias_slave;
}
else {
list_for_each_entry(slave, &master->slaves, list) {
if (slave->ring_position == first) return slave;
}
EC_ERR("Slave address \"%s\" - Absolute position invalid!\n",
address);
}
}
else if (remainder[0] == ':') { // field position
remainder++;
second = simple_strtoul(remainder, &remainder2, 0);
if (remainder2 == remainder) {
EC_ERR("Slave address \"%s\" - Second number empty!\n", address);
return NULL;
}
if (remainder2[0]) {
EC_ERR("Slave address \"%s\" - Invalid trailer!\n", address);
return NULL;
}
if (alias_requested) {
if (!alias_slave->type ||
alias_slave->type->special != EC_TYPE_BUS_COUPLER) {
EC_ERR("Slave address \"%s\": Alias slave must be bus coupler"
" in colon mode.\n", address);
return NULL;
}
list_for_each_entry(slave, &master->slaves, list) {
if (slave->coupler_index == alias_slave->coupler_index
&& slave->coupler_subindex == second)
return slave;
}
EC_ERR("Slave address \"%s\" - Bus coupler %i has no %lu. slave"
" following!\n", address, alias_slave->ring_position,
second);
return NULL;
}
else {
list_for_each_entry(slave, &master->slaves, list) {
if (slave->coupler_index == first
&& slave->coupler_subindex == second) return slave;
}
}
}
else
EC_ERR("Slave address \"%s\" - Invalid format!\n", address);
return NULL;
}
/*****************************************************************************/
/**
Initializes a sync manager configuration page.
The referenced memory (\a data) must be at least EC_SYNC_SIZE bytes.
\ingroup Master
*/
void ec_sync_config(const ec_sync_t *sync, /**< sync manager */
@@ -805,6 +728,7 @@ void ec_sync_config(const ec_sync_t *sync, /**< sync manager */
/**
Initializes a sync manager configuration page with EEPROM data.
The referenced memory (\a data) must be at least EC_SYNC_SIZE bytes.
\ingroup Master
*/
void ec_eeprom_sync_config(const ec_eeprom_sync_t *sync, /**< sync manager */
@@ -823,6 +747,7 @@ void ec_eeprom_sync_config(const ec_eeprom_sync_t *sync, /**< sync manager */
/**
Initializes an FMMU configuration page.
The referenced memory (\a data) must be at least EC_FMMU_SIZE bytes.
\ingroup Master
*/
void ec_fmmu_config(const ec_fmmu_t *fmmu, /**< FMMU */
@@ -845,6 +770,7 @@ void ec_fmmu_config(const ec_fmmu_t *fmmu, /**< FMMU */
/**
Formats attribute data for SysFS read access.
\return number of bytes to read
\ingroup Master
*/
ssize_t ec_show_master_attribute(struct kobject *kobj, /**< kobject */
@@ -875,6 +801,7 @@ ssize_t ec_show_master_attribute(struct kobject *kobj, /**< kobject */
/**
Processes the watchdog command.
\ingroup Master
*/
void ec_master_process_watch_command(ec_master_t *master
@@ -918,6 +845,22 @@ void ec_master_process_watch_command(ec_master_t *master
}
}
/*****************************************************************************/
/**
Does the Ethernet-over-EtherCAT processing.
\ingroup Master
*/
void ec_master_run_eoe(ec_master_t *master /**< EtherCAT master */)
{
ec_eoe_t *eoe;
list_for_each_entry(eoe, &master->eoe_slaves, list) {
ec_eoe_run(eoe);
}
}
/******************************************************************************
* Realtime interface
*****************************************************************************/
@@ -925,6 +868,7 @@ void ec_master_process_watch_command(ec_master_t *master
/**
Creates a domain.
\return pointer to new domain on success, else NULL
\ingroup Master
*/
ec_domain_t *ecrt_master_create_domain(ec_master_t *master /**< master */)
@@ -970,6 +914,7 @@ ec_domain_t *ecrt_master_create_domain(ec_master_t *master /**< master */)
managers and FMMUs, and does the appropriate transitions, until the slave
is operational.
\return 0 in case of success, else < 0
\ingroup Master
*/
int ecrt_master_activate(ec_master_t *master /**< EtherCAT master */)
@@ -1156,6 +1101,7 @@ int ecrt_master_activate(ec_master_t *master /**< EtherCAT master */)
/**
Resets all slaves to INIT state.
\ingroup Master
*/
void ecrt_master_deactivate(ec_master_t *master /**< EtherCAT master */)
@@ -1175,6 +1121,7 @@ void ecrt_master_deactivate(ec_master_t *master /**< EtherCAT master */)
Fetches the SDO dictionaries of all slaves.
Slaves that do not support the CoE protocol are left out.
\return 0 in case of success, else < 0
\ingroup Master
*/
int ecrt_master_fetch_sdo_lists(ec_master_t *master /**< EtherCAT master */)
@@ -1198,6 +1145,7 @@ int ecrt_master_fetch_sdo_lists(ec_master_t *master /**< EtherCAT master */)
/**
Sends queued commands and waits for their reception.
\ingroup Master
*/
void ecrt_master_sync_io(ec_master_t *master /**< EtherCAT master */)
@@ -1253,6 +1201,7 @@ void ecrt_master_sync_io(ec_master_t *master /**< EtherCAT master */)
/**
Asynchronous sending of commands.
\ingroup Master
*/
void ecrt_master_async_send(ec_master_t *master /**< EtherCAT master */)
@@ -1279,6 +1228,7 @@ void ecrt_master_async_send(ec_master_t *master /**< EtherCAT master */)
/**
Asynchronous receiving of commands.
\ingroup Master
*/
void ecrt_master_async_receive(ec_master_t *master /**< EtherCAT master */)
@@ -1313,6 +1263,7 @@ void ecrt_master_async_receive(ec_master_t *master /**< EtherCAT master */)
Prepares synchronous IO.
Queues all domain commands and sends them. Then waits a certain time, so
that ecrt_master_sasync_receive() can be called securely.
\ingroup Master
*/
void ecrt_master_prepare_async_io(ec_master_t *master /**< EtherCAT master */)
@@ -1340,6 +1291,7 @@ void ecrt_master_prepare_async_io(ec_master_t *master /**< EtherCAT master */)
/**
Does all cyclic master work.
\ingroup Master
*/
void ecrt_master_run(ec_master_t *master /**< EtherCAT master */)
@@ -1357,11 +1309,120 @@ void ecrt_master_run(ec_master_t *master /**< EtherCAT master */)
/*****************************************************************************/
/**
Translates an ASCII coded bus-address to a slave pointer.
These are the valid addressing schemes:
- \a "X" = the X. slave on the bus,
- \a "X:Y" = the Y. slave after the X. branch (bus coupler),
- \a "#X" = the slave with alias X,
- \a "#X:Y" = the Y. slave after the branch (bus coupler) with alias X.
X and Y are zero-based indices and may be provided in hexadecimal or octal
notation (with respective prefix).
\return pointer to the slave on success, else NULL
\ingroup Master
*/
ec_slave_t *ecrt_master_get_slave(const ec_master_t *master, /**< Master */
const char *address /**< address string */
)
{
unsigned long first, second;
char *remainder, *remainder2;
unsigned int alias_requested, alias_found;
ec_slave_t *alias_slave = NULL, *slave;
if (!address || address[0] == 0) return NULL;
alias_requested = 0;
if (address[0] == '#') {
alias_requested = 1;
address++;
}
first = simple_strtoul(address, &remainder, 0);
if (remainder == address) {
EC_ERR("Slave address \"%s\" - First number empty!\n", address);
return NULL;
}
if (alias_requested) {
alias_found = 0;
list_for_each_entry(alias_slave, &master->slaves, list) {
if (alias_slave->sii_alias == first) {
alias_found = 1;
break;
}
}
if (!alias_found) {
EC_ERR("Slave address \"%s\" - Alias not found!\n", address);
return NULL;
}
}
if (!remainder[0]) { // absolute position
if (alias_requested) {
return alias_slave;
}
else {
list_for_each_entry(slave, &master->slaves, list) {
if (slave->ring_position == first) return slave;
}
EC_ERR("Slave address \"%s\" - Absolute position invalid!\n",
address);
}
}
else if (remainder[0] == ':') { // field position
remainder++;
second = simple_strtoul(remainder, &remainder2, 0);
if (remainder2 == remainder) {
EC_ERR("Slave address \"%s\" - Second number empty!\n", address);
return NULL;
}
if (remainder2[0]) {
EC_ERR("Slave address \"%s\" - Invalid trailer!\n", address);
return NULL;
}
if (alias_requested) {
if (!alias_slave->type ||
alias_slave->type->special != EC_TYPE_BUS_COUPLER) {
EC_ERR("Slave address \"%s\": Alias slave must be bus coupler"
" in colon mode.\n", address);
return NULL;
}
list_for_each_entry(slave, &master->slaves, list) {
if (slave->coupler_index == alias_slave->coupler_index
&& slave->coupler_subindex == second)
return slave;
}
EC_ERR("Slave address \"%s\" - Bus coupler %i has no %lu. slave"
" following!\n", address, alias_slave->ring_position,
second);
return NULL;
}
else {
list_for_each_entry(slave, &master->slaves, list) {
if (slave->coupler_index == first
&& slave->coupler_subindex == second) return slave;
}
}
}
else
EC_ERR("Slave address \"%s\" - Invalid format!\n", address);
return NULL;
}
/*****************************************************************************/
/**
Sets the debug level of the master.
The following levels are valid:
- 1: only output positions marks and basic data
- 2: additional frame data output
\ingroup Master
*/
void ecrt_master_debug(ec_master_t *master, /**< EtherCAT master */
@@ -1382,6 +1443,7 @@ void ecrt_master_debug(ec_master_t *master, /**< EtherCAT master */
- 0: Only slave types and positions
- 1: with EEPROM contents
- >1: with SDO dictionaries
\ingroup Master
*/
void ecrt_master_print(const ec_master_t *master, /**< EtherCAT master */
@@ -1408,21 +1470,6 @@ void ecrt_master_print(const ec_master_t *master, /**< EtherCAT master */
/*****************************************************************************/
/**
Does the Ethernet-over-EtherCAT processing.
*/
void ec_master_run_eoe(ec_master_t *master /**< EtherCAT master */)
{
ec_eoe_t *eoe;
list_for_each_entry(eoe, &master->eoe_slaves, list) {
ec_eoe_run(eoe);
}
}
/*****************************************************************************/
EXPORT_SYMBOL(ecrt_master_create_domain);
EXPORT_SYMBOL(ecrt_master_activate);
EXPORT_SYMBOL(ecrt_master_deactivate);

View File

@@ -6,6 +6,23 @@
*
* $Id$
*
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
*
* This file is part of the IgH EtherCAT Master.
*
* The IgH EtherCAT Master is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*
* The IgH EtherCAT Master is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#ifndef _EC_MASTER_H_
@@ -20,6 +37,14 @@
/*****************************************************************************/
/**
\defgroup Master EtherCAT master
Data types and functions of the EtherCAT master.
\{
*/
/*****************************************************************************/
/**
EtherCAT master mode.
*/
@@ -80,6 +105,8 @@ struct ec_master
ec_master_mode_t mode; /**< master mode */
};
/** \} */
/*****************************************************************************/
// master creation and deletion

View File

@@ -8,13 +8,22 @@
*
* $Id$
*
* (C) Copyright IgH 2005
* Ingenieurgemeinschaft IgH
* Heinz-Bäcker Str. 34
* D-45356 Essen
* Tel.: +49 201/61 99 31
* Fax.: +49 201/61 98 36
* E-mail: sp@igh-essen.com
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
*
* This file is part of the IgH EtherCAT Master.
*
* The IgH EtherCAT Master is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*
* The IgH EtherCAT Master is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/

View File

@@ -6,6 +6,23 @@
*
* $Id$
*
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
*
* This file is part of the IgH EtherCAT Master.
*
* The IgH EtherCAT Master is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*
* The IgH EtherCAT Master is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#include <linux/module.h>
@@ -65,6 +82,7 @@ const ec_code_msg_t al_status_messages[];
/**
Slave constructor.
\return 0 in case of success, else < 0
\ingroup Slave
*/
int ec_slave_init(ec_slave_t *slave, /**< EtherCAT slave */
@@ -135,6 +153,7 @@ int ec_slave_init(ec_slave_t *slave, /**< EtherCAT slave */
/**
Slave destructor.
\ingroup Slave
*/
void ec_slave_clear(struct kobject *kobj /**< kobject of the slave */)
@@ -201,6 +220,7 @@ void ec_slave_clear(struct kobject *kobj /**< kobject of the slave */)
/**
Reads all necessary information from a slave.
\return 0 in case of success, else < 0
\ingroup Slave
*/
int ec_slave_fetch(ec_slave_t *slave /**< EtherCAT slave */)
@@ -278,6 +298,7 @@ int ec_slave_fetch(ec_slave_t *slave /**< EtherCAT slave */)
/**
Reads 16 bit from the slave information interface (SII).
\return 0 in case of success, else < 0
\ingroup Slave
*/
int ec_slave_sii_read16(ec_slave_t *slave,
@@ -338,6 +359,7 @@ int ec_slave_sii_read16(ec_slave_t *slave,
/**
Reads 32 bit from the slave information interface (SII).
\return 0 in case of success, else < 0
\ingroup Slave
*/
int ec_slave_sii_read32(ec_slave_t *slave,
@@ -398,6 +420,7 @@ int ec_slave_sii_read32(ec_slave_t *slave,
/**
Writes 16 bit of data to the slave information interface (SII).
\return 0 in case of success, else < 0
\ingroup Slave
*/
int ec_slave_sii_write16(ec_slave_t *slave,
@@ -468,6 +491,7 @@ int ec_slave_sii_write16(ec_slave_t *slave,
/**
Fetches data from slave's EEPROM.
\return 0 in case of success, else < 0
\ingroup Slave
*/
int ec_slave_fetch_categories(ec_slave_t *slave /**< EtherCAT slave */)
@@ -560,6 +584,7 @@ int ec_slave_fetch_categories(ec_slave_t *slave /**< EtherCAT slave */)
/**
Fetches data from a STRING category.
\return 0 in case of success, else < 0
\ingroup Slave
*/
int ec_slave_fetch_strings(ec_slave_t *slave, /**< EtherCAT slave */
@@ -598,6 +623,7 @@ int ec_slave_fetch_strings(ec_slave_t *slave, /**< EtherCAT slave */
/**
Fetches data from a GENERAL category.
\return 0 in case of success, else < 0
\ingroup Slave
*/
int ec_slave_fetch_general(ec_slave_t *slave, /**< EtherCAT slave */
@@ -625,6 +651,7 @@ int ec_slave_fetch_general(ec_slave_t *slave, /**< EtherCAT slave */
/**
Fetches data from a SYNC MANAGER category.
\return 0 in case of success, else < 0
\ingroup Slave
*/
int ec_slave_fetch_sync(ec_slave_t *slave, /**< EtherCAT slave */
@@ -661,6 +688,7 @@ int ec_slave_fetch_sync(ec_slave_t *slave, /**< EtherCAT slave */
/**
Fetches data from a [RT]XPDO category.
\return 0 in case of success, else < 0
\ingroup Slave
*/
int ec_slave_fetch_pdo(ec_slave_t *slave, /**< EtherCAT slave */
@@ -722,9 +750,14 @@ int ec_slave_fetch_pdo(ec_slave_t *slave, /**< EtherCAT slave */
/**
Searches the string list for an index and allocates a new string.
\return 0 in case of success, else < 0
\ingroup Slave
\todo documentation
*/
int ec_slave_locate_string(ec_slave_t *slave, unsigned int index, char **ptr)
int ec_slave_locate_string(ec_slave_t *slave, /**< EtherCAT slave */
unsigned int index, /**< string index */
char **ptr /**< Address of the string pointer */
)
{
ec_eeprom_string_t *string;
char *err_string;
@@ -767,6 +800,7 @@ int ec_slave_locate_string(ec_slave_t *slave, unsigned int index, char **ptr)
/**
Acknowledges an error after a state transition.
\ingroup Slave
*/
void ec_slave_state_ack(ec_slave_t *slave, /**< EtherCAT slave */
@@ -822,7 +856,8 @@ void ec_slave_state_ack(ec_slave_t *slave, /**< EtherCAT slave */
/**
Reads the AL status code of a slave and displays it.
If the AL status code is not supported, or if no error occurred (both
resulting in code=0), nothing is displayed.
resulting in code = 0), nothing is displayed.
\ingroup Slave
*/
void ec_slave_read_al_status_code(ec_slave_t *slave /**< EtherCAT slave */)
@@ -858,6 +893,7 @@ void ec_slave_read_al_status_code(ec_slave_t *slave /**< EtherCAT slave */)
/**
Does a state transition.
\return 0 in case of success, else < 0
\ingroup Slave
*/
int ec_slave_state_change(ec_slave_t *slave, /**< EtherCAT slave */
@@ -927,6 +963,7 @@ int ec_slave_state_change(ec_slave_t *slave, /**< EtherCAT slave */
If the FMMU configuration is already prepared, the function returns with
success.
\return 0 in case of success, else < 0
\ingroup Slave
*/
int ec_slave_prepare_fmmu(ec_slave_t *slave, /**< EtherCAT slave */
@@ -965,6 +1002,7 @@ int ec_slave_prepare_fmmu(ec_slave_t *slave, /**< EtherCAT slave */
- 0: Only slave types and addresses
- 1: with EEPROM information
- >1: with SDO dictionaries
\ingroup Slave
*/
void ec_slave_print(const ec_slave_t *slave, /**< EtherCAT slave */
@@ -1126,6 +1164,7 @@ void ec_slave_print(const ec_slave_t *slave, /**< EtherCAT slave */
/**
Outputs the values of the CRC faoult counters and resets them.
\return 0 in case of success, else < 0
\ingroup Slave
*/
int ec_slave_check_crc(ec_slave_t *slave /**< EtherCAT slave */)
@@ -1181,10 +1220,11 @@ int ec_slave_check_crc(ec_slave_t *slave /**< EtherCAT slave */)
/**
Writes the "configured station alias" to the slave's EEPROM.
\return 0 in case of success, else < 0
\ingroup Slave
*/
int ecrt_slave_write_alias(ec_slave_t *slave, /** EtherCAT slave */
uint16_t alias /** new alias */
int ecrt_slave_write_alias(ec_slave_t *slave, /**< EtherCAT slave */
uint16_t alias /**< new alias */
)
{
return ec_slave_sii_write16(slave, 0x0004, alias);
@@ -1195,6 +1235,7 @@ int ecrt_slave_write_alias(ec_slave_t *slave, /** EtherCAT slave */
/**
Formats attribute data for SysFS read access.
\return number of bytes to read
\ingroup Slave
*/
ssize_t ec_show_slave_attribute(struct kobject *kobj, /**< slave's kobject */

View File

@@ -6,6 +6,23 @@
*
* $Id$
*
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
*
* This file is part of the IgH EtherCAT Master.
*
* The IgH EtherCAT Master is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*
* The IgH EtherCAT Master is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#ifndef _EC_SLAVE_H_
@@ -20,6 +37,14 @@
/*****************************************************************************/
/**
\defgroup Slave EtherCAT slave
Data types and functions for EtherCAT slaves.
\{
*/
/*****************************************************************************/
/**
State of an EtherCAT slave.
*/
@@ -244,6 +269,8 @@ struct ec_slave
ec_command_t mbox_command; /**< mailbox command */
};
/** \} */
/*****************************************************************************/
// slave construction/destruction

View File

@@ -6,6 +6,23 @@
*
* $Id$
*
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
*
* This file is part of the IgH EtherCAT Master.
*
* The IgH EtherCAT Master is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*
* The IgH EtherCAT Master is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#include <linux/module.h>

View File

@@ -6,6 +6,23 @@
*
* $Id$
*
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
*
* This file is part of the IgH EtherCAT Master.
*
* The IgH EtherCAT Master is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*
* The IgH EtherCAT Master is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#ifndef _EC_TYPES_H_
@@ -24,6 +41,7 @@
/**
Special slaves.
\ingroup Slave
*/
typedef enum
@@ -38,6 +56,7 @@ ec_special_type_t;
/**
Process data field.
\ingroup Slave
*/
typedef struct
@@ -51,6 +70,7 @@ ec_field_t;
/**
Sync-Manager.
\ingroup Slave
*/
typedef struct
@@ -66,6 +86,7 @@ ec_sync_t;
/**
Slave description type.
\ingroup Slave
*/
typedef struct ec_slave_type
@@ -82,6 +103,7 @@ ec_slave_type_t;
/**
Slave type identification.
\ingroup Slave
*/
typedef struct

View File

@@ -6,6 +6,23 @@
#
# $Id$
#
# Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
#
# This file is part of the IgH EtherCAT Master.
#
# The IgH EtherCAT Master is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2 of the License.
#
# The IgH EtherCAT Master is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the IgH EtherCAT Master; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
#----------------------------------------------------------------
ifneq ($(KERNELRELEASE),)

View File

@@ -6,6 +6,23 @@
*
* $Id$
*
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
*
* This file is part of the IgH EtherCAT Master.
*
* The IgH EtherCAT Master is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*
* The IgH EtherCAT Master is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#include <linux/module.h>

View File

@@ -4,6 +4,23 @@
#
# $Id$
#
# Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
#
# This file is part of the IgH EtherCAT Master.
#
# The IgH EtherCAT Master is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2 of the License.
#
# The IgH EtherCAT Master is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the IgH EtherCAT Master; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
#------------------------------------------------------------------------------
ifneq ($(KERNELRELEASE),)

View File

@@ -6,6 +6,23 @@
#
# $Id: install.sh 5 2006-04-07 13:49:10Z fp $
#
# Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
#
# This file is part of the IgH EtherCAT Master.
#
# The IgH EtherCAT Master is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2 of the License.
#
# The IgH EtherCAT Master is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the IgH EtherCAT Master; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
#------------------------------------------------------------------------------
# Fetch parameters

View File

@@ -1,6 +1,23 @@
/******************************************************************************
*
* $Id$
* $Id$
*
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
*
* This file is part of the IgH EtherCAT Master.
*
* The IgH EtherCAT Master is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*
* The IgH EtherCAT Master is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/

View File

@@ -4,18 +4,25 @@
*
* Kernelmodul f<>ür 2.6 Kernel zur Me<4D>ßdatenerfassung, Steuerung und Regelung.
*
* Autor: Wilhelm Hagemeister, Florian Pose
*
* (C) Copyright IgH 2002
* Ingenieurgemeinschaft IgH
* Heinz-B<>äcker Str. 34
* D-45356 Essen
* Tel.: +49 201/61 99 31
* Fax.: +49 201/61 98 36
* E-mail: hm@igh-essen.com
*
* $Id$
*
* Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
*
* This file is part of the IgH EtherCAT Master.
*
* The IgH EtherCAT Master is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*
* The IgH EtherCAT Master is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the IgH EtherCAT Master; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
// Linux

View File

@@ -1,30 +1,35 @@
#!/usr/bin/perl -w
#------------------------------------------------------------
#------------------------------------------------------------------------------
#
# (C) Copyright
# Ingenieurgemeinschaft IgH
# Heinz-Baecker-Strasse 34
# D-45356 Essen
# Tel.: +49-201/61 99 31
# Fax.: +49-201/61 98 36
# WWW: http://www.igh-essen.com
# Email: msr@igh-essen.com
# Copyright (C) 2006 Ingenieurgemeinschaft IgH
#
#------------------------------------------------------------
# This file is part of the IgH EtherCAT Master.
#
# Multithreaded Server
# according to the example from "Programming Perl"
# this code is improved according to the example from
# perldoc perlipc, so now safely being usable under Perl 5.8
# (see note (*))
# The IgH EtherCAT Master is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2 of the License.
#
# works with read/write on a device-file
# The IgH EtherCAT Master is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# $Revision: 1.1 $
# $Date: 2004/10/01 16:00:42 $
# $RCSfile: msrserv.pl,v $
# You should have received a copy of the GNU General Public License
# along with the IgH EtherCAT Master; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
#------------------------------------------------------------
#------------------------------------------------------------------------------
#
# Multithreaded Server
# according to the example from "Programming Perl"
# this code is improved according to the example from
# perldoc perlipc, so now safely being usable under Perl 5.8
# (see note (*))
#
# works with read/write on a device-file
#
#------------------------------------------------------------------------------
require 5.002;
use strict;

View File

@@ -8,6 +8,23 @@
#
# $Id: slave.c 340 2006-04-11 10:17:30Z fp $
#
# Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH
#
# This file is part of the IgH EtherCAT Master.
#
# The IgH EtherCAT Master is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2 of the License.
#
# The IgH EtherCAT Master is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the IgH EtherCAT Master; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
#------------------------------------------------------------------------------
use strict;