Skip to content
Snippets Groups Projects
Select Git revision
  • 0c217a78442bc9921048f1d9a3867e8d8ee860ae
  • develop default protected
  • feature/module-gpiod
  • 0.5.6
  • 0.5.5
  • 0.5.4
  • 0.5.3
  • 0.5.2
  • 0.5.1
  • 0.5.0
  • 0.4.1
  • 0.4.0
  • 0.3.2
  • 0.3.1
  • 0.3.0
  • 0.2.8
  • 0.2.7
  • 0.2.6
  • 0.2.5
  • 0.2.4
  • 0.2.3
  • 0.2.2
  • 0.2.1
23 results

__init__.py

Blame
  • user avatar
    Herb Peyerl authored and Ellis Percival committed
    * outputs must have PUD_OFF. Enforced on RPi.GPIO-0.6.3.
    
    * <tab> vs <spaces> snuck in
    0c217a78
    History
    __init__.py 562 B
    import abc
    
    from enum import Enum
    
    
    class PinDirection(Enum):
        INPUT = 0
        OUTPUT = 1
    
    
    class PinPullup(Enum):
        OFF = 0
        UP = 1
        DOWN = 2
    
    
    class GenericGPIO(object):
        """
        Abstracts a generic GPIO interface to be implemented by the modules in this
        directory.
        """
        __metaclass__ = abc.ABCMeta
    
        @abc.abstractmethod
        def setup_pin(self, pin, direction, pullup, pin_config):
            pass
    
        @abc.abstractmethod
        def set_pin(self, pin, value):
            pass
    
        @abc.abstractmethod
        def get_pin(self, pin):
            pass