Embedded SDK
Embedded SDK
Classes | Macros | Typedefs | Enumerations | Functions
nbgl_obj.h File Reference

API to draw all basic graphic objects. More...

#include "nbgl_types.h"
#include "nbgl_fonts.h"
#include "ux_loc.h"
Include dependency graph for nbgl_obj.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  nbgl_touchStatePosition_t
 The low level Touchscreen event, coming from driver. More...
 
struct  nbgl_obj_s
 Common structure for all graphical objects. More...
 
struct  nbgl_container_s
 struct to represent a container (CONTAINER type) More...
 
struct  nbgl_line_s
 struct to represent a vertical or horizontal line More...
 
struct  nbgl_image_s
 struct to represent an image (IMAGE type) More...
 
struct  nbgl_image_file_s
 struct to represent an image file object (IMAGE_FILE type) The source of the data is an image file with header. width and height are given in this header More...
 
struct  nbgl_qrcode_s
 struct to represent a QR code (QR_CODE type), whose size is fixed More...
 
struct  nbgl_radio_s
 struct to represent a radio button (RADIO_BUTTON type) More...
 
struct  nbgl_switch_s
 struct to represent a switch (size is fixed) (SWITCH type) More...
 
struct  nbgl_progress_bar_s
 struct to represent a progress bar (PROGRESS_BAR type) More...
 
struct  nbgl_navigation_bar_s
 struct to represent a navigation bar (PAGE_INDICATOR type) There can be up to 5 page indicators, whose shape is fixed. If there are more than 5 pages, the middle indicator will be "..." More...
 
struct  nbgl_button_s
 struct to represent a button (BUTTON type) that can contain a text and/or an icon More...
 
struct  nbgl_text_area_s
 struct to represent a text area (TEXT_AREA type) More...
 
struct  nbgl_text_entry_s
 struct to represent a text entry area (TEXT_ENTRY type) More...
 
struct  nbgl_mask_control_s
 
struct  nbgl_spinner_s
 struct to represent a "spinner", represented by the Ledger corners, in gray, with one of the corners in black (SPINNER type) More...
 
struct  nbgl_keyboard_s
 struct to represent a keyboard (KEYBOARD type) More...
 
struct  nbgl_keypad_s
 struct to represent a keypad (KEYPAD type) More...
 

Macros

#define BACKSPACE_KEY   8
 
#define VALIDATE_KEY   '\r'
 
#define KEYBOARD_KEY_HEIGHT   72
 
#define SHIFT_KEY_INDEX   26
 
#define DIGITS_SWITCH_KEY_INDEX   27
 
#define BACKSPACE_KEY_INDEX   28
 
#define SPACE_KEY_INDEX   29
 
#define SPECIAL_KEYS_INDEX   30
 
#define KEYPAD_KEY_HEIGHT   88
 
#define KEYPAD_MAX_DIGITS   12
 
#define BORDER_MARGIN   32
 
#define BOTTOM_BORDER_MARGIN   24
 
#define BACK_BUTTON_HEADER_HEIGHT   96
 
#define BUTTON_RADIUS   RADIUS_44_PIXELS
 
#define BUTTON_DIAMETER   88
 
#define SPINNER_WIDTH   64
 
#define SPINNER_HEIGHT   48
 
#define RADIO_WIDTH   40
 
#define RADIO_HEIGHT   40
 
#define SPACE_ICON   C_Space_40px
 
#define BACKSPACE_ICON   C_Erase_40px
 
#define SHIFT_ICON   C_Maj_40px
 
#define SHIFT_LOCKED_ICON   C_Maj_Lock_40px
 
#define VALIDATE_ICON   C_Check_40px
 
#define RADIO_OFF_ICON   C_radio_inactive_40px
 
#define RADIO_ON_ICON   C_radio_active_40px
 
#define PUSH_ICON   C_Chevron_40px
 
#define LEFT_ARROW_ICON   C_Back_40px
 
#define RIGHT_ARROW_ICON   C_Next_40px
 
#define CHEVRON_BACK_ICON   C_Chevron_Back_40px
 
#define CHEVRON_NEXT_ICON   C_Chevron_Next_40px
 
#define CLOSE_ICON   C_Close_40px
 
#define WHEEL_ICON   C_Settings_40px
 
#define INFO_I_ICON   C_Info_40px
 
#define QRCODE_ICON   C_QRCode_40px
 
#define MINI_PUSH_ICON   C_Mini_Push_40px
 
#define WARNING_ICON   C_Warning_40px
 
