From d2c8eab7936c622016ed5b5635f5e62483c2b0a4 Mon Sep 17 00:00:00 2001
From: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Date: Tue, 22 Jan 2019 15:46:33 +0100
Subject: [PATCH] boards/arduino*: Added/refactored params for W5100

- ATmega based boards: Added parameter for W5100 to board_common.h
- Arduino Due based boards: Use board.h instead of providing w5100_params.h
---
 .../arduino-atmega/include/board_common.h     | 12 ++++
 boards/common/arduino-due/include/board.h     | 12 ++++
 .../common/arduino-due/include/w5100_params.h | 63 -------------------
 3 files changed, 24 insertions(+), 63 deletions(-)
 delete mode 100644 boards/common/arduino-due/include/w5100_params.h

diff --git a/boards/common/arduino-atmega/include/board_common.h b/boards/common/arduino-atmega/include/board_common.h
index a433f164aa..d299e36df4 100644
--- a/boards/common/arduino-atmega/include/board_common.h
+++ b/boards/common/arduino-atmega/include/board_common.h
@@ -82,6 +82,18 @@ extern "C" {
 #define XTIMER_BACKOFF              (40)
 /** @} */
 
+/**
+ * @name    Configuration parameters for the W5100 driver
+ * @{
+ */
+#ifndef W5100_PARAM_CS
+#define W5100_PARAM_CS          (ARDUINO_PIN_10)
+#endif
+#ifndef W5100_PARAM_EVT
+#define W5100_PARAM_EVT         (ARDUINO_PIN_2)
+#endif
+/** @} */
+
 /**
  * @brief   Initialize board specific hardware, including clock, LEDs and std-IO
  */
diff --git a/boards/common/arduino-due/include/board.h b/boards/common/arduino-due/include/board.h
index cdc1f5cf9b..f63b897ac5 100644
--- a/boards/common/arduino-due/include/board.h
+++ b/boards/common/arduino-due/include/board.h
@@ -39,6 +39,18 @@ extern "C" {
 #define LED0_TOGGLE         ((PIOB->PIO_ODSR & PIO_PB27) ? LED0_OFF : LED0_ON)
 /** @} */
 
+/**
+ * @name    Configuration parameters for the W5100 driver
+ * @{
+ */
+#ifndef W5100_PARAM_CS
+#define W5100_PARAM_CS          (ARDUINO_PIN_10)
+#endif
+#ifndef W5100_PARAM_EVT
+#define W5100_PARAM_EVT         (ARDUINO_PIN_2)
+#endif
+/** @} */
+
 /**
  * @brief Initialize board specific hardware, including clock, LEDs and std-IO
  */
diff --git a/boards/common/arduino-due/include/w5100_params.h b/boards/common/arduino-due/include/w5100_params.h
deleted file mode 100644
index 032291900f..0000000000
--- a/boards/common/arduino-due/include/w5100_params.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2016-2017 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_arduino_due
- * @{
- *
- * @file
- * @brief       Parameters for W5100 Arduino Ehternet Shields (v4 and v5)
- *
- * @author      Hauke Petersen <hauke.petersen@fu-berlin.de>
- */
-
-#ifndef W5100_PARAMS_H
-#define W5100_PARAMS_H
-
-#include "arduino_pinmap.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @name    Configuration parameters for the W5100 driver
- * @{
- */
-#ifndef W5100_PARAM_SPI
-#define W5100_PARAM_SPI         (SPI_DEV(0))
-#endif
-#ifndef W5100_PARAM_SPI_CLK
-#define W5100_PARAM_SPI_CLK     (SPI_CLK_5MHZ)
-#endif
-#ifndef W5100_PARAM_CS
-#define W5100_PARAM_CS          (ARDUINO_PIN_10)
-#endif
-#ifndef W5100_PARAM_EVT
-#define W5100_PARAM_EVT         (ARDUINO_PIN_2)
-#endif
-/** @} */
-
-/**
- * @brief   W5100 configuration instance
- */
-static const  w5100_params_t w5100_params[] = {
-    {
-        .spi = W5100_PARAM_SPI,
-        .clk = W5100_PARAM_SPI_CLK,
-        .cs  = W5100_PARAM_CS,
-        .evt = W5100_PARAM_EVT
-    },
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* W5100_PARAMS_H */
-/** @} */
-- 
GitLab