mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
tests/driver_at86rf2xx: use default atrf_params.h
This commit is contained in:
parent
004537e045
commit
6e3e99cf4d
@ -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
|
||||
|
@ -1,70 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 Kaspar Schleiser <kaspar@schleiser.de>
|
||||
*
|
||||
* 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 <kaspar@schleiser.de>
|
||||
*/
|
||||
|
||||
#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 */
|
||||
/** @} */
|
Loading…
Reference in New Issue
Block a user