From 346810ce12164c583bf89a5823c571c4ab0f975c Mon Sep 17 00:00:00 2001
From: Hauke Petersen <hauke.petersen@fu-berlin.de>
Date: Sat, 23 Aug 2014 17:31:29 +0200
Subject: [PATCH] boards: added SPI definitions for NRF based boards

added SPI defines for
- yunjia-nrf51822
- pca10005
- airfy-beacon
---
 boards/airfy-beacon/Makefile.features        |  3 ++-
 boards/airfy-beacon/include/periph_conf.h    | 15 +++++++++++++
 boards/pca10005/Makefile.features            |  3 ++-
 boards/pca10005/include/periph_conf.h        | 22 +++++++++++++++++++
 boards/yunjia-nrf51822/Makefile.features     |  3 ++-
 boards/yunjia-nrf51822/include/periph_conf.h | 23 ++++++++++++++++++++
 6 files changed, 66 insertions(+), 3 deletions(-)

diff --git a/boards/airfy-beacon/Makefile.features b/boards/airfy-beacon/Makefile.features
index f7dc503f5c..7444aa3910 100644
--- a/boards/airfy-beacon/Makefile.features
+++ b/boards/airfy-beacon/Makefile.features
@@ -1,3 +1,4 @@
 FEATURES_PROVIDED += cpp
-FEATURES_PROVIDED += periph_uart periph_gpio periph_random periph_rtt periph_cpuid
+FEATURES_PROVIDED += periph_uart periph_gpio periph_random periph_rtt \
+                     periph_cpuid periph_spi
 FEATURES_MCU_GROUP = cortex_m0
diff --git a/boards/airfy-beacon/include/periph_conf.h b/boards/airfy-beacon/include/periph_conf.h
index e9dd02ebc4..198b85e99b 100644
--- a/boards/airfy-beacon/include/periph_conf.h
+++ b/boards/airfy-beacon/include/periph_conf.h
@@ -108,6 +108,21 @@
 #define RANDOM_NUMOF        (1U)
 /** @} */
 
+/**
+ * @name SPI configuration
+ * @{
+ */
+#define SPI_NUMOF           (1U)
+#define SPI_0_EN            1
+#define SPI_IRQ_PRIO        1
+
+/* SPI_0 device configuration */
+#define SPI_0_DEV           NRF_SPI0
+#define SPI_0_PIN_MOSI      13
+#define SPI_0_PIN_MISO      14
+#define SPI_0_PIN_SCK       15
+/** @} */
+
 /**
  * @name GPIO configuration
  * @{
diff --git a/boards/pca10005/Makefile.features b/boards/pca10005/Makefile.features
index f7dc503f5c..7444aa3910 100644
--- a/boards/pca10005/Makefile.features
+++ b/boards/pca10005/Makefile.features
@@ -1,3 +1,4 @@
 FEATURES_PROVIDED += cpp
-FEATURES_PROVIDED += periph_uart periph_gpio periph_random periph_rtt periph_cpuid
+FEATURES_PROVIDED += periph_uart periph_gpio periph_random periph_rtt \
+                     periph_cpuid periph_spi
 FEATURES_MCU_GROUP = cortex_m0
diff --git a/boards/pca10005/include/periph_conf.h b/boards/pca10005/include/periph_conf.h
index 32bfa62a55..3548e0a964 100644
--- a/boards/pca10005/include/periph_conf.h
+++ b/boards/pca10005/include/periph_conf.h
@@ -108,6 +108,28 @@ extern "C" {
 #define RANDOM_NUMOF        (1U)
 /** @} */
 
+/**
+ * @name SPI configuration
+ * @{
+ */
+#define SPI_NUMOF           (2U)
+#define SPI_0_EN            1
+#define SPI_1_EN            1
+#define SPI_IRQ_PRIO        1
+
+/* SPI_0 device configuration */
+#define SPI_0_DEV           NRF_SPI0
+#define SPI_0_PIN_MOSI      17
+#define SPI_0_PIN_MISO      18
+#define SPI_0_PIN_SCK       19
+
+/* SPI_1 device configuration */
+#define SPI_1_DEV           NRF_SPI1
+#define SPI_1_PIN_MOSI      20
+#define SPI_1_PIN_MISO      21
+#define SPI_1_PIN_SCK       22
+/** @} */
+
 /**
  * @name GPIO configuration
  * @{
diff --git a/boards/yunjia-nrf51822/Makefile.features b/boards/yunjia-nrf51822/Makefile.features
index f7dc503f5c..7444aa3910 100644
--- a/boards/yunjia-nrf51822/Makefile.features
+++ b/boards/yunjia-nrf51822/Makefile.features
@@ -1,3 +1,4 @@
 FEATURES_PROVIDED += cpp
-FEATURES_PROVIDED += periph_uart periph_gpio periph_random periph_rtt periph_cpuid
+FEATURES_PROVIDED += periph_uart periph_gpio periph_random periph_rtt \
+                     periph_cpuid periph_spi
 FEATURES_MCU_GROUP = cortex_m0
diff --git a/boards/yunjia-nrf51822/include/periph_conf.h b/boards/yunjia-nrf51822/include/periph_conf.h
index 19bb6b83e5..f37ef58e57 100644
--- a/boards/yunjia-nrf51822/include/periph_conf.h
+++ b/boards/yunjia-nrf51822/include/periph_conf.h
@@ -106,6 +106,29 @@ extern "C" {
 #define RANDOM_NUMOF        (1U)
 /** @} */
 
+/**
+ * @name SPI configuration
+ * @{
+ */
+#define SPI_NUMOF           (2U)
+#define SPI_0_EN            1
+#define SPI_1_EN            1
+#define SPI_IRQ_PRIO        1
+
+/* SPI_0 device configuration */
+#define SPI_0_DEV           NRF_SPI0
+#define SPI_0_PIN_MOSI      17
+#define SPI_0_PIN_MISO      18
+#define SPI_0_PIN_SCK       19
+
+/* SPI_1 device configuration */
+#define SPI_1_DEV           NRF_SPI1
+#define SPI_1_PIN_MOSI      20
+#define SPI_1_PIN_MISO      21
+#define SPI_1_PIN_SCK       22
+/** @} */
+
+
 /**
  * @name GPIO configuration
  * @{
-- 
GitLab