Files
python-gpiozero/docs/api_generic.rst
Dave Jones 576fced6c4 Update all hierarchy charts in the docs
Added notes on how the abstracts are represented, ensured all the class
hierarchies were up to date, and changed the orientation so the classes
are actually readable in the big chart.
2017-06-21 17:01:13 +01:00

69 lines
1.5 KiB
ReStructuredText

===============
Generic Classes
===============
.. currentmodule:: gpiozero
The GPIO Zero class hierarchy is quite extensive. It contains several base
classes (most of which are documented in their corresponding chapters):
* :class:`Device` is the root of the hierarchy, implementing base functionality
like :meth:`~Device.close` and context manager handlers.
* :class:`GPIODevice` represents individual devices that attach to a single
GPIO pin
* :class:`SPIDevice` represents devices that communicate over an SPI interface
(implemented as four GPIO pins)
* :class:`InternalDevice` represents devices that are entirely internal to
the Pi (usually operating system related services)
* :class:`CompositeDevice` represents devices composed of multiple other
devices like HATs
There are also several `mixin classes`_ for adding important functionality
at numerous points in the hierarchy, which is illustrated below (mixin classes
are represented in purple, while abstract classes are shaded lighter):
.. image:: images/device_hierarchy.*
.. _mixin classes: https://en.wikipedia.org/wiki/Mixin
Device
======
.. autoclass:: Device
:members: close, closed, value, is_active
ValuesMixin
===========
.. autoclass:: ValuesMixin(...)
:members:
SourceMixin
===========
.. autoclass:: SourceMixin(...)
:members:
SharedMixin
===========
.. autoclass:: SharedMixin(...)
:members: _shared_key
EventsMixin
===========
.. autoclass:: EventsMixin(...)
:members:
HoldMixin
=========
.. autoclass:: HoldMixin(...)
:members: