From c0ee92e776040534b3516a909a27c0024ee3cb3c Mon Sep 17 00:00:00 2001
From: Semjon Kerner <semjon.kerner@fu-berlin.de>
Date: Fri, 17 Aug 2018 15:49:28 +0200
Subject: [PATCH] boards/nrf52dk: add PWM configuration

---
 boards/common/nrf52xxxdk/include/periph_conf.h | 15 ++++++++++++++-
 boards/nrf52840dk/Makefile.features            |  2 ++
 boards/nrf52dk/Makefile.features               |  2 ++
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/boards/common/nrf52xxxdk/include/periph_conf.h b/boards/common/nrf52xxxdk/include/periph_conf.h
index fffedc3fe8..0230e23265 100644
--- a/boards/common/nrf52xxxdk/include/periph_conf.h
+++ b/boards/common/nrf52xxxdk/include/periph_conf.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016-2017 Freie Universität Berlin
+ * Copyright (C) 2016-2018 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
@@ -108,6 +108,19 @@ static const i2c_conf_t i2c_config[] = {
 #define I2C_NUMOF           (sizeof(i2c_config) / sizeof(i2c_config[0]))
 /** @} */
 
+#if defined(BOARD_NRF52DK) || defined(BOARD_NRF52840DK)
+/**
+ * @name   PWM configuration
+ * @{
+ */
+static const pwm_conf_t pwm_config[] = {
+    { NRF_PWM0, { 28, 29, 30, 31 } }
+};
+#define PWM_NUMOF           (sizeof(pwm_config) / sizeof(pwm_config[0]))
+/** @} */
+
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/boards/nrf52840dk/Makefile.features b/boards/nrf52840dk/Makefile.features
index b99cfa472a..7759727ffd 100644
--- a/boards/nrf52840dk/Makefile.features
+++ b/boards/nrf52840dk/Makefile.features
@@ -1 +1,3 @@
 include $(RIOTBOARD)/common/nrf52xxxdk/Makefile.features
+
+FEATURES_PROVIDED += periph_pwm
diff --git a/boards/nrf52dk/Makefile.features b/boards/nrf52dk/Makefile.features
index b99cfa472a..7759727ffd 100644
--- a/boards/nrf52dk/Makefile.features
+++ b/boards/nrf52dk/Makefile.features
@@ -1 +1,3 @@
 include $(RIOTBOARD)/common/nrf52xxxdk/Makefile.features
+
+FEATURES_PROVIDED += periph_pwm
-- 
GitLab