diff --git a/boards/common/e104-bt50xxa-tb/Kconfig b/boards/common/e104-bt50xxa-tb/Kconfig new file mode 100644 index 0000000000..1e6a27d1da --- /dev/null +++ b/boards/common/e104-bt50xxa-tb/Kconfig @@ -0,0 +1,14 @@ +# Copyright (c) 2020 Benjamin Valentin +# +# 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 +# directory for more details. + +config BOARD_COMMON_E104_BT50XXA_TB + bool + select BOARD_COMMON_NRF52 + select HAS_PERIPH_I2C + select HAS_PERIPH_SPI + select HAS_PERIPH_UART + +source "$(RIOTBOARD)/common/nrf52/Kconfig" diff --git a/boards/common/e104-bt50xxa-tb/Makefile b/boards/common/e104-bt50xxa-tb/Makefile new file mode 100644 index 0000000000..25fe337df7 --- /dev/null +++ b/boards/common/e104-bt50xxa-tb/Makefile @@ -0,0 +1,3 @@ +MODULE = boards_common_e104_bt50xxa_tb + +include $(RIOTBASE)/Makefile.base diff --git a/boards/common/e104-bt50xxa-tb/Makefile.dep b/boards/common/e104-bt50xxa-tb/Makefile.dep new file mode 100644 index 0000000000..7317b22d44 --- /dev/null +++ b/boards/common/e104-bt50xxa-tb/Makefile.dep @@ -0,0 +1,5 @@ +ifneq (,$(filter saul_default,$(USEMODULE))) + USEMODULE += saul_gpio +endif + +include $(RIOTBOARD)/common/nrf52/Makefile.dep diff --git a/boards/common/e104-bt50xxa-tb/Makefile.features b/boards/common/e104-bt50xxa-tb/Makefile.features new file mode 100644 index 0000000000..d41ae96de9 --- /dev/null +++ b/boards/common/e104-bt50xxa-tb/Makefile.features @@ -0,0 +1,7 @@ +# Put defined MCU peripherals here (in alphabetical order) +FEATURES_PROVIDED += periph_i2c +FEATURES_PROVIDED += periph_spi +FEATURES_PROVIDED += periph_rtt +FEATURES_PROVIDED += periph_uart + +include $(RIOTBOARD)/common/nrf52/Makefile.features diff --git a/boards/common/e104-bt50xxa-tb/Makefile.include b/boards/common/e104-bt50xxa-tb/Makefile.include new file mode 100644 index 0000000000..4c917458dd --- /dev/null +++ b/boards/common/e104-bt50xxa-tb/Makefile.include @@ -0,0 +1,6 @@ +# external programmer required +DEBUG_ADAPTER ?= jlink + +INCLUDES += -I$(RIOTBOARD)/common/e104-bt50xxa-tb/include + +include $(RIOTBOARD)/common/nrf52/Makefile.include diff --git a/boards/e104-bt5010a-tb/board.c b/boards/common/e104-bt50xxa-tb/board.c similarity index 83% rename from boards/e104-bt5010a-tb/board.c rename to boards/common/e104-bt50xxa-tb/board.c index f12a16aec9..f052b65071 100644 --- a/boards/e104-bt5010a-tb/board.c +++ b/boards/common/e104-bt50xxa-tb/board.c @@ -7,11 +7,11 @@ */ /** - * @ingroup boards_e104-bt5010a-tb + * @ingroup boards_common_e104-bt50xxa-tb * @{ * * @file - * @brief Board initialization for the E104-BT5010A Test Board + * @brief Board initialization for the E104-BT50xxA Test Board * * @author Benjamin Valentin * diff --git a/boards/common/e104-bt50xxa-tb/doc.txt b/boards/common/e104-bt50xxa-tb/doc.txt new file mode 100644 index 0000000000..45ee1ed771 --- /dev/null +++ b/boards/common/e104-bt50xxa-tb/doc.txt @@ -0,0 +1,6 @@ +/** + @defgroup boards_common_e104-bt50xxa-tb E104-BT50xxA-TB common code + @ingroup boards_common + @brief Support for EBYTE nRF52 module breakout boards + + */ diff --git a/boards/e104-bt5010a-tb/include/board.h b/boards/common/e104-bt50xxa-tb/include/board.h similarity index 92% rename from boards/e104-bt5010a-tb/include/board.h rename to boards/common/e104-bt50xxa-tb/include/board.h index ef3ac4fec1..058aadd643 100644 --- a/boards/e104-bt5010a-tb/include/board.h +++ b/boards/common/e104-bt50xxa-tb/include/board.h @@ -7,11 +7,11 @@ */ /** - * @ingroup boards_e104-bt5010a-tb + * @ingroup boards_common_e104-bt50xxa-tb * @{ * * @file - * @brief Board specific configuration for the E104-BT5010A Test Board + * @brief Board specific configuration for the E104-BT50xxA Test Board * * @author Benjamin Valentin */ diff --git a/boards/e104-bt5010a-tb/include/gpio_params.h b/boards/common/e104-bt50xxa-tb/include/gpio_params.h similarity index 96% rename from boards/e104-bt5010a-tb/include/gpio_params.h rename to boards/common/e104-bt50xxa-tb/include/gpio_params.h index 5beeceab94..1ef05f286d 100644 --- a/boards/e104-bt5010a-tb/include/gpio_params.h +++ b/boards/common/e104-bt50xxa-tb/include/gpio_params.h @@ -7,7 +7,7 @@ */ /** - * @ingroup boards_e104-bt5010a-tb + * @ingroup boards_common_e104-bt50xxa-tb * @{ * * @file diff --git a/boards/e104-bt5010a-tb/include/periph_conf.h b/boards/common/e104-bt50xxa-tb/include/periph_conf.h similarity index 88% rename from boards/e104-bt5010a-tb/include/periph_conf.h rename to boards/common/e104-bt50xxa-tb/include/periph_conf.h index 48a6614d37..33f8632ab9 100644 --- a/boards/e104-bt5010a-tb/include/periph_conf.h +++ b/boards/common/e104-bt50xxa-tb/include/periph_conf.h @@ -7,11 +7,11 @@ */ /** - * @ingroup boards_e104-bt5010a-tb + * @ingroup boards_common_e104-bt50xxa-tb * @{ * * @file - * @brief Peripheral configuration for the E104-BT5010A Test Board + * @brief Peripheral configuration for the E104-BT50xxA Test Board * * @author Benjamin Valentin * @@ -30,10 +30,10 @@ extern "C" { /** * @name Clock configuration - * The E104-BT5010A module does not have any external oscillators + * The E104-BT50xxA module does not have any external oscillators * @{ */ -#define CLOCK_HFCLK (0U) /* internal RC oscillator */ +#define CLOCK_HFCLK (1) /* external crystal */ #define CLOCK_LFCLK (0) /* internal RC oscillator */ /** @} */ diff --git a/boards/e104-bt5010a-tb/Kconfig b/boards/e104-bt5010a-tb/Kconfig index 6072ff6d69..b6127d2827 100644 --- a/boards/e104-bt5010a-tb/Kconfig +++ b/boards/e104-bt5010a-tb/Kconfig @@ -10,10 +10,7 @@ config BOARD config BOARD_E104_BT5010A_TB bool default y - select BOARD_COMMON_NRF52 + select BOARD_COMMON_E104_BT50XXA_TB select CPU_MODEL_NRF52810XXAA - select HAS_PERIPH_I2C - select HAS_PERIPH_SPI - select HAS_PERIPH_UART -source "$(RIOTBOARD)/common/nrf52/Kconfig" +source "$(RIOTBOARD)/common/e104-bt50xxa-tb/Kconfig" diff --git a/boards/e104-bt5010a-tb/Makefile b/boards/e104-bt5010a-tb/Makefile index 72ba6f3624..e3e754831f 100644 --- a/boards/e104-bt5010a-tb/Makefile +++ b/boards/e104-bt5010a-tb/Makefile @@ -1,2 +1,5 @@ MODULE = board + +DIRS = $(RIOTBOARD)/common/e104-bt50xxa-tb + include $(RIOTBASE)/Makefile.base diff --git a/boards/e104-bt5010a-tb/Makefile.dep b/boards/e104-bt5010a-tb/Makefile.dep index 7317b22d44..d5b015b176 100644 --- a/boards/e104-bt5010a-tb/Makefile.dep +++ b/boards/e104-bt5010a-tb/Makefile.dep @@ -1,5 +1,3 @@ -ifneq (,$(filter saul_default,$(USEMODULE))) - USEMODULE += saul_gpio -endif +USEMODULE += boards_common_e104_bt50xxa_tb -include $(RIOTBOARD)/common/nrf52/Makefile.dep +include $(RIOTBOARD)/common/e104-bt50xxa-tb/Makefile.dep diff --git a/boards/e104-bt5010a-tb/Makefile.features b/boards/e104-bt5010a-tb/Makefile.features index c8ce63bcd0..09529b5ad5 100644 --- a/boards/e104-bt5010a-tb/Makefile.features +++ b/boards/e104-bt5010a-tb/Makefile.features @@ -1,9 +1,3 @@ CPU_MODEL = nrf52810xxaa -# Put defined MCU peripherals here (in alphabetical order) -FEATURES_PROVIDED += periph_i2c -FEATURES_PROVIDED += periph_spi -FEATURES_PROVIDED += periph_rtt -FEATURES_PROVIDED += periph_uart - -include $(RIOTBOARD)/common/nrf52/Makefile.features +include $(RIOTBOARD)/common/e104-bt50xxa-tb/Makefile.features diff --git a/boards/e104-bt5010a-tb/Makefile.include b/boards/e104-bt5010a-tb/Makefile.include index a182868c3e..f3dda365ba 100644 --- a/boards/e104-bt5010a-tb/Makefile.include +++ b/boards/e104-bt5010a-tb/Makefile.include @@ -1,4 +1 @@ -# external programmer required -DEBUG_ADAPTER ?= jlink - -include $(RIOTBOARD)/common/nrf52/Makefile.include +include $(RIOTBOARD)/common/e104-bt50xxa-tb/Makefile.include