#define C_warning64px   _Pragma("GCC warning \"Deprecated constant!\"") C_Warning_64px
 
#define C_round_warning_64px   _Pragma("GCC warning \"Deprecated constant!\"") C_Important_Circle_64px
 
#define C_round_check_64px   _Pragma("GCC warning \"Deprecated constant!\"") C_Check_Circle_64px
 
#define C_Message_64px   _Pragma("GCC warning \"Deprecated constant!\"") C_Review_64px
 
#define C_leftArrow32px   _Pragma("GCC warning \"Deprecated constant!\"") C_Back_32px
 
#define C_Next32px   _Pragma("GCC warning \"Deprecated constant!\"") C_Next_32px
 
#define C_round_cross_64px   _Pragma("GCC warning \"Deprecated constant!\"") C_Denied_Circle_64px
 
#define NB_MAX_PAGES_WITH_DASHES   6
 
#define SWIPE_MASK    ((1 << SWIPED_UP) | (1 << SWIPED_DOWN) | (1 << SWIPED_LEFT) | (1 << SWIPED_RIGHT))
 
#define LEFT_BUTTON   0x01
 The different pressed buttons. More...
 
#define RIGHT_BUTTON   0x02
 Right button event. More...
 
#define BOTH_BUTTONS   0x03
 Both buttons event. More...
 
#define RELEASED_MASK   0x80
 released (see LSB bits to know what buttons are released) More...
 
#define CONTINUOUS_MASK    0x40
 300ms after the first 800ms) More...
 

Typedefs

typedef 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 screen?) More...
 
typedef 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 More...
 
typedef struct PACKED__ nbgl_obj_s nbgl_obj_t
 Common structure for all graphical objects. More...
 
typedef struct PACKED__ nbgl_container_s nbgl_container_t
 struct to represent a container (CONTAINER type) More...
 
typedef struct PACKED__ nbgl_line_s nbgl_line_t
 struct to represent a vertical or horizontal line More...
 
typedef nbgl_icon_details_t *(* onImageDrawCallback_t) (uint8_t token)
 prototype of function to be called when a IMAGE object is drawned, and no buffer was provided More...
 
typedef struct PACKED__ nbgl_image_s nbgl_image_t
 struct to represent an image (IMAGE type) More...
 
typedef struct PACKED__ nbgl_image_file_s nbgl_image_file_t
 struct to represent an image file object (IMAGE_FILE type) The source of the data is an image file with header. width and height are given in this header More...
 
typedef struct PACKED__ nbgl_qrcode_s nbgl_qrcode_t
 struct to represent a QR code (QR_CODE type), whose size is fixed More...
 
typedef struct PACKED__ nbgl_radio_s nbgl_radio_t
 struct to represent a radio button (RADIO_BUTTON type) More...
 
typedef struct PACKED__ nbgl_switch_s nbgl_switch_t
 struct to represent a switch (size is fixed) (SWITCH type) More...
 
typedef struct PACKED__ nbgl_progress_bar_s nbgl_progress_bar_t
 struct to represent a progress bar (PROGRESS_BAR type) More...
 
typedef struct PACKED__ nbgl_navigation_bar_s nbgl_page_indicator_t
 struct to represent a navigation bar (PAGE_INDICATOR type) There can be up to 5 page indicators, whose shape is fixed. If there are more than 5 pages, the middle indicator will be "..." More...
 
typedef char *(* onTextDrawCallback_t) (uint8_t token)
 prototype of function to be called when a TEXT_AREA object is drawned, and no text was provided More...
 
typedef struct PACKED__ nbgl_button_s nbgl_button_t
 struct to represent a button (BUTTON type) that can contain a text and/or an icon More...
 
typedef struct PACKED__ nbgl_text_area_s nbgl_text_area_t
 struct to represent a text area (TEXT_AREA type) More...
 
typedef struct PACKED__ nbgl_text_entry_s nbgl_text_entry_t
 struct to represent a text entry area (TEXT_ENTRY type) More...
 
typedef struct PACKED__ nbgl_mask_control_s nbgl_mask_control_t
 
typedef struct PACKED__ nbgl_spinner_s nbgl_spinner_t
 struct to represent a "spinner", represented by the Ledger corners, in gray, with one of the corners in black (SPINNER type) More...
 
typedef void(* keyboardCallback_t) (char touchedKey)
 prototype of function to be called when a valid key is pressed on keyboard Backspace is equal to 0x8 (ASCII code), Validate (for Keypad) is equal to 15 ('\r') More...
 
