-
Notifications
You must be signed in to change notification settings - Fork 0
/
_fake_GPIO.py
70 lines (48 loc) · 967 Bytes
/
_fake_GPIO.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 8 21:11:39 2022
@author: robert
"""
from __future__ import print_function
print('nix_GPIO loaded - testing without hardware')
RPI_REVISION = 1
VERSION = 1
BOARD = 0
BCM = 1
IN = 0
OUT = 1
HIGH = True
LOW = False
PUD_DOWN = 0
PUD_UP = 1
PUD_OFF = -1
FALLING = 0
RISING = 1
BOTH = 2
_setup_mode = BOARD
_warnings = False
def setmode(mode):
_setup_mode = mode
def setwarnings(mode):
_warnings = mode
def setup(pin, mode, initial=None, pull_up_down=None):
pass
def gpio_function(pin):
return None
def cleanup(pin=None):
pass
def output(pin, state):
return LOW
def input(pin):
return HIGH
def PWM(pin, frequency):
return None
def wait_for_edge(pin, edge_type):
pass
def add_event_detect(pin, edge_type, callback=None, bouncetime=0):
pass
def add_event_callback(pin, callback, bouncetime=0):
pass
def remove_event_detect(pin):
pass