[imxrt1060]support NXP GUiGuider
This commit is contained in:
parent
a5ba85f434
commit
a0bfbe8d90
|
@ -0,0 +1,2 @@
|
|||
This folder is for NXP GUI Guider
|
||||
|
|
@ -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')
|
|
@ -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.
|
||||
|
|
@ -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 <rtthread.h>
|
||||
#include <lvgl.h>
|
||||
|
||||
#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);
|
|
@ -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
|
|
@ -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
|
|
@ -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 <rtconfig.h>
|
||||
#include <lvgl.h>
|
||||
|
||||
void lv_user_gui_init(void)
|
||||
{
|
||||
#ifdef PKG_USING_GUI_GUIDER_DEMO
|
||||
extern void gui_guider_setup(void);
|
||||
gui_guider_setup();
|
||||
#endif
|
||||
}
|
|
@ -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')
|
||||
|
|
|
@ -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')
|
|
@ -5,50 +5,11 @@
|
|||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2021-10-17 Meco Man First version
|
||||
* 2022-05-13 Meco Man First version
|
||||
*/
|
||||
#include <rtthread.h>
|
||||
#include <lvgl.h>
|
||||
#include <lv_port_indev.h>
|
||||
#define DBG_TAG "LVGL.demo"
|
||||
#define DBG_LVL DBG_INFO
|
||||
#include <rtdbg.h>
|
||||
|
||||
#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);
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue