/* * Copyright (C) 2022-2024 ArtInChip Technology Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 * * Authors: Ning Fang */ #include "lvgl.h" #include "aic_ui.h" #include "aic_osal.h" #include "lvgl/demos/lv_demos.h" #ifdef AIC_USE_TOUCH_MONKEY_TEST #if LV_USE_MONKEY static void use_touch_monkey_test(void) { /*Create encoder monkey test*/ lv_monkey_config_t config; lv_monkey_config_init(&config); config.type = LV_INDEV_TYPE_POINTER; config.period_range.min = AIC_USE_TOUCH_MONKEY_TEST_PERIOD_RANG_MIN; config.period_range.max = AIC_USE_TOUCH_MONKEY_TEST_PERIOD_RANG_MAX; config.input_range.min = AIC_USE_TOUCH_MONKEY_TEST_INPUT_RANG_MAX; config.input_range.max = AIC_USE_TOUCH_MONKEY_TEST_PERIOD_RANG_MAX; lv_monkey_t * monkey = lv_monkey_create(&config); /*Set the default group*/ lv_group_t * group = lv_group_create(); lv_indev_set_group(lv_monkey_get_indev(monkey), group); lv_group_set_default(group); /*Start monkey test*/ lv_monkey_set_enable(monkey, true); } #endif #endif void aic_ui_init() { #if defined(AIC_LVGL_QC_TEST_DEMO) extern int qc_test_init(); qc_test_init(); #elif defined(AIC_LVGL_MUSIC_DEMO) lv_demo_music(); #elif defined(AIC_LVGL_DEMO_BENCHMARK) lv_demo_benchmark(); #elif defined(AIC_LVGL_DEMO_WIDGETS) lv_demo_widgets(); #else extern void ui_init(void); ui_init(); #endif #ifdef AIC_USE_TOUCH_MONKEY_TEST use_touch_monkey_test(); #endif return; }