From b6382d2a00add3dd1af7d89b53a10fb391e0d428 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Sat, 5 Oct 2024 21:10:33 -0400 Subject: [PATCH] [stm32l475][RTduino] modify macros and files name --- .../adafruit-aht10.attach} | 2 -- .../attachconfig/rtduino/adafruit-gfx.attach | 4 +++ .../.ci/attachconfig/rtduino/tft-espi.attach | 4 +++ bsp/stm32/stm32l475-atk-pandora/board/Kconfig | 28 +++++++++++++++---- .../board/ports/arduino/SConscript | 6 ++-- ..._demo.cpp => ST7789_adafruit_gfx_demo.cpp} | 0 .../ports/arduino/ST7789_tft_espi_demo.cpp | 21 ++++++++++++++ 7 files changed, 56 insertions(+), 9 deletions(-) rename bsp/stm32/stm32l475-atk-pandora/.ci/attachconfig/{rtduino.attach => rtduino/adafruit-aht10.attach} (57%) create mode 100644 bsp/stm32/stm32l475-atk-pandora/.ci/attachconfig/rtduino/adafruit-gfx.attach create mode 100644 bsp/stm32/stm32l475-atk-pandora/.ci/attachconfig/rtduino/tft-espi.attach rename bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/{ST7789_demo.cpp => ST7789_adafruit_gfx_demo.cpp} (100%) create mode 100644 bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/ST7789_tft_espi_demo.cpp diff --git a/bsp/stm32/stm32l475-atk-pandora/.ci/attachconfig/rtduino.attach b/bsp/stm32/stm32l475-atk-pandora/.ci/attachconfig/rtduino/adafruit-aht10.attach similarity index 57% rename from bsp/stm32/stm32l475-atk-pandora/.ci/attachconfig/rtduino.attach rename to bsp/stm32/stm32l475-atk-pandora/.ci/attachconfig/rtduino/adafruit-aht10.attach index b414212c9d..83e6637eb6 100644 --- a/bsp/stm32/stm32l475-atk-pandora/.ci/attachconfig/rtduino.attach +++ b/bsp/stm32/stm32l475-atk-pandora/.ci/attachconfig/rtduino/adafruit-aht10.attach @@ -1,5 +1,3 @@ CONFIG_BSP_USING_ARDUINO=y -CONFIG_BSP_USING_ARDUINO_ST7789=y -CONFIG_BSP_USING_ARDUINO_ST7789_DEMO=y CONFIG_BSP_USING_ARDUINO_AHT10=y CONFIG_BSP_USING_ARDUINO_AHT10_DEMO=y diff --git a/bsp/stm32/stm32l475-atk-pandora/.ci/attachconfig/rtduino/adafruit-gfx.attach b/bsp/stm32/stm32l475-atk-pandora/.ci/attachconfig/rtduino/adafruit-gfx.attach new file mode 100644 index 0000000000..f981a5abac --- /dev/null +++ b/bsp/stm32/stm32l475-atk-pandora/.ci/attachconfig/rtduino/adafruit-gfx.attach @@ -0,0 +1,4 @@ +CONFIG_BSP_USING_ARDUINO=y +CONFIG_BSP_USING_ARDUINO_ST7789=y +CONFIG_BSP_USING_ARDUINO_ST7789_ADAFRUIT_GFX=y +CONFIG_BSP_USING_ARDUINO_ST7789_ADAFRUIT_GFX_DEMO=y diff --git a/bsp/stm32/stm32l475-atk-pandora/.ci/attachconfig/rtduino/tft-espi.attach b/bsp/stm32/stm32l475-atk-pandora/.ci/attachconfig/rtduino/tft-espi.attach new file mode 100644 index 0000000000..f11ab134c0 --- /dev/null +++ b/bsp/stm32/stm32l475-atk-pandora/.ci/attachconfig/rtduino/tft-espi.attach @@ -0,0 +1,4 @@ +CONFIG_BSP_USING_ARDUINO=y +CONFIG_BSP_USING_ARDUINO_ST7789=y +CONFIG_BSP_USING_ARDUINO_ST7789_TFT_ESPI=y +CONFIG_BSP_USING_ARDUINO_ST7789_TFT_ESPI_DEMO=y diff --git a/bsp/stm32/stm32l475-atk-pandora/board/Kconfig b/bsp/stm32/stm32l475-atk-pandora/board/Kconfig index aa46f1064f..e7906e12f5 100644 --- a/bsp/stm32/stm32l475-atk-pandora/board/Kconfig +++ b/bsp/stm32/stm32l475-atk-pandora/board/Kconfig @@ -46,14 +46,32 @@ menu "Onboard Peripheral Drivers" select BSP_USING_SPI3 select BSP_SPI3_TX_USING_DMA select BSP_USING_PWM4_CH2 - select PKG_USING_ARDUINO_ADAFRUIT_ST7735 depends on !BSP_USING_SPI_LCD default n - config BSP_USING_ARDUINO_ST7789_DEMO - bool "Enable Arduino LCD (ST7789) library demo" - depends on BSP_USING_ARDUINO_ST7789 - default n + if BSP_USING_ARDUINO_ST7789 + choice + prompt "Arduino GUI Framework" + + config BSP_USING_ARDUINO_ST7789_ADAFRUIT_GFX + bool "Adafruit GFX" + select PKG_USING_ARDUINO_ADAFRUIT_ST7735 + + config BSP_USING_ARDUINO_ST7789_TFT_ESPI + bool "TFT eSPI" + select PKG_USING_ARDUINO_TFT_ESPI + endchoice + + config BSP_USING_ARDUINO_ST7789_ADAFRUIT_GFX_DEMO + bool "Enable ST7789 Adafruit demo" + depends on BSP_USING_ARDUINO_ST7789_ADAFRUIT_GFX + default n + + config BSP_USING_ARDUINO_ST7789_TFT_ESPI_DEMO + bool "Enable ST7789 TFT eSPI demo" + depends on BSP_USING_ARDUINO_ST7789_TFT_ESPI + default n + endif config BSP_USING_ARDUINO_AHT10 bool "Enable Arduino AHT10 sensor library" diff --git a/bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/SConscript b/bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/SConscript index b0db46cc9e..3d68349796 100644 --- a/bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/SConscript +++ b/bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/SConscript @@ -3,8 +3,10 @@ from building import * cwd = GetCurrentDir() src = [] -if GetDepend(['BSP_USING_ARDUINO_ST7789_DEMO']): - src += ['ST7789_demo.cpp'] +if GetDepend(['BSP_USING_ARDUINO_ST7789_ADAFRUIT_GFX_DEMO']): + src += ['ST7789_adafruit_gfx_demo.cpp'] +elif GetDepend(['BSP_USING_ARDUINO_ST7789_ADAFRUIT_GFX_DEMO']): + src += ['ST7789_tft_espi_demo.cpp'] group = DefineGroup('RTduino-libraries', src, depend = ['BSP_USING_ARDUINO']) diff --git a/bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/ST7789_demo.cpp b/bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/ST7789_adafruit_gfx_demo.cpp similarity index 100% rename from bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/ST7789_demo.cpp rename to bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/ST7789_adafruit_gfx_demo.cpp diff --git a/bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/ST7789_tft_espi_demo.cpp b/bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/ST7789_tft_espi_demo.cpp new file mode 100644 index 0000000000..ea069691e4 --- /dev/null +++ b/bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/ST7789_tft_espi_demo.cpp @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2006-2023, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2023-10-05 Meco Man port to RTduino + */ + +#include + +static void st7789_setup(void) +{ +} + +static void st7789_loop(void) +{ + delay(500); +} +RTDUINO_SKETCH_LOADER("ST7789", st7789_setup, st7789_loop);