From 2bacd729f24319783c3a886137f9afad8c816cb8 Mon Sep 17 00:00:00 2001 From: Martin Teichmann <martin.teichmann@xfel.eu> Date: Wed, 18 Jan 2023 15:59:03 +0100 Subject: [PATCH] clean up documentation --- ebpfcat/ethercat.py | 36 +++++++++++++++++++++++++++++++++--- ebpfcat/ethercat.rst | 1 - 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/ebpfcat/ethercat.py b/ebpfcat/ethercat.py index 6677da0..078ea3a 100644 --- a/ebpfcat/ethercat.py +++ b/ebpfcat/ethercat.py @@ -21,10 +21,20 @@ # users may want to consult a lawyer before using this program. """\ -Low-level access to EtherCAT -============================ +:mod:`ethercat` --- Low-level access to EtherCAT +================================================ this modules contains the code to actually talk to EtherCAT terminals. + +.. autoclass:: EtherCat + :members: + +.. autoclass:: Terminal + :members: + +.. autoclass:: Packet + :members: + """ from asyncio import ensure_future, Event, Future, gather, get_event_loop, Protocol, Queue, Lock from enum import Enum @@ -346,7 +356,27 @@ class EtherCat(Protocol): class Terminal: - """Represent one terminal ("slave") in the loop""" + """Represent one terminal ("slave") in the loop + + Communication with a terminal is done in several ways: process data, which + needs to be updated fast, is directly read or written within one package, + the values are directly in the packet, called the process data object, PDO. + + Slower data is transferred as service data objects (SDO). Requests to + change them are written into a mailbox, which is a specific location in the + packet address space. + + Every terminal has a small EEPROM which contains informations about itself. + + Attributes: + ec: The :class:`EtherCat` object this terminal belongs to. + This will be set once this terminal is added to such an object. + pdo_in_off, pdo_in_sz: The offset and size of the input PDO + pdo_out_off, pdo_out_sz: The offset and size of the output PDO + mbx_in_off, mbx_in_sz: The offset and size of the input mailbox + mbx_out_off, mbx_out_sz: The offset and size of the output mailbox + + """ async def initialize(self, relative, absolute): """Initialize the terminal diff --git a/ebpfcat/ethercat.rst b/ebpfcat/ethercat.rst index 004991e..a50fa14 100644 --- a/ebpfcat/ethercat.rst +++ b/ebpfcat/ethercat.rst @@ -101,4 +101,3 @@ Reference Documentation :members: .. automodule:: ebpfcat.ethercat - :members: -- GitLab