Skip to content

Commit

Permalink
Update documentation accordingly to new NBGL cases on Nano devices
Browse files Browse the repository at this point in the history
  • Loading branch information
cedelavergne-ledger committed Jan 23, 2025
1 parent c50d79e commit 3f604e0
Show file tree
Hide file tree
Showing 14 changed files with 509 additions and 336 deletions.
13 changes: 0 additions & 13 deletions doc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,6 @@ TAB_SIZE = 4

ALIASES =

# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding "class=itcl::class"
# will allow you to use the command class in the itcl::class meaning.

TCL_SUBST =

# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
# only. Doxygen will then generate output that is more tailored for C. For
# instance, some of the names that are used will be different. The list of all
Expand Down Expand Up @@ -1182,13 +1176,6 @@ CLANG_DATABASE_PATH =

ALPHABETICAL_INDEX = YES

# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
# which the alphabetical index list will be split.
# Minimum value: 1, maximum value: 20, default value: 5.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.

COLS_IN_ALPHA_INDEX = 5

# In case all classes in a project start with a common prefix, all classes will
# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
# can be used to specify a prefix (or a list of prefixes) that should be ignored
Expand Down
6 changes: 3 additions & 3 deletions doc/mainpage.dox
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@section mainpage_intro Introduction

This documentation describes the different interfaces of Embedded SDK,
for \b Nano X, \b Nano S+ and \b Stax applications development.
for \b Nano X, \b Nano S+ \b Stax and \b Flex applications development.

@section ble_presentation BlueTooth Low-Energy Interface

Expand All @@ -16,7 +16,7 @@ The @subpage cxng_mainpage page contains all information necessary to understand
@section nbgl_presentation Screen drawing API

The @subpage nbgl_mainpage page contains all information necessary to understand the Graphical Library for
\b Stax, \b NanoX and \b NanoS+ applications development.
\b Stax, \b Flex, \b NanoX and \b NanoS+ applications development.

@section nfc_presentation NFC Interface

Expand Down Expand Up @@ -50,7 +50,7 @@ The @subpage ux_mainpage page contains all information necessary to user the Use
@subsection ux_nbgl_presentation User eXperience on Applications using \b NBGL

The @subpage ux_nbgl_mainpage page contains all information necessary to user the User eXperience for
\b Stax, \b NanoX and \b NanoS+ applications development using \b NBGL (most recent ones).
\b Stax, \b Flex, \b NanoX and \b NanoS+ applications development using \b NBGL (most recent ones).


