mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
boards/seeedstudio-gd32: use common gd32v board definition
This commit is contained in:
parent
31604da8fe
commit
400609f69b
@ -12,21 +12,10 @@ config BOARD_SEEEDSTUDIO_GD32
|
||||
bool
|
||||
default y
|
||||
select CPU_MODEL_GD32VF103VBT6
|
||||
select HAS_PERIPH_UART
|
||||
select BOARD_HAS_HXTAL
|
||||
select BOARD_HAS_LXTAL
|
||||
select HAS_PERIPH_TIMER
|
||||
select HAS_PERIPH_UART
|
||||
select HAVE_SAUL_GPIO
|
||||
|
||||
config BOARD_HAS_HXTAL
|
||||
bool
|
||||
help
|
||||
Indicates that the board is providing an HXTAL oscillator
|
||||
|
||||
config BOARD_HAS_LXTAL
|
||||
bool
|
||||
help
|
||||
Indicates that the board is providing an LXTAL oscillator
|
||||
|
||||
config CLOCK_HXTAL
|
||||
int
|
||||
default 8000000
|
||||
source "$(RIOTBOARD)/common/gd32v/Kconfig"
|
||||
|
@ -1,3 +1,5 @@
|
||||
ifneq (,$(filter saul_default,$(USEMODULE)))
|
||||
USEMODULE += saul_gpio
|
||||
endif
|
||||
|
||||
include $(RIOTBOARD)/common/gd32v/Makefile.dep
|
||||
|
@ -1,6 +1,7 @@
|
||||
CPU = gd32v
|
||||
CPU_MODEL = gd32vf103vbt6
|
||||
|
||||
# Put defined MCU peripherals here (in alphabetical order)
|
||||
FEATURES_PROVIDED += periph_timer
|
||||
FEATURES_PROVIDED += periph_uart
|
||||
|
||||
include $(RIOTBOARD)/common/gd32v/Makefile.features
|
||||
|
@ -1,10 +1 @@
|
||||
# configure the serial interface
|
||||
PORT_LINUX ?= /dev/ttyUSB0
|
||||
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
|
||||
|
||||
# configure the flasher
|
||||
PROGRAMMER ?= openocd
|
||||
OPENOCD_DEBUG_ADAPTER ?= ftdi
|
||||
OPENOCD_FTDI_ADAPTER ?= openocd-usb
|
||||
OPENOCD_TRANSPORT = jtag
|
||||
OPENOCD_RESET_USE_CONNECT_ASSERT_SRST = 1
|
||||
include $(RIOTBOARD)/common/gd32v/Makefile.include
|
||||
|
@ -25,8 +25,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "macros/units.h"
|
||||
|
||||
/**
|
||||
* @name Button pin definitions
|
||||
* @{
|
||||
@ -67,14 +65,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
|
||||
|
@ -19,15 +19,14 @@
|
||||
#ifndef PERIPH_CONF_H
|
||||
#define PERIPH_CONF_H
|
||||
|
||||
#include "macros/units.h"
|
||||
#include "periph_cpu.h"
|
||||
#include "periph_common_conf.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include "cfg_timer_default.h"
|
||||
#include "cfg_uart_default.h"
|
||||
|
||||
#ifndef CONFIG_BOARD_HAS_HXTAL
|
||||
#define CONFIG_BOARD_HAS_HXTAL 1 /**< This board provides an high frequency oscillator */
|
||||
#define CONFIG_BOARD_HAS_HXTAL 1 /**< The board provides a high frequency oscillator. */
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_BOARD_HAS_LXTAL
|
||||
@ -38,54 +37,9 @@ extern "C" {
|
||||
#define CONFIG_CLOCK_HXTAL MHZ(8) /**< HXTAL frequency */
|
||||
#endif
|
||||
|
||||
#define CLOCK_CORECLOCK MHZ(108) /**< CPU clock frequency in Hz */
|
||||
|
||||
/**
|
||||
* @name Timer configuration
|
||||
* @{
|
||||
*/
|
||||
static const timer_conf_t timer_config[] = {
|
||||
{
|
||||
.dev = TIMER2,
|
||||
.max = 0x0000ffff,
|
||||
.rcu_mask = RCU_APB1EN_TIMER2EN_Msk,
|
||||
.bus = APB1,
|
||||
.irqn = TIMER2_IRQn
|
||||
},
|
||||
{
|
||||
.dev = TIMER3,
|
||||
.max = 0x0000ffff,
|
||||
.rcu_mask = RCU_APB1EN_TIMER3EN_Msk,
|
||||
.bus = APB1,
|
||||
.irqn = TIMER3_IRQn
|
||||
}
|
||||
};
|
||||
|
||||
#define TIMER_0_IRQN TIMER2_IRQn
|
||||
#define TIMER_1_IRQN TIMER3_IRQn
|
||||
|
||||
#define TIMER_NUMOF ARRAY_SIZE(timer_config)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name UART configuration
|
||||
* @{
|
||||
*/
|
||||
static const uart_conf_t uart_config[] = {
|
||||
{
|
||||
.dev = USART0,
|
||||
.rcu_mask = RCU_APB2EN_USART0EN_Msk,
|
||||
.rx_pin = GPIO_PIN(PORT_A, 10),
|
||||
.tx_pin = GPIO_PIN(PORT_A, 9),
|
||||
.bus = APB2,
|
||||
.irqn = USART0_IRQn,
|
||||
},
|
||||
};
|
||||
|
||||
#define UART_0_IRQN USART0_IRQn
|
||||
|
||||
#define UART_NUMOF ARRAY_SIZE(uart_config)
|
||||
/** @} */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user