Files
python-gpiozero/docs/api_generic.rst
Dave Jones 9fdc093837 Add pin_factory to all relevant class docs
Also tell a whole load of lies about what's a keyword-only arg. In the
vast majority of cases, pin_factory (and other args) *aren't*
keyword-only ... but we'd really like them to be, it's just difficult
while maintaining py2 compatibility.
2017-07-14 11:01:02 +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(\*, pin_factory=None)
: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: