2021-05-29 17:18:37 -04:00
|
|
|
"""
|
|
|
|
Module used to fake the RPi.GPIO module so that
|
2021-05-29 20:08:15 -04:00
|
|
|
the hardware can be run without the actual hardware.
|
2021-05-29 17:18:37 -04:00
|
|
|
"""
|
|
|
|
|
|
|
|
# Constants used by RPi.GPIO
|
|
|
|
BOARD = 0
|
|
|
|
IN = 0
|
2021-07-02 01:47:19 -04:00
|
|
|
OUT = 1
|
2021-05-29 17:18:37 -04:00
|
|
|
FALLING = 0
|
|
|
|
|
2021-07-02 01:47:19 -04:00
|
|
|
HIGH = 1
|
|
|
|
LOW = 0
|
|
|
|
|
2021-05-29 17:18:37 -04:00
|
|
|
|
|
|
|
def setmode(new_mode):
|
|
|
|
"""
|
|
|
|
Fake setmode function.
|
|
|
|
:param new_mode:
|
|
|
|
"""
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
def setup(channel, mode, initial=None, pull_up_down=None):
|
|
|
|
"""
|
|
|
|
Fake setup function.
|
|
|
|
:param channel:
|
|
|
|
:param mode:
|
|
|
|
:param initial:
|
|
|
|
:param pull_up_down:
|
|
|
|
"""
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2021-07-02 01:47:19 -04:00
|
|
|
def output(channel, set):
|
|
|
|
"""
|
|
|
|
Fake function to set a fake channel output.
|
|
|
|
:param channel:
|
|
|
|
:param set:
|
|
|
|
:return:
|
|
|
|
"""
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2021-05-29 17:18:37 -04:00
|
|
|
def add_event_detect(channel, edge_type, callback=None, bouncetime=0):
|
|
|
|
"""
|
|
|
|
Fake function to add a non-existent event detect.
|
|
|
|
:param channel:
|
|
|
|
:param edge_type:
|
|
|
|
:param callback:
|
|
|
|
:param bouncetime:
|
|
|
|
"""
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
def event_detected(channel):
|
|
|
|
"""
|
|
|
|
Fake function to detect an event. Always returns false.
|
|
|
|
:param channel:
|
2021-07-02 01:47:19 -04:00
|
|
|
:return: False
|
2021-05-29 17:18:37 -04:00
|
|
|
"""
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
|
|
def cleanup(channel=None):
|
|
|
|
"""
|
|
|
|
Fake cleanup function.
|
|
|
|
:param channel:
|
|
|
|
"""
|
|
|
|
pass
|