Skip to content

Commit

Permalink
fixup! boards/sipeed-longan-nano: initial support
Browse files Browse the repository at this point in the history
  • Loading branch information
gschorcht committed Jan 19, 2023
1 parent e1769b4 commit a0fece0
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 15 deletions.
6 changes: 5 additions & 1 deletion boards/sipeed-longan-nano/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 0 additions & 2 deletions boards/sipeed-longan-nano/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
MODULE = board

DIRS = $(RIOTBOARD)/common/gd32v

include $(RIOTBASE)/Makefile.base
4 changes: 3 additions & 1 deletion boards/sipeed-longan-nano/Makefile.dep
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
USEMODULE += boards_common_gd32v
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif

include $(RIOTBOARD)/common/gd32v/Makefile.dep
4 changes: 4 additions & 0 deletions boards/sipeed-longan-nano/Makefile.features
Original file line number Diff line number Diff line change
@@ -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
10 changes: 1 addition & 9 deletions boards/sipeed-longan-nano/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
extern "C" {
#endif

#include "macros/units.h"
#include "board_common.h"

/**
* @name LED (on-board) configuration
Expand Down Expand Up @@ -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
Expand Down
18 changes: 16 additions & 2 deletions boards/sipeed-longan-nano/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand All @@ -29,7 +45,5 @@ extern "C" {
}
#endif

#include "periph_common_conf.h"

#endif /* PERIPH_CONF_H */
/** @} */

0 comments on commit a0fece0

Please sign in to comment.