From 84ebd83a62b3523ccc9aedce6d376749d0f4ba1b Mon Sep 17 00:00:00 2001
From: Semjon Kerner <semjon.kerner@fu-berlin.de>
Date: Mon, 4 Mar 2019 13:20:46 +0100
Subject: [PATCH] boards/nrf52840dk: support ieee802.15.4 radio

---
 boards/common/nrf52/Makefile.dep                | 2 ++
 boards/common/nrf52/include/cfg_timer_default.h | 7 +++++++
 boards/nrf52840dk/Makefile.dep                  | 6 ++++++
 boards/nrf52840dk/Makefile.features             | 4 ++++
 4 files changed, 19 insertions(+)

diff --git a/boards/common/nrf52/Makefile.dep b/boards/common/nrf52/Makefile.dep
index b9f6fc79e5..6f369896e7 100644
--- a/boards/common/nrf52/Makefile.dep
+++ b/boards/common/nrf52/Makefile.dep
@@ -1,3 +1,5 @@
+include $(RIOTCPU)/nrf52/Makefile.dep
+
 ifneq (,$(filter skald,$(USEMODULE)))
   USEMODULE += nrfble
 endif
diff --git a/boards/common/nrf52/include/cfg_timer_default.h b/boards/common/nrf52/include/cfg_timer_default.h
index 43f61d1a6a..8dd673806f 100644
--- a/boards/common/nrf52/include/cfg_timer_default.h
+++ b/boards/common/nrf52/include/cfg_timer_default.h
@@ -36,10 +36,17 @@ static const timer_conf_t timer_config[] = {
         .channels = 3,
         .bitmode  = TIMER_BITMODE_BITMODE_32Bit,
         .irqn     = TIMER1_IRQn
+    },
+    {
+        .dev      = NRF_TIMER2,
+        .channels = 3,
+        .bitmode  = TIMER_BITMODE_BITMODE_08Bit,
+        .irqn     = TIMER2_IRQn
     }
 };
 
 #define TIMER_0_ISR         isr_timer1
+#define TIMER_1_ISR         isr_timer2
 
 #define TIMER_NUMOF         (sizeof(timer_config) / sizeof(timer_config[0]))
 /** @} */
diff --git a/boards/nrf52840dk/Makefile.dep b/boards/nrf52840dk/Makefile.dep
index 68628f406a..f75b7b047c 100644
--- a/boards/nrf52840dk/Makefile.dep
+++ b/boards/nrf52840dk/Makefile.dep
@@ -1 +1,7 @@
 include $(RIOTBOARD)/common/nrf52xxxdk/Makefile.dep
+
+ifneq (,$(filter gnrc_netdev_default netdev_default,$(USEMODULE)))
+  ifeq (,$(filter nrfmin,$(USEMODULE)))
+    USEMODULE += nrf802154
+  endif
+endif
diff --git a/boards/nrf52840dk/Makefile.features b/boards/nrf52840dk/Makefile.features
index b99cfa472a..4ab48c7cbc 100644
--- a/boards/nrf52840dk/Makefile.features
+++ b/boards/nrf52840dk/Makefile.features
@@ -1 +1,5 @@
 include $(RIOTBOARD)/common/nrf52xxxdk/Makefile.features
+
+# Various other features (if any)
+FEATURES_PROVIDED += radio_nrf802154
+FEATURES_PROVIDED += periph_pwm
-- 
GitLab