GPIO
index
/home/linaro/python/linker_starter_kit/libsoc_zero/GPIO.py

 
Modules
       
libsoc.gpio

 
Classes
       
builtins.object
Input
Button
Tilt
LED

 
class Button(Input)
    Extends input class to define a button
 
 
Method resolution order:
Button
Input
builtins.object

Methods defined here:
__init__(self, pin)

Methods inherited from Input:
clear_when_pressed(self)
Remove callback from when_pressed
close(self)
When you've finished close it all down nicely!
get_edge(self)
Returns which edge is currently set for interrupt
:return: integer
0 = EDGE_NONE
1 = EDGE_FALLING
2 = EDGE_RISING
3 = EDGE_BOTH
is_pressed(self)
Get the state of the input device
:return:
Returns 'True' if active. 'False' if not
trigger_on_rising_edge(self)
Set the edge that the interrupt will trigger off
:return:
wait_for_press(self, timeout=10000000)
Pause the script until the device is activated or the timeout is reached
when_pressed(self, interrupt_callback)

Data descriptors inherited from Input:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class Input(builtins.object)
    Control a digital input component
The pin name should be of the format 'GPIO-A'
 
  Methods defined here:
__init__(self, gpio_input_id)
clear_when_pressed(self)
Remove callback from when_pressed
close(self)
When you've finished close it all down nicely!
get_edge(self)
Returns which edge is currently set for interrupt
:return: integer
0 = EDGE_NONE
1 = EDGE_FALLING
2 = EDGE_RISING
3 = EDGE_BOTH
is_pressed(self)
Get the state of the input device
:return:
Returns 'True' if active. 'False' if not
trigger_on_rising_edge(self)
Set the edge that the interrupt will trigger off
:return:
wait_for_press(self, timeout=10000000)
Pause the script until the device is activated or the timeout is reached
when_pressed(self, interrupt_callback)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class LED(builtins.object)
    Control an LED object
The pin name should be of the format 'GPIO-A'
 
  Methods defined here:
__init__(self, pin)
close(self)
When you've finished close it all down nicely!
off(self)
Turn the device off
on(self)
Turn the device on

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class Tilt(Input)
    Extends input class to define digital tilt switch
 
 
Method resolution order:
Tilt
Input
builtins.object

Methods defined here:
__init__(self, pin)
is_tilted(self)
Returns boolean of tilt state
:return:
wait_for_tilt(self, timeout=None)
Pause the script until the device is tilted or the timeout is reached

Methods inherited from Input:
clear_when_pressed(self)
Remove callback from when_pressed
close(self)
When you've finished close it all down nicely!
get_edge(self)
Returns which edge is currently set for interrupt
:return: integer
0 = EDGE_NONE
1 = EDGE_FALLING
2 = EDGE_RISING
3 = EDGE_BOTH
is_pressed(self)
Get the state of the input device
:return:
Returns 'True' if active. 'False' if not
trigger_on_rising_edge(self)
Set the edge that the interrupt will trigger off
:return:
wait_for_press(self, timeout=10000000)
Pause the script until the device is activated or the timeout is reached
when_pressed(self, interrupt_callback)

Data descriptors inherited from Input:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)