typedef struct PACKED__ nbgl_keyboard_s nbgl_keyboard_t
 struct to represent a keyboard (KEYBOARD type) More...
 
typedef struct PACKED__ nbgl_keypad_s nbgl_keypad_t
 struct to represent a keypad (KEYPAD type) More...
 

Enumerations

enum  nbgl_buttonEvent_t {
  BUTTON_LEFT_PRESSED = 0 , BUTTON_RIGHT_PRESSED , BUTTON_LEFT_CONTINUOUS_PRESSED , BUTTON_RIGHT_CONTINUOUS_PRESSED ,
  BUTTON_BOTH_PRESSED , BUTTON_BOTH_TOUCHED , INVALID_BUTTON_EVENT
}
 
enum  nbgl_page_indicator_style_t { PROGRESSIVE_INDICATOR = 0 , CURRENT_INDICATOR }
 Style to apply to nbgl_page_indicator_t. More...
 
enum  keyboardMode_t { MODE_LETTERS = 0 , MODE_DIGITS , MODE_SPECIAL }
 Mode in which to open/set the keyboard. More...
 
enum  keyboardCase_t { LOWER_CASE = 0 , UPPER_CASE , LOCKED_UPPER_CASE }
 Letters casing in which to open/set the keyboard. More...
 
enum  {
  BOTTOM_BUTTON_ID = 1 , LEFT_BUTTON_ID , RIGHT_BUTTON_ID , WHOLE_SCREEN_ID ,
  TOP_RIGHT_BUTTON_ID , BACK_BUTTON_ID , SINGLE_BUTTON_ID , EXTRA_BUTTON_ID ,
  CHOICE_1_ID , CHOICE_2_ID , KEYPAD_ID , KEYBOARD_ID ,
  ENTERED_TEXT_ID , VALUE_BUTTON_1_ID , VALUE_BUTTON_2_ID , VALUE_BUTTON_3_ID ,
  LONG_PRESS_BUTTON_ID , TIP_BOX_ID , CONTROLS_ID , NB_CONTROL_IDS
}
 ids of touchable objects, for external stimulus (by Testing environment) More...
 

Functions

void nbgl_refresh (void)
 This functions refreshes the actual screen on display with what has changed since the last refresh. More...
 
void nbgl_refreshSpecial (nbgl_refresh_mode_t mode)
 This functions refreshes the actual screen on display with what has changed since the last refresh, according to the given mode (Black&White and other) More...
 
void nbgl_refreshSpecialWithPostRefresh (nbgl_refresh_mode_t mode, nbgl_post_refresh_t post_refresh)
 
bool nbgl_refreshIsNeeded (void)
 This functions returns true if there is something to refresh. More...
 
void nbgl_refreshReset (void)
 This functions resets all changes since the last refresh. More...
 
void nbgl_objInit (void)
 This functions inits all internal of nbgl objects layer. More...
 
void nbgl_objDraw (nbgl_obj_t *obj)
 This function draws or redraws the given object and its children (recursive version) More...
 
void nbgl_objAllowDrawing (bool enable)
 This functions enables or disables drawing/refresh for all further calls. More...
 
void nbgl_objPoolRelease (uint8_t layer)
 Release the objects from the pool for the given layer. More...
 
nbgl_obj_tnbgl_objPoolGet (nbgl_obj_type_t type, uint8_t layer)
 Gets a new graphic object from the pool, with the given type. The type field of the object is set. More...
 
nbgl_obj_tnbgl_objPoolGetPrevious (nbgl_obj_t *obj, uint8_t layer)
 Gets a link to the previous object in the pool, for the given layer. (to be used with care) More...
 
uint8_t nbgl_objPoolGetId (nbgl_obj_t *obj)
 Gets a unique index for the given object, in the pool. More...
 
int nbgl_objPoolGetArray (nbgl_obj_type_t type, uint8_t nbObjs, uint8_t layer, nbgl_obj_t **objArray)
 Gets nbObjects new graphic object from the pool, with the given type, for the given layer (screen). The type field of the object is set. More...
 
uint8_t nbgl_objPoolGetNbUsed (uint8_t layer)
 returns the number of objects currently used in the pool More...
 
void nbgl_containerPoolRelease (uint8_t layer)
 Release the objects pointers from the pool for the given layer. More...
 
nbgl_obj_t ** nbgl_containerPoolGet (uint8_t nbObjs, uint8_t layer)
 Gets a new container from the pool, with the given number of obj pointers. More...
 
uint8_t nbgl_containerPoolGetNbUsed (uint8_t layer)
 returns the number of containers currently used in the pool More...
 
