Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
nbgl_types.h
Go to the documentation of this file.
1
7#ifndef NBGL_TYPES_H
8#define NBGL_TYPES_H
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14/*********************
15 * INCLUDES
16 *********************/
17#include <stddef.h>
18#include <stdint.h>
19#include <stdbool.h>
20#include "bolos_target.h"
21
22/*********************
23 * DEFINES
24 *********************/
28#ifdef SCREEN_SIZE_WALLET
29#ifdef TARGET_STAX
30#define SCREEN_WIDTH 400
31#else // TARGET_STAX
32#define SCREEN_WIDTH 480
33#endif // TARGET_STAX
34#else // SCREEN_SIZE_WALLET
35#define SCREEN_WIDTH 128
36#endif // SCREEN_SIZE_WALLET
37
41#ifdef SCREEN_SIZE_WALLET
42#ifdef TARGET_STAX
43#define SCREEN_HEIGHT 672
44#else // TARGET_STAX
45#define SCREEN_HEIGHT 600
46#endif // TARGET_STAX
47#else // SCREEN_SIZE_WALLET
48#define SCREEN_HEIGHT 64
49#endif // SCREEN_SIZE_WALLET
50
51// HW vertical alignment
52#define VERTICAL_ALIGNMENT 1
53
58#define NO_TRANSFORMATION 0
59
64#define VERTICAL_MIRROR 0x2
65
70#define ROTATE_90_CLOCKWISE 0x4
71
76#define INVALID_COLOR_MAP 0x0
77
78/**********************
79 * TYPEDEFS
80 **********************/
81#ifndef MIN
82#define MIN(x, y) ((x) < (y) ? (x) : (y))
83#endif
84#ifndef MAX
85#define MAX(x, y) ((x) > (y) ? (x) : (y))
86#endif
87
88#ifdef LINUX_SIMU
89#define PACKED__
90#else // LINUX_SIMU
91#define PACKED__ __attribute__((packed))
92#endif // LINUX_SIMU
93#ifdef BICOLOR_MODE
94
95typedef enum {
96 BLACK = 0,
97 DARK_GRAY = 0,
98 LIGHT_GRAY = 0,
99 WHITE = 3
100} color_t;
101
102#else
103
111
112#endif
113
138
159
167
176
181typedef enum {
183#ifdef SCREEN_SIZE_NANO
184 INVERTED_COLORS
185#endif // SCREEN_SIZE_NANO
187
198
207
218
242
253
264
269#define GZLIB_UNCOMPRESSED_CHUNK 2049
270
285
299
322
327typedef enum {
328#ifdef SCREEN_SIZE_WALLET
330#ifdef TARGET_STAX
331 RADIUS_40_PIXELS,
332 RADIUS_MAX = RADIUS_40_PIXELS,
333#else // TARGET_STAX
336#endif // TARGET_STAX
337#else // SCREEN_SIZE_WALLET
338 RADIUS_1_PIXEL = 0,
339 RADIUS_3_PIXELS,
340 RADIUS_MAX = RADIUS_3_PIXELS,
341#endif // SCREEN_SIZE_WALLET
344
350
357
369
370#ifdef __cplusplus
371} /* extern "C" */
372#endif
373
374#endif /* NBGL_TYPES_H */
color_t
Definition nbgl_types.h:104
@ NB_NBGL_COLOR
Definition nbgl_types.h:109
@ WHITE
Definition nbgl_types.h:108
@ DARK_GRAY
Definition nbgl_types.h:106
@ LIGHT_GRAY
Definition nbgl_types.h:107
@ BLACK
Definition nbgl_types.h:105
uint8_t nbgl_transformation_t
Represents the transformation to be applied on the bitmap before rendering This is a bitfield using m...
Definition nbgl_types.h:349
nbgl_state_t
to represent a boolean state.
Definition nbgl_types.h:163
@ ON_STATE
Definition nbgl_types.h:165
@ OFF_STATE
Definition nbgl_types.h:164
nbgl_post_refresh_t
Post refresh modes.
Definition nbgl_types.h:316
@ POST_REFRESH_KEEP_POWER_STATE
Keep state after refresh.
Definition nbgl_types.h:320
@ POST_REFRESH_FORCE_POWER_OFF
Force screen power off after refresh.
Definition nbgl_types.h:317
@ POST_REFRESH_FORCE_POWER_ON
Force screen power on after refresh.
Definition nbgl_types.h:318
@ POST_REFRESH_FORCE_POWER_ON_WITH_PIPELINE
Force screen power on and enable pipeline.
Definition nbgl_types.h:319
uint8_t nbgl_color_map_t
Represents the color_map to be used for 2BPP image, or the foreground color for 1BPP image.
Definition nbgl_types.h:356
nbgl_radius_t
possible radius for objects
Definition nbgl_types.h:327
@ RADIUS_MAX
Definition nbgl_types.h:335
@ RADIUS_0_PIXELS
no radius (square angle)
Definition nbgl_types.h:342
@ RADIUS_32_PIXELS
32 pixels
Definition nbgl_types.h:329
@ RADIUS_44_PIXELS
44 pixels
Definition nbgl_types.h:334
nbgl_touchType_t
The different types of Touchscreen events.
Definition nbgl_types.h:223
@ SWIPED_LEFT
Definition nbgl_types.h:239
@ LONG_TOUCHED
Definition nbgl_types.h:226
@ SWIPED_UP
Definition nbgl_types.h:236
@ SWIPED_DOWN
Definition nbgl_types.h:237
@ SWIPED_RIGHT
Definition nbgl_types.h:238
@ VALUE_CHANGED
corresponding to a change of state of the object (indirect event)
Definition nbgl_types.h:235
@ NB_TOUCH_TYPES
Definition nbgl_types.h:240
@ TOUCH_RELEASED
Definition nbgl_types.h:233
@ TOUCHED
Definition nbgl_types.h:224
@ TOUCHING
corresponding to an object that is currently touched
Definition nbgl_types.h:228
@ TOUCH_PRESSED
Definition nbgl_types.h:231
@ OUT_OF_TOUCH
Definition nbgl_types.h:229
nbgl_qrcode_version_t
possible modes for QR Code
Definition nbgl_types.h:193
@ QRCODE_V10
QRCode V10, can encode text len up to 1500 chars, display size = 228*228.
Definition nbgl_types.h:195
@ QRCODE_V4_SMALL
QRCode V4, can encode text len up to 1500 chars, display size = 132*132.
Definition nbgl_types.h:196
@ QRCODE_V4
QRCode V4, can encode text len up to 62 chars, display size = 264*264.
Definition nbgl_types.h:194
nbgl_direction_t
Directions for layout or lines.
Definition nbgl_types.h:172
@ VERTICAL
from top to bottom
Definition nbgl_types.h:173
@ HORIZONTAL
from left to right
Definition nbgl_types.h:174
struct PACKED__ nbgl_icon_details_s nbgl_icon_details_t
Represents all information about an icon.
nbgl_aligment_t
All types of alignments.
Definition nbgl_types.h:143
@ TOP_MIDDLE
Definition nbgl_types.h:146
@ CENTER
Definition nbgl_types.h:149
@ BOTTOM_RIGHT
Definition nbgl_types.h:153
@ TOP_LEFT
Definition nbgl_types.h:145
@ NO_ALIGNMENT
used when parent container layout is used
Definition nbgl_types.h:144
@ BOTTOM_LEFT
Definition nbgl_types.h:151
@ LEFT_TOP
on outside left
Definition nbgl_types.h:154
@ LEFT_BOTTOM
on outside left
Definition nbgl_types.h:155
@ MID_RIGHT
Definition nbgl_types.h:150
@ RIGHT_TOP
on outside right
Definition nbgl_types.h:156
@ TOP_RIGHT
Definition nbgl_types.h:147
@ MID_LEFT
Definition nbgl_types.h:148
@ BOTTOM_MIDDLE
Definition nbgl_types.h:152
@ RIGHT_BOTTOM
on outside right
Definition nbgl_types.h:157
nbgl_hardwareSwipe_t
Hardware powered detected swipe states.
Definition nbgl_types.h:211
@ HARDWARE_SWIPE_RIGHT
Definition nbgl_types.h:214
@ NO_HARDWARE_SWIPE
Definition nbgl_types.h:216
@ HARDWARE_SWIPE_LEFT
Definition nbgl_types.h:215
@ HARDWARE_SWIPE_DOWN
Definition nbgl_types.h:213
@ HARDWARE_SWIPE_UP
Definition nbgl_types.h:212
nbgl_obj_type_t
All types of graphical objects.
Definition nbgl_types.h:118
@ KEYPAD
Keypad.
Definition nbgl_types.h:131
@ IMAGE
Bitmap (y and height must be multiple of 4 on Stax)
Definition nbgl_types.h:121
@ IMAGE_FILE
Image file (with Ledger compression)
Definition nbgl_types.h:133
@ TEXT_ENTRY
area for entered text, only for Nanos
Definition nbgl_types.h:134
@ NB_OBJ_TYPES
Definition nbgl_types.h:136
@ SWITCH
Switch to turn on/off something.
Definition nbgl_types.h:125
@ RADIO_BUTTON
Indicator to inform whether something is on or off.
Definition nbgl_types.h:128
@ SPINNER
Spinner.
Definition nbgl_types.h:132
@ BUTTON
Rounded rectangle button with icon and/or text.
Definition nbgl_types.h:124
@ PROGRESS_BAR
horizontal bar to indicate progression of something (between 0% and 100%)
Definition nbgl_types.h:127
@ QR_CODE
QR Code.
Definition nbgl_types.h:129
@ PAGE_INDICATOR
horizontal bar to indicate position within pages
Definition nbgl_types.h:126
@ LINE
Vertical or Horizontal line.
Definition nbgl_types.h:122
@ KEYBOARD
Keyboard.
Definition nbgl_types.h:130
@ MASK_CONTROL
OS-specific object to enable/disable masked area.
Definition nbgl_types.h:135
@ CONTAINER
Empty container.
Definition nbgl_types.h:120
@ TEXT_AREA
Area to contain text line(s)
Definition nbgl_types.h:123
@ SCREEN
Main screen.
Definition nbgl_types.h:119
nbgl_touchState_t
the 2 possible states of a finger on the Touchscreen
Definition nbgl_types.h:203
@ PRESSED
the finger is currently pressing the screen
Definition nbgl_types.h:205
@ RELEASED
the finger has been released from the screen
Definition nbgl_types.h:204
nbgl_bpp_t
Enum to represent the number of bits per pixel (BPP)
Definition nbgl_types.h:247
@ NB_NBGL_BPP
Number of NBGL_BPP enums.
Definition nbgl_types.h:251
@ NBGL_BPP_1
1 bit per pixel
Definition nbgl_types.h:248
@ NBGL_BPP_4
4 bits per pixel
Definition nbgl_types.h:250
@ NBGL_BPP_2
2 bits per pixel
Definition nbgl_types.h:249
nbgl_style_t
possible styles for text area border
Definition nbgl_types.h:181
@ NO_STYLE
no border
Definition nbgl_types.h:182
#define PACKED__
Definition nbgl_types.h:91
struct PACKED__ nbgl_area_s nbgl_area_t
Represents a rectangle area of the screen.
nbgl_compression_t
Enum to represent the compression.
Definition nbgl_types.h:258
@ NBGL_GZLIB_COMPRESSION
gzlib compression
Definition nbgl_types.h:260
@ NBGL_NO_COMPRESSION
no compression, raw data
Definition nbgl_types.h:259
@ NBGL_RLE_COMPRESSION
RLE compression.
Definition nbgl_types.h:261
@ NB_NBGL_COMPRESSION
Number of NBGL_COMPRESSION enums.
Definition nbgl_types.h:262
nbgl_refresh_mode_t
different modes of refresh for nbgl_refreshSpecial()
Definition nbgl_types.h:290
@ BLACK_AND_WHITE_REFRESH
to be used for pure B&W area, when contrast is important
Definition nbgl_types.h:294
@ FULL_COLOR_CLEAN_REFRESH
to be used for lock screen display (cleaner but longer refresh)
Definition nbgl_types.h:293
@ BLACK_AND_WHITE_FAST_REFRESH
to be used for pure B&W area, when contrast is not priority
Definition nbgl_types.h:295
@ FULL_COLOR_PARTIAL_REFRESH
to be used for small partial refresh (radio buttons, switches)
Definition nbgl_types.h:292
@ INIT_REFRESH
to be used to fully clear the screen in white
Definition nbgl_types.h:296
@ NB_REFRESH_MODES
Definition nbgl_types.h:297
@ FULL_COLOR_REFRESH
to be used for normal refresh
Definition nbgl_types.h:291
Represents a rectangle area of the screen.
Definition nbgl_types.h:275
color_t backgroundColor
color (usually background) to be applied
Definition nbgl_types.h:282
uint16_t width
width of the area, in pixels
Definition nbgl_types.h:280
int16_t y0
Definition nbgl_types.h:278
int16_t x0
Definition nbgl_types.h:276
nbgl_bpp_t bpp
bits per pixel for this area
Definition nbgl_types.h:283
uint16_t height
height of the area, in pixels
Definition nbgl_types.h:281
Represents all information about an icon.
Definition nbgl_types.h:362
bool isFile
if true, the bitmap buffer contains an image file
Definition nbgl_types.h:366
uint16_t width
width of the icon, in pixels
Definition nbgl_types.h:363
const uint8_t * bitmap
buffer containing pixel values
Definition nbgl_types.h:367
nbgl_bpp_t bpp
bits per pixel for this area
Definition nbgl_types.h:365
uint16_t height
height of the icon, in pixels
Definition nbgl_types.h:364
signed short int16_t
Definition usbd_conf.h:50
unsigned short uint16_t
Definition usbd_conf.h:54
unsigned char uint8_t
Definition usbd_conf.h:53