diff --git a/bsp/stm32/stm32l475-atk-pandora/applications/SConscript b/bsp/stm32/stm32l475-atk-pandora/applications/SConscript index 77d927a66b..e87f545100 100644 --- a/bsp/stm32/stm32l475-atk-pandora/applications/SConscript +++ b/bsp/stm32/stm32l475-atk-pandora/applications/SConscript @@ -7,7 +7,7 @@ src = Split(''' main.c ''') -if GetDepend(['BSP_USING_SPI_LCD']): +if GetDepend(['BSP_USING_LCD_SAMPLE']): src += ['lcd_sample.c'] if GetDepend(['PKG_USING_NRF24L01']): diff --git a/bsp/stm32/stm32l475-atk-pandora/applications/lcd_sample.c b/bsp/stm32/stm32l475-atk-pandora/applications/lcd_sample.c index a89c5e0b9c..54d440f7f3 100644 --- a/bsp/stm32/stm32l475-atk-pandora/applications/lcd_sample.c +++ b/bsp/stm32/stm32l475-atk-pandora/applications/lcd_sample.c @@ -11,8 +11,6 @@ #include #include #include - -#ifdef BSP_USING_SPI_LCD #include #include @@ -45,4 +43,3 @@ static int lcd_sample(void) return RT_EOK; } INIT_APP_EXPORT(lcd_sample); -#endif /* BSP_USING_SPI_LCD */ diff --git a/bsp/stm32/stm32l475-atk-pandora/board/Kconfig b/bsp/stm32/stm32l475-atk-pandora/board/Kconfig index e8a0713647..48fa68dd15 100644 --- a/bsp/stm32/stm32l475-atk-pandora/board/Kconfig +++ b/bsp/stm32/stm32l475-atk-pandora/board/Kconfig @@ -35,6 +35,18 @@ menu "Onboard Peripheral Drivers" select BSP_USING_SPI3 default n + config BSP_USING_LCD_SAMPLE + bool "Enable LCD sample" + depends on BSP_USING_SPI_LCD + depends on !BSP_USING_LVGL + default n + + config BSP_USING_LVGL + bool "Enable LVGL for LCD" + select BSP_USING_SPI_LCD + select PKG_USING_LVGL + default n + config BSP_USING_SDCARD bool "Enable SDCARD (spi1)" select BSP_USING_SPI diff --git a/bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/SConscript b/bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/SConscript new file mode 100644 index 0000000000..63fbfd3933 --- /dev/null +++ b/bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/SConscript @@ -0,0 +1,9 @@ +from building import * + +cwd = GetCurrentDir() + +src = Glob('*.c') +CPPPATH = [cwd] + +group = DefineGroup('LVGL', src, depend = ['BSP_USING_LVGL'], CPPPATH = CPPPATH) +Return('group') diff --git a/bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lv_conf.h b/bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lv_conf.h new file mode 100644 index 0000000000..c3ff474e58 --- /dev/null +++ b/bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lv_conf.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2006-2021, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2021-10-18 Meco Man First version + */ + +#ifndef LV_CONF_H +#define LV_CONF_H + +#define LV_COLOR_16_SWAP 1 + +#endif diff --git a/bsp/stm32/stm32l475-atk-pandora/applications/lvgl_demo.c b/bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lvgl_demo.c similarity index 100% rename from bsp/stm32/stm32l475-atk-pandora/applications/lvgl_demo.c rename to bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lvgl_demo.c