From b368179d6bcc6588f81c32c87a2c7b8636def40c Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Tue, 22 Nov 2016 10:48:10 +0100 Subject: [PATCH] boards/pba-d-01-kw2x: adapted MMA8x5x configuaration --- boards/pba-d-01-kw2x/Makefile.dep | 2 +- boards/pba-d-01-kw2x/include/board.h | 12 ++-- boards/pba-d-01-kw2x/include/mma8652_params.h | 58 ------------------ boards/pba-d-01-kw2x/include/mma8x5x_params.h | 61 +++++++++++++++++++ 4 files changed, 68 insertions(+), 65 deletions(-) delete mode 100644 boards/pba-d-01-kw2x/include/mma8652_params.h create mode 100644 boards/pba-d-01-kw2x/include/mma8x5x_params.h diff --git a/boards/pba-d-01-kw2x/Makefile.dep b/boards/pba-d-01-kw2x/Makefile.dep index 87ee42995..2be84deec 100644 --- a/boards/pba-d-01-kw2x/Makefile.dep +++ b/boards/pba-d-01-kw2x/Makefile.dep @@ -3,6 +3,6 @@ ifneq (,$(filter netdev_default gnrc_netdev_default,$(USEMODULE))) endif ifneq (,$(filter saul_default,$(USEMODULE))) - USEMODULE += mma8652 + USEMODULE += mma8x5x USEMODULE += hdc1000 endif diff --git a/boards/pba-d-01-kw2x/include/board.h b/boards/pba-d-01-kw2x/include/board.h index 7e08ea653..8a2973cea 100644 --- a/boards/pba-d-01-kw2x/include/board.h +++ b/boards/pba-d-01-kw2x/include/board.h @@ -79,7 +79,7 @@ extern "C" * @name Define the interface for the HDC1000 humidity sensor * @{ */ -#define HDC1000_I2C (I2C_0) +#define HDC1000_I2C (I2C_DEV(0)) #define HDC1000_ADDR (0x43) /** @} */ @@ -87,7 +87,7 @@ extern "C" * @name Define the interface for the MAG3110 magnetometer sensor * @{ */ -#define MAG3110_I2C (I2C_0) +#define MAG3110_I2C (I2C_DEV(0)) #define MAG3110_ADDR (0x0E) /** @} */ @@ -95,7 +95,7 @@ extern "C" * @name Define the interface for the MMA8652 tri-axis accelerometer sensor * @{ */ -#define MMA8652_I2C (I2C_0) +#define MMA8652_I2C (I2C_DEV(0)) #define MMA8652_ADDR (0x1D) /** @} */ @@ -103,7 +103,7 @@ extern "C" * @name Define the interface for the MPL3115A2 pressure sensor * @{ */ -#define MPL3115A2_I2C (I2C_0) +#define MPL3115A2_I2C (I2C_DEV(0)) #define MPL3115A2_ADDR (0x60) /** @} */ @@ -111,7 +111,7 @@ extern "C" * @name Define the interface for the TCS3772 light sensor * @{ */ -#define TCS37727_I2C (I2C_0) +#define TCS37727_I2C (I2C_DEV(0)) #define TCS37727_ADDR (0x29) /** @} */ @@ -119,7 +119,7 @@ extern "C" * @name Define the interface for the TMP006 IR-Termopile sensor * @{ */ -#define TMP006_I2C (I2C_0) +#define TMP006_I2C (I2C_DEV(0)) #define TMP006_ADDR (0x41) /** @} */ diff --git a/boards/pba-d-01-kw2x/include/mma8652_params.h b/boards/pba-d-01-kw2x/include/mma8652_params.h deleted file mode 100644 index 14957c2d9..000000000 --- a/boards/pba-d-01-kw2x/include/mma8652_params.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2016 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_pba-d-01-kw2x - * @{ - * - * @file - * @brief MMA8652 board specific configuration - * - * @author Cenk Gündoğan - */ - -#ifndef MMA8652_PARAMS_H -#define MMA8652_PARAMS_H - -#include "board.h" -#include "saul_reg.h" -#include "mma8652.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief MMA852 configuration - */ -static const mma8652_params_t mma8652_params[] = -{ - { - .i2c = MMA8652_I2C, - .addr = MMA8652_ADDR, - .rate = MMA8652_DATARATE_DEFAULT, - .scale = MMA8652_FS_RANGE_DEFAULT, - }, -}; - -/** - * @brief Additional meta information to keep in the SAUL registry - */ -static const saul_reg_info_t mma8652_saul_info[] = -{ - { - .name = "mma8652", - }, -}; - -#ifdef __cplusplus -} -#endif - -#endif /* MMA8652_PARAMS_H */ -/** @} */ diff --git a/boards/pba-d-01-kw2x/include/mma8x5x_params.h b/boards/pba-d-01-kw2x/include/mma8x5x_params.h new file mode 100644 index 000000000..9e84326f0 --- /dev/null +++ b/boards/pba-d-01-kw2x/include/mma8x5x_params.h @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2016 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_pba-d-01-kw2x + * @{ + * + * @file + * @brief MMA8x5x board specific configuration + * + * @author Cenk Gündoğan + * @author Hauke Petersen + */ + +#ifndef MMA8X5X_PARAMS_H +#define MMA8X5X_PARAMS_H + +#include "board.h" +#include "saul_reg.h" +#include "mma8x5x.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief MMA852 configuration + */ +static const mma8x5x_params_t mma8x5x_params[] = +{ + { + .i2c = MMA8652_I2C, + .addr = MMA8652_ADDR, + .type = MMA8X5X_TYPE_MMA8652, + .rate = MMA8X5X_RATE_200HZ, + .range = MMA8X5X_RANGE_2G, + .offset = { 0, 0, 0 } + } +}; + +/** + * @brief Additional meta information to keep in the SAUL registry + */ +static const saul_reg_info_t mma8x5x_saul_info[] = +{ + { + .name = "mma8652" + } +}; + +#ifdef __cplusplus +} +#endif + +#endif /* MMA8X5X_PARAMS_H */ +/** @} */