void nbgl_objDrawKeyboard (nbgl_keyboard_t *kbd)
 This function draws a keyboard object. More...
 
void nbgl_objDrawKeypad (nbgl_keypad_t *kbd)
 This function draws a keypad object. More...
 
void nbgl_keyboardTouchCallback (nbgl_obj_t *obj, nbgl_touchType_t eventType)
 function to be called when the keyboard object is touched More...
 
void nbgl_keypadTouchCallback (nbgl_obj_t *obj, nbgl_touchType_t eventType)
 function to be called when the keypad object is touched More...
 
bool nbgl_keyboardGetPosition (nbgl_keyboard_t *kbd, char index, uint16_t *x, uint16_t *y)
 This function gets the position (top-left corner) of the key at the given index. (to be used for Testing purpose) More...
 
bool nbgl_keypadGetPosition (nbgl_keypad_t *kbd, char index, uint16_t *x, uint16_t *y)
 This function gets the position (top-left corner) of the key at the given index. (to be used for Testing purpose). Only works without shuffling. More...
 

Detailed Description

API to draw all basic graphic objects.

Definition in file nbgl_obj.h.

Macro Definition Documentation

◆ BACK_BUTTON_HEADER_HEIGHT

#define BACK_BUTTON_HEADER_HEIGHT   96

Definition at line 79 of file nbgl_obj.h.

◆ BACKSPACE_ICON

#define BACKSPACE_ICON   C_Erase_40px

Definition at line 132 of file nbgl_obj.h.

◆ BACKSPACE_KEY

#define BACKSPACE_KEY   8

Definition at line 26 of file nbgl_obj.h.

◆ BACKSPACE_KEY_INDEX

#define BACKSPACE_KEY_INDEX   28

Definition at line 41 of file nbgl_obj.h.

◆ BORDER_MARGIN

#define BORDER_MARGIN   32

Definition at line 71 of file nbgl_obj.h.

◆ BOTH_BUTTONS

#define BOTH_BUTTONS   0x03

Both buttons event.

Definition at line 176 of file nbgl_obj.h.

◆ BOTTOM_BORDER_MARGIN

#define BOTTOM_BORDER_MARGIN   24

Definition at line 72 of file nbgl_obj.h.

◆ BUTTON_DIAMETER

#define BUTTON_DIAMETER   88

Definition at line 88 of file nbgl_obj.h.

◆ BUTTON_RADIUS

#define BUTTON_RADIUS   RADIUS_44_PIXELS

Definition at line 87 of file nbgl_obj.h.

◆ C_leftArrow32px

#define C_leftArrow32px   _Pragma("GCC warning \"Deprecated constant!\"") C_Back_32px

Definition at line 156 of file nbgl_obj.h.

◆ C_Message_64px

#define C_Message_64px   _Pragma("GCC warning \"Deprecated constant!\"") C_Review_64px

Definition at line 155 of file nbgl_obj.h.

◆ C_Next32px

#define C_Next32px   _Pragma("GCC warning \"Deprecated constant!\"") C_Next_32px

Definition at line 157 of file nbgl_obj.h.

◆ C_round_check_64px

#define C_round_check_64px   _Pragma("GCC warning \"Deprecated constant!\"") C_Check_Circle_64px

Definition at line 154 of file nbgl_obj.h.

◆ C_round_cross_64px

#define C_round_cross_64px   _Pragma("GCC warning \"Deprecated constant!\"") C_Denied_Circle_64px

Definition at line 158 of file nbgl_obj.h.

◆ C_round_warning_64px

#define C_round_warning_64px   _Pragma("GCC warning \"Deprecated constant!\"") C_Important_Circle_64px

Definition at line 153 of file nbgl_obj.h.

◆ C_warning64px

#define C_warning64px   _Pragma("GCC warning \"Deprecated constant!\"") C_Warning_64px

Definition at line 152 of file nbgl_obj.h.

◆ CHEVRON_BACK_ICON

#define CHEVRON_BACK_ICON   C_Chevron_Back_40px

Definition at line 141 of file nbgl_obj.h.

◆ CHEVRON_NEXT_ICON

#define CHEVRON_NEXT_ICON   C_Chevron_Next_40px

Definition at line 142 of file nbgl_obj.h.

◆ CLOSE_ICON

#define CLOSE_ICON   C_Close_40px

Definition at line 143 of file nbgl_obj.h.

◆ CONTINUOUS_MASK

#define CONTINUOUS_MASK    0x40

300ms after the first 800ms)

