mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 04:52:59 +01:00
boards/common/nrf51: introduce common location
This commit is contained in:
parent
21efb20184
commit
84cdab8c0b
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014 Christian Mehlis <mehlis@inf.fu-berlin.de>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup boards_airfy-beacon
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Board specific implementations for the Airfy Beacon board
|
||||
*
|
||||
* @author Christian Mehlis <mehlis@inf.fu-berlin.de>
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include "board.h"
|
||||
#include "cpu.h"
|
||||
|
||||
void board_init(void)
|
||||
{
|
||||
/* initialize the CPU */
|
||||
cpu_init();
|
||||
}
|
3
boards/common/nrf51/Makefile
Normal file
3
boards/common/nrf51/Makefile
Normal file
@ -0,0 +1,3 @@
|
||||
MODULE = boards_common_nrf51
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
3
boards/common/nrf51/Makefile.dep
Normal file
3
boards/common/nrf51/Makefile.dep
Normal file
@ -0,0 +1,3 @@
|
||||
ifneq (,$(filter gnrc_netdev_default netdev_default,$(USEMODULE)))
|
||||
USEMODULE += nrfmin
|
||||
endif
|
5
boards/common/nrf51/Makefile.features
Normal file
5
boards/common/nrf51/Makefile.features
Normal file
@ -0,0 +1,5 @@
|
||||
# Put defined MCU peripherals here (in alphabetical order)
|
||||
FEATURES_PROVIDED += periph_rtt
|
||||
FEATURES_PROVIDED += periph_timer
|
||||
|
||||
-include $(RIOTCPU)/nrf51/Makefile.features
|
18
boards/common/nrf51/Makefile.include
Normal file
18
boards/common/nrf51/Makefile.include
Normal file
@ -0,0 +1,18 @@
|
||||
# define the used CPU
|
||||
export CPU = nrf51
|
||||
|
||||
# setup serial terminal
|
||||
include $(RIOTMAKE)/tools/serial.inc.mk
|
||||
|
||||
# include common nrf51 headers
|
||||
INCLUDES += -I$(RIOTBOARD)/common/nrf51/include
|
||||
|
||||
ifeq ($(PROGRAMMER),openocd)
|
||||
# use common openocd configuration for nrf51
|
||||
export OPENOCD_CONFIG = $(RIOTBOARD)/common/nrf51/dist/openocd.cfg
|
||||
include $(RIOTMAKE)/tools/openocd.inc.mk
|
||||
else ifeq ($(PROGRAMMER),jlink)
|
||||
# setup JLink for flashing
|
||||
export JLINK_DEVICE := nrf51822
|
||||
include $(RIOTMAKE)/tools/jlink.inc.mk
|
||||
endif
|
@ -7,11 +7,11 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup boards_yunjia-nrf51822
|
||||
* @ingroup boards_common_nrf51
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Board specific implementations for the Yunjia NRF51822 board
|
||||
* @brief Board initialization for the nRF51 based boards
|
||||
*
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
*
|
50
boards/common/nrf51/include/board_common.h
Normal file
50
boards/common/nrf51/include/board_common.h
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (C) 2017 Freie Universität Berlin
|
||||
* 2018 Inria
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup boards_common_nrf51 NRF51 common
|
||||
* @ingroup boards_common
|
||||
* @brief Shared files and configuration for some nRF51 boards.
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Shared configuration for some nRF51-based boards
|
||||
*
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
|
||||
*/
|
||||
|
||||
#ifndef BOARD_COMMON_H
|
||||
#define BOARD_COMMON_H
|
||||
|
||||
#include "cpu.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @name Xtimer configuration
|
||||
* @{
|
||||
*/
|
||||
#define XTIMER_WIDTH (24)
|
||||
#define XTIMER_BACKOFF (40)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Initialize the platform
|
||||
*/
|
||||
void board_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* BOARD_COMMON_H */
|
||||
/** @} */
|
56
boards/common/nrf51/include/periph_conf_common.h
Normal file
56
boards/common/nrf51/include/periph_conf_common.h
Normal file
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Inria
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup boards_common_nrf51
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Common peripheral MCU configuration for some nrf51 based boards
|
||||
*
|
||||
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
|
||||
*/
|
||||
|
||||
#ifndef PERIPH_CONF_COMMON_H
|
||||
#define PERIPH_CONF_COMMON_H
|
||||
|
||||
#include "periph_cpu.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @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 Real time counter configuration
|
||||
* @{
|
||||
*/
|
||||
#define RTT_NUMOF (1U)
|
||||
#define RTT_DEV (1) /* NRF_RTC1 */
|
||||
#define RTT_MAX_VALUE (0x00ffffff)
|
||||
#define RTT_FREQUENCY (1024)
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* PERIPH_CONF_COMMON_H */
|
3
boards/yunjia-nrf51822/dist/openocd.cfg
vendored
3
boards/yunjia-nrf51822/dist/openocd.cfg
vendored
@ -1,3 +0,0 @@
|
||||
set WORKAREASIZE 0x4000
|
||||
source [find target/nrf51.cfg]
|
||||
$_TARGETNAME configure -rtos auto
|
Loading…
Reference in New Issue
Block a user