mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
boards/nrf51-based: split shared timer/rtt config
This commit is contained in:
parent
fcd7f2233a
commit
44625ecc1b
@ -21,8 +21,9 @@
|
||||
#define PERIPH_CONF_H
|
||||
|
||||
#include "periph_cpu.h"
|
||||
#include "periph_conf_common.h"
|
||||
#include "cfg_clock_16_1.h"
|
||||
#include "cfg_timer_012.h"
|
||||
#include "cfg_rtt_default.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -22,46 +22,13 @@
|
||||
|
||||
#include "periph_cpu.h"
|
||||
#include "cfg_clock_16_0.h"
|
||||
#include "cfg_timer_012.h"
|
||||
#include "cfg_rtt_default.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @name Timer configuration
|
||||
* @{
|
||||
*/
|
||||
static const timer_conf_t timer_config[] = {
|
||||
{
|
||||
.dev = NRF_TIMER0,
|
||||
.channels = 3,
|
||||
.bitmode = TIMER_BITMODE_BITMODE_24Bit,
|
||||
.irqn = TIMER0_IRQn
|
||||
},
|
||||
{
|
||||
.dev = NRF_TIMER1,
|
||||
.channels = 3,
|
||||
.bitmode = TIMER_BITMODE_BITMODE_16Bit,
|
||||
.irqn = TIMER1_IRQn
|
||||
}
|
||||
};
|
||||
|
||||
#define TIMER_0_ISR isr_timer0
|
||||
#define TIMER_1_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 UART configuration
|
||||
* @{
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Inria
|
||||
* 2019 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
|
||||
@ -11,34 +12,19 @@
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Common peripheral MCU configuration for some nrf51 based boards
|
||||
* @brief Shared default RTT configuration for nRF51-based boards
|
||||
*
|
||||
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
*/
|
||||
|
||||
#ifndef PERIPH_CONF_COMMON_H
|
||||
#define PERIPH_CONF_COMMON_H
|
||||
|
||||
#include "periph_cpu.h"
|
||||
#ifndef CFG_RTT_DEFAULT_H
|
||||
#define CFG_RTT_DEFAULT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
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
|
||||
* @{
|
||||
@ -53,4 +39,4 @@ static const timer_conf_t timer_config[] = {
|
||||
} /* end extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* PERIPH_CONF_COMMON_H */
|
||||
#endif /* CFG_RTT_DEFAULT_H */
|
59
boards/common/nrf51/include/cfg_timer_01.h
Normal file
59
boards/common/nrf51/include/cfg_timer_01.h
Normal file
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Inria
|
||||
* 2019 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_common_nrf51
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Shared timer peripheral configuration mapping timers 0 and 1
|
||||
*
|
||||
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
*/
|
||||
|
||||
#ifndef CFG_TIMER_01_H
|
||||
#define CFG_TIMER_01_H
|
||||
|
||||
#include "periph_cpu.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @name Timer configuration
|
||||
* @{
|
||||
*/
|
||||
static const timer_conf_t timer_config[] = {
|
||||
{
|
||||
.dev = NRF_TIMER0,
|
||||
.channels = 3,
|
||||
.bitmode = TIMER_BITMODE_BITMODE_24Bit,
|
||||
.irqn = TIMER0_IRQn,
|
||||
},
|
||||
{
|
||||
.dev = NRF_TIMER1,
|
||||
.channels = 3,
|
||||
.bitmode = TIMER_BITMODE_BITMODE_16Bit,
|
||||
.irqn = TIMER1_IRQn,
|
||||
}
|
||||
};
|
||||
|
||||
#define TIMER_0_ISR isr_timer0
|
||||
#define TIMER_1_ISR isr_timer1
|
||||
|
||||
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CFG_TIMER_01_H */
|
66
boards/common/nrf51/include/cfg_timer_012.h
Normal file
66
boards/common/nrf51/include/cfg_timer_012.h
Normal file
@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Inria
|
||||
* 2019 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_common_nrf51
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Shared timer peripheral configuration mapping timers 0, 1, and 2
|
||||
*
|
||||
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
*/
|
||||
|
||||
#ifndef CFG_TIMER_012_H
|
||||
#define CFG_TIMER_012_H
|
||||
|
||||
#include "periph_cpu.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @name Timer configuration
|
||||
* @{
|
||||
*/
|
||||
static const timer_conf_t timer_config[] = {
|
||||
{
|
||||
.dev = NRF_TIMER0,
|
||||
.channels = 3,
|
||||
.bitmode = TIMER_BITMODE_BITMODE_24Bit,
|
||||
.irqn = TIMER0_IRQn,
|
||||
},
|
||||
{
|
||||
.dev = NRF_TIMER1,
|
||||
.channels = 3,
|
||||
.bitmode = TIMER_BITMODE_BITMODE_16Bit,
|
||||
.irqn = TIMER1_IRQn,
|
||||
},
|
||||
{
|
||||
.dev = NRF_TIMER2,
|
||||
.channels = 3,
|
||||
.bitmode = TIMER_BITMODE_BITMODE_16Bit,
|
||||
.irqn = TIMER2_IRQn,
|
||||
}
|
||||
};
|
||||
|
||||
#define TIMER_0_ISR isr_timer0
|
||||
#define TIMER_1_ISR isr_timer1
|
||||
#define TIMER_2_ISR isr_timer2
|
||||
|
||||
#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* CFG_TIMER_012_H */
|
@ -21,53 +21,13 @@
|
||||
|
||||
#include "periph_cpu.h"
|
||||
#include "cfg_clock_16_0.h"
|
||||
#include "cfg_timer_012.h"
|
||||
#include "cfg_rtt_default.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @name Timer configuration
|
||||
* @{
|
||||
*/
|
||||
static const timer_conf_t timer_config[] = {
|
||||
{
|
||||
.dev = NRF_TIMER0,
|
||||
.channels = 3,
|
||||
.bitmode = TIMER_BITMODE_BITMODE_24Bit,
|
||||
.irqn = TIMER0_IRQn
|
||||
},
|
||||
{
|
||||
.dev = NRF_TIMER1,
|
||||
.channels = 3,
|
||||
.bitmode = TIMER_BITMODE_BITMODE_16Bit,
|
||||
.irqn = TIMER1_IRQn
|
||||
},
|
||||
{
|
||||
.dev = NRF_TIMER2,
|
||||
.channels = 3,
|
||||
.bitmode = TIMER_BITMODE_BITMODE_16Bit,
|
||||
.irqn = TIMER2_IRQn
|
||||
}
|
||||
};
|
||||
|
||||
#define TIMER_0_ISR isr_timer0
|
||||
#define TIMER_1_ISR isr_timer1
|
||||
#define TIMER_2_ISR isr_timer2
|
||||
|
||||
#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 UART configuration
|
||||
* @{
|
||||
|
@ -20,8 +20,9 @@
|
||||
#define PERIPH_CONF_H
|
||||
|
||||
#include "periph_cpu.h"
|
||||
#include "periph_conf_common.h"
|
||||
#include "cfg_clock_16_1.h"
|
||||
#include "cfg_timer_012.h"
|
||||
#include "cfg_rtt_default.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -20,8 +20,9 @@
|
||||
#define PERIPH_CONF_H
|
||||
|
||||
#include "periph_cpu.h"
|
||||
#include "periph_conf_common.h"
|
||||
#include "cfg_clock_16_1.h"
|
||||
#include "cfg_timer_012.h"
|
||||
#include "cfg_rtt_default.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -23,8 +23,9 @@
|
||||
#define PERIPH_CONF_H
|
||||
|
||||
#include "periph_cpu.h"
|
||||
#include "periph_conf_common.h"
|
||||
#include "cfg_clock_16_1.h"
|
||||
#include "cfg_timer_012.h"
|
||||
#include "cfg_rtt_default.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -20,8 +20,9 @@
|
||||
#define PERIPH_CONF_H
|
||||
|
||||
#include "periph_cpu.h"
|
||||
#include "periph_conf_common.h"
|
||||
#include "cfg_clock_16_0.h"
|
||||
#include "cfg_timer_012.h"
|
||||
#include "cfg_rtt_default.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
Loading…
Reference in New Issue
Block a user