1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-26 16:18:22 +00:00

Mocks of MicroPython methods used by Core (taken from https://docs.micropython.org/en/latest/pyboard/py-modindex.html)

This commit is contained in:
slush0 2016-09-27 16:45:58 +02:00 committed by Pavol Rusnak
parent 69fa5acf8b
commit 76d8be3395
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
10 changed files with 168 additions and 0 deletions

14
mocks/gc.py Normal file
View File

@ -0,0 +1,14 @@
def enable():
pass
def disable():
pass
def collect():
pass
def mem_alloc():
pass
def mem_free():
pass

41
mocks/machine.py Normal file
View File

@ -0,0 +1,41 @@
def reset():
pass
def reset_cause():
pass
def disable_irq():
pass
def enable_irq(state):
pass
def freq():
pass
def idle():
pass
def sleep():
pass
def deepsleep():
pass
def unique_id():
pass
def time_pulse_us(pin, pulse_level, timeout_us=1000000):
pass
IDLE = 0
SLEEP = 0
DEEPSLEEP = 0
PWRON_RESET = 0
HARD_RESET = 0
WDT_RESET = 0
DEEPSLEEP_RESET = 0
SOFT_RESET = 0
WLAN_WAKE = 0
PIN_WAKE = 0
RTC_WAKE = 0

9
mocks/micropython.py Normal file
View File

@ -0,0 +1,9 @@
def mem_info(verbose=None):
pass
def qstr_info(verbose=None):
pass
def alloc_emergency_exception_buf(size):
pass

18
mocks/sys.py Normal file
View File

@ -0,0 +1,18 @@
def exit(retval=0):
pass
def print_exception(exc, file=None):
pass
argv = []
byteorder = None
implementation = None
maxsize = None
modules = []
path = []
platform = 'mock'
stderr = None
stdin = None
stdout = None
version = 'mock-version'
version_info = (0, 0, 0)

11
mocks/ubinascii.py Normal file
View File

@ -0,0 +1,11 @@
def hexlify(data, sep=None):
pass
def unhexlify(data):
pass
def a2b_base64(data):
pass
def b2a_base64(data):
pass

8
mocks/uheapq.py Normal file
View File

@ -0,0 +1,8 @@
def heappush(heap, item):
pass
def heappop(heap):
pass
def heapify(x):
pass

19
mocks/uio.py Normal file
View File

@ -0,0 +1,19 @@
def open(name, mode='r', **kwargs):
pass
class FileIO:
pass
class TextIOWrapper:
pass
class StringIO:
def __init__(string):
pass
class BytesIO:
def __init__(string):
pass
def getvalue():
pass

14
mocks/ustruct.py Normal file
View File

@ -0,0 +1,14 @@
def calcsize(fmt):
pass
def pack(fmt, *args):
pass
def pack_info(fmt, buffer, offset, *args):
pass
def unpack(fmt, data):
pass
def unpack_from(fmt, data, offset=0):
pass

32
mocks/utime.py Normal file
View File

@ -0,0 +1,32 @@
def localtime(secs=None):
pass
def ticks_ms():
pass
def mktime():
pass
def sleep(seconds):
pass
def sleep_ms(ms):
pass
def sleep_us(us):
pass
def ticks_ms():
pass
def ticks_us():
pass
def ticks_cpu():
pass
def ticks_diff(old, new):
pass
def time():
pass

2
mocks/uzlib.py Normal file
View File

@ -0,0 +1,2 @@
def decompress(data):
pass