diff --git a/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/guiguider/README.md b/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/guiguider/README.md new file mode 100644 index 0000000000..6f6e125c82 --- /dev/null +++ b/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/guiguider/README.md @@ -0,0 +1,2 @@ +This folder is for NXP GUI Guider + diff --git a/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/guiguider/SConscript b/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/guiguider/SConscript new file mode 100644 index 0000000000..5e66e2096f --- /dev/null +++ b/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/guiguider/SConscript @@ -0,0 +1,17 @@ +from building import * + +cwd = GetCurrentDir() +group = [] +src = [] +CPPPATH =[] + +src += Glob(cwd + '/ui/*.c') +CPPPATH += [cwd+'/ui'] + +if GetConfigValue('PKG_LVGL_VER_NUM') == '0x08020': + src += Glob(cwd + '/legacy/*.c') + CPPPATH += [cwd+'/legacy'] + +group = group + DefineGroup('LVGL-GUIGuider', src, depend = ['BSP_USING_LVGL', 'BSP_USING_NXP_GUIGUIDER'], CPPPATH = CPPPATH) + +Return('group') diff --git a/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/guiguider/legacy/README.md b/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/guiguider/legacy/README.md new file mode 100644 index 0000000000..ce90952e6b --- /dev/null +++ b/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/guiguider/legacy/README.md @@ -0,0 +1,2 @@ +This folder is to let LVGL 8.2.0 can run on RT-Thread 4.1.1 or even higher version. + diff --git a/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/guiguider/legacy/lv_init_thread.c b/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/guiguider/legacy/lv_init_thread.c new file mode 100644 index 0000000000..613dd7d198 --- /dev/null +++ b/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/guiguider/legacy/lv_init_thread.c @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2006-2022, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2021-10-17 Meco Man First version + * 2022-05-13 Meco Man support LVGL8.2.0 legacy version + */ +#include +#include + +#ifndef PKG_LVGL_THREAD_STACK_SIZE +#define PKG_LVGL_THREAD_STACK_SIZE 4096 +#endif + +#ifndef PKG_LVGL_THREAD_PRIO +#define PKG_LVGL_THREAD_PRIO (RT_THREAD_PRIORITY_MAX * 2 / 3) +#endif + +extern void lv_user_gui_init(void); + +static struct rt_thread lvgl_thread; +static rt_uint8_t lvgl_thread_stack[PKG_LVGL_THREAD_STACK_SIZE]; + +static void lvgl_thread_entry(void *parameter) +{ + lv_user_gui_init(); + + while(1) + { + lv_task_handler(); + rt_thread_mdelay(5); + } +} + +static int lvgl_thread_init(void) +{ + rt_thread_init(&lvgl_thread, + "LVGL", + lvgl_thread_entry, + RT_NULL, + &lvgl_thread_stack[0], + sizeof(lvgl_thread_stack), + PKG_LVGL_THREAD_PRIO, + 10); + rt_thread_startup(&lvgl_thread); + + return 0; +} +INIT_ENV_EXPORT(lvgl_thread_init); diff --git a/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/guiguider/legacy/lv_port_disp.h b/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/guiguider/legacy/lv_port_disp.h new file mode 100644 index 0000000000..500dcb1d24 --- /dev/null +++ b/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/guiguider/legacy/lv_port_disp.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2006-2022, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2021-10-18 Meco Man The first version + * 2022-05-13 Meco Man support LVGL8.2.0 legacy version + */ +#ifndef LV_PORT_DISP_H +#define LV_PORT_DISP_H + +#ifdef __cplusplus +extern "C" { +#endif + +void lv_port_disp_init(void); + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif diff --git a/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/guiguider/legacy/lv_port_indev.h b/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/guiguider/legacy/lv_port_indev.h new file mode 100644 index 0000000000..17c68c5661 --- /dev/null +++ b/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/guiguider/legacy/lv_port_indev.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2006-2022, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2021-10-18 Meco Man The first version + * 2022-05-13 Meco Man support LVGL8.2.0 legacy version + */ +#ifndef LV_PORT_INDEV_H +#define LV_PORT_INDEV_H + +#ifdef __cplusplus +extern "C" { +#endif + +void lv_port_indev_init(void); + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif diff --git a/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/guiguider/ui/lv_ui_entry.c b/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/guiguider/ui/lv_ui_entry.c new file mode 100644 index 0000000000..27c20fbc53 --- /dev/null +++ b/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/guiguider/ui/lv_ui_entry.c @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2006-2022, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2022-05-13 Meco Man First version + */ + +#include +#include + +void lv_user_gui_init(void) +{ +#ifdef PKG_USING_GUI_GUIDER_DEMO + extern void gui_guider_setup(void); + gui_guider_setup(); +#endif +} diff --git a/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/squareline/ui/README.md b/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/squareline/README.md similarity index 100% rename from bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/squareline/ui/README.md rename to bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/squareline/README.md diff --git a/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/squareline/SConscript b/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/squareline/SConscript index 4c815c49b8..96527eed47 100644 --- a/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/squareline/SConscript +++ b/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/squareline/SConscript @@ -1,15 +1,13 @@ -# RT-Thread building script for bridge - -import os from building import * cwd = GetCurrentDir() -objs = [] -list = os.listdir(cwd) +group = [] +src = [] +CPPPATH =[] -for d in list: - path = os.path.join(cwd, d) - if os.path.isfile(os.path.join(path, 'SConscript')): - objs = objs + SConscript(os.path.join(d, 'SConscript')) +src += Glob(cwd + '/ui/*.c') +CPPPATH += [cwd+'/ui'] -Return('objs') +group = group + DefineGroup('LVGL-SquareLine', src, depend = ['BSP_USING_LVGL', 'BSP_USING_LVGL_SQUARELINE'], CPPPATH = CPPPATH) + +Return('group') diff --git a/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/squareline/ui/SConscript b/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/squareline/ui/SConscript deleted file mode 100644 index dc89784ac0..0000000000 --- a/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/squareline/ui/SConscript +++ /dev/null @@ -1,10 +0,0 @@ -from building import * - -cwd = GetCurrentDir() -group = [] -src = Glob('*.c') -CPPPATH = [cwd] - -group = group + DefineGroup('LVGL-SquareLine', src, depend = ['BSP_USING_LVGL', 'BSP_USING_LVGL_SQUARELINE'], CPPPATH = CPPPATH) - -Return('group') diff --git a/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/squareline/ui/lv_ui_entry.c b/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/squareline/ui/lv_ui_entry.c index 720dab70d7..d3257967b4 100644 --- a/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/squareline/ui/lv_ui_entry.c +++ b/bsp/imxrt/imxrt1060-nxp-evk/applications/lvgl/squareline/ui/lv_ui_entry.c @@ -5,50 +5,11 @@ * * Change Logs: * Date Author Notes - * 2021-10-17 Meco Man First version + * 2022-05-13 Meco Man First version */ -#include -#include -#include -#define DBG_TAG "LVGL.demo" -#define DBG_LVL DBG_INFO -#include -#ifndef LV_THREAD_STACK_SIZE -#define LV_THREAD_STACK_SIZE 4096 -#endif - -#ifndef LV_THREAD_PRIO -#define LV_THREAD_PRIO (RT_THREAD_PRIORITY_MAX * 2 / 8) -#endif - -static struct rt_thread lvgl_thread; -static rt_uint8_t lvgl_thread_stack[LV_THREAD_STACK_SIZE]; - -static void lvgl_thread_entry(void *parameter) +void lv_user_gui_init(void) { extern void ui_init(void); ui_init(); - - while(1) - { - lv_task_handler(); - rt_thread_mdelay(5); - } } - -static int lvgl_demo_init(void) -{ - rt_thread_init(&lvgl_thread, - "LVGL", - lvgl_thread_entry, - RT_NULL, - &lvgl_thread_stack[0], - sizeof(lvgl_thread_stack), - LV_THREAD_PRIO, - 10); - rt_thread_startup(&lvgl_thread); - - return 0; -} -INIT_APP_EXPORT(lvgl_demo_init); diff --git a/bsp/imxrt/imxrt1060-nxp-evk/board/Kconfig b/bsp/imxrt/imxrt1060-nxp-evk/board/Kconfig index 0e26acd5c3..c97dada2be 100644 --- a/bsp/imxrt/imxrt1060-nxp-evk/board/Kconfig +++ b/bsp/imxrt/imxrt1060-nxp-evk/board/Kconfig @@ -85,6 +85,11 @@ menu "Onboard Peripheral Drivers" config BSP_USING_LVGL_SQUARELINE bool "Support LVGL SuqareLine Studio" default n + + config BSP_USING_NXP_GUIGUIDER + bool "Support NXP GUI Guider" + select PKG_USING_GUI_GUIDER_DEMO + default n endif endmenu