1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

drivers/cc110x: Moved cc110x_params.h from boards to driver

- Replaced magic numbers in the CC110X configuration of the MSBA2
   with SPI_DEV(x) and GPIO_PIN(x, y) macros
 - Adjusted implementation of `cc110x_params.h` to match the code of `at86rf2xx`
 - Made MSBA2's CC110X parameters the default configuration
This commit is contained in:
Marian Buschsieweke 2018-05-21 22:59:46 +02:00
parent 4ca2109655
commit a6f9a86597
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F
4 changed files with 83 additions and 48 deletions

View File

@ -1 +1,5 @@
include $(RIOTBOARD)/common/msba2/Makefile.dep
ifneq (,$(filter netdev_default gnrc_netdev_default,$(USEMODULE)))
USEMODULE += cc110x
endif

View File

@ -1,7 +1,3 @@
ifneq (,$(filter netdev_default gnrc_netdev_default,$(USEMODULE)))
USEMODULE += cc110x
endif
USEMODULE += boards_common_msba2
include $(RIOTBOARD)/common/msba2/Makefile.include

View File

@ -1,44 +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 board_msba2
* @{
*
* @file
* @brief cc110x board specific configuration
*
* @author Kaspar Schleiser <kaspar@schleiser.de>
*/
#ifndef CC110X_PARAMS_H
#define CC110X_PARAMS_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name CC110X configuration
*/
const cc110x_params_t cc110x_params[] = {
{
.spi = 0,
.cs = 53,
.gdo0 = 27,
.gdo1 = 55,
.gdo2 = 28
},
};
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* CC110X_PARAMS_H */
/** @} */

View File

@ -0,0 +1,79 @@
/*
* Copyright (C) 2017 Marian Buschsieweke <marian.buschsieweke@ovgu.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 drivers_cc110x
* @{
*
* @file
* @brief cc110x board specific configuration
*
* @author Marian Buschsieweke <marian.buschsieweke@ovgu.de>
*/
#ifndef CC110X_PARAMS_H
#define CC110X_PARAMS_H
#include "board.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Default parameters for the cc110x driver
*
* These values are based on the msba2 board
* @{
*/
#ifndef CC110X_PARAM_SPI
#define CC110X_PARAM_SPI SPI_DEV(0)
#endif
#ifndef CC110X_PARAM_CS
#define CC110X_PARAM_CS GPIO_PIN(1, 21)
#endif
#ifndef CC110X_PARAM_GDO0
#define CC110X_PARAM_GDO0 GPIO_PIN(0, 27)
#endif
#ifndef CC110X_PARAM_GDO1
#define CC110X_PARAM_GDO1 GPIO_PIN(1, 23)
#endif
#ifndef CC110X_PARAM_GDO2
#define CC110X_PARAM_GDO2 GPIO_PIN(0, 28)
#endif
#ifndef CC110X_PARAMS
#define CC110X_PARAMS { \
.spi = CC110X_PARAM_SPI, \
.cs = CC110X_PARAM_CS, \
.gdo0 = CC110X_PARAM_GDO0, \
.gdo1 = CC110X_PARAM_GDO1, \
.gdo2 = CC110X_PARAM_GDO2, \
}
#endif
/** @} */
/**
* @name CC110X configuration
* @brief Specifies the SPI bus and GPIOs connected to the CC110X transceiver
*/
const cc110x_params_t cc110x_params[] = {
CC110X_PARAMS
};
#ifdef __cplusplus
}
#endif
#endif /* CC110X_PARAMS_H */
/** @} */