From 6e3e99cf4d017d7e770b61c0429ef3d63b32eb6d Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Fri, 13 Nov 2015 16:33:50 +0100 Subject: [PATCH] tests/driver_at86rf2xx: use default atrf_params.h --- tests/driver_at86rf2xx/Makefile | 42 +++----------- tests/driver_at86rf2xx/at86rf2xx_params.h | 70 ----------------------- 2 files changed, 9 insertions(+), 103 deletions(-) delete mode 100644 tests/driver_at86rf2xx/at86rf2xx_params.h diff --git a/tests/driver_at86rf2xx/Makefile b/tests/driver_at86rf2xx/Makefile index 95926b6e97..03f6c10e65 100644 --- a/tests/driver_at86rf2xx/Makefile +++ b/tests/driver_at86rf2xx/Makefile @@ -13,45 +13,21 @@ USEMODULE += shell USEMODULE += shell_commands USEMODULE += ps -# define parameters for selected boards +# define the driver to be used for selected boards ifneq (,$(filter samr21-xpro,$(BOARD))) - DRIVER := at86rf233 - USE_BOARD_PARAMETERS := true + DRIVER := at86rf233 endif ifneq (,$(filter iotlab-m3 fox,$(BOARD))) - DRIVER := at86rf231 - USE_BOARD_PARAMETERS := true + DRIVER := at86rf231 +endif +ifneq (,$(filter mulle,$(BOARD))) + DRIVER := at86rf212b endif -# only set specific parameters if not using board configuration -ifneq (true,$(USE_BOARD_PARAMETERS)) +# use the at86rf231 as fallback device +DRIVER ?= at86rf231 - # set default device parameters in case they are undefined - DRIVER ?= at86rf231 - ATRF_SPI ?= SPI_0 - ATRF_SPI_SPEED ?= SPI_SPEED_5MHZ - ATRF_CS ?= GPIO_PIN\(0,0\) - ATRF_INT ?= GPIO_PIN\(0,1\) - ATRF_SLEEP ?= GPIO_PIN\(0,2\) - ATRF_RESET ?= GPIO_PIN\(0,3\) - - # export parameters - CFLAGS += -DATRF_SPI=$(ATRF_SPI) - CFLAGS += -DATRF_SPI_SPEED=$(ATRF_SPI_SPEED) - CFLAGS += -DATRF_CS=$(ATRF_CS) - CFLAGS += -DATRF_INT=$(ATRF_INT) - CFLAGS += -DATRF_SLEEP=$(ATRF_SLEEP) - CFLAGS += -DATRF_RESET=$(ATRF_RESET) - - # This adds . to include path so generic at86rf2xx_params.h gets picked - # up. All boards actually having such a device on board should define - # USE_BOARD_PARAMETERS=true above to skip this step, as the board provides - # this header. - CFLAGS += -I$(CURDIR) - -endif - -# finally include the actual chosen driver +# include the selected driver USEMODULE += $(DRIVER) CFLAGS += -DDEVELHELP diff --git a/tests/driver_at86rf2xx/at86rf2xx_params.h b/tests/driver_at86rf2xx/at86rf2xx_params.h deleted file mode 100644 index ae89a65e0d..0000000000 --- a/tests/driver_at86rf2xx/at86rf2xx_params.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2015 Kaspar Schleiser - * - * 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 tests_at86rf2xx - * @brief generic at86rf231 pin config - * - * @{ - * @file - * - * @author Kaspar Schleiser - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef AT86RF2XX_PARAMS_H -#define AT86RF2XX_PARAMS_H - -/** - * @brief make sure the SPI port and the needed GPIO pins are defined - * @{ - */ -#ifndef ATRF_SPI -#error "SPI not defined" -#endif -#ifndef ATRF_CS -#error "Chip select pin not defined" -#endif -#ifndef ATRF_INT -#error "Interrupt pin not defined" -#endif -#ifndef ATRF_SLEEP -#error "Sleep pin not defined" -#endif -#ifndef ATRF_RESET -#error "Reset pin not defined" -#endif -#ifndef ATRF_SPI_SPEED -#define ATRF_SPI_SPEED (SPI_SPEED_5MHZ) -#endif -/**@}*/ - -/** - * @name AT86RF231 configuration - */ -static const at86rf2xx_params_t at86rf2xx_params[] = - { - { - .spi = ATRF_SPI, - .spi_speed = ATRF_SPI_SPEED, - .cs_pin = ATRF_CS, - .int_pin = ATRF_INT, - .sleep_pin = ATRF_SLEEP, - .reset_pin = ATRF_RESET, - }, - }; -/** @} */ - -#ifdef __cplusplus -} -#endif -#endif /* AT86RF2XX_PARAMS_H */ -/** @} */