1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 15:38:11 +00:00

update docu

This commit is contained in:
Pavol Rusnak 2016-05-18 00:58:21 +02:00
parent dbc57b16d4
commit 627f547fcb
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
4 changed files with 11 additions and 4 deletions

View File

@ -276,6 +276,9 @@ Function returns None if timeout specified in microseconds is reached.
def trezor.ui.rgbcolor(r: int, g: int, b: int) -> int def trezor.ui.rgbcolor(r: int, g: int, b: int) -> int
``` ```
``` python ``` python
def trezor.ui.in_area(pos: tuple, area: tuple) -> bool
```
``` python
def trezor.ui.lerpi(a: int, b: int, t: float) -> int def trezor.ui.lerpi(a: int, b: int, t: float) -> int
``` ```
``` python ``` python
@ -359,17 +362,19 @@ When icon and iconfgcolor are provided, an icon is drawn in the middle using the
Icon needs to be of exaclty 96x96 pixels size. Icon needs to be of exaclty 96x96 pixels size.
``` python ``` python
def trezor.ui.display.orientation(degrees: int) -> None def trezor.ui.display.orientation(degrees: int=None) -> int
``` ```
Sets display orientation to 0, 90, 180 or 270 degrees. Sets display orientation to 0, 90, 180 or 270 degrees.
Everything needs to be redrawn again when this function is used. Everything needs to be redrawn again when this function is used.
Call without the degrees parameter to just perform the read of the value.
``` python ``` python
def trezor.ui.display.backlight(val: int) -> None def trezor.ui.display.backlight(val: int=None) -> int
``` ```
Sets backlight intensity to the value specified in val. Sets backlight intensity to the value specified in val.
Call without the val parameter to just perform the read of the value.
``` python ``` python
def trezor.ui.display.raw(reg: int, data: bytes) -> None def trezor.ui.display.raw(reg: int, data: bytes) -> None

View File

@ -20,6 +20,8 @@ def process_file(fn):
r.append('') r.append('')
elif ext == '.py': elif ext == '.py':
mod = mod[4:].replace('/', '.') mod = mod[4:].replace('/', '.')
if mod.endswith('.__init__'):
mod = mod[:-9]
for l in src: for l in src:
l = l.rstrip() l = l.rstrip()
if l.startswith('def '): if l.startswith('def '):

View File

@ -58,7 +58,7 @@ Syntax used below is a valid Python function declaration with type hints defined
##trezor.ui ##trezor.ui
@src/trezor/ui.py @src/trezor/ui/__init__.py
###trezor.ui.display ###trezor.ui.display

View File

@ -39,7 +39,7 @@ NORMAL = const(1)
BOLD = const(2) BOLD = const(2)
def in_area(pos, area): def in_area(pos: tuple, area: tuple) -> bool:
x, y = pos x, y = pos
ax, ay, aw, ah = area ax, ay, aw, ah = area
return ax <= x <= ax + aw and ay <= y <= ay + ah return ax <= x <= ax + aw and ay <= y <= ay + ah