*/
15 changes: 6 additions & 9 deletions lib_nbgl/doc/mainpage_nanos.dox
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef HAVE_SE_TOUCH
/** @page nbgl_mainpage New BOLOS Graphic API for Nanos
/** @page nbgl_mainpage New BOLOS Graphic API for Nano devices (Nano X and Nano S+)

@section mainpage_intro Introduction
@section nbgl_mainpage_intro Introduction

This documentation describes the different interfaces of <b>NBGL</b>, the library that
is targeted to be integrated in Nano products (Nano X and Nano S+).
Expand All @@ -23,15 +23,11 @@ This is the most preferred API level to write an embedded Application.
The @subpage nbgl_app_use_case_nanos page contains all information necessary to understand
and use \b NBGL Application Use cases API

@subsection nbgl_flow_level_api_1 Flow API
The @subpage nbgl_flow page contains all information necessary to understand
and use \b NBGL Flow API, managing a scenario flow, made of one or several steps

@subsection nbgl_step_level_api_1 Step API
@subsection nbgl_step_level_api_1 High-Level API
The @subpage nbgl_step page contains all information necessary to understand
and use \b NBGL Step API, managing the page(s) of a scenario step
and use \b NBGL High-Level API, using predefined steps

@subsection nbgl_mid_level_api_1 Complex objects (layout) API
@subsection nbgl_mid_level_api_1 Mid-Level API
The @subpage nbgl_layout page contains all information necessary to understand
and use \b NBGL Mid-Level API, using complex objects

Expand All @@ -48,6 +44,7 @@ In order to reduce the footprint (RAM+Flash), some features are only activated i

Define | Meaning | Default state
------------- | ------------- | -------------
\b NBGL_STEP | Activate High-Level API | Active in SDK, not in OS
\b NBGL_USE_CASE | Activate Use Case API | Active in SDK, not in OS
\b NBGL_KEYBOARD | Activate Keyboard object | Active in OS, not in SDK
\b NBGL_KEYPAD | Activate Keypad object | Active in OS, not in SDK
Expand Down
22 changes: 11 additions & 11 deletions lib_nbgl/doc/nbgl_layout.dox
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ For example 1:

@code
nbgl_layoutDescription_t layoutDescription = {
.modal = false, // not modal (so on plane 0)
.onActionCallback = &myActionCallback, // generic callback for all controls
.onTapText = NULL, // no "tapable" main container
.ticker.callback = NULL // no ticker
.modal = false, // not modal (so on plane 0)
.onActionCallback = &myActionCallback, // generic callback for all controls
.onTapText = NULL, // no "tapable" main container
.ticker.callback = NULL // no ticker
};
// create layout
nbgl_layout_t *layout = nbgl_layoutGet(&layoutDescription);
Expand All @@ -63,11 +63,11 @@ For example 2:

@code
nbgl_layoutDescription_t layoutDescription = {
.modal = false, // not modal (so on plane 0)
.onActionCallback = &myActionCallback, // generic callback for all controls
.onTapText = "Tap to continue", // A "tapable" main container is necessary, with this text
.onTapToken = TAP_TOKEN, // token to be used when main container is touched
.ticker.callback = NULL // no ticker
.modal = false, // not modal (so on plane 0)
.onActionCallback = &myActionCallback, // generic callback for all controls
.onTapText = "Tap to continue", // A "tapable" main container is necessary, with this text
.onTapToken = TAP_TOKEN, // token to be used when main container is touched
.ticker.callback = NULL // no ticker
};
/* create layout */
nbgl_layout_t *layout = nbgl_layoutGet(&layoutDescription);
Expand Down Expand Up @@ -665,7 +665,7 @@ void app_keyboard(void) {

Some rare screens require displaying a keypad at the bottom of the page, to enter digits.

The digits to enter are usually a PIN code, so enter or to confirm.
The digits to enter are usually a PIN code, to enter or to confirm.

Here are some example of these pages in Bolos UX:

Expand All @@ -675,7 +675,7 @@ To build such screens, some dedicated APIs are necessary, which will be detailed

@subsubsection keypad_sub_section_1 Adding/Updating keypad

This object, at the bottom of the main container (with a margin), proposes a regular keypad, with 10 digits, a backspace and a validate keys.
This object, at the bottom of the main container (with a margin), proposes a regular keypad, with 12 digits, a backspace and a validate keys.

The only parameters to configure this object are:

Expand Down
47 changes: 27 additions & 20 deletions lib_nbgl/doc/nbgl_layout_nanos.dox
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ For example:

@code
nbgl_layoutDescription_t layoutDescription = {
.modal = false, // not modal (so on plane 0)
.onActionCallback = &myActionCallback, // generic callback for all controls
.ticker.callback = NULL // no ticker
.modal = false, // not modal (so on plane 0)
.onActionCallback = &myActionCallback, // generic callback for all controls
.ticker.callback = NULL // no ticker
};
// create layout
nbgl_layout_t *layout = nbgl_layoutGet(&layoutDescription);
Expand Down Expand Up @@ -187,22 +187,22 @@ static void keyboardCallback(char touchedKey) {

void app_keyboard(void) {
nbgl_layoutDescription_t layoutDescription = {
.modal = false,
.modal = false,
.onActionCallback = NULL
};
nbgl_layoutKbd_t kbdInfo = {
.callback = keyboardCallback,
.keyMask = 1<<26, // no masked letter but masked backspace
.lettersOnly = true // only letters are allowed
.callback = keyboardCallback,
.keyMask = 1<<26, // no masked letter but masked backspace
.lettersOnly = true // only letters are allowed
};
nbgl_layoutCenteredInfo_t centeredInfo = {
.text1 = descriptionTxt,
.text2 = NULL,
.icon = NULL,
.icon = NULL,
.onTop = true
};
nbgl_layoutNavigation_t navInfo = {
.direction = HORIZONTAL_NAV,
.direction = HORIZONTAL_NAV,
.indication = LEFT_ARROW | RIGHT_ARROW
};
int status;
Expand Down Expand Up @@ -245,7 +245,7 @@ To build such screens, some dedicated APIs are necessary, which will be detailed

@subsubsection keypad_sub_section_1 Adding/Updating keypad

This object is made of an area at the bottom of the screen, presenting the 10 digits, a backspace and a validate keys, that can be navigated
This object is made of an area at the bottom of the screen, presenting the 12 digits, a backspace and a validate keys, that can be navigated
with left and right buttons and selected with both buttons. And a title at the top of the screen.

The only parameters to configure this object (at creation time) are:
Expand All @@ -261,19 +261,26 @@ used to modify the active keys of an existing keypad (backspace and validate key

@note at creation time, backspace and validate keys are inactive

@subsubsection keypad_sub_section_2 Adding/Updating hidden digits area
@subsubsection keypad_sub_section_2 Adding/Updating keypad content

This object, displayed on top of the keypad, consists in up to 8 discs (plain or empty) corresponding to
hidden entered/not entered digits.
This object consists in:
- an optional title
- either:
- up to 12 discs (invisible or visible) corresponding to hidden entered/not entered digits.
- or up to 12 digits if not hidden

The parameters to configure this object are:

- The optional title (NULL if not used)
- A boolean to indicate whether digits are hidden or not
- The number of total digits to be displayed (all digits are considered as "not entered")
- The digits to be displayed if not hidden

The API to insert such an object is @ref nbgl_layoutAddHiddenDigits().
The API to insert such an object is @ref nbgl_layoutAddKeypadContent().

This function returns a positive integer (if successful) to be used as an index in @ref nbgl_layoutUpdateHiddenDigits() function,
used to modify the number of entered digits.
This function returns a positive integer (if successful).

The @ref nbgl_layoutUpdateKeypadContent() function can be used to modify the number of entered digits or the digits.

@section refresh_layout Refreshing screen

Expand All @@ -286,18 +293,18 @@ It will only refresh the rectangle part of the screen having changed (with objec

@section callbacks Control actions management

Some controls, like a touchable bar, or a choice by radio buttons, can be interacted with thanks to the Touchscreen.
Some controls can be interacted with thanks to the buttons.

The developer can subscribe to these events by providing an action callback in @ref nbgl_layoutGet(), with @ref nbgl_layoutTouchCallback_t prototype.

The first parameter (*token*) of this function is a token provided along with the definition of the complex object.

The second parameter (*index*) is only used for some types of complex objects:

- **Navigation bar**: in this case, *index* gives the index of the new active page, when navigating.
- **Bar List choices**: in this case, *index* gives the index of the selected bar.
- **Radio button choices**: in this case, *index* gives the index of the selected choice.
- **Switches**: in this case, if *index* is 0 it means OFF, otherwise it means ON.
- **Choice buttons**: in this case, if *index* is 0, it means top-button (choice 1), otherwise it means bottom-buttom (choice 2)
- **Switches**: in this case, *index* is 0: it is up to the Apps to know what to do here.
- **Info buttons**: in this case, *index* is 0 (useless)

@subsection release Releasing a layout

Expand Down
2 changes: 1 addition & 1 deletion lib_nbgl/doc/nbgl_page.dox
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifdef NBGL_PAGE
/** @page nbgl_page Predefined pages API
/** @page nbgl_page Predefined Pages API

@section nbgl_page_intro Introduction
This chapter describes briefly the high-level API of Advanced BOLOS Graphic Library.
Expand Down
2 changes: 1 addition & 1 deletion lib_nbgl/doc/nbgl_step.dox
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifdef NBGL_STEP
/** @page nbgl_step Step API
/** @page nbgl_step Predefined Step API

@section nbgl_step_intro Introduction
This chapter describes briefly the high-level API of Advanced BOLOS Graphic Library.
Expand Down
Loading

0 comments on commit 3f604e0

Please sign in to comment.