2016-09-27 14:48:21 +00:00
|
|
|
|
2017-04-08 16:43:26 +00:00
|
|
|
# extmod/modtrezormsg/modtrezormsg.c
|
2017-06-12 16:02:32 +00:00
|
|
|
def init_usb(usb_info, usb_ifaces) -> None:
|
2016-09-27 14:48:21 +00:00
|
|
|
'''
|
2017-06-12 16:02:32 +00:00
|
|
|
Registers passed interfaces and initializes the USB stack
|
2016-09-27 14:48:21 +00:00
|
|
|
'''
|
|
|
|
|
2017-04-08 16:43:26 +00:00
|
|
|
# extmod/modtrezormsg/modtrezormsg.c
|
2017-06-12 16:02:32 +00:00
|
|
|
def deinit_usb() -> None:
|
2016-10-12 16:58:18 +00:00
|
|
|
'''
|
2017-06-12 16:02:32 +00:00
|
|
|
Cleans up the USB stack
|
2016-10-12 16:58:18 +00:00
|
|
|
'''
|
|
|
|
|
2017-04-08 16:43:26 +00:00
|
|
|
# extmod/modtrezormsg/modtrezormsg.c
|
2017-06-12 16:02:32 +00:00
|
|
|
def send(iface: 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.
|
|
|
|
'''
|