if set, means that the button(s) is continuously pressed (this event is sent every

Definition at line 180 of file nbgl_obj.h.

◆ DIGITS_SWITCH_KEY_INDEX

#define DIGITS_SWITCH_KEY_INDEX   27

Definition at line 40 of file nbgl_obj.h.

◆ INFO_I_ICON

#define INFO_I_ICON   C_Info_40px

Definition at line 145 of file nbgl_obj.h.

◆ KEYBOARD_KEY_HEIGHT

#define KEYBOARD_KEY_HEIGHT   72

Definition at line 35 of file nbgl_obj.h.

◆ KEYPAD_KEY_HEIGHT

#define KEYPAD_KEY_HEIGHT   88

Definition at line 55 of file nbgl_obj.h.

◆ KEYPAD_MAX_DIGITS

#define KEYPAD_MAX_DIGITS   12

Definition at line 59 of file nbgl_obj.h.

◆ LEFT_ARROW_ICON

#define LEFT_ARROW_ICON   C_Back_40px

Definition at line 139 of file nbgl_obj.h.

◆ LEFT_BUTTON

#define LEFT_BUTTON   0x01

The different pressed buttons.

Left button event

Definition at line 174 of file nbgl_obj.h.

◆ MINI_PUSH_ICON

#define MINI_PUSH_ICON   C_Mini_Push_40px

Definition at line 147 of file nbgl_obj.h.

◆ NB_MAX_PAGES_WITH_DASHES

#define NB_MAX_PAGES_WITH_DASHES   6

Definition at line 161 of file nbgl_obj.h.

◆ PUSH_ICON

#define PUSH_ICON   C_Chevron_40px

Definition at line 138 of file nbgl_obj.h.

◆ QRCODE_ICON

#define QRCODE_ICON   C_QRCode_40px

Definition at line 146 of file nbgl_obj.h.

◆ RADIO_HEIGHT

#define RADIO_HEIGHT   40

Definition at line 107 of file nbgl_obj.h.

◆ RADIO_OFF_ICON

#define RADIO_OFF_ICON   C_radio_inactive_40px

Definition at line 136 of file nbgl_obj.h.

◆ RADIO_ON_ICON

#define RADIO_ON_ICON   C_radio_active_40px

Definition at line 137 of file nbgl_obj.h.

◆ RADIO_WIDTH

#define RADIO_WIDTH   40

Definition at line 106 of file nbgl_obj.h.

◆ RELEASED_MASK

#define RELEASED_MASK   0x80

released (see LSB bits to know what buttons are released)

Definition at line 177 of file nbgl_obj.h.

◆ RIGHT_ARROW_ICON

#define RIGHT_ARROW_ICON   C_Next_40px

Definition at line 140 of file nbgl_obj.h.

◆ RIGHT_BUTTON

#define RIGHT_BUTTON   0x02

Right button event.

Definition at line 175 of file nbgl_obj.h.

◆ SHIFT_ICON

#define SHIFT_ICON   C_Maj_40px

Definition at line 133 of file nbgl_obj.h.

◆ SHIFT_KEY_INDEX

#define SHIFT_KEY_INDEX   26

Definition at line 39 of file nbgl_obj.h.

◆ SHIFT_LOCKED_ICON

#define SHIFT_LOCKED_ICON   C_Maj_Lock_40px

Definition at line 134 of file nbgl_obj.h.

◆ SPACE_ICON

#define SPACE_ICON   C_Space_40px

Definition at line 131 of file nbgl_obj.h.

◆ SPACE_KEY_INDEX

#define SPACE_KEY_INDEX   29

Definition at line 42 of file nbgl_obj.h.

◆ SPECIAL_KEYS_INDEX

#define SPECIAL_KEYS_INDEX   30

Definition at line 43 of file nbgl_obj.h.

◆ SPINNER_HEIGHT

#define SPINNER_HEIGHT   48

Definition at line 98 of file nbgl_obj.h.

◆ SPINNER_WIDTH

#define SPINNER_WIDTH   64

Definition at line 97 of file nbgl_obj.h.

◆ SWIPE_MASK

#define SWIPE_MASK    ((1 << SWIPED_UP) | (1 << SWIPED_DOWN) | (1 << SWIPED_LEFT) | (1 << SWIPED_RIGHT))

Definition at line 167 of file nbgl_obj.h.

◆ VALIDATE_ICON

#define VALIDATE_ICON   C_Check_40px

Definition at line 135 of file nbgl_obj.h.

◆ VALIDATE_KEY

#define VALIDATE_KEY   '\r'

Definition at line 27 of file nbgl_obj.h.

◆ WARNING_ICON

#define WARNING_ICON   C_Warning_40px

Definition at line 148 of file nbgl_obj.h.

◆ WHEEL_ICON

#define WHEEL_ICON   C_Settings_40px

Definition at line 144 of file nbgl_obj.h.

Typedef Documentation

◆ keyboardCallback_t

typedef void(* keyboardCallback_t) (char touchedKey)

prototype of function to be called when a valid key is pressed on keyboard Backspace is equal to 0x8 (ASCII code), Validate (for Keypad) is equal to 15 ('\r')

Parameters
touchedKeychar typed on keyboard

Definition at line 466 of file nbgl_obj.h.

◆ nbgl_button_t

struct to represent a button (BUTTON type) that can contain a text and/or an icon

Note
border width is fixed (2 pixels)

◆ nbgl_buttonCallback_t

typedef 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 screen?)

