[Infineon]Add lvgl support
This commit is contained in:
parent
72037b6353
commit
8a52e65013
|
@ -0,0 +1,16 @@
|
||||||
|
from building import *
|
||||||
|
import os
|
||||||
|
|
||||||
|
cwd = GetCurrentDir()
|
||||||
|
group = []
|
||||||
|
src = Glob('*.c')
|
||||||
|
CPPPATH = [cwd]
|
||||||
|
|
||||||
|
list = os.listdir(cwd)
|
||||||
|
for d in list:
|
||||||
|
path = os.path.join(cwd, d)
|
||||||
|
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||||
|
group = group + SConscript(os.path.join(d, 'SConscript'))
|
||||||
|
|
||||||
|
group = group + DefineGroup('LVGL-port', src, depend = ['BSP_USING_LVGL'], CPPPATH = CPPPATH)
|
||||||
|
Return('group')
|
|
@ -0,0 +1,17 @@
|
||||||
|
from building import *
|
||||||
|
import os
|
||||||
|
|
||||||
|
cwd = GetCurrentDir()
|
||||||
|
group = []
|
||||||
|
src = Glob('*.c')
|
||||||
|
CPPPATH = [cwd]
|
||||||
|
|
||||||
|
list = os.listdir(cwd)
|
||||||
|
for d in list:
|
||||||
|
path = os.path.join(cwd, d)
|
||||||
|
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||||
|
group = group + SConscript(os.path.join(d, 'SConscript'))
|
||||||
|
|
||||||
|
group = group + DefineGroup('LVGL-demo', src, depend = ['BSP_USING_LVGL', 'BSP_USING_LVGL_DEMO'], CPPPATH = CPPPATH)
|
||||||
|
|
||||||
|
Return('group')
|
|
@ -0,0 +1,17 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2006-2023, RT-Thread Development Team
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Change Logs:
|
||||||
|
* Date Author Notes
|
||||||
|
* 2021-10-17 Meco Man First version
|
||||||
|
* 2022-05-10 Meco Man improve rt-thread initialization process
|
||||||
|
*/
|
||||||
|
|
||||||
|
void lv_user_gui_init(void)
|
||||||
|
{
|
||||||
|
/* display demo; you may replace with your LVGL application at here */
|
||||||
|
extern void lv_demo_music(void);
|
||||||
|
lv_demo_music();
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2006-2023, RT-Thread Development Team
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Change Logs:
|
||||||
|
* Date Author Notes
|
||||||
|
* 2023-02-22 Rbb666 First version
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef LV_CONF_H
|
||||||
|
#define LV_CONF_H
|
||||||
|
|
||||||
|
#include <rtconfig.h>
|
||||||
|
|
||||||
|
#define LV_USE_PERF_MONITOR 1
|
||||||
|
#define LV_COLOR_DEPTH 16
|
||||||
|
|
||||||
|
#ifdef PKG_USING_ILI9341
|
||||||
|
#define LV_HOR_RES_MAX 240
|
||||||
|
#define LV_VER_RES_MAX 320
|
||||||
|
#define LV_COLOR_16_SWAP 1
|
||||||
|
#define LV_DPI_DEF 99
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PKG_USING_LV_MUSIC_DEMO
|
||||||
|
/* music player demo */
|
||||||
|
#define LV_USE_DEMO_RTT_MUSIC 1
|
||||||
|
#define LV_DEMO_RTT_MUSIC_AUTO_PLAY 1
|
||||||
|
#define LV_FONT_MONTSERRAT_12 1
|
||||||
|
#define LV_FONT_MONTSERRAT_16 1
|
||||||
|
#define LV_COLOR_SCREEN_TRANSP 0
|
||||||
|
#endif /* PKG_USING_LV_MUSIC_DEMO */
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,58 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2006-2023, RT-Thread Development Team
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Change Logs:
|
||||||
|
* Date Author Notes
|
||||||
|
* 2022-04-04 Rbb666 The first version
|
||||||
|
*/
|
||||||
|
#include <lvgl.h>
|
||||||
|
|
||||||
|
#ifdef PKG_USING_ILI9341
|
||||||
|
#include "lcd_ili9341.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define COLOR_BUFFER (LV_HOR_RES_MAX * LV_VER_RES_MAX)
|
||||||
|
|
||||||
|
/*A static or global variable to store the buffers*/
|
||||||
|
static lv_disp_draw_buf_t disp_buf;
|
||||||
|
|
||||||
|
/*Descriptor of a display driver*/
|
||||||
|
static lv_disp_drv_t disp_drv;
|
||||||
|
static struct rt_device_graphic_info info;
|
||||||
|
|
||||||
|
/*Static or global buffer(s). The second buffer is optional*/
|
||||||
|
static lv_color_t buf_1[COLOR_BUFFER];
|
||||||
|
|
||||||
|
static void disp_flush(lv_disp_drv_t *disp_drv, const lv_area_t *area, lv_color_t *color_p)
|
||||||
|
{
|
||||||
|
#ifdef PKG_USING_ILI9341
|
||||||
|
lcd_fill_array_spi(area->x1, area->y1, area->x2, area->y2, color_p);
|
||||||
|
#endif
|
||||||
|
lv_disp_flush_ready(disp_drv);
|
||||||
|
}
|
||||||
|
|
||||||
|
void lv_port_disp_init(void)
|
||||||
|
{
|
||||||
|
#ifdef PKG_USING_ILI9341
|
||||||
|
spi_lcd_init(25);
|
||||||
|
#endif
|
||||||
|
/*Initialize `disp_buf` with the buffer(s). With only one buffer use NULL instead buf_2 */
|
||||||
|
lv_disp_draw_buf_init(&disp_buf, buf_1, NULL, COLOR_BUFFER);
|
||||||
|
|
||||||
|
lv_disp_drv_init(&disp_drv); /*Basic initialization*/
|
||||||
|
|
||||||
|
/*Set the resolution of the display*/
|
||||||
|
disp_drv.hor_res = LV_HOR_RES_MAX;
|
||||||
|
disp_drv.ver_res = LV_VER_RES_MAX;
|
||||||
|
|
||||||
|
/*Set a display buffer*/
|
||||||
|
disp_drv.draw_buf = &disp_buf;
|
||||||
|
|
||||||
|
/*Used to copy the buffer's content to the display*/
|
||||||
|
disp_drv.flush_cb = disp_flush;
|
||||||
|
|
||||||
|
/*Finally register the driver*/
|
||||||
|
lv_disp_drv_register(&disp_drv);
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2006-2023, RT-Thread Development Team
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Change Logs:
|
||||||
|
* Date Author Notes
|
||||||
|
* 2022-04-04 Rbb666 The first version
|
||||||
|
*/
|
||||||
|
#include <lvgl.h>
|
||||||
|
#include <rtdevice.h>
|
||||||
|
|
||||||
|
void lv_port_indev_init(void)
|
||||||
|
{
|
||||||
|
}
|
|
@ -257,6 +257,26 @@ menu "On-chip Peripheral Drivers"
|
||||||
bool "Enable TIM2"
|
bool "Enable TIM2"
|
||||||
default n
|
default n
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
menuconfig BSP_USING_LVGL
|
||||||
|
bool "Enable LVGL for LCD"
|
||||||
|
select PKG_USING_LVGL
|
||||||
|
default n
|
||||||
|
if BSP_USING_LVGL
|
||||||
|
config BSP_USING_LCD_ILI9431
|
||||||
|
bool "Enable LVGL for LCD_ILI9431"
|
||||||
|
select PKG_USING_ILI9341
|
||||||
|
select BSP_USING_SPI
|
||||||
|
select BSP_USING_SPI0
|
||||||
|
default n
|
||||||
|
endif
|
||||||
|
|
||||||
|
if BSP_USING_LVGL
|
||||||
|
config BSP_USING_LVGL_DEMO
|
||||||
|
bool "Enable LVGL demo"
|
||||||
|
select PKG_USING_LV_MUSIC_DEMO
|
||||||
|
default y
|
||||||
|
endif
|
||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
menu "Board extended module Drivers"
|
menu "Board extended module Drivers"
|
||||||
|
|
Loading…
Reference in New Issue