pyparts.platforms.gpio.base_gpio
index
/home/sean/src/python/pyparts/src/pyparts/platforms/gpio/base_gpio.py

 
Modules
       
abc

 
Classes
       
__builtin__.object
BaseGPIO
BaseDigitalInput
exceptions.Exception(exceptions.BaseException)
GPIOError

 
class BaseDigitalInput(BaseGPIO)
    A class for creating digital input type peripherals.
 
BaseDigitalInput adds interrupt functionality to BaseGPIO.
 
 
Method resolution order:
BaseDigitalInput
BaseGPIO
__builtin__.object

Methods defined here:
add_interrupt(self, type, callback=None, debounce_time_ms=0)
Adds an interrupt to the digital input pin.
 
Args:
  type: FALLING, RISING, or BOTH. Edge to trigger the interrupt on.
  callback: Function. The function to call when the interrupt fires.
      (default=None)
  debounce_time_ms: Integer. Debounce time to put on the interrupt.
      (default=0)
remove_interrupt(self)
Removes all interrupts from the digital input pin.
wait_for_edge(self, type)
Blocks until the edge is detected.
 
Args:
  type: RISING, FALLING, or BOTH. Edge to detect before unblocking.

Data and other attributes defined here:
INTERRUPT_BOTH = None
INTERRUPT_FALLING = None
INTERRUPT_RISING = None
__abstractmethods__ = frozenset(['_read', '_write', 'add_interrupt', 'wait_for_edge'])

Methods inherited from BaseGPIO:
__init__(self, pin, mode, pull_up_down)
Creates a GPIO pin.
 
Args:
  pin: Integer. The pin to create the GPIO on.
  mode: INPUT, OUTPUT, or BIDIRECTIONAL. The type of pin mode to use.
  pull_up_down: PUD_UP or PUD_DOWN. Enable pull up or pull down resistors.
set_high(self)
Writes a value of HIGH to the GPIO pin.
 
Raises:
  GPIOError: Trying to write to a pin in INPUT mode will throw an
    exception.
set_low(self)
Writes a value of LOW to the GPIO pin.
 
Raises:
  GPIOError: Trying to write to a pin in INPUT mode will throw an
    exception.

Data descriptors inherited from BaseGPIO:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
is_high
Checks if the GPIO pin has a value of HIGH.
 
Returns:
  True if the pin is in a HIGH state, False otherwise.
is_low
Checks if the GPIO pin has a value of LOW.
 
Returns:
  True if the GPIO pin is in a LOW state, False otherwise.
mode
Gets the mode the GPIO pin is in.
 
Returns:
  The mode being used by the GPIO pin.
pin_number
Gets the pin number of the GPIO.
 
Returns:
  The GPIO's pin number.
pull_up_down
Gets the state of the GPIO pull up or pull down resistors.
 
Returns:
  The state of the GPIO pull up or pull down resistors.

Data and other attributes inherited from BaseGPIO:
BIDIRECTIONAL = 2
INPUT = 1
OUTPUT = 0
PUD_DOWN = 2
PUD_UP = 1
__metaclass__ = <class 'abc.ABCMeta'>
Metaclass for defining Abstract Base Classes (ABCs).
 
Use this metaclass to create an ABC.  An ABC can be subclassed
directly, and then acts as a mix-in class.  You can also register
unrelated concrete classes (even built-in classes) and unrelated
ABCs as 'virtual subclasses' -- these and their descendants will
be considered subclasses of the registering ABC by the built-in
issubclass() function, but the registering ABC won't show up in
their MRO (Method Resolution Order) nor will method
implementations defined by the registering ABC be callable (not
even via super()).

 
class BaseGPIO(__builtin__.object)
    A class for creating GPIO type peripherals.
 
BaseGPIO implements basic GPIO functionality such as reading pin values
and setting pins high or low. Platforms are expected to subclass BaseGPIO
and provide platform specific implementations of _write and _read. Platforms
will likely also have to override the constructor to do platform specific
initialization tasks like setting the pin to INPUT or OUTPUT.
 
Attributes:
  _pin: The GPIO pin being used. For example a pin number.
  _mode: The mode the pin is in. For example INPUT or OUTPUT.
 
  Methods defined here:
__init__(self, pin, mode, pull_up_down)
Creates a GPIO pin.
 
Args:
  pin: Integer. The pin to create the GPIO on.
  mode: INPUT, OUTPUT, or BIDIRECTIONAL. The type of pin mode to use.
  pull_up_down: PUD_UP or PUD_DOWN. Enable pull up or pull down resistors.
set_high(self)
Writes a value of HIGH to the GPIO pin.
 
Raises:
  GPIOError: Trying to write to a pin in INPUT mode will throw an
    exception.
set_low(self)
Writes a value of LOW to the GPIO pin.
 
Raises:
  GPIOError: Trying to write to a pin in INPUT mode will throw an
    exception.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
is_high
Checks if the GPIO pin has a value of HIGH.
 
Returns:
  True if the pin is in a HIGH state, False otherwise.
is_low
Checks if the GPIO pin has a value of LOW.
 
Returns:
  True if the GPIO pin is in a LOW state, False otherwise.
mode
Gets the mode the GPIO pin is in.
 
Returns:
  The mode being used by the GPIO pin.
pin_number
Gets the pin number of the GPIO.
 
Returns:
  The GPIO's pin number.
pull_up_down
Gets the state of the GPIO pull up or pull down resistors.
 
Returns:
  The state of the GPIO pull up or pull down resistors.

Data and other attributes defined here:
BIDIRECTIONAL = 2
INPUT = 1
OUTPUT = 0
PUD_DOWN = 2
PUD_UP = 1
__abstractmethods__ = frozenset(['_read', '_write'])
__metaclass__ = <class 'abc.ABCMeta'>
Metaclass for defining Abstract Base Classes (ABCs).
 
Use this metaclass to create an ABC.  An ABC can be subclassed
directly, and then acts as a mix-in class.  You can also register
unrelated concrete classes (even built-in classes) and unrelated
ABCs as 'virtual subclasses' -- these and their descendants will
be considered subclasses of the registering ABC by the built-in
issubclass() function, but the registering ABC won't show up in
their MRO (Method Resolution Order) nor will method
implementations defined by the registering ABC be callable (not
even via super()).

 
class GPIOError(exceptions.Exception)
    Error type for exceptions while writing to GPIO pins.
 
 
Method resolution order:
GPIOError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.Exception:
__init__(...)
x.__init__(...) initializes x; see help(type(x)) for signature

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__str__(...)
x.__str__() <==> str(x)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
Data
        HIGH = True
LOW = False