Browse Source

[l475] port for LVGL

Meco Man 3 years ago
parent
commit
d4991d9d50

+ 1 - 1
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']):

+ 0 - 3
bsp/stm32/stm32l475-atk-pandora/applications/lcd_sample.c

@@ -11,8 +11,6 @@
 #include <rtthread.h>
 #include <rtdevice.h>
 #include <board.h>
-
-#ifdef BSP_USING_SPI_LCD
 #include <drv_lcd.h>
 #include <rttlogo.h>
 
@@ -45,4 +43,3 @@ static int lcd_sample(void)
     return RT_EOK;
 }
 INIT_APP_EXPORT(lcd_sample);
-#endif /* BSP_USING_SPI_LCD */

+ 12 - 0
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

+ 9 - 0
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')

+ 16 - 0
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

+ 0 - 0
bsp/stm32/stm32l475-atk-pandora/applications/lvgl_demo.c → bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lvgl_demo.c