Embedded SDK
Embedded SDK
Classes | Macros | Typedefs | Functions | Variables
ux_nbgl.h File Reference
#include "os_math.h"
#include "os_ux.h"
#include "os_task.h"
#include "nbgl_screen.h"
#include "nbgl_touch.h"
#include <string.h>
#include "glyphs.h"
Include dependency graph for ux_nbgl.h:

Go to the source code of this file.

Classes

struct  ux_state_s
 
struct  ux_seph_s
 

Macros

#define BUTTON_LEFT   1
 
#define BUTTON_RIGHT   2
 
#define UX_INIT()   nbgl_objInit();
 
#define UX_WAKE_UP()
 
#define UX_BUTTON_PUSH_EVENT(seph_packet)
 
#define UX_FINGER_EVENT(seph_packet)   ux_process_finger_event(seph_packet)
 
#define UX_TICKER_EVENT(seph_packet, callback)   ux_process_ticker_event()
 
#define UX_DEFAULT_EVENT()   ux_process_default_event()
 

Typedefs

typedef void(* asynchmodal_end_callback_t) (unsigned int ux_status)
 
typedef struct ux_state_s ux_state_t
 
typedef struct ux_seph_s ux_seph_os_and_app_t
 

Functions

void ux_process_finger_event (uint8_t seph_packet[])
 Process finger event. More...
 
void ux_process_button_event (uint8_t seph_packet[])
 
void ux_process_ticker_event (void)
 Process the ticker_event to the os ux handler. Ticker event callback is always called whatever the return code of the ux app. More...
 
void ux_process_default_event (void)
 
void io_seproxyhal_request_mcu_status (void)
 
void io_seproxyhal_power_off (bool criticalBattery)
 

Variables

ux_state_t G_ux
 
bolos_ux_params_t G_ux_params
 
ux_seph_os_and_app_t G_ux_os
 

Macro Definition Documentation

◆ BUTTON_LEFT

#define BUTTON_LEFT   1

Definition at line 33 of file ux_nbgl.h.

◆ BUTTON_RIGHT

#define BUTTON_RIGHT   2

Definition at line 34 of file ux_nbgl.h.

◆ UX_BUTTON_PUSH_EVENT

#define UX_BUTTON_PUSH_EVENT (   seph_packet)

forward the button push/release events to the os ux handler. if not used by it, it will be used by App controls

Definition at line 106 of file ux_nbgl.h.

◆ UX_DEFAULT_EVENT

#define UX_DEFAULT_EVENT ( )    ux_process_default_event()

Forward the event, ignoring the UX return code, the event must therefore be either not processed or processed with extreme care by the application afterwards

Definition at line 131 of file ux_nbgl.h.

◆ UX_FINGER_EVENT

#define UX_FINGER_EVENT (   seph_packet)    ux_process_finger_event(seph_packet)

forward the finger_event to the os ux handler. if not used by it, it will be used by App controls

Definition at line 116 of file ux_nbgl.h.

◆ UX_INIT

#define UX_INIT ( )    nbgl_objInit();

Initialize the user experience structure

Definition at line 66 of file ux_nbgl.h.

◆ UX_TICKER_EVENT

#define UX_TICKER_EVENT (   seph_packet,
  callback 
)    ux_process_ticker_event()

forward the ticker_event to the os ux handler. Ticker event callback is always called whatever the return code of the ux app. Ticker event interval is assumed to be 100 ms.

Definition at line 125 of file ux_nbgl.h.

◆ UX_WAKE_UP

#define UX_WAKE_UP ( )
Value:
G_ux_params.ux_id = BOLOS_UX_WAKE_UP; \
G_ux_params.len = 0; \
os_ux(&G_ux_params); \
G_ux_params.len = os_sched_last_status(TASK_BOLOS_UX);
bolos_ux_params_t G_ux_params
Definition: main.c:33

Request a wake up of the device (pin lock screen, ...) to display a new interface to the user. Wake up prevents power-off features. Therefore, security wise, this function shall only be called to request direct user interaction.

Definition at line 95 of file ux_nbgl.h.

Typedef Documentation

◆ asynchmodal_end_callback_t

typedef void(* asynchmodal_end_callback_t) (unsigned int ux_status)

Definition at line 36 of file ux_nbgl.h.

◆ ux_seph_os_and_app_t

◆ ux_state_t

typedef struct ux_state_s ux_state_t

Common structure for applications to perform asynchronous UX aside IO operations

Definition at line 36 of file ux_nbgl.h.

Function Documentation

◆ io_seproxyhal_power_off()

void io_seproxyhal_power_off ( bool  criticalBattery)

◆ io_seproxyhal_request_mcu_status()

void io_seproxyhal_request_mcu_status ( void  )

◆ ux_process_button_event()

void ux_process_button_event ( uint8_t  seph_packet[])

◆ ux_process_default_event()

void ux_process_default_event ( void  )

Forwards the event to UX

Definition at line 143 of file ux.c.

◆ ux_process_finger_event()

void ux_process_finger_event ( uint8_t  seph_packet[])

Process finger event.

Note
Application's finger event handler is called only if the ux app does not deny it (finger event caught by BOLOS UX page).
Parameters
seph_packetreceived SEPH packet

Definition at line 64 of file ux.c.

◆ ux_process_ticker_event()

void ux_process_ticker_event ( void  )

Process the ticker_event to the os ux handler. Ticker event callback is always called whatever the return code of the ux app.

Note
Ticker event interval is assumed to be 100 ms.

Definition at line 110 of file ux.c.

Variable Documentation

◆ G_ux

ux_state_t G_ux
extern

Definition at line 32 of file main.c.

◆ G_ux_os

ux_seph_os_and_app_t G_ux_os
extern

◆ G_ux_params

bolos_ux_params_t G_ux_params
extern

Definition at line 33 of file main.c.