diff --git a/boards/sipeed-longan-nano/Kconfig b/boards/sipeed-longan-nano/Kconfig index 0538d0e39306..c316e937a4fc 100644 --- a/boards/sipeed-longan-nano/Kconfig +++ b/boards/sipeed-longan-nano/Kconfig @@ -11,7 +11,11 @@ config BOARD config BOARD_SIPEED_LONGAN_NANO bool default y - select BOARD_COMMON_GD32V select CPU_MODEL_GD32VF103CBT6 + select BOARD_HAS_HXTAL + select BOARD_HAS_LXTAL + select HAS_PERIPH_TIMER + select HAS_PERIPH_UART + select HAVE_SAUL_GPIO source "$(RIOTBOARD)/common/gd32v/Kconfig" diff --git a/boards/sipeed-longan-nano/Makefile b/boards/sipeed-longan-nano/Makefile index 1ef58cb7a9fd..f8fcbb53a065 100644 --- a/boards/sipeed-longan-nano/Makefile +++ b/boards/sipeed-longan-nano/Makefile @@ -1,5 +1,3 @@ MODULE = board -DIRS = $(RIOTBOARD)/common/gd32v - include $(RIOTBASE)/Makefile.base diff --git a/boards/sipeed-longan-nano/Makefile.dep b/boards/sipeed-longan-nano/Makefile.dep index c300c5829dcf..a7dc06f36c35 100644 --- a/boards/sipeed-longan-nano/Makefile.dep +++ b/boards/sipeed-longan-nano/Makefile.dep @@ -1,3 +1,5 @@ -USEMODULE += boards_common_gd32v +ifneq (,$(filter saul_default,$(USEMODULE))) + USEMODULE += saul_gpio +endif include $(RIOTBOARD)/common/gd32v/Makefile.dep diff --git a/boards/sipeed-longan-nano/Makefile.features b/boards/sipeed-longan-nano/Makefile.features index b2dbe080ffd8..090ae88e5a9b 100644 --- a/boards/sipeed-longan-nano/Makefile.features +++ b/boards/sipeed-longan-nano/Makefile.features @@ -1,3 +1,7 @@ CPU_MODEL = gd32vf103cbt6 +# Put defined MCU peripherals here (in alphabetical order) +FEATURES_PROVIDED += periph_timer +FEATURES_PROVIDED += periph_uart + include $(RIOTBOARD)/common/gd32v/Makefile.features diff --git a/boards/sipeed-longan-nano/include/board.h b/boards/sipeed-longan-nano/include/board.h index 2603f73f436d..f9777eddb972 100644 --- a/boards/sipeed-longan-nano/include/board.h +++ b/boards/sipeed-longan-nano/include/board.h @@ -24,7 +24,7 @@ extern "C" { #endif -#include "macros/units.h" +#include "board_common.h" /** * @name LED (on-board) configuration @@ -53,14 +53,6 @@ extern "C" { #define LED_BLUE_PIN LED2_PIN /**< LED2 is blue */ /** @} */ -/** - * @name Xtimer configuration - * @{ - */ -#define XTIMER_HZ MHZ(1) -#define XTIMER_WIDTH (16) -/** @} */ - #ifdef __cplusplus } #endif diff --git a/boards/sipeed-longan-nano/include/periph_conf.h b/boards/sipeed-longan-nano/include/periph_conf.h index 35b0c750c553..7c0a616c38b4 100644 --- a/boards/sipeed-longan-nano/include/periph_conf.h +++ b/boards/sipeed-longan-nano/include/periph_conf.h @@ -20,6 +20,22 @@ #define PERIPH_CONF_H #include "periph_cpu.h" +#include "periph_common_conf.h" + +#include "cfg_timer_default.h" +#include "cfg_uart_default.h" + +#ifndef CONFIG_BOARD_HAS_HXTAL +#define CONFIG_BOARD_HAS_HXTAL 1 /**< The board provides a high frequency oscillator. */ +#endif + +#ifndef CONFIG_BOARD_HAS_LXTAL +#define CONFIG_BOARD_HAS_LXTAL 1 /**< The board provides a low frequency oscillator. */ +#endif + +#ifndef CONFIG_CLOCK_HXTAL +#define CONFIG_CLOCK_HXTAL MHZ(8) /**< HXTAL frequency */ +#endif #ifdef __cplusplus extern "C" { @@ -29,7 +45,5 @@ extern "C" { } #endif -#include "periph_common_conf.h" - #endif /* PERIPH_CONF_H */ /** @} */