2016-09-27 14:48:21 +00:00
|
|
|
|
2017-04-08 16:43:26 +00:00
|
|
|
# extmod/modtrezormsg/modtrezormsg.c
|
2016-10-12 16:58:18 +00:00
|
|
|
def set_interfaces(ifaces: list/tuple) -> None:
|
2016-09-27 14:48:21 +00:00
|
|
|
'''
|
2016-10-12 16:58:18 +00:00
|
|
|
Configures USB interfaces with a list/tuple of (usage_page, ...)
|
2016-09-27 14:48:21 +00:00
|
|
|
'''
|
|
|
|
|
2017-04-08 16:43:26 +00:00
|
|
|
# extmod/modtrezormsg/modtrezormsg.c
|
2016-10-12 16:58:18 +00:00
|
|
|
def get_interfaces() -> tuple:
|
|
|
|
'''
|
|
|
|
Reads a tuple (of usage pages) of configured USB interfaces
|
|
|
|
'''
|
|
|
|
|
2017-04-08 16:43:26 +00:00
|
|
|
# extmod/modtrezormsg/modtrezormsg.c
|
2016-10-12 16:58:18 +00:00
|
|
|
def send(usage_page: int, message: bytes) -> int:
|
2016-09-27 14:48:21 +00:00
|
|
|
'''
|
|
|
|
Sends message using USB HID (device) or UDP (emulator).
|
|
|
|
'''
|
|
|
|
|
2017-04-08 16:43:26 +00:00
|
|
|
# extmod/modtrezormsg/modtrezormsg.c
|
2016-09-27 14:48:21 +00:00
|
|
|
def select(timeout_us: int) -> tuple:
|
|
|
|
'''
|
|
|
|
Polls the event queue and returns the event object.
|
|
|
|
Function returns None if timeout specified in microseconds is reached.
|
|
|
|
'''
|