Embedded SDK
Embedded SDK
Macros | Functions | Variables
nbgl_obj_keypad.c File Reference

The construction and touch management of a keypad object. More...

#include "nbgl_debug.h"
#include "nbgl_front.h"
#include "nbgl_draw.h"
#include "nbgl_obj.h"
#include "nbgl_fonts.h"
#include "nbgl_touch.h"
#include "glyphs.h"
#include "os_io_seproxyhal.h"
#include "lcx_rng.h"
Include dependency graph for nbgl_obj_keypad.c:

Go to the source code of this file.

Macros

#define KEY_WIDTH   (SCREEN_WIDTH / 3)
 
#define DIGIT_OFFSET_Y   (((KEYPAD_KEY_HEIGHT - 48) / 2) & 0xFFC)
 
#define BACKSPACE_KEY_IDX   10
 
#define VALIDATE_KEY_IDX   11
 
#define GET_DIGIT_INDEX(_keypad, _digit)
 
#define SET_DIGIT_INDEX(_keypad, _digit, _index)    (_keypad->digitIndexes[_digit >> 1] |= (_digit & 1) ? (_index << 4) : _index)
 

Functions

void nbgl_keypadTouchCallback (nbgl_obj_t *obj, nbgl_touchType_t eventType)
 function to be called when the keypad object is touched More...
 
bool nbgl_keypadGetPosition (nbgl_keypad_t *kpd, char index, uint16_t *x, uint16_t *y)
 This function gets the position (top-left corner) of the key at the given index. (to be used for Testing purpose). Only works without shuffling. More...
 
void nbgl_objDrawKeypad (nbgl_keypad_t *kpd)
 This function draws a keypad object. More...
 

Variables

uint8_t ramBuffer [GZLIB_UNCOMPRESSED_CHUNK]
 

Detailed Description

The construction and touch management of a keypad object.

Definition in file nbgl_obj_keypad.c.

Macro Definition Documentation

◆ BACKSPACE_KEY_IDX

#define BACKSPACE_KEY_IDX   10

Definition at line 30 of file nbgl_obj_keypad.c.

◆ DIGIT_OFFSET_Y

#define DIGIT_OFFSET_Y   (((KEYPAD_KEY_HEIGHT - 48) / 2) & 0xFFC)

Definition at line 28 of file nbgl_obj_keypad.c.

◆ GET_DIGIT_INDEX

#define GET_DIGIT_INDEX (   _keypad,
  _digit 
)
Value:
((_digit & 1) ? (_keypad->digitIndexes[_digit >> 1] >> 4) \
: (_keypad->digitIndexes[_digit >> 1] & 0xF))

Definition at line 34 of file nbgl_obj_keypad.c.

◆ KEY_WIDTH

#define KEY_WIDTH   (SCREEN_WIDTH / 3)

Definition at line 27 of file nbgl_obj_keypad.c.

◆ SET_DIGIT_INDEX

#define SET_DIGIT_INDEX (   _keypad,
  _digit,
  _index 
)     (_keypad->digitIndexes[_digit >> 1] |= (_digit & 1) ? (_index << 4) : _index)

Definition at line 37 of file nbgl_obj_keypad.c.

◆ VALIDATE_KEY_IDX

#define VALIDATE_KEY_IDX   11

Definition at line 31 of file nbgl_obj_keypad.c.

Function Documentation

◆ nbgl_keypadGetPosition()

bool nbgl_keypadGetPosition ( nbgl_keypad_t kpd,
char  index,
uint16_t x,
uint16_t y 
)

This function gets the position (top-left corner) of the key at the given index. (to be used for Testing purpose). Only works without shuffling.

Parameters
kpdthe object to be drawned
indexthe char of the key
x[out] the top-left position
y[out] the top-left position
Returns
true if found, false otherwise

Definition at line 337 of file nbgl_obj_keypad.c.

◆ nbgl_keypadTouchCallback()

void nbgl_keypadTouchCallback ( nbgl_obj_t obj,
nbgl_touchType_t  eventType 
)

function to be called when the keypad object is touched

Parameters
objtouched object (keypad)
eventTypetype of touch (only TOUCHED is accepted)
Returns
none

Definition at line 270 of file nbgl_obj_keypad.c.

◆ nbgl_objDrawKeypad()

void nbgl_objDrawKeypad ( nbgl_keypad_t kpd)

This function draws a keypad object.

Parameters
kpdkeypad object to draw
Returns
the keypad keypad object

Definition at line 376 of file nbgl_obj_keypad.c.

Variable Documentation

◆ ramBuffer

uint8_t ramBuffer[GZLIB_UNCOMPRESSED_CHUNK]
extern

Definition at line 124 of file nbgl_obj.c.