Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
Enumerations | Functions
nbgl_layout_keypad.c File Reference

Implementation of keypad management of predefined layouts management for Applications. More...

#include <string.h>
#include <stdlib.h>
#include "nbgl_debug.h"
#include "nbgl_front.h"
#include "nbgl_layout_internal.h"
#include "nbgl_obj.h"
#include "nbgl_draw.h"
#include "nbgl_screen.h"
#include "nbgl_touch.h"
#include "glyphs.h"
#include "os_pic.h"
#include "os_helpers.h"
#include "os.h"
Include dependency graph for nbgl_layout_keypad.c:

Go to the source code of this file.

Enumerations

enum  { TITLE_INDEX = 0 , INPUT_INDEX , NB_CHILDREN }
 

Functions

int nbgl_layoutAddKeypad (nbgl_layout_t *layout, keyboardCallback_t callback, 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, bool enableDigits)
 Updates an existing keypad on bottom of the screen, with the given configuration.
 
int nbgl_layoutUpdateKeypadValidation (nbgl_layout_t *layout, bool softValidation)
 Updates an existing keypad on bottom of the screen, with the given configuration, without redraw.
 
int nbgl_layoutAddKeypadContent (nbgl_layout_t *layout, const char *title, 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. On Stax, the placeholder is "underligned" with a thin horizontal line of the expected full length.
 
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.
 

Detailed Description

Implementation of keypad management of predefined layouts management for Applications.

Note
This file applies only to wallet size products (Stax, Flex...)

Definition in file nbgl_layout_keypad.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
TITLE_INDEX 
INPUT_INDEX 
NB_CHILDREN 

Definition at line 30 of file nbgl_layout_keypad.c.

Function Documentation

◆ nbgl_layoutAddKeypad()

int nbgl_layoutAddKeypad ( nbgl_layout_t *  layout,
keyboardCallback_t  callback,
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
shuffledif set to true, digits are shuffled in keypad
Returns
the index of keypad, to use in nbgl_layoutUpdateKeypad()

Definition at line 84 of file nbgl_layout_keypad.c.

◆ nbgl_layoutAddKeypadContent()

int nbgl_layoutAddKeypadContent ( nbgl_layout_t *  layout,
const char *  title,
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. On Stax, the placeholder is "underligned" with a thin horizontal line of the expected full length.

Note
It shall be the only object added in the layout, beside a potential header and the keypad itself
Parameters
layoutthe current layout
titlethe text to use on top of the digits
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 229 of file nbgl_layout_keypad.c.

◆ nbgl_layoutUpdateKeypad()

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

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

Parameters
layoutthe current layout
indexindex returned by nbgl_layoutAddKeypad() (unused, for compatibility)
enableValidateif true, enable Validate key
enableBackspaceif true, enable Backspace key
enableDigitsif true, enable all digit keys
Returns
>=0 if OK

Definition at line 147 of file nbgl_layout_keypad.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 384 of file nbgl_layout_keypad.c.

◆ nbgl_layoutUpdateKeypadValidation()

int nbgl_layoutUpdateKeypadValidation ( nbgl_layout_t *  layout,
bool  softValidation 
)

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

Parameters
layoutthe current layout
softValidationif true, the "check icon" is replaced by an arrow
Returns
>=0 if OK

Definition at line 191 of file nbgl_layout_keypad.c.