1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +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
DIRS = $(RIOTBOARD)/common/nrf51
include $(RIOTBASE)/Makefile.base

View File

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

View File

@ -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

View File

@ -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

View File

@ -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 */

View File

@ -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
* @{