diff --git a/boards/airfy-beacon/Makefile b/boards/airfy-beacon/Makefile index f8fcbb53a0..83d059dc34 100644 --- a/boards/airfy-beacon/Makefile +++ b/boards/airfy-beacon/Makefile @@ -1,3 +1,4 @@ MODULE = board +DIRS = $(RIOTBOARD)/common/nrf51 include $(RIOTBASE)/Makefile.base diff --git a/boards/airfy-beacon/Makefile.dep b/boards/airfy-beacon/Makefile.dep index 7de44689f6..babcd96228 100644 --- a/boards/airfy-beacon/Makefile.dep +++ b/boards/airfy-beacon/Makefile.dep @@ -1,3 +1 @@ -ifneq (,$(filter gnrc_netdev_default netdev_default,$(USEMODULE))) - USEMODULE += nrfmin -endif +include $(RIOTBOARD)/common/nrf51/Makefile.dep diff --git a/boards/airfy-beacon/Makefile.features b/boards/airfy-beacon/Makefile.features index 32008a8330..e5a4957546 100644 --- a/boards/airfy-beacon/Makefile.features +++ b/boards/airfy-beacon/Makefile.features @@ -1,15 +1,8 @@ # Put defined MCU peripherals here (in alphabetical order) FEATURES_PROVIDED += periph_adc -FEATURES_PROVIDED += periph_gpio periph_gpio_irq FEATURES_PROVIDED += periph_i2c -FEATURES_PROVIDED += periph_rtt FEATURES_PROVIDED += periph_spi -FEATURES_PROVIDED += periph_timer FEATURES_PROVIDED += periph_uart -# Various other features (if any) - -# The board MPU family (used for grouping by the CI system) -FEATURES_MCU_GROUP = cortex_m0_2 - -include $(RIOTCPU)/nrf51/Makefile.features +# include common nrf51 based boards features +include $(RIOTBOARD)/common/nrf51/Makefile.features diff --git a/boards/airfy-beacon/Makefile.include b/boards/airfy-beacon/Makefile.include index e4c6cac363..e73b42a69b 100644 --- a/boards/airfy-beacon/Makefile.include +++ b/boards/airfy-beacon/Makefile.include @@ -1,16 +1,18 @@ -# define the used CPU -export CPU = nrf51 +# define the used CPU model export CPU_MODEL = nrf51x22xxaa +# include common nrf51 boards module into the build +USEMODULE += boards_common_nrf51 + # define the default port depending on the host OS PORT_LINUX ?= /dev/ttyUSB0 PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) -# setup serial terminal -include $(RIOTMAKE)/tools/serial.inc.mk +# this board uses an ST-Link v2 debug adapter +DEBUG_ADAPTER ?= stlink +STLINK_VERSION ?= 2 -export DEBUG_ADAPTER ?= stlink -export STLINK_VERSION ?= 2 +PROGRAMMER = openocd -# this board uses openocd -include $(RIOTMAKE)/tools/openocd.inc.mk +# include nrf51 boards common configuration +include $(RIOTBOARD)/common/nrf51/Makefile.include diff --git a/boards/airfy-beacon/include/board.h b/boards/airfy-beacon/include/board.h index c83bd8d0ee..d5c83e217a 100644 --- a/boards/airfy-beacon/include/board.h +++ b/boards/airfy-beacon/include/board.h @@ -19,27 +19,10 @@ #ifndef BOARD_H #define BOARD_H -#include "cpu.h" +#include "board_common.h" #ifdef __cplusplus - extern "C" { -#endif - -/** - * @name Xtimer configuration - * @{ - */ -#define XTIMER_WIDTH (24) -#define XTIMER_BACKOFF (40) -/** @} */ - -/** - * @brief Initialize board specific hardware, including clock, LEDs and std-IO - */ -void board_init(void); - -#ifdef __cplusplus -} /* end extern "C" */ + extern "C" {} #endif #endif /* BOARD_H */ diff --git a/boards/airfy-beacon/include/periph_conf.h b/boards/airfy-beacon/include/periph_conf.h index 69d3f16bd6..916f3e5494 100644 --- a/boards/airfy-beacon/include/periph_conf.h +++ b/boards/airfy-beacon/include/periph_conf.h @@ -21,6 +21,7 @@ #define PERIPH_CONF_H #include "periph_cpu.h" +#include "periph_conf_common.h" #ifdef __cplusplus extern "C" { @@ -41,20 +42,6 @@ * 2: derived from HFCLK */ /** @} */ -/** - * @name Timer configuration - * @{ - */ -static const timer_conf_t timer_config[] = { - /* dev, channels, width */ - { NRF_TIMER0, 3, TIMER_BITMODE_BITMODE_24Bit, TIMER0_IRQn } -}; - -#define TIMER_0_ISR isr_timer0 - -#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0])) -/** @} */ - /** * @name UART configuration * @@ -66,16 +53,6 @@ static const timer_conf_t timer_config[] = { #define UART_PIN_TX 18 /** @} */ -/** - * @name Real time counter configuration - * @{ - */ -#define RTT_NUMOF (1U) -#define RTT_DEV (1) /* NRF_RTC1 */ -#define RTT_MAX_VALUE (0x00ffffff) -#define RTT_FREQUENCY (1024) -/** @} */ - /** * @name SPI configuration * @{