mirror of
https://github.com/naruxde/revpimodio2.git
synced 2026-03-31 15:08:09 +02:00
docs: add comprehensive documentation structure and API reference
Created topic-based documentation: - basics.rst: core concepts and fundamental usage - cyclic_programming.rst: PLC-style programming with Cycletools - event_programming.rst: event-driven patterns and callbacks - advanced.rst: gateway IOs, replace_io_file, watchdog management - installation.rst and quickstart.rst: getting started guides Added complete API reference in docs/api/: - All device classes including ModularBaseConnect_4_5 and GatewayMixin - I/O, helper, and main class documentation Enhanced Sphinx configuration with RTD theme and improved autodoc settings. Removed auto-generated modules.rst and revpimodio2.rst.
This commit is contained in:
@@ -1,18 +1,87 @@
|
||||
.. revpimodio2 documentation main file, created by
|
||||
sphinx-quickstart on Sun Jan 22 17:49:41 2023.
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
====================================
|
||||
Welcome to RevPiModIO Documentation!
|
||||
====================================
|
||||
|
||||
Welcome to revpimodio2's documentation!
|
||||
=======================================
|
||||
RevPiModIO is a Python3 module for programming Revolution Pi hardware from KUNBUS GmbH.
|
||||
It provides easy access to all devices and IOs from the piCtory configuration, supporting
|
||||
both cyclic (PLC-style) and event-driven programming paradigms.
|
||||
|
||||
.. note::
|
||||
**New to RevPiModIO?** Start with :doc:`installation` and :doc:`quickstart`.
|
||||
|
||||
Key Features
|
||||
============
|
||||
|
||||
* **Dual Programming Models**: Cyclic (PLC-style) and event-driven approaches
|
||||
* **Direct Hardware Access**: Simple Python interface to all I/O devices
|
||||
* **Automatic Configuration**: Loads piCtory device configuration
|
||||
* **Event System**: Callbacks for value changes and timer events
|
||||
* **Open Source**: LGPLv2 license, no licensing fees
|
||||
|
||||
Quick Example
|
||||
=============
|
||||
|
||||
**Cyclic Programming**::
|
||||
|
||||
import revpimodio2
|
||||
rpi = revpimodio2.RevPiModIO(autorefresh=True)
|
||||
|
||||
def main(ct):
|
||||
if ct.io.button.value:
|
||||
ct.io.led.value = True
|
||||
|
||||
rpi.cycleloop(main)
|
||||
|
||||
**Event-Driven Programming**::
|
||||
|
||||
import revpimodio2
|
||||
rpi = revpimodio2.RevPiModIO(autorefresh=True)
|
||||
|
||||
def on_change(ioname, iovalue):
|
||||
print(f"{ioname} = {iovalue}")
|
||||
|
||||
rpi.io.button.reg_event(on_change)
|
||||
rpi.handlesignalend()
|
||||
rpi.mainloop()
|
||||
|
||||
Documentation
|
||||
=============
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Contents:
|
||||
:caption: Getting Started
|
||||
|
||||
installation
|
||||
quickstart
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: User Guide
|
||||
|
||||
Indices and tables
|
||||
basics
|
||||
cyclic_programming
|
||||
event_programming
|
||||
advanced
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 3
|
||||
:caption: API Reference
|
||||
|
||||
api/index
|
||||
api/revpimodio
|
||||
api/io
|
||||
api/helper
|
||||
api/device
|
||||
|
||||
External Resources
|
||||
==================
|
||||
|
||||
* **Official Website**: `revpimodio.org <https://revpimodio.org>`_
|
||||
* **GitHub Repository**: `github.com/naruxde/ <https://github.com/naruxde/>`_
|
||||
* **Discussion Forum**: `revpimodio.org/diskussionsforum/ <https://revpimodio.org/diskussionsforum/>`_
|
||||
* **Revolution Pi Hardware**: `revolution.kunbus.com <https://revolution.kunbus.com>`_
|
||||
|
||||
Indices and Tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
|
||||
Reference in New Issue
Block a user