Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
nbgl_screen.h
Go to the documentation of this file.
1
7#ifndef NBGL_SCREEN_H
8#define NBGL_SCREEN_H
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14/*********************
15 * INCLUDES
16 *********************/
17
18#include "nbgl_types.h"
19#include "nbgl_obj.h"
20
21/*********************
22 * DEFINES
23 *********************/
24
25/**********************
26 * TYPEDEFS
27 **********************/
28
32typedef void (*nbgl_tickerCallback_t)(void);
33
46
53typedef struct PACKED__ nbgl_screen_s {
56#ifdef HAVE_SE_TOUCH
59#else // HAVE_SE_TOUCH
60 nbgl_buttonCallback_t buttonCallback;
61#endif // HAVE_SE_TOUCH
62 struct nbgl_screen_s
69
70/**********************
71 * GLOBAL PROTOTYPES
72 **********************/
75
76#ifdef HAVE_STAX_DISPLAY_FAST_MODE
77void nbgl_screen_update_temperature(uint8_t temp_degrees);
78#endif // HAVE_STAX_DISPLAY_FAST_MODE
79
80#ifdef HAVE_STAX_CONFIG_DISPLAY_FAST_MODE
81void nbgl_screen_config_fast_mode(uint8_t fast_mode_setting);
82#endif // HAVE_STAX_CONFIG_DISPLAY_FAST_MODE
83
84void nbgl_screenRedraw(void);
91
92#ifdef HAVE_SE_TOUCH
93int nbgl_screenSet(nbgl_obj_t ***elements,
94 uint8_t nbElements,
97#else // HAVE_SE_TOUCH
98int nbgl_screenSet(nbgl_obj_t ***elements,
99 uint8_t nbElements,
101 nbgl_buttonCallback_t buttonCallback);
102#endif // HAVE_SE_TOUCH
103int nbgl_screenUpdateNbElements(uint8_t screenIndex, uint8_t nbElements);
104int nbgl_screenUpdateBackgroundColor(uint8_t screenIndex, color_t color);
108#ifdef HAVE_SE_TOUCH
109int nbgl_screenPush(nbgl_obj_t ***elements,
110 uint8_t nbElements,
113#else // HAVE_SE_TOUCH
114int nbgl_screenPush(nbgl_obj_t ***elements,
115 uint8_t nbElements,
117 nbgl_buttonCallback_t buttonCallback);
118#endif // HAVE_SE_TOUCH
119int nbgl_screenPop(uint8_t screenIndex);
120int nbgl_screenReset(void);
121void nbgl_screenHandler(uint32_t intervaleMs);
122
123/**********************
124 * MACROS
125 **********************/
126
127#ifdef __cplusplus
128} /* extern "C" */
129#endif
130
131#endif /* NBGL_SCREEN_H */
API to draw all basic graphic objects.
void(* nbgl_touchCallback_t)(void *obj, nbgl_touchType_t eventType)
prototype of function to be called when a touch event is received by an object
Definition nbgl_obj.h:242
void(* nbgl_buttonCallback_t)(void *obj, nbgl_buttonEvent_t buttonEvent)
prototype of function to be called when a button event is received by an object (TODO: change to scre...
Definition nbgl_obj.h:221
struct PACKED__ nbgl_container_s nbgl_container_t
struct to represent a container (CONTAINER type)
struct PACKED__ nbgl_obj_s nbgl_obj_t
Common structure for all graphical objects.
int nbgl_screenSet(nbgl_obj_t ***elements, uint8_t nbElements, const nbgl_screenTickerConfiguration_t *ticker, nbgl_touchCallback_t touchCallback)
Configures the lowest layer screen. To be used by applications A nbgl_screenRedraw() can be called af...
int nbgl_screenPush(nbgl_obj_t ***elements, uint8_t nbElements, const nbgl_screenTickerConfiguration_t *ticker, nbgl_touchCallback_t touchCallback)
Pushes a screen on top of the stack, with the given number of elements, if possible....
void nbgl_wait_pipeline(void)
int nbgl_screenUpdateNbElements(uint8_t screenIndex, uint8_t nbElements)
Updates the number of children on given layer. can only be smaller than the number given in nbgl_scre...
int nbgl_screenUpdateTicker(uint8_t screenIndex, const nbgl_screenTickerConfiguration_t *ticker)
Updates the ticker configuration of the screen at the given screenIndex, always set at WHITE in.
bool nbgl_screenContainsObj(nbgl_obj_t *obj)
return true if the given obj can be found in refObj or any of its children
struct PACKED__ nbgl_screen_s nbgl_screen_t
struct to represent a screen (SCREEN type)
nbgl_obj_t * nbgl_screenGetAt(uint8_t screenIndex)
Returns the screen on the given layer index, as a generic object.
Definition nbgl_screen.c:88
int nbgl_screenReset(void)
Releases all screens and objects and resets the screen stack. It is supposed to be called before runn...
nbgl_obj_t ** nbgl_screenGetElements(uint8_t screenIndex)
Returns the array of elements (children) of the screen at the given index (return value of nbgl_scree...
void(* nbgl_tickerCallback_t)(void)
prototype of function to be called when a timer on screen is fired
Definition nbgl_screen.h:32
uint8_t nbgl_screenGetUxStackSize(void)
Returns the number of used UX screens on stack.
nbgl_obj_t * nbgl_screenGetTop(void)
Returns the screen on top layer, as a generic object.
int nbgl_screenPop(uint8_t screenIndex)
Release the screen at the given index in screen array (index returned by nbgl_screenPush())....
uint8_t nbgl_screenGetCurrentStackSize(void)
Returns the number of used screens on stack.
struct PACKED__ nbgl_screenTickerConfiguration_s nbgl_screenTickerConfiguration_t
struct to configure a screen layer
int nbgl_screenUpdateBackgroundColor(uint8_t screenIndex, color_t color)
Updates the background color of the screen at the given screenIndex, always set at WHITE in.
int nbgl_screenRelease(void)
nbgl_obj_t * nbgl_screenContainsObjType(nbgl_screen_t *screen, nbgl_obj_type_t type)
return an object of the given type in the given screen
void nbgl_screenRedraw(void)
This function redraws the whole screen on top of stack and its children.
Definition nbgl_screen.c:66
void nbgl_screenHandler(uint32_t intervaleMs)
Function to be called periodically by system to enable using ticker.
void nbgl_screen_reinit(void)
common types for Graphical Library
color_t
Definition nbgl_types.h:120
nbgl_obj_type_t
All types of graphical objects.
Definition nbgl_types.h:134
#define PACKED__
Definition nbgl_types.h:107
struct to configure a screen layer
Definition nbgl_screen.h:38
nbgl_tickerCallback_t tickerCallback
callback called when ticker timer is fired. Set to NULL for no ticker
Definition nbgl_screen.h:40
struct to represent a screen (SCREEN type)
Definition nbgl_screen.h:53
uint8_t index
index in screenStack array
Definition nbgl_screen.h:66
nbgl_screenTickerConfiguration_t ticker
ticker configuration
Definition nbgl_screen.h:55
bool isUxScreen
set to TRUE if allocated by Bolos-UX
Definition nbgl_screen.h:67
nbgl_container_t container
common part
Definition nbgl_screen.h:54
struct nbgl_screen_s * previous
Definition nbgl_screen.h:64
struct nbgl_screen_s * next
pointer to screen on top of this one (or NULL is this screen is top of stack)
Definition nbgl_screen.h:62
nbgl_touchCallback_t touchCallback
function to be called on events defined in touchMask of each objects
Definition nbgl_screen.h:58
unsigned char uint8_t
Definition usbd_conf.h:53