2023-08-30 16:21:18 +08:00
|
|
|
/*
|
2024-09-03 11:16:08 +08:00
|
|
|
* Copyright (C) 2022-2024 ArtInChip Technology Co., Ltd.
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
*
|
2023-08-30 16:21:18 +08:00
|
|
|
* Authors: Ning Fang <ning.fang@artinchip.com>
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "lvgl.h"
|
|
|
|
|
#include "aic_ui.h"
|
|
|
|
|
#include "aic_osal.h"
|
2024-09-03 11:16:08 +08:00
|
|
|
#include "lvgl/demos/lv_demos.h"
|
|
|
|
|
|
|
|
|
|
#ifdef AIC_USE_TOUCH_MONKEY_TEST
|
2024-09-30 17:06:01 +08:00
|
|
|
#if LV_USE_MONKEY
|
2024-09-03 11:16:08 +08:00
|
|
|
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
|
2024-09-30 17:06:01 +08:00
|
|
|
#endif
|
2023-08-30 16:21:18 +08:00
|
|
|
|
|
|
|
|
void aic_ui_init()
|
|
|
|
|
{
|
2024-11-26 13:23:39 +08:00
|
|
|
#if defined(AIC_LVGL_QC_TEST_DEMO)
|
|
|
|
|
extern int qc_test_init();
|
|
|
|
|
qc_test_init();
|
|
|
|
|
#elif defined(AIC_LVGL_MUSIC_DEMO)
|
2024-09-03 11:16:08 +08:00
|
|
|
lv_demo_music();
|
2024-11-26 13:23:39 +08:00
|
|
|
#elif defined(AIC_LVGL_DEMO_BENCHMARK)
|
2024-09-03 11:16:08 +08:00
|
|
|
lv_demo_benchmark();
|
2024-11-26 13:23:39 +08:00
|
|
|
#elif defined(AIC_LVGL_DEMO_WIDGETS)
|
2024-09-03 11:16:08 +08:00
|
|
|
lv_demo_widgets();
|
2024-11-26 13:23:39 +08:00
|
|
|
#else
|
|
|
|
|
extern void ui_init(void);
|
|
|
|
|
ui_init();
|
2024-09-03 11:16:08 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef AIC_USE_TOUCH_MONKEY_TEST
|
|
|
|
|
use_touch_monkey_test();
|
|
|
|
|
#endif
|
2023-08-30 16:21:18 +08:00
|
|
|
return;
|
|
|
|
|
}
|