20#include "app_config.h"
21#include "bolos_target.h"
29#ifdef SCREEN_SIZE_WALLET
30#if defined(TARGET_STAX)
31#define SCREEN_WIDTH 400
32#define SCREEN_HEIGHT 672
33#define SMALL_ICON_SIZE 32
34#define LARGE_ICON_SIZE 64
36#define SMALL_FONT_HEIGHT 24
38#define COMMON_RADIUS 40
40#define SMALL_BUTTON_RADIUS 32
42#define VERTICAL_ALIGNMENT 4
44#define NB_COLOR_BITS 4
45#elif defined(TARGET_FLEX)
46#define SCREEN_WIDTH 480
47#define SCREEN_HEIGHT 600
48#define SMALL_ICON_SIZE 40
49#define LARGE_ICON_SIZE 64
51#define SMALL_FONT_HEIGHT 28
53#define COMMON_RADIUS 44
55#define SMALL_BUTTON_RADIUS 32
57#define VERTICAL_ALIGNMENT 4
59#define NB_COLOR_BITS 4
62#define SCREEN_WIDTH 128
63#define SCREEN_HEIGHT 64
65#define SMALL_FONT_HEIGHT 11
67#define NB_COLOR_BITS 1
74#define NO_TRANSFORMATION 0
80#define VERTICAL_MIRROR 0x2
86#define ROTATE_90_CLOCKWISE 0x4
92#define INVALID_COLOR_MAP 0x0
98#define MIN(x, y) ((x) < (y) ? (x) : (y))
101#define MAX(x, y) ((x) > (y) ? (x) : (y))
107#define PACKED__ __attribute__((packed))
199#ifdef SCREEN_SIZE_NANO
285#define GZLIB_UNCOMPRESSED_CHUNK 2049
344#ifdef SCREEN_SIZE_WALLET
uint8_t nbgl_transformation_t
Represents the transformation to be applied on the bitmap before rendering This is a bitfield using m...
nbgl_state_t
to represent a boolean state.
nbgl_post_refresh_t
Post refresh modes.
@ POST_REFRESH_KEEP_POWER_STATE
Keep state after refresh.
@ POST_REFRESH_FORCE_POWER_OFF
Force screen power off after refresh.
@ POST_REFRESH_FORCE_POWER_ON
Force screen power on after refresh.
@ POST_REFRESH_FORCE_POWER_ON_WITH_PIPELINE
Force screen power on and enable pipeline.
uint8_t nbgl_color_map_t
Represents the color_map to be used for 2BPP image, or the foreground color for 1BPP image.
nbgl_radius_t
possible radius indexes for objects
@ RADIUS_0_PIXELS
no radius (square angle)
struct nbgl_animation_s nbgl_animation_t
Represents all information about an animation (succession of icons)
nbgl_touchType_t
The different types of Touchscreen events.
@ VALUE_CHANGED
corresponding to a change of state of the object (indirect event)
@ TOUCHING
corresponding to an object that is currently touched
nbgl_qrcode_version_t
possible modes for QR Code
@ QRCODE_V10
QRCode V10, can encode text len up to 1500 chars, display size = 228*228.
@ QRCODE_V4_SMALL
QRCode V4, can encode text len up to 1500 chars, display size = 132*132.
@ QRCODE_V4
QRCode V4, can encode text len up to 62 chars, display size = 264*264.
nbgl_direction_t
Directions for layout or lines.
@ VERTICAL
from top to bottom
@ HORIZONTAL
from left to right
nbgl_parsingType_t
possible parsings of icons to create animation
@ BACK_AND_FORTH_PARSING
0, 1, 2, 1, 2, 0, ...
@ LOOP_PARSING
0, 1, 2, 0, 1, 2, ...
struct PACKED__ nbgl_icon_details_s nbgl_icon_details_t
Represents all information about an icon.
nbgl_aligment_t
All types of alignments.
@ NO_ALIGNMENT
used when parent container layout is used
@ LEFT_TOP
on outside left
@ LEFT_BOTTOM
on outside left
@ RIGHT_TOP
on outside right
@ RIGHT_BOTTOM
on outside right
nbgl_hardwareSwipe_t
Hardware powered detected swipe states.
nbgl_obj_type_t
All types of graphical objects.
@ IMAGE
Bitmap (y and height must be multiple of 4 on Stax)
@ IMAGE_FILE
Image file (with Ledger compression)
@ TEXT_ENTRY
area for entered text, only for Nanos
@ SWITCH
Switch to turn on/off something.
@ RADIO_BUTTON
Indicator to inform whether something is on or off.
@ BUTTON
Rounded rectangle button with icon and/or text.
@ PROGRESS_BAR
horizontal bar to indicate progression of something (between 0% and 100%)
@ PAGE_INDICATOR
horizontal bar to indicate position within pages
@ LINE
Vertical or Horizontal line.
@ MASK_CONTROL
OS-specific object to enable/disable masked area.
@ CONTAINER
Empty container.
@ TEXT_AREA
Area to contain text line(s)
nbgl_touchState_t
the 2 possible states of a finger on the Touchscreen
@ PRESSED
the finger is currently pressing the screen
@ RELEASED
the finger has been released from the screen
nbgl_bpp_t
Enum to represent the number of bits per pixel (BPP)
@ NB_NBGL_BPP
Number of NBGL_BPP enums.
@ NBGL_BPP_1
1 bit per pixel
@ NBGL_BPP_4
4 bits per pixel
@ NBGL_BPP_2
2 bits per pixel
nbgl_style_t
possible styles for text area border
struct PACKED__ nbgl_area_s nbgl_area_t
Represents a rectangle area of the screen.
nbgl_compression_t
Enum to represent the compression.
@ NBGL_GZLIB_COMPRESSION
gzlib compression
@ NBGL_NO_COMPRESSION
no compression, raw data
@ NBGL_RLE_COMPRESSION
RLE compression.
@ NB_NBGL_COMPRESSION
Number of NBGL_COMPRESSION enums.
nbgl_refresh_mode_t
different modes of refresh for nbgl_refreshSpecial()
@ BLACK_AND_WHITE_REFRESH
to be used for pure B&W area, when contrast is important
@ FULL_COLOR_CLEAN_REFRESH
to be used for lock screen display (cleaner but longer refresh)
@ BLACK_AND_WHITE_FAST_REFRESH
to be used for pure B&W area, when contrast is not priority
@ FULL_COLOR_PARTIAL_REFRESH
to be used for small partial refresh (radio buttons, switches)
@ INIT_REFRESH
to be used to fully clear the screen in white
@ FULL_COLOR_REFRESH
to be used for normal refresh
Represents all information about an animation (succession of icons)
uint16_t delayMs
delay between 2 drawings
uint8_t nbIcons
number of icons in icons array
const nbgl_icon_details_t ** icons
array of nbIcons pointers on icons
nbgl_parsingType_t parsing
Represents a rectangle area of the screen.
color_t backgroundColor
color (usually background) to be applied
uint16_t width
width of the area, in pixels
nbgl_bpp_t bpp
bits per pixel for this area
uint16_t height
height of the area, in pixels
Represents all information about an icon.
bool isFile
if true, the bitmap buffer contains an image file
uint16_t width
width of the icon, in pixels
const uint8_t * bitmap
buffer containing pixel values
nbgl_bpp_t bpp
bits per pixel for this area
uint16_t height
height of the icon, in pixels