:py:mod:`lager.gpio` ==================== .. py:module:: lager.gpio Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: lager.gpio.Mode lager.gpio.Level lager.gpio.GPIO Attributes ~~~~~~~~~~ .. autoapisummary:: lager.gpio.LAGER_HOST .. py:data:: LAGER_HOST :meta private: .. py:class:: Mode Bases: :py:obj:`enum.Enum` GPIO I/O Mode .. py:attribute:: IN :annotation: = 1 Input .. py:attribute:: OUT :annotation: = 2 Output .. py:class:: Level Bases: :py:obj:`enum.Enum` GPIO Level .. py:attribute:: ON :annotation: = ON .. py:attribute:: OFF :annotation: = OFF .. py:attribute:: HIGH :annotation: = HIGH .. py:attribute:: LOW :annotation: = LOW .. py:class:: GPIO(name, pin) Class for managing access to GPIO lines .. py:property:: name .. py:property:: pin .. py:method:: __str__() Return str(self). .. py:method:: input() Read the value for a GPIO Net whose direction has been set to INput ``level = my_gpio_net.input()`` .. py:method:: output(level) Write a value to a GPIO Net whose direction has been set to OUTput my_gpio_net.output(Level.HIGH) time.sleep(1) my_gpio_net.output(Leve.LOW) .. py:method:: set(mode) Set the direction of the GPIO net to either INput or OUTput my_gpio_net.set(GPIO.Mode.OUT) my_other_gpio_net.set(GPIO.Mode.IN)