1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #18811 from maribu/boards/common/nrf52

boards/common/nrf52: improve default clock config
This commit is contained in:
Koen Zandberg 2022-11-21 09:33:47 +00:00 committed by GitHub
commit 64dcfd67ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,6 +20,7 @@
#ifndef CFG_TIMER_DEFAULT_H #ifndef CFG_TIMER_DEFAULT_H
#define CFG_TIMER_DEFAULT_H #define CFG_TIMER_DEFAULT_H
#include "kernel_defines.h"
#include "periph_cpu.h" #include "periph_cpu.h"
#ifdef __cplusplus #ifdef __cplusplus
@ -30,34 +31,45 @@ extern "C" {
* @name Timer configuration * @name Timer configuration
* @{ * @{
*/ */
/**
* @brief Configuration of the exposed timers
*
* @warning The timer `NRF802154_TIMER`, which by default is `TIMER_DEV(1)`,
* is used for the IEEE 802.15.4 driver
*/
static const timer_conf_t timer_config[] = { static const timer_conf_t timer_config[] = {
{ {
.dev = NRF_TIMER1, .dev = NRF_TIMER1,
.channels = 3, .channels = 4,
.bitmode = TIMER_BITMODE_BITMODE_32Bit, .bitmode = TIMER_BITMODE_BITMODE_32Bit,
.irqn = TIMER1_IRQn .irqn = TIMER1_IRQn
}, },
{ {
/* BEWARE: This timer is allocated to the nRF52 IEEE 802.15.4 driver.
* Do not use this timer (unless you do not use IEEE 802.15.4
* networking)!
*/
.dev = NRF_TIMER2, .dev = NRF_TIMER2,
.channels = 3, .channels = 4,
.bitmode = TIMER_BITMODE_BITMODE_08Bit, .bitmode = TIMER_BITMODE_BITMODE_32Bit,
.irqn = TIMER2_IRQn .irqn = TIMER2_IRQn
}, },
/* The later timers are only present on the larger NRF52 CPUs like NRF52840 /* The later timers are only present on the larger NRF52 CPUs like NRF52840
* or NRF52833, but not small ones like NRF52810 */ * or NRF52833, but not small ones like NRF52810. They do have 2 channels
* more (CC registers [0..5] instead of CC registers [0..3]). */
#ifdef NRF_TIMER3 #ifdef NRF_TIMER3
{ {
.dev = NRF_TIMER3, .dev = NRF_TIMER3,
.channels = 3, .channels = 6,
.bitmode = TIMER_BITMODE_BITMODE_08Bit, .bitmode = TIMER_BITMODE_BITMODE_32Bit,
.irqn = TIMER3_IRQn .irqn = TIMER3_IRQn
}, },
#endif #endif
#ifdef NRF_TIMER4 #ifdef NRF_TIMER4
{ {
.dev = NRF_TIMER4, .dev = NRF_TIMER4,
.channels = 3, .channels = 6,
.bitmode = TIMER_BITMODE_BITMODE_08Bit, .bitmode = TIMER_BITMODE_BITMODE_32Bit,
.irqn = TIMER4_IRQn .irqn = TIMER4_IRQn
} }
#endif #endif