1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:32:45 +01:00

boards/airfy-beacon: factorize common code

This commit is contained in:
Alexandre Abadie 2018-10-24 17:55:43 +02:00
parent 84cdab8c0b
commit 0842eb56ce
6 changed files with 17 additions and 63 deletions

View File

@ -1,3 +1,4 @@
MODULE = board MODULE = board
DIRS = $(RIOTBOARD)/common/nrf51
include $(RIOTBASE)/Makefile.base include $(RIOTBASE)/Makefile.base

View File

@ -1,3 +1 @@
ifneq (,$(filter gnrc_netdev_default netdev_default,$(USEMODULE))) include $(RIOTBOARD)/common/nrf51/Makefile.dep
USEMODULE += nrfmin
endif

View File

@ -1,15 +1,8 @@
# Put defined MCU peripherals here (in alphabetical order) # Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_adc FEATURES_PROVIDED += periph_adc
FEATURES_PROVIDED += periph_gpio periph_gpio_irq
FEATURES_PROVIDED += periph_i2c FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_rtt
FEATURES_PROVIDED += periph_spi FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart FEATURES_PROVIDED += periph_uart
# Various other features (if any) # include common nrf51 based boards features
include $(RIOTBOARD)/common/nrf51/Makefile.features
# The board MPU family (used for grouping by the CI system)
FEATURES_MCU_GROUP = cortex_m0_2
include $(RIOTCPU)/nrf51/Makefile.features

View File

@ -1,16 +1,18 @@
# define the used CPU # define the used CPU model
export CPU = nrf51
export CPU_MODEL = nrf51x22xxaa 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 # define the default port depending on the host OS
PORT_LINUX ?= /dev/ttyUSB0 PORT_LINUX ?= /dev/ttyUSB0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
# setup serial terminal # this board uses an ST-Link v2 debug adapter
include $(RIOTMAKE)/tools/serial.inc.mk DEBUG_ADAPTER ?= stlink
STLINK_VERSION ?= 2
export DEBUG_ADAPTER ?= stlink PROGRAMMER = openocd
export STLINK_VERSION ?= 2
# this board uses openocd # include nrf51 boards common configuration
include $(RIOTMAKE)/tools/openocd.inc.mk include $(RIOTBOARD)/common/nrf51/Makefile.include

View File

@ -19,27 +19,10 @@
#ifndef BOARD_H #ifndef BOARD_H
#define BOARD_H #define BOARD_H
#include "cpu.h" #include "board_common.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { 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" */
#endif #endif
#endif /* BOARD_H */ #endif /* BOARD_H */

View File

@ -21,6 +21,7 @@
#define PERIPH_CONF_H #define PERIPH_CONF_H
#include "periph_cpu.h" #include "periph_cpu.h"
#include "periph_conf_common.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -41,20 +42,6 @@
* 2: derived from HFCLK */ * 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 * @name UART configuration
* *
@ -66,16 +53,6 @@ static const timer_conf_t timer_config[] = {
#define UART_PIN_TX 18 #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 * @name SPI configuration
* @{ * @{