From d24a4eedee6a4de7eaba8ac7374dc1f7d41a6a8a Mon Sep 17 00:00:00 2001 From: Gunar Schorcht Date: Sun, 6 Aug 2023 12:30:41 +0200 Subject: [PATCH] boards/sipeed-longan-nano: remove TFT display handling --- boards/sipeed-longan-nano/Kconfig | 16 +++---------- boards/sipeed-longan-nano/Makefile.dep | 4 ---- boards/sipeed-longan-nano/Makefile.include | 4 ---- boards/sipeed-longan-nano/doc.txt | 24 ++++++++++++------- boards/sipeed-longan-nano/include/board.h | 2 +- .../sipeed-longan-nano/include/periph_conf.h | 10 ++++---- 6 files changed, 24 insertions(+), 36 deletions(-) diff --git a/boards/sipeed-longan-nano/Kconfig b/boards/sipeed-longan-nano/Kconfig index 7f65aa90a6..dc50ef4b70 100644 --- a/boards/sipeed-longan-nano/Kconfig +++ b/boards/sipeed-longan-nano/Kconfig @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Inria +# Copyright (c) 2023 Gunar Schorcht # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level @@ -25,24 +25,14 @@ config BOARD_SIPEED_LONGAN_NANO select HAS_PERIPH_USBDEV select HAS_RIOTBOOT select HAS_TINYUSB_DEVICE - select HAVE_SAUL_GPIO select HAVE_MTD_SDCARD_DEFAULT + select HAVE_SAUL_GPIO + select MODULE_FATFS_VFS if MODULE_VFS_DEFAULT select MODULE_USB_BOARD_RESET if KCONFIG_USB && TEST_KCONFIG config FORCE_USB_STDIO default y -menu "Sipeed Longan Nano Board Configuration" - - config SIPEED_LONGAN_NANO_WITH_TFT - bool "Board with TFT display" - default y if MODULE_DISP_DEV - select HAVE_ST7735 - help - Indicates that a Sipeed Longan Nano board with TFT display is used. - -endmenu - source "$(RIOTBOARD)/common/gd32v/Kconfig" diff --git a/boards/sipeed-longan-nano/Makefile.dep b/boards/sipeed-longan-nano/Makefile.dep index 7affdc2679..6a80d00e25 100644 --- a/boards/sipeed-longan-nano/Makefile.dep +++ b/boards/sipeed-longan-nano/Makefile.dep @@ -12,9 +12,5 @@ ifneq (,$(filter vfs_default,$(USEMODULE))) USEMODULE += mtd endif -ifneq (,$(filter disp_dev,$(USEMODULE))) - USEMODULE += st7735 -endif - include $(RIOTBOARD)/common/makefiles/stdio_cdc_acm.dep.mk include $(RIOTBOARD)/common/gd32v/Makefile.dep diff --git a/boards/sipeed-longan-nano/Makefile.include b/boards/sipeed-longan-nano/Makefile.include index 08b8f4897b..1ff81aea98 100644 --- a/boards/sipeed-longan-nano/Makefile.include +++ b/boards/sipeed-longan-nano/Makefile.include @@ -1,8 +1,4 @@ PORT_LINUX ?= /dev/ttyACM0 PROGRAMMER ?= dfu-util -ifneq (,$(filter st7735,$(USEMODULE))) - CFLAGS += '-DCONFIG_SIPEED_LONGAN_NANO_WITH_TFT=1' -endif - include $(RIOTBOARD)/common/gd32v/Makefile.include diff --git a/boards/sipeed-longan-nano/doc.txt b/boards/sipeed-longan-nano/doc.txt index 7ba4a97b02..bb343f3ec2 100644 --- a/boards/sipeed-longan-nano/doc.txt +++ b/boards/sipeed-longan-nano/doc.txt @@ -1,9 +1,11 @@ /** -@defgroup boards_sipeed_longan_nano Sipeed Longan Nano board +@defgroup boards_sipeed_longan_nano Sipeed Longan Nano @ingroup boards @brief Support for the Sipeed Longan Nano board @author Gunar Schorcht +\section sipeed_longan_nano Sipeed Longan Nano + ## Overview The [Sipeed Longan Nano](https://longan.sipeed.com/en) is a @@ -97,11 +99,10 @@ by pins. | UART_DEV(0) RX | PA10 | USART0 RX | UART RX | | \n -@note To use the TFT display of a Sipeed Longan Nano board, if available, the -macro `CONFIG_SIPEED_LONGAN_NANO_WITH_TFT=1` has to be defined, for -example using the `CFLAGS` variable in the make command: +@note For the Sipeed Longan Nano board version with TFT display, the + `sipeed-longan-nano-tft` board definition has to be used. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -BOARD=sipeed-longan-nano CFLAGS='-DCONFIG_SIPEED_LONGAN_NANO_WITH_TFT=1' make ... +BOARD=sipeed-longan-nano-tft make ... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Pin | Board Function | RIOT Function 1 | RIOT Function 2 | RIOT Function 3 | @@ -162,6 +163,12 @@ BOARD=sipeed-longan-nano make -C examples/hello-world flash After flashing you need to leave bootloader mode again by pressing the RESET button. +@note For the Sipeed Longan Nano board version with TFT display, the + `sipeed-longan-nano-tft` board definition has to be used. +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +BOARD=sipeed-longan-nano-tft make -C examples/hello-world flash +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ### Using an external debug adapter The board can also be flashed via a JTAG interface with OpenOCD (at least [release version 0.12.0] @@ -187,11 +194,10 @@ PROGRAMMER=openocd OPENOCD_DEBUG_ADAPTER=jlink BOARD=sipeed-longan-nano make -C ## Using the TFT Display -To use the TFT display of a Sipeed Longan Nano board, if available, the -macro `CONFIG_SIPEED_LONGAN_NANO_WITH_TFT=1` has to be defined, for -example using the `CFLAGS` variable in the make command: +To use the display of the Sipeed Longan Nano board version with TFT display, +the `sipeed_longan_nano_tft` board definition has to be used, for example: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -BOARD=sipeed-longan-nano CFLAGS='-DCONFIG_SIPEED_LONGAN_NANO_WITH_TFT=1' make -C tests/drivers/st7735 flash +BOARD=sipeed-longan-nano-tft make -C tests/drivers/st7735 flash ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ## Accessing STDIO diff --git a/boards/sipeed-longan-nano/include/board.h b/boards/sipeed-longan-nano/include/board.h index b325809ccf..10e099ea39 100644 --- a/boards/sipeed-longan-nano/include/board.h +++ b/boards/sipeed-longan-nano/include/board.h @@ -70,7 +70,7 @@ extern "C" { #define SDCARD_SPI_PARAM_MOSI GPIO_PIN(PORT_B, 15) #endif -#if defined(MODULE_ST7735) && defined(CONFIG_SIPEED_LONGAN_NANO_WITH_TFT) +#if defined(MODULE_ST7735) && defined(BOARD_SIPEED_LONGAN_NANO_TFT) #define ST7735_PARAM_SPI SPI_DEV(1) /**< SPI device */ #define ST7735_PARAM_SPI_CLK SPI_CLK_5MHZ /**< SPI clock frequency */ #define ST7735_PARAM_SPI_MODE SPI_MODE_0 /**< SPI mode */ diff --git a/boards/sipeed-longan-nano/include/periph_conf.h b/boards/sipeed-longan-nano/include/periph_conf.h index bca6e0c36e..60470c7415 100644 --- a/boards/sipeed-longan-nano/include/periph_conf.h +++ b/boards/sipeed-longan-nano/include/periph_conf.h @@ -33,7 +33,7 @@ #define CONFIG_CLOCK_HXTAL MHZ(8) /**< HXTAL frequency */ #endif -#if CONFIG_SIPEED_LONGAN_NANO_WITH_TFT +#if defined(BOARD_SIPEED_LONGAN_NANO_TFT) #define SPI_DEV_1_USED /**< Enable SPI_DEV(1) if TFT is connected */ #endif @@ -61,7 +61,7 @@ static const adc_conf_t adc_config[] = { { .pin = GPIO_UNDEF, .dev = 0, .chan = 16 }, /* ADC VREF channel */ { .pin = GPIO_UNDEF, .dev = 0, .chan = 17 }, -#if !CONFIG_SIPEED_LONGAN_NANO_WITH_TFT +#if !defined(BOARD_SIPEED_LONGAN_NANO_TFT) /* This conflicts with TFT pins if connected. */ { .pin = GPIO_PIN(PORT_B, 0), .dev = 0, .chan = 8 }, { .pin = GPIO_PIN(PORT_B, 1), .dev = 0, .chan = 9 }, @@ -72,7 +72,7 @@ static const adc_conf_t adc_config[] = { { .pin = GPIO_PIN(PORT_A, 4), .dev = 0, .chan = 4 }, { .pin = GPIO_PIN(PORT_A, 5), .dev = 0, .chan = 5 }, #endif /* !defined(MODULE_PERIPH_DAC) */ -#endif /* !CONFIG_SIPEED_LONGAN_NANO_WITH_TFT */ +#endif /* !defined(BOARD_SIPEED_LONGAN_NANO_TFT) */ }; #define ADC_NUMOF ARRAY_SIZE(adc_config) @@ -83,10 +83,10 @@ static const adc_conf_t adc_config[] = { * @{ */ static const dac_conf_t dac_config[] = { -#if !CONFIG_SIPEED_LONGAN_NANO_WITH_TFT +#if !defined(BOARD_SIPEED_LONGAN_NANO_TFT) { .pin = GPIO_PIN(PORT_A, 4), .chan = 0 }, { .pin = GPIO_PIN(PORT_A, 5), .chan = 1 }, -#endif /* !CONFIG_SIPEED_LONGAN_NANO_WITH_TFT */ +#endif /* !defined(BOARD_SIPEED_LONGAN_NANO_TFT) */ }; #define DAC_NUMOF ARRAY_SIZE(dac_config)