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:
parent
dbc57b16d4
commit
627f547fcb
@ -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
|
||||||
|
@ -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 '):
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user