Embedded SDK
Embedded SDK
Classes | Macros | Typedefs | Enumerations | Functions
nbgl_touch.c File Reference
#include "app_config.h"
#include <string.h>
#include "nbgl_obj.h"
#include "nbgl_debug.h"
#include "nbgl_touch.h"
#include "nbgl_screen.h"
#include "os_pic.h"
#include "os_io_seproxyhal.h"
Include dependency graph for nbgl_touch.c:

Go to the source code of this file.

Classes

struct  nbgl_touchCtx_s
 

Macros

#define SWIPE_THRESHOLD_X   10
 
#define SWIPE_THRESHOLD_Y   20
 

Typedefs

typedef struct nbgl_touchCtx_s nbgl_touchCtx_t
 

Enumerations

enum  { UX_CTX = 0 , APP_CTX , NB_CTXS }
 

Functions

void nbgl_touchInit (bool fromUx)
 Function to initialize the touch context. More...
 
void nbgl_touchHandler (bool fromUx, nbgl_touchStatePosition_t *touchStatePosition, uint32_t currentTime)
 Function to be called periodically to check touchscreen state and coordinates. More...
 
bool nbgl_touchGetTouchedPosition (nbgl_obj_t *obj, nbgl_touchStatePosition_t **firstPos, nbgl_touchStatePosition_t **lastPos)
 
uint32_t nbgl_touchGetTouchDuration (nbgl_obj_t *obj)
 
nbgl_obj_tnbgl_touchGetObjectFromId (nbgl_obj_t *obj, uint8_t id)
 parse all the children of the given object, recursively, until an object with the given touch if is found. More...
 

Detailed Description

Implementation of touchscreen management in new BAGL

Definition in file nbgl_touch.c.

Macro Definition Documentation

◆ SWIPE_THRESHOLD_X

#define SWIPE_THRESHOLD_X   10

Definition at line 222 of file nbgl_touch.c.

◆ SWIPE_THRESHOLD_Y

#define SWIPE_THRESHOLD_Y   20

Definition at line 223 of file nbgl_touch.c.

Typedef Documentation

◆ nbgl_touchCtx_t

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
UX_CTX 
APP_CTX 
NB_CTXS 

Definition at line 23 of file nbgl_touch.c.

Function Documentation

◆ nbgl_touchGetObjectFromId()

nbgl_obj_t* nbgl_touchGetObjectFromId ( nbgl_obj_t obj,
uint8_t  id 
)

parse all the children of the given object, recursively, until an object with the given touch if is found.

Parameters
objparent of the touched object
idid of the touched object to find
Returns
the concerned object or NULL if not found

Definition at line 419 of file nbgl_touch.c.

◆ nbgl_touchGetTouchDuration()

uint32_t nbgl_touchGetTouchDuration ( nbgl_obj_t obj)

Definition at line 402 of file nbgl_touch.c.

◆ nbgl_touchGetTouchedPosition()

bool nbgl_touchGetTouchedPosition ( nbgl_obj_t obj,
nbgl_touchStatePosition_t **  firstPos,
nbgl_touchStatePosition_t **  lastPos 
)

Definition at line 388 of file nbgl_touch.c.

◆ nbgl_touchHandler()

void nbgl_touchHandler ( bool  fromUx,
nbgl_touchStatePosition_t touchStatePosition,
uint32_t  currentTime 
)

Function to be called periodically to check touchscreen state and coordinates.

Parameters
fromUxif true, means this is called from the UX, not the App
touchStatePositionstate and position read from touch screen
currentTimecurrent time in ms

Definition at line 285 of file nbgl_touch.c.

◆ nbgl_touchInit()

void nbgl_touchInit ( bool  fromUx)

Function to initialize the touch context.

Parameters
fromUxif true, means to initialize the UX context, otherwise App one

Definition at line 272 of file nbgl_touch.c.