-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adapt NBGL to support LNS+ & LNX, and use NBGL for LNS+ & LNX
- Loading branch information
1 parent
80b72e7
commit 5c736d9
Showing
399 changed files
with
6,623 additions
and
312 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#ifndef HAVE_SE_TOUCH | ||
/** @page nbgl_mainpage New BOLOS Graphic API | ||
|
||
@section mainpage_intro Introduction | ||
|
||
This documentation describes the different interfaces of <b>NBGL</b>, the library that | ||
is targeted to be integrated in Stax product. | ||
|
||
<b>NBGL Engine</b> is responsible for constructing screens and handling Touchscreen input. | ||
|
||
@section mainpage_overall_archi Overall architecture | ||
|
||
<b>NBGL Engine</b> is a library to be integrated in SDK. | ||
It is intended to replace existing BAGL/FLOW Graphical Engine (used on Nanos/Blue products) | ||
|
||
\image{inline} html NBGLArchi.png "caption" height=600 | ||
|
||
@section nbgl_drawing_api Screen drawing APIs | ||
|
||
@subsection nbgl_app_use_case_api_1 Application Use-cases API | ||
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 | ||
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 | ||
|
||
@subsection nbgl_mid_level_api_1 Complex objects (layout) API | ||
The @subpage nbgl_layout page contains all information necessary to understand | ||
and use \b NBGL Mid-Level API, using complex objects | ||
|
||
@subsection nbgl_low_level_api_1 Low-Level API | ||
The @subpage nbgl_obj page contains all information necessary to understand | ||
and use \b NBGL Low-Level API | ||
|
||
@section nbgl_screen_objs Screen and objects management | ||
The @subpage nbgl_screens_and_objs page contains all information necessary to understand | ||
how \b NBGL manages the screens stack and the dynamically allocated objects | ||
|
||
@section nbgl_touch_api Touchscreen events management | ||
The @subpage nbgl_touchscreen page contains all information necessary to understand | ||
how \b NBGL manages the touchscreen events and how to receive and process these events. | ||
|
||
@section nbgl_building Compilation options | ||
In order to reduce the footprint (RAM+Flash), some features are only activated if some building options are defined. | ||
|
||
Define | Meaning | Default state | ||
------------- | ------------- | ------------- | ||
\b NBGL_PAGE | 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 | ||
\b NBGL_QRCODE | Activate QRCode object | Active in OS, not in SDK | ||
|
||
Applications are free to define \b NBGL_KEYBOARD, \b NBGL_KEYPAD or \b NBGL_QRCODE in their own Makefile if they need to use these | ||
"rare" objects. | ||
|
||
*/ | ||
#endif // HAVE_SE_TOUCH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
#ifdef NBGL_STEP | ||
/** @page nbgl_flow Flow API | ||
|
||
@section nbgl_flow_intro Introduction | ||
This chapter describes briefly the Flow API of Advanced BOLOS Graphic Library. | ||
|
||
This layer offers a way to handle multi-steps flows in typical scenarios of Nanos OS or Apps, like a transaction, a navigation in a menu. | ||
|
||
A full description of the way to create and interact with a flow can be found in this document | ||
|
||
@section nbgl_flow_concepts Concepts | ||
|
||
This layer uses the step API described in @ref nbgl_step, but for list of steps. The navigation between steps is entirely managed | ||
by the flow engine. | ||
|
||
@subsection nbgl_flow_example Example | ||
|
||
\image{inline} html layout_nanos_flow1.png "caption" height=200 | ||
|
||
In this example, a flow made of 4 steps (each on one page) is built. The navigation is possible between these steps (no loop), and the | ||
last step can be selected (double button press). | ||
|
||
@section nbgl_flow_operations Operations | ||
|
||
@subsection create_flow Draw a flow | ||
|
||
The configuration of a flow is provided in a single function call, through @ref nbgl_flowDraw() which will: | ||
|
||
- draw the first step | ||
- Refresh after first step drawing | ||
|
||
The arguments of @ref nbgl_flowDraw() are: | ||
|
||
- An array of step descriptions (see below) | ||
- The index of the step to start with in step descriptions array | ||
- A boolean indicating whether the flow shall be modal or not | ||
- A boolean indicating whether the flow is circular or not (loop) | ||
|
||
@code | ||
static char string_buffer[128]; | ||
|
||
static void onPrepareOSversion(void); | ||
static void onPrepareMCUversion(void); | ||
static void onPrepareBootloaderversion(void); | ||
static void onBack(void); | ||
|
||
static nbgl_flow_t flowContext; | ||
|
||
static const nbgl_stepDesc_t flowSteps[] = { | ||
{ | ||
.text = "\bSecure Element", | ||
.subText = string_buffer, | ||
.init = onPrepareOSversion | ||
}, | ||
{ | ||
.text = "\bMicrocontroller", | ||
.subText = string_buffer, | ||
.init = onPrepareMCUversion | ||
}, | ||
{ | ||
.text = "\bBootloader", | ||
.subText = string_buffer, | ||
.init = onPrepareBootloaderversion | ||
}, | ||
{ | ||
.text = "\bBack", | ||
.callback = onBack, | ||
.icon = &C_icon_back | ||
} | ||
}; | ||
|
||
static void onPrepareOSversion(void) { | ||
os_version((unsigned char*)string_buffer, 32); | ||
} | ||
|
||
static void onPrepareMCUversion(void) { | ||
os_seph_version((unsigned char*)string_buffer, 32); | ||
} | ||
|
||
static void onPrepareBootloaderversion(void) { | ||
os_bootloader_version((unsigned char*)string_buffer, 32); | ||
} | ||
|
||
static void onBack(void) { | ||
nbgl_flowRelease(flowContext); | ||
// go to parent flow | ||
} | ||
|
||
void displayInfo() { | ||
// use string_buffer as temporary buffer | ||
memset(string_buffer, 0, 128); | ||
flowContext = nbgl_flowDraw(flowSteps, 4, 0, false, false); | ||
} | ||
|
||
@endcode | ||
|
||
@subsection page_release Releasing a predefined page | ||
|
||
Before leaving a screen built with a layout, it must be released with a call to @ref nbgl_flowRelease(). It will free the allocated | ||
objects. | ||
|
||
|
||
*/ | ||
#endif // NBGL_STEP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.