mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
boards: add support for nrf52-base RuuviTag
This commit is contained in:
parent
45e0468ea4
commit
2b815a385a
4
boards/ruuvitag/Makefile
Normal file
4
boards/ruuvitag/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
MODULE = board
|
||||
DIRS = $(RIOTBOARD)/common/nrf52xxxdk
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
11
boards/ruuvitag/Makefile.dep
Normal file
11
boards/ruuvitag/Makefile.dep
Normal file
@ -0,0 +1,11 @@
|
||||
include $(RIOTBOARD)/common/nrf52xxxdk/Makefile.dep
|
||||
|
||||
ifneq (,$(filter saul_default,$(USEMODULE)))
|
||||
# TODO: enable drivers once their adaption/implementations are merged
|
||||
# USEMODULE += bme280_spi
|
||||
# USEMODULE += lis2dh12_spi
|
||||
endif
|
||||
|
||||
ifneq (,$(filter gnrc_netdev_default,$(USEMODULE)))
|
||||
USEMODULE += nrfmin
|
||||
endif
|
14
boards/ruuvitag/Makefile.features
Normal file
14
boards/ruuvitag/Makefile.features
Normal file
@ -0,0 +1,14 @@
|
||||
# Put defined MCU peripherals here (in alphabetical order)
|
||||
FEATURES_PROVIDED += periph_gpio
|
||||
FEATURES_PROVIDED += periph_rtt
|
||||
FEATURES_PROVIDED += periph_spi
|
||||
FEATURES_PROVIDED += periph_timer
|
||||
FEATURES_PROVIDED += periph_uart
|
||||
|
||||
# Various other features (if any)
|
||||
FEATURES_PROVIDED += radio_nrfmin
|
||||
|
||||
# The board MPU family (used for grouping by the CI system)
|
||||
FEATURES_MCU_GROUP = cortex_m4_3
|
||||
|
||||
-include $(RIOTCPU)/nrf52/Makefile.features
|
10
boards/ruuvitag/Makefile.include
Normal file
10
boards/ruuvitag/Makefile.include
Normal file
@ -0,0 +1,10 @@
|
||||
# CPU configuration
|
||||
CPU_MODEL = nrf52832xxaa
|
||||
|
||||
# for this board, we are using Segger's RTT as default terminal interface
|
||||
USEMODULE += rtt_stdio
|
||||
TERMPROG = $(RIOTBASE)/dist/tools/jlink/jlink.sh
|
||||
TERMFLAGS = term_rtt
|
||||
|
||||
# use shared Makefile.include
|
||||
include $(RIOTBOARD)/common/nrf52xxxdk/Makefile.include
|
85
boards/ruuvitag/include/board.h
Normal file
85
boards/ruuvitag/include/board.h
Normal file
@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Feie Universität Berlin
|
||||
*
|
||||
* 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_ruuvitag RuuviTag
|
||||
* @ingroup boards
|
||||
* @brief Board specific configuration for the RuuviTag board
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Board specific configuration for the RuuviTag board
|
||||
*
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
*/
|
||||
|
||||
#ifndef BOARD_H
|
||||
#define BOARD_H
|
||||
|
||||
#include "cpu.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @name LED pin configuration
|
||||
* @{
|
||||
*/
|
||||
#define LED0_PIN GPIO_PIN(0, 17)
|
||||
#define LED1_PIN GPIO_PIN(0, 19)
|
||||
|
||||
#define LED_PORT NRF_P0
|
||||
#define LED0_MASK (1 << 17)
|
||||
#define LED1_MASK (1 << 19)
|
||||
#define LED_MASK (LED0_MASK | LED1_MASK)
|
||||
|
||||
#define LED0_ON (LED_PORT->OUTCLR = LED0_MASK)
|
||||
#define LED0_OFF (LED_PORT->OUTSET = LED0_MASK)
|
||||
#define LED0_TOGGLE (LED_PORT->OUT ^= LED0_MASK)
|
||||
|
||||
#define LED1_ON (LED_PORT->OUTCLR = LED1_MASK)
|
||||
#define LED1_OFF (LED_PORT->OUTSET = LED1_MASK)
|
||||
#define LED1_TOGGLE (LED_PORT->OUT ^= LED1_MASK)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name Button pin configuration
|
||||
* @{
|
||||
*/
|
||||
#define BTN0_PIN GPIO_PIN(0, 13)
|
||||
#define BTN0_MODE GPIO_IN_PU
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name Environmental sensor configuration (Bosch BMX280)
|
||||
* @{
|
||||
*/
|
||||
#define BMX280_PARAM_CS GPIO_PIN(0, 3)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name Accelerometer configuration
|
||||
* @{
|
||||
*/
|
||||
#define LIS2DH12_PARAM_CS GPIO_PIN(0, 8)
|
||||
#define LIS2DH12_PARAM_INT1 GPIO_PIN(0, 2)
|
||||
#define LIS2DH12_PARAM_INT2 GPIO_PIN(0, 6)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Initialize board specific hardware
|
||||
*/
|
||||
void board_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* BOARD_H */
|
||||
/** @} */
|
100
boards/ruuvitag/include/periph_conf.h
Normal file
100
boards/ruuvitag/include/periph_conf.h
Normal file
@ -0,0 +1,100 @@
|
||||
/*
|
||||
* Copyright (C) 2017 Freie Universität Berlin
|
||||
*
|
||||
* 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_ruuvitag
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Peripheral configuration for the RuuviTag
|
||||
*
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef PERIPH_CONF_H
|
||||
#define PERIPH_CONF_H
|
||||
|
||||
#include "periph_cpu.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @name Clock configuration
|
||||
*
|
||||
* @note The radio will not work with the internal RC oscillator!
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
#define CLOCK_HFCLK (32U) /* set to 0: internal RC oscillator
|
||||
* 32: 32MHz crystal */
|
||||
#define CLOCK_LFCLK (1) /* set to 0: internal RC oscillator
|
||||
* 1: 32.768 kHz crystal
|
||||
* 2: derived from HFCLK */
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name Timer configuration
|
||||
* @{
|
||||
*/
|
||||
static const timer_conf_t timer_config[] = {
|
||||
{
|
||||
.dev = NRF_TIMER1,
|
||||
.channels = 3,
|
||||
.bitmode = TIMER_BITMODE_BITMODE_32Bit,
|
||||
.irqn = TIMER1_IRQn
|
||||
}
|
||||
};
|
||||
|
||||
#define TIMER_0_ISR isr_timer1
|
||||
|
||||
#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)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name SPI configuration
|
||||
* @{
|
||||
*/
|
||||
static const spi_conf_t spi_config[] = {
|
||||
{
|
||||
.dev = NRF_SPI0,
|
||||
.sclk = 29,
|
||||
.mosi = 25,
|
||||
.miso = 28,
|
||||
}
|
||||
};
|
||||
|
||||
#define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name UART configuration
|
||||
* @{
|
||||
*/
|
||||
#define UART_NUMOF (1U)
|
||||
#define UART_PIN_RX GPIO_PIN(0, 4)
|
||||
#define UART_PIN_TX GPIO_PIN(0, 5)
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* PERIPH_CONF_H */
|
Loading…
Reference in New Issue
Block a user