Parameters
objthe concerned object
buttonStateevent on buttons

Definition at line 200 of file nbgl_obj.h.

◆ nbgl_container_t

struct to represent a container (CONTAINER type)

Note
the main screen is a kind of container

◆ nbgl_image_file_t

struct to represent an image file object (IMAGE_FILE type) The source of the data is an image file with header. width and height are given in this header

◆ nbgl_image_t

struct to represent an image (IMAGE type)

◆ nbgl_keyboard_t

struct to represent a keyboard (KEYBOARD type)

◆ nbgl_keypad_t

struct to represent a keypad (KEYPAD type)

◆ nbgl_line_t

struct to represent a vertical or horizontal line

◆ nbgl_mask_control_t

◆ nbgl_obj_t

typedef struct PACKED__ nbgl_obj_s nbgl_obj_t

Common structure for all graphical objects.

Note
this type must never be instantiated

◆ nbgl_page_indicator_t

struct to represent a navigation bar (PAGE_INDICATOR type) There can be up to 5 page indicators, whose shape is fixed. If there are more than 5 pages, the middle indicator will be "..."

Note
height is fixed

◆ nbgl_progress_bar_t

struct to represent a progress bar (PROGRESS_BAR type)

Note
if withBorder, the stroke of the border is fixed (3 pixels)

◆ nbgl_qrcode_t

struct to represent a QR code (QR_CODE type), whose size is fixed

◆ nbgl_radio_t

struct to represent a radio button (RADIO_BUTTON type)

Note
size is fixed

◆ nbgl_spinner_t

struct to represent a "spinner", represented by the Ledger corners, in gray, with one of the corners in black (SPINNER type)

◆ nbgl_switch_t

struct to represent a switch (size is fixed) (SWITCH type)

◆ nbgl_text_area_t

struct to represent a text area (TEXT_AREA type)

◆ nbgl_text_entry_t

struct to represent a text entry area (TEXT_ENTRY type)

◆ nbgl_touchCallback_t

typedef 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

Parameters
objthe concerned object
eventTypetype of touch event

Definition at line 221 of file nbgl_obj.h.

◆ onImageDrawCallback_t

typedef nbgl_icon_details_t*(* onImageDrawCallback_t) (uint8_t token)

prototype of function to be called when a IMAGE object is drawned, and no buffer was provided

Parameters
tokenprovided token in IMAGE object
Returns
the icn details to be drawned in image object

Definition at line 280 of file nbgl_obj.h.

◆ onTextDrawCallback_t

typedef char*(* onTextDrawCallback_t) (uint8_t token)

prototype of function to be called when a TEXT_AREA object is drawned, and no text was provided

Parameters
tokenprovided token in TEXT_AREA object
Returns
an ASCII string (null terminated) to be drawned in text area

Definition at line 387 of file nbgl_obj.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

ids of touchable objects, for external stimulus (by Testing environment)

Enumerator
BOTTOM_BUTTON_ID 
LEFT_BUTTON_ID 
RIGHT_BUTTON_ID 
WHOLE_SCREEN_ID 
TOP_RIGHT_BUTTON_ID 
BACK_BUTTON_ID 
SINGLE_BUTTON_ID 
EXTRA_BUTTON_ID 
CHOICE_1_ID 
CHOICE_2_ID 
KEYPAD_ID 
KEYBOARD_ID 
ENTERED_TEXT_ID 
VALUE_BUTTON_1_ID 
VALUE_BUTTON_2_ID 
VALUE_BUTTON_3_ID 
LONG_PRESS_BUTTON_ID 
TIP_BOX_ID 
CONTROLS_ID 
NB_CONTROL_IDS 

