trezor-core/docs/api.md

49 lines
1.5 KiB
Markdown
Raw Normal View History

2016-02-01 02:52:57 -08:00
#TREZOR OS API
2016-02-01 08:48:26 -08:00
Auxiliary classes used to tighten the type checking.
2016-02-01 06:16:33 -08:00
2016-02-01 08:18:04 -08:00
``` python
2016-02-02 09:40:29 -08:00
bytes16 = bytes # bytes variable of exactly 16 bytes
bytes20 = bytes # bytes variable of exactly 20 bytes
bytes21 = bytes # bytes variable of exactly 21 bytes
bytes24 = bytes # bytes variable of exactly 24 bytes
bytes32 = bytes # bytes variable of exactly 32 bytes
bytes33 = bytes # bytes variable of exactly 33 bytes
bytes64 = bytes # bytes variable of exactly 64 bytes
bytes65 = bytes # bytes variable of exactly 65 bytes
2016-02-01 08:18:04 -08:00
```
2016-02-02 09:25:27 -08:00
Syntax used below is a valid Python function declaration with type hints defined in [PEP 0484](https://www.python.org/dev/peps/pep-0484/).
2016-02-01 08:48:26 -08:00
2016-04-03 06:26:49 -07:00
##trezor.ui
2016-02-01 02:52:57 -08:00
2016-04-03 06:26:49 -07:00
###trezor.ui.display
2016-02-01 02:52:57 -08:00
2016-02-01 06:16:33 -08:00
``` python
2016-04-03 06:26:49 -07:00
trezor.ui.display.bar(self, x: int, y: int, w: int, h: int, color: int) -> None
2016-02-01 02:52:57 -08:00
2016-04-03 06:26:49 -07:00
trezor.ui.display.blit(self, x: int, y: int, w: int, h: int, data: bytes) -> None
2016-02-01 02:52:57 -08:00
2016-04-03 06:26:49 -07:00
trezor.ui.display.image(self, x: int, y: int, image: bytes) -> None
2016-02-01 08:48:26 -08:00
2016-04-03 06:26:49 -07:00
trezor.ui.display.icon(self, x: int, y: int, icon: bytes, fgcolor: int, bgcolor: int) -> None
2016-02-01 08:48:26 -08:00
2016-04-03 06:26:49 -07:00
trezor.ui.display.text(self, x: int, y: int, text: bytes, font: int, fgcolor: int, bgcolor: int) -> None
2016-02-01 08:48:26 -08:00
2016-04-03 06:26:49 -07:00
trezor.ui.display.orientation(self, degrees: int) -> None
2016-02-01 08:48:26 -08:00
2016-04-03 06:26:49 -07:00
trezor.ui.display.rawcmd(self, reg: int, data: bytes) -> None
2016-02-01 08:48:26 -08:00
2016-04-03 06:26:49 -07:00
trezor.ui.display.backlight(self, val: int) -> None
2016-02-01 08:48:26 -08:00
```
2016-04-03 06:26:49 -07:00
###trezor.ui.touch
2016-02-01 08:48:26 -08:00
``` python
2016-04-03 06:26:49 -07:00
trezor.ui.touch.callback_start(self, callback) -> None
2016-02-01 08:48:26 -08:00
2016-04-03 06:26:49 -07:00
trezor.ui.touch.callback_move(self, callback) -> None
2016-02-01 08:18:04 -08:00
2016-04-03 06:26:49 -07:00
trezor.ui.touch.callback_end(self, callback) -> None
2016-02-01 02:52:57 -08:00
```