diff --git a/drivers/include/lsm6dsl.h b/drivers/include/lsm6dsl.h index 0752660099..9deb380b17 100644 --- a/drivers/include/lsm6dsl.h +++ b/drivers/include/lsm6dsl.h @@ -8,13 +8,13 @@ */ /** - * @defgroup drivers_lsm6dsl LSM36DSL 3D accelerometer/gyroscope + * @defgroup drivers_lsm6dsl LSM6DSL 3D accelerometer/gyroscope * @ingroup drivers_sensors - * @brief Device driver for the LSM36DSL 3D accelerometer/gyroscope + * @brief Device driver for the LSM6DSL 3D accelerometer/gyroscope * * @{ * @file - * @brief Device driver interface for the LSM36DSL 3D accelerometer/gyroscope. + * @brief Device driver interface for the LSM6DSL 3D accelerometer/gyroscope. * * @author Vincent Dupont */ diff --git a/drivers/lsm6dsl/include/lsm6dsl_internal.h b/drivers/lsm6dsl/include/lsm6dsl_internal.h index 6fa9655fd4..f11c4e3c59 100644 --- a/drivers/lsm6dsl/include/lsm6dsl_internal.h +++ b/drivers/lsm6dsl/include/lsm6dsl_internal.h @@ -8,11 +8,11 @@ */ /** - * @addtogroup drivers_lsm6dsl + * @ingroup drivers_lsm6dsl * * @{ * @file - * @brief Internal configuration for LSM36DSL devices + * @brief Internal configuration for LSM6DSL devices * * @author Vincent Dupont */ diff --git a/drivers/lsm6dsl/include/lsm6dsl_params.h b/drivers/lsm6dsl/include/lsm6dsl_params.h index 71df0cbc28..2910b4a1a3 100644 --- a/drivers/lsm6dsl/include/lsm6dsl_params.h +++ b/drivers/lsm6dsl/include/lsm6dsl_params.h @@ -8,11 +8,11 @@ */ /** - * @addtogroup drivers_lsm6dsl + * @ingroup drivers_lsm6dsl * * @{ * @file - * @brief Default configuration for LSM36DSL devices + * @brief Default configuration for LSM6DSL devices * * @author Vincent Dupont */ diff --git a/drivers/lsm6dsl/lsm6dsl.c b/drivers/lsm6dsl/lsm6dsl.c index f1f181a96c..3b1b911c3f 100644 --- a/drivers/lsm6dsl/lsm6dsl.c +++ b/drivers/lsm6dsl/lsm6dsl.c @@ -9,7 +9,7 @@ /** * @file - * @brief Device driver implementation for the LSM36DSL 3D accelerometer/gyroscope. + * @brief Device driver implementation for the LSM6DSL 3D accelerometer/gyroscope. * * @author Vincent Dupont */ diff --git a/drivers/lsm6dsl/lsm6dsl_saul.c b/drivers/lsm6dsl/lsm6dsl_saul.c index 0b921c8c35..322e71037f 100644 --- a/drivers/lsm6dsl/lsm6dsl_saul.c +++ b/drivers/lsm6dsl/lsm6dsl_saul.c @@ -9,7 +9,7 @@ /** * @file - * @brief SAUL implementation for the LSM36DSL 3D accelerometer/gyroscope. + * @brief SAUL implementation for the LSM6DSL 3D accelerometer/gyroscope. * * @author Vincent Dupont */ diff --git a/tests/driver_lsm6dsl/Makefile b/tests/driver_lsm6dsl/Makefile new file mode 100644 index 0000000000..540392b082 --- /dev/null +++ b/tests/driver_lsm6dsl/Makefile @@ -0,0 +1,9 @@ +APPLICATION = driver_lsm6dsl +include ../Makefile.tests_common + +FEATURES_REQUIRED = periph_i2c + +USEMODULE += lsm6dsl +USEMODULE += xtimer + +include $(RIOTBASE)/Makefile.include diff --git a/tests/driver_lsm6dsl/main.c b/tests/driver_lsm6dsl/main.c new file mode 100644 index 0000000000..f37a0fe480 --- /dev/null +++ b/tests/driver_lsm6dsl/main.c @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2017 OTA keys S.A. + * + * 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. + */ + +/** + * @file + * @brief Test application for the LSM6DSL accelerometer/gyroscope driver. + * + * @author Vincent Dupont + * + */ + +#include + +#include "xtimer.h" +#include "lsm6dsl.h" +#include "lsm6dsl_params.h" + +#define SLEEP (100 * 1000U) + +int main(void) +{ + lsm6dsl_t dev; + int16_t temp_value; + lsm6dsl_3d_data_t mag_value; + lsm6dsl_3d_data_t acc_value; + + puts("LSM6DSL test application\n"); + printf("Initializing LSM6DSL sensor at I2C_%i... ", lsm6dsl_params->i2c); + + if (lsm6dsl_init(&dev, lsm6dsl_params) == 0) { + puts("[OK]\n"); + } + else { + puts("[Failed]"); + return 1; + } + + while (1) { + if (lsm6dsl_read_acc(&dev, &acc_value) == 0) { + printf("Accelerometer x: %i y: %i z: %i\n", acc_value.x, + acc_value.y, + acc_value.z); + } + else { + puts("\nFailed reading accelerometer values\n"); + } + if (lsm6dsl_read_temp(&dev, &temp_value) == 0) { + printf("Temperature value: %i degrees\n", temp_value); + } + else { + puts("\nFailed reading value\n"); + } + + if (lsm6dsl_read_gyro(&dev, &mag_value) == 0) { + printf("Gyroscope x: %i y: %i z: %i\n", mag_value.x, + mag_value.y, + mag_value.z); + } + else { + puts("\nFailed reading Gyroscope values\n"); + } + + xtimer_usleep(SLEEP); + } + + return 0; +}