Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
Functions
nbgl_layout_keypad_nanos.c File Reference
#include <string.h>
#include <stdlib.h>
#include "nbgl_debug.h"
#include "nbgl_layout_internal_nanos.h"
#include "glyphs.h"
#include "os_pic.h"
#include "os_helpers.h"
#include "lcx_rng.h"
Include dependency graph for nbgl_layout_keypad_nanos.c:

Go to the source code of this file.

Functions

int nbgl_layoutAddKeypad (nbgl_layout_t *layout, keyboardCallback_t callback, const char *text, bool shuffled)
 Adds a keypad on bottom of the screen, with the associated callback.
 
int nbgl_layoutUpdateKeypad (nbgl_layout_t *layout, uint8_t index, bool enableValidate, bool enableBackspace)
 Updates an existing keypad on bottom of the screen, with the given configuration.
 
int nbgl_layoutAddHiddenDigits (nbgl_layout_t *layout, uint8_t nbDigits)
 Adds a placeholder for hidden digits on top of a keypad, to represent the entered digits, as full circles.
 
int nbgl_layoutUpdateHiddenDigits (nbgl_layout_t *layout, uint8_t index, uint8_t nbActive)
 Updates an existing set of hidden digits, with the given configuration.
 
int nbgl_layoutAddKeypadContent (nbgl_layout_t *layout, bool hidden, uint8_t nbDigits, const char *text)
 Adds an area with a title and a placeholder for hidden digits on top of a keypad, to represent the entered digits as small discs.
 
int nbgl_layoutUpdateKeypadContent (nbgl_layout_t *layout, bool hidden, uint8_t nbActiveDigits, const char *text)
 Updates an existing set of hidden digits, with the given configuration.
 

Function Documentation

◆ nbgl_layoutAddHiddenDigits()

int nbgl_layoutAddHiddenDigits ( nbgl_layout_t layout,
uint8_t  nbDigits 
)

Adds a placeholder for hidden digits on top of a keypad, to represent the entered digits, as full circles.

Note
It must be the last added object, after keypad. Vertical positions of title and hidden digits will be computed here
Parameters
layoutthe current layout
nbDigitsnumber of digits to be displayed
Returns
the index of digits set, to use in nbgl_layoutUpdateHiddenDigits()

Definition at line 161 of file nbgl_layout_keypad_nanos.c.

◆ nbgl_layoutAddKeypad()

int nbgl_layoutAddKeypad ( nbgl_layout_t layout,
keyboardCallback_t  callback,
const char *  text,
bool  shuffled 
)

Adds a keypad on bottom of the screen, with the associated callback.

Note
Validate and Backspace keys are not enabled at start-up
Parameters
layoutthe current layout
callbackfunction called when any of the key is touched
texttext to use as title for the keypad
shuffledif set to true, digits are shuffled in keypad
Returns
the index of keypad in layout, to use in nbgl_layoutUpdateKeypad()

Definition at line 59 of file nbgl_layout_keypad_nanos.c.

◆ nbgl_layoutAddKeypadContent()

int nbgl_layoutAddKeypadContent ( nbgl_layout_t layout,
bool  hidden,
uint8_t  nbDigits,
const char *  text 
)

Adds an area with a title and a placeholder for hidden digits on top of a keypad, to represent the entered digits as small discs.

Note
It must be the only object added in the layout, after the keypad itself
Parameters
layoutthe current layout
hiddenif set to true, digits appear as discs, otherwise as visible digits (given in text param)
nbDigitsnumber of digits to be displayed (only used if hidden is true)
textonly used if hidden is false
Returns
the height of this area, if no error, < 0 otherwise

Definition at line 196 of file nbgl_layout_keypad_nanos.c.

◆ nbgl_layoutUpdateHiddenDigits()

int nbgl_layoutUpdateHiddenDigits ( nbgl_layout_t layout,
uint8_t  index,
uint8_t  nbActive 
)

Updates an existing set of hidden digits, with the given configuration.

Parameters
layoutthe current layout
indexindex returned by nbgl_layoutAddHiddenDigits()
nbActivenumber of "active" digits (represented by discs instead of circles)
Returns
>=0 if OK

Definition at line 174 of file nbgl_layout_keypad_nanos.c.

◆ nbgl_layoutUpdateKeypad()

int nbgl_layoutUpdateKeypad ( nbgl_layout_t layout,
uint8_t  index,
bool  enableValidate,
bool  enableBackspace 
)

Updates an existing keypad on bottom of the screen, with the given configuration.

Parameters
layoutthe current layout
indexindex returned by nbgl_layoutAddKeypad()
enableValidateif true, enable Validate key
enableBackspaceif true, enable Backspace key
Returns
>=0 if OK

Definition at line 112 of file nbgl_layout_keypad_nanos.c.

◆ nbgl_layoutUpdateKeypadContent()

int nbgl_layoutUpdateKeypadContent ( nbgl_layout_t layout,
bool  hidden,
uint8_t  nbActiveDigits,
const char *  text 
)

Updates an existing set of hidden digits, with the given configuration.

Parameters
layoutthe current layout
hiddenif set to true, digits appear as discs, otherwise as visible digits (given in text param)
nbActiveDigitsnumber of "active" digits (represented by discs instead of circles) (only used if hidden is true)
textonly used if hidden is false
Returns
>=0 if OK

Definition at line 277 of file nbgl_layout_keypad_nanos.c.