1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
GPIO
====
Code Example
------------
.. code-block:: python
from periphery import GPIO
# Open GPIO /dev/gpiochip0 line 10 with input direction
gpio_in = GPIO("/dev/gpiochip0", 10, "in")
# Open GPIO /dev/gpiochip0 line 12 with output direction
gpio_out = GPIO("/dev/gpiochip0", 12, "out")
value = gpio_in.read()
gpio_out.write(not value)
gpio_in.close()
gpio_out.close()
API
---
.. class:: periphery.GPIO(path, line, direction)
.. autoclass:: periphery.CdevGPIO
.. class:: periphery.GPIO(line, direction)
.. autoclass:: periphery.SysfsGPIO
.. autoclass:: periphery.GPIO
:members:
:undoc-members:
:show-inheritance:
.. autoclass:: periphery.EdgeEvent
:members:
:undoc-members:
:show-inheritance:
.. autoclass:: periphery.GPIOError
:members:
:undoc-members:
:show-inheritance:
|