pocket-friends/pocket_friends/game_files/io/fake_gpio.py

76 lines
1.0 KiB
Python

"""
Dummy module that contains empty functions and variables that exist in RPi.GPIO. This module is to be imported
if importing RPi.GPIO fails.
"""
# Constants used by RPi.GPIO
BOARD = 0
IN = 0
FALLING = 0
def setmode(new_mode):
"""
Fake setmode function.
Args:
new_mode:
Returns:
"""
pass
def setup(channel, mode, initial=None, pull_up_down=None):
"""
Fake setup function.
Args:
channel:
mode:
initial:
pull_up_down:
Returns:
"""
pass
def add_event_detect(channel, edge_type, callback=None, bouncetime=0):
"""
Fake function to add a non-existent event detect.
Args:
channel:
edge_type:
callback:
bouncetime:
Returns:
"""
pass
def event_detected(channel):
"""
Fake function to detect an event. Always returns false.
Args:
channel:
Returns:
"""
return False
def cleanup(channel=None):
"""
Fake cleanup function.
Args:
channel:
Returns:
"""
pass