Definition at line 544 of file nbgl_obj.h.

◆ keyboardCase_t

Letters casing in which to open/set the keyboard.

Enumerator
LOWER_CASE 

lower case mode

UPPER_CASE 

upper case mode for one character

LOCKED_UPPER_CASE 

locked upper case mode

Definition at line 489 of file nbgl_obj.h.

◆ keyboardMode_t

Mode in which to open/set the keyboard.

Enumerator
MODE_LETTERS 

letters mode

MODE_DIGITS 

digits and some special characters mode

MODE_SPECIAL 

extended special characters mode

Definition at line 472 of file nbgl_obj.h.

◆ nbgl_buttonEvent_t

Enumerator
BUTTON_LEFT_PRESSED 

Sent when Left button is released.

BUTTON_RIGHT_PRESSED 

Send when Right button is released.

BUTTON_LEFT_CONTINUOUS_PRESSED 

Send when Left button is continuouly pressed (sent every 300ms after the first 800ms)

BUTTON_RIGHT_CONTINUOUS_PRESSED 

Send when Right button is continuouly pressed (sent every 300ms after the first 800ms)

BUTTON_BOTH_PRESSED 

Sent when both buttons are released.

BUTTON_BOTH_TOUCHED 

Sent when both buttons are touched.

INVALID_BUTTON_EVENT 

Definition at line 182 of file nbgl_obj.h.

◆ nbgl_page_indicator_style_t

Style to apply to nbgl_page_indicator_t.

Enumerator
PROGRESSIVE_INDICATOR 

all dashes before active page are black

CURRENT_INDICATOR 

only current page dash is black

Definition at line 362 of file nbgl_obj.h.

Function Documentation

◆ nbgl_containerPoolGet()

nbgl_obj_t** nbgl_containerPoolGet ( uint8_t  nbObjs,
uint8_t  layer 
)

Gets a new container from the pool, with the given number of obj pointers.

Parameters
nbObjsnumber of objects pointers for the container
layerlayer (screen) to get the container to

Definition at line 290 of file nbgl_obj_pool.c.

◆ nbgl_containerPoolGetNbUsed()

uint8_t nbgl_containerPoolGetNbUsed ( uint8_t  layer)

returns the number of containers currently used in the pool

Definition at line 334 of file nbgl_obj_pool.c.

◆ nbgl_containerPoolRelease()

void nbgl_containerPoolRelease ( uint8_t  layer)

Release the objects pointers from the pool for the given layer.

Parameters
layerlayer to release objects pointers from

Definition at line 265 of file nbgl_obj_pool.c.

◆ nbgl_keyboardGetPosition()

bool nbgl_keyboardGetPosition ( nbgl_keyboard_t kbd,
char  index,
uint16_t x,
uint16_t y 
)

This function gets the position (top-left corner) of the key at the given index. (to be used for Testing purpose)

Parameters
kbdthe object to be drawned
indexascii character (in lower-case)
x[out] the top-left position
y[out] the top-left position
Returns
true if found, false otherwise

Definition at line 644 of file nbgl_obj_keyboard.c.

◆ nbgl_keyboardTouchCallback()

void nbgl_keyboardTouchCallback ( nbgl_obj_t obj,
nbgl_touchType_t  eventType 
)

function to be called when the keyboard object is touched

Parameters
objtouched object (keyboard)
eventTypetype of touch (only TOUCHED is accepted)
Returns
none

Definition at line 526 of file nbgl_obj_keyboard.c.

◆ nbgl_keypadGetPosition()

bool nbgl_keypadGetPosition ( nbgl_keypad_t kpd,
char  index,
uint16_t x,
uint16_t y 
)

This function gets the position (top-left corner) of the key at the given index. (to be used for Testing purpose). Only works without shuffling.

Parameters
kpdthe object to be drawned
indexthe char of the key
x[out] the top-left position
y[out] the top-left position
Returns
true if found, false otherwise

Definition at line 337 of file nbgl_obj_keypad.c.

◆ nbgl_keypadTouchCallback()

void nbgl_keypadTouchCallback ( nbgl_obj_t obj,
nbgl_touchType_t  eventType 
)

function to be called when the keypad object is touched

Parameters
objtouched object (keypad)
eventTypetype of touch (only TOUCHED is accepted)
Returns
none

Definition at line 270 of file nbgl_obj_keypad.c.

◆ nbgl_objAllowDrawing()

void nbgl_objAllowDrawing ( bool  enable)

This functions enables or disables drawing/refresh for all further calls.

Parameters
enableif true, enables drawing/refresh, otherwise disables

Definition at line 1645 of file nbgl_obj.c.

◆ nbgl_objDraw()

void nbgl_objDraw ( nbgl_obj_t obj)

This function draws or redraws the given object and its children (recursive version)

Parameters
objthe object to redraw

Definition at line 1521 of file nbgl_obj.c.

◆ nbgl_objDrawKeyboard()

void nbgl_objDrawKeyboard ( nbgl_keyboard_t kbd)

This function draws a keyboard object.

Parameters
kbdthe object to be drawned

Definition at line 692 of file nbgl_obj_keyboard.c.

◆ nbgl_objDrawKeypad()

void nbgl_objDrawKeypad ( nbgl_keypad_t kpd)

This function draws a keypad object.

Parameters
kpdkeypad object to draw
Returns
the keypad keypad object

Definition at line 376 of file nbgl_obj_keypad.c.

◆ nbgl_objInit()

void nbgl_objInit ( void  )

This functions inits all internal of nbgl objects layer.

Definition at line 1634 of file nbgl_obj.c.

◆ nbgl_objPoolGet()

nbgl_obj_t* nbgl_objPoolGet ( nbgl_obj_type_t  type,
uint8_t  layer 
)

Gets a new graphic object from the pool, with the given type. The type field of the object is set.

Parameters
typetype of object to get from the pool
layerlayer to get object for

Definition at line 164 of file nbgl_obj_pool.c.

◆ nbgl_objPoolGetArray()

int nbgl_objPoolGetArray ( nbgl_obj_type_t  type,
uint8_t  nbObjs,
uint8_t  layer,
nbgl_obj_t **  objArray 
)

Gets nbObjects new graphic object from the pool, with the given type, for the given layer (screen). The type field of the object is set.

Parameters
typetype of objects to get from the pool
nbObjsnumber of objects to get from the pool
layerlayer (screen) to get the object to
objArrayarray of objs pointers
Returns
>= 0 if OK

Definition at line 242 of file nbgl_obj_pool.c.

◆ nbgl_objPoolGetId()

uint8_t nbgl_objPoolGetId ( nbgl_obj_t obj)

Gets a unique index for the given object, in the pool.

Parameters
objobject to get id from
Returns
an unique index of the object

Definition at line 223 of file nbgl_obj_pool.c.

◆ nbgl_objPoolGetNbUsed()

uint8_t nbgl_objPoolGetNbUsed ( uint8_t  layer)

returns the number of objects currently used in the pool

Definition at line 147 of file nbgl_obj_pool.c.

◆ nbgl_objPoolGetPrevious()

nbgl_obj_t* nbgl_objPoolGetPrevious ( nbgl_obj_t obj,
uint8_t  layer 
)

Gets a link to the previous object in the pool, for the given layer. (to be used with care)

Parameters
objobject to get previous from
layerlayer (screen) in which to retrieve the object
Returns
a pointer to the previous object in the pool

Definition at line 201 of file nbgl_obj_pool.c.

◆ nbgl_objPoolRelease()

void nbgl_objPoolRelease ( uint8_t  layer)

Release the objects from the pool for the given layer.

Parameters
layerlayer to release object from

Definition at line 126 of file nbgl_obj_pool.c.

◆ nbgl_refresh()

void nbgl_refresh ( void  )

This functions refreshes the actual screen on display with what has changed since the last refresh.

Definition at line 1560 of file nbgl_obj.c.

◆ nbgl_refreshIsNeeded()

bool nbgl_refreshIsNeeded ( void  )

This functions returns true if there is something to refresh.

Returns
true if there is something to refresh

Definition at line 1606 of file nbgl_obj.c.

◆ nbgl_refreshReset()

void nbgl_refreshReset ( void  )

This functions resets all changes since the last refresh.

Definition at line 1618 of file nbgl_obj.c.

◆ nbgl_refreshSpecial()

void nbgl_refreshSpecial ( nbgl_refresh_mode_t  mode)

This functions refreshes the actual screen on display with what has changed since the last refresh, according to the given mode (Black&White and other)

Parameters
modemode of refresh

Definition at line 1570 of file nbgl_obj.c.

◆ nbgl_refreshSpecialWithPostRefresh()

void nbgl_refreshSpecialWithPostRefresh ( nbgl_refresh_mode_t  mode,
nbgl_post_refresh_t  post_refresh 
)

Definition at line 1586 of file nbgl_obj.c.