Embedded SDK
Embedded SDK
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
11 extern "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 
32 typedef void (*nbgl_tickerCallback_t)(void);
33 
41  uint32_t tickerValue;
43  uint32_t tickerIntervale;
46 
53 typedef 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
63  *next;
67  bool isUxScreen;
69 
70 /**********************
71  * GLOBAL PROTOTYPES
72  **********************/
73 void nbgl_screen_reinit(void);
74 void nbgl_wait_pipeline(void);
75 
76 #ifdef HAVE_STAX_DISPLAY_FAST_MODE
77 void nbgl_screen_update_temperature(uint8_t temp_degrees);
78 #endif // HAVE_STAX_DISPLAY_FAST_MODE
79 
80 #ifdef HAVE_STAX_CONFIG_DISPLAY_FAST_MODE
81 void nbgl_screen_config_fast_mode(uint8_t fast_mode_setting);
82 #endif // HAVE_STAX_CONFIG_DISPLAY_FAST_MODE
83 
84 void nbgl_screenRedraw(void);
85 nbgl_obj_t *nbgl_screenGetAt(uint8_t screenIndex);
91 
92 #ifdef HAVE_SE_TOUCH
93 int nbgl_screenSet(nbgl_obj_t ***elements,
94  uint8_t nbElements,
97 #else // HAVE_SE_TOUCH
98 int nbgl_screenSet(nbgl_obj_t ***elements,
99  uint8_t nbElements,
101  nbgl_buttonCallback_t buttonCallback);
102 #endif // HAVE_SE_TOUCH
103 int nbgl_screenUpdateNbElements(uint8_t screenIndex, uint8_t nbElements);
104 int nbgl_screenUpdateBackgroundColor(uint8_t screenIndex, color_t color);
108 #ifdef HAVE_SE_TOUCH
109 int nbgl_screenPush(nbgl_obj_t ***elements,
110  uint8_t nbElements,
113 #else // HAVE_SE_TOUCH
114 int nbgl_screenPush(nbgl_obj_t ***elements,
115  uint8_t nbElements,
117  nbgl_buttonCallback_t buttonCallback);
118 #endif // HAVE_SE_TOUCH
119 int nbgl_screenPop(uint8_t screenIndex);
120 int nbgl_screenReset(void);
121 void 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:221
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:200
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...
Definition: nbgl_screen.c:225
nbgl_obj_t * nbgl_screenGetTop(void)
Returns the screen on top layer, as a generic object.
Definition: nbgl_screen.c:102
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....
Definition: nbgl_screen.c:330
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...
Definition: nbgl_screen.c:257
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.
Definition: nbgl_screen.c:289
bool nbgl_screenContainsObj(nbgl_obj_t *obj)
return true if the given obj can be found in refObj or any of its children
Definition: nbgl_screen.c:568
struct PACKED__ nbgl_screen_s nbgl_screen_t
struct to represent a screen (SCREEN type)
int nbgl_screenReset(void)
Releases all screens and objects and resets the screen stack. It is supposed to be called before runn...
Definition: nbgl_screen.c:452
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...
Definition: nbgl_screen.c:312
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.
Definition: nbgl_screen.c:128
int nbgl_screenPop(uint8_t screenIndex)
Release the screen at the given index in screen array (index returned by nbgl_screenPush())....
Definition: nbgl_screen.c:403
uint8_t nbgl_screenGetCurrentStackSize(void)
Returns the number of used screens on stack.
Definition: nbgl_screen.c:116
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
Definition: nbgl_screen.c:583
struct PACKED__ nbgl_screenTickerConfiguration_s nbgl_screenTickerConfiguration_t
struct to configure a screen layer
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_screenUpdateBackgroundColor(uint8_t screenIndex, color_t color)
Updates the background color of the screen at the given screenIndex, always set at WHITE in.
Definition: nbgl_screen.c:273
int nbgl_screenRelease(void)
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.
Definition: nbgl_screen.c:475
void nbgl_screen_reinit(void)
common types for Graphical Library
color_t
Definition: nbgl_types.h:101
nbgl_obj_type_t
All types of graphical objects.
Definition: nbgl_types.h:115
#define PACKED__
Definition: nbgl_types.h:88
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