APP_COMM

Defines

LCD_DEVICE_NAME
OTA_ERR_FONT
FACTORY_CFG_ID_OTA
WATCH_DEVICE_NAME
CPU_MODEL
PRODUCT_SOFTWARE_VER
BACKLIGHT_LEVEL_MAX
BACKLIGHT_LEVEL_MIN
BACKLIGHT_MANUAL_TIMEOUT
OTA_BLE_MASK
OTA_TF_MASK
OTA_PAN_MASK
STR_NULL
app_get_strid(key_name, name)
app_get_str(key_name, name)
app_get_str_from_id(key_id)
app_get_str_from_lang_pack(lang_pack, key_name)

Enums

enum [anonymous]

Values:

enumerator BACKLIGHT_ONE_LEVEL

LCD brightness level 1

enumerator BACKLIGHT_TWO_LEVEL

LCD brightness level 2

enumerator BACKLIGHT_THREE_LEVEL

LCD brightness level 3

enumerator BACKLIGHT_FOUR_LEVEL

LCD brightness level 4

enumerator BACKLIGHT_FIVE_LEVEL

LCD brightness level 5

enumerator BACKLIGHT_SIX_LEVEL

LCD brightness level 6

enumerator BACKLIGHT_SEVEN_LEVEL

LCD brightness level 7

enumerator BACKLIGHT_EIGHT_LEVEL

LCD brightness level 8

enumerator BACKLIGHT_NINE_LEVEL

LCD brightness level 9

enumerator BACKLIGHT_TEN_LEVEL

LCD brightness level 10

Functions

void app_lcd_off(void)

Turn off LCD, LCD power off.

void app_lcd_on(void)

Turn on LCD, LCD power on.

void app_lcpu_pwr_on(void)

Notify LCPU, the HCPU has been powered on. In dual core (non 52x), due to the need for low battery detection on the HCPU during power on, the battery measurement of the LCPU is opened here..

void app_lcpu_pwr_off(uint16_t type)

Notify LCPU, the HCPU is about to shutdown.

参数:
  • type -- Interface of type app_lcpu_t.

void app_lcpu_pwr_off_cb(void)

After notify LCPU when the HCPU is about to shutdown, waiting for LCPU response.

void app_device_info_get(device_info_t *device_info)

Obtain relevant information about the device.

参数:
  • device_info -- Pointer to device information

bool app_screen_lock_time_is_end(void)

Determine if the lock screen time has timed out.

返回值:

bool -- Timeout or not

void app_screen_lock_enable(bool enable)

Set whether to enable the lock screen function.

uint32_t app_screen_lock_time_set(uint32_t ms)

Set lock screen time length and store it in NVM.

参数:
  • ms -- Lock screen time length, unit ms

返回值:

uint32_t -- Previous lock screen time length before setting

uint32_t app_screen_lock_time_temp_set(uint32_t ms)

Temporarily set lock screen time length, not store it in NVM.

参数:
  • ms -- Lock screen time length, unit ms

返回值:

uint32_t -- Previous lock screen time length before setting

void app_sys_time_update(sys_time_t *time)

Update system time.

参数:
  • time -- New system time

void app_sys_time_reset(void)

Reset the system clock, the system clock will be restored to its default state.

void app_sys_timestamp_update(time_t timestamp)

Update system time using time_t's time stamp.

参数:
  • timestamp -- New system time

void app_hindi_font_active(void)

Open hindi(Devanagari) with font name Devanagari _hindi_name. HINDI_LANG_PREV_CONVERT_SUPPORT: Static text uses pre conversion to improve display speed.

void app_hindi_font_deactive(void)

close hindi(Devanagari) font.

void app_tp_buffer_clean(void)

Clean TP buffer in driver.

void app_tp_wakeup_enable(uint8_t enable)

Enable TP wakeup function or not. Due to tp pin maybe placed in LCPU, so need send to LCPU.

参数:
  • enable -- Enable or not.

void app_frame_buffer_clean(void)

Clean frame buffer.

void app_locale_lang_init(void)

Initalize local language. 1) Get language list(ex_lang) from flash's language packet if exist. 2) Set default language.

void app_locale_lang_update(const char *locale)

Updated and set local language.

参数:
  • locale -- Locale language name.

void app_lcd_backlight_set(uint8_t level)

Set LCD display brightness.

参数:
  • level -- Brightness level.

char *app_current_app_name_get(void)

Get the name of currently running application name.

返回值:

string -- Currently running application name

void app_watchdog_enable(uint8_t enable)

Enable watchdog or not.

参数:
  • enable -- Enable watchdog or not.

void app_watchdog_pet(void)

Pet watchdog to avoid watchdog timeout.

rt_err_t app_ota_status_set(uint16_t state)

Set OTA status and save it.

参数:
  • state -- OTA status.

返回值:

rt_err_t -- Set status result

uint16_t app_ota_status_get(void)

Get OTA status.

返回值:

uint16_t -- Current OTA state.

int app_version_is_release_mode(void)

Get version mode, release mode or debug mode. For release mode, some exception can't be asserted For debug mode, watchdog maybe close.

返回值:

int -- 0: debug mode; 1: release mode.

void app_version_release_mode_set(bool mode)

Set version mode.

参数:
  • mode -- Version mode, 0: debug mode; 1: release mode.

void app_gpu_wait_done(void)

Waiting GPU done. It will be called when power_off animation procedure.

char *app_convert_time_formats_str(bool need_sec)

Convert time to format string. hour : minute: second with format %02d:%02d:%02d.

返回值:

string -- time string with %02d:%02d:%02d (hour : minute: second).

void app_font_open(void)

Initialize font, deal ota abnoraml.

bool app_path_check_valid(const char *path)

check file is valid or not.

bool app_file_check_valid(const char *file)

check path is valid or not.

bool app_path_check_is_sd(const char *path)

check path is sd card or not.

int app_get_o_directory(void)

Get the value of the O_DIRECTORY macro (adapted to DFS environment)

This function encapsulates the logic for obtaining O_DIRECTORY. It returns the actual value of the macro only when the DFS is enabled, and returns 0 when DFS is disabled. Meanwhile, it avoids the problem of inconsistent O_DIRECTORY values between GCC and KEIL compilers.

返回:

int Return value description

  • O_DIRECTORY: RT_USING_DFS is defined (DFS enabled), returns the actual value of the macro

  • 0: RT_USING_DFS is not defined (DFS disabled), returns the default value

int app_qjs_del_app(const char *id)

Delete qjs application(aod/app/wf).

参数:
  • id -- id to delete.

返回值:

0 -- : success, others: failed

int app_mpy_del_app(const char *id)

Delete micropython application(aod/app/wf).

参数:
  • id -- id to delete.

返回值:

0 -- : success, others: failed

const char *app_get_reg_power_on_app(void)

Retrieve the registered power_on application. This application can be set through app_set_reg_power_on_app or obtained from NVM.

返回值:

The -- name of power on application

void app_set_reg_power_on_app(const char *main_app)

Set the power on application through this interface and immediately store it in the NVM. This application will serve as the first application to be entered after the device power on.

const char *app_get_reg_main_app(void)

Retrieve the registered main application. This application can be set through app_set_reg_main or obtained from NVM.

返回值:

The -- name of main application

void app_set_reg_main_app(const char *main_app)

Set the main application through this interface and immediately store it in the NVM. Pressing the home key will return to this application.

const char *app_get_reg_tlv_app(void)

Retrieve the registered tlv application. This application can be set through app_set_reg_tlv or obtained from NVM.

返回值:

The -- name of tlv application

void app_set_reg_tlv_app(const char *tlv_app)

Set the tlv application through this interface and immediately store it in the NVM. When Gui is in the main app, pressing the home key will enterto this application.

void app_get_poweron_app(void)

Retrieve the first app that launches on startup. First, try to obtain the application stored in NVM. If it is unsuccessful and there is no built-in application, then try to obtain an external application as the first application to start up.

bool app_is_built_in(const char *thumb)

Check app is built_in_app by thumbnail.

参数:
  • thumb -- thumbnail or icon for application

返回值:

true -- built in, false: non built in

void app_text_font_reload(void)

Close all external fonts and switch the fonts of all texts back to the initial state.

void app_text_font_update(const char *app_id, const char *page_id, const char *new_font)

Update the font of the specified application and page. If both the application name and the page name are null, then update all existing texts.

参数:
  • app_id -- application's name

  • page_id -- subpage's name

  • new_font -- the specified font, if it is null, nothing will be done.

void app_remove_substr(char *src, const char *sub)

This function is used to remove all occurrences of the substring 'sub' from the string 'src'.

参数:
  • src -- source string

  • sub -- the string to be removed.

int app_mkdir(const char *path)

This function is used to make dir level by level.

参数:
  • path -- dir to create

  • RT_EOK -- success, othewise failed

int app_mkfs_partition(const char *device_name)

Format partion.

参数:
  • device_name -- partion name

  • 0 -- : success, oterwise fail

void app_del_ext_all(void)

Delete all external application except the built-in.

返回值:

None --

uint8_t app_get_backlight_level_by_lux(uint16_t lux)

Get backlight level by lux.

参数:
  • lux -- lux to convert

  • level -- backlight level

void app_screen_light_adjust_set(uint32_t manual_tick)

Record the time of manual brightness adjustment. If the current time is greater than the manual brightness adjustment timeout threshold, the brightness will be adjusted automatically.

参数:
  • manual_tick -- manually adjust ticj

void app_screen_light_auto_set(uint8_t enable)

Set screen light auto ajust.

参数:
  • enable -- Enable watchdog or not.

bool app_screen_light_adjust_is_timeout(void)

Determine if the screen light manual adjust time has timed out.

返回值:

bool -- Timeout or not

bool solution_is_builtin_res(void)

To determine whether solution is builtin_res.

返回值:

0 -- : success, others: failed

size_t app_get_file_size(const char *file)
int app_get_file_open_mode(const char *mode)

Get file open mode from string.

返回值:

O -- flag to open file

const char *app_get_active_netdev_name(void)

Get active netdev name.

返回值:

active -- netdev name

bool app_get_netdev_internet_up(const char *name)

Get netdev is internet up.

参数:
  • name -- netdev name

返回值:

true -- for internet up, false for internet down

struct device_info_t

Public Members

uint8_t device_name[20]
uint8_t device_cpu[12]
uint8_t sw_version[18]
uint8_t build_date[20]
struct screen_lock_ctrl_t

Public Members

uint32_t idle_time_limit

If input device is idle for a duration idle_time_limit(ms), GUI will enter sleep

bool enable

enable lock screen or not

struct screen_light_ctrl_t

Public Members

uint32_t manual_adj_tick

manually adjust lcd light tick

bool enable

enable auto adjust light or not