commit ded1ded74770be5d73034e4f0bc949f570271b5e
Author: Thomas Schöpping <tschoepp@cit-ec.uni-bielefeld.de>
Date:   Wed Jul 29 11:24:12 2020 +0200

    VL53L1X test overhauled.
    - AMiRo-LLD updated
    - periphAL implementation adapted
    - NUCLEO-L476RG module configuration modified
    - VL53L1X test reworked (still wip)

diff --git a/modules/NUCLEO-L476RG/module.c b/modules/NUCLEO-L476RG/module.c
index d433d60..1ac0bbb 100644
--- a/modules/NUCLEO-L476RG/module.c
+++ b/modules/NUCLEO-L476RG/module.c
@@ -49,26 +49,12 @@ SerialConfig moduleHalProgIfConfig = {
   /* CR1      */ 0,
 };
 
-#if (BOARD_MPU6050_CONNECTED == true)
-
-I2CConfig moduleHalI2c3Config = {
-  /* timing reg */ 0, // configured later in MODULE_INIT_PERIPHERY_IF_MPU6050() hook
-  /* CR1        */ 0,
-  /* CR2        */ 0,
-};
-
-#endif /* (BOARD_MPU6050_CONNECTED == true) */
-
-#if (BOARD_VL53L1X_CONNECTED == true)
-
-I2CConfig moduleHalI2c3Config = {
-  /* timing reg */ 0, // configured later in MODULE_INIT_PERIPHERY_IF_MPU6050() hook
+I2CConfig moduleHalI2cConfig = {
+  /* timing reg */ 0, // configured later in MODULE_INIT_PERIPHERY_IF hook
   /* CR1        */ 0,
   /* CR2        */ 0,
 };
 
-#endif /* (BOARD_VL53L1X_CONNECTED == true) */
-
 /** @} */
 
 /*===========================================================================*/
@@ -108,9 +94,13 @@ ROMCONST apalControlGpio_t moduleGpioUserButton = {
   },
 };
 
+#if (BOARD_VL53L1X_CONNECTED == true) || defined(__DOXYGEN__)
 
+/**
+ * @brief   VL53L1X interrupt signal GPIO.
+ */
 static apalGpio_t _gpioVl53l1xINT = {
-  /* line */ PAL_LINE(GPIOC, GPIOC_PIN2),
+  /* line */ PAL_LINE(GPIOC, GPIOC_PIN6),
 };
 ROMCONST apalControlGpio_t moduleGpioVl53l1xINT = {
   /* GPIO */ &_gpioVl53l1xINT,
@@ -121,8 +111,11 @@ ROMCONST apalControlGpio_t moduleGpioVl53l1xINT = {
   },
 };
 
+/**
+ * @brief   VL53L1X XSHUT signal GPIO.
+ */
 static apalGpio_t _gpioVl53l1xXSHUT = {
-  /* line */ PAL_LINE(GPIOC, GPIOC_PIN3),
+  /* line */ PAL_LINE(GPIOC, GPIOC_PIN5),
 };
 ROMCONST apalControlGpio_t moduleGpioVl53l1xXSHUT = {
   /* GPIO */ &_gpioVl53l1xXSHUT,
@@ -133,6 +126,8 @@ ROMCONST apalControlGpio_t moduleGpioVl53l1xXSHUT = {
   },
 };
 
+#endif /* (BOARD_VL53L1X_CONNECTED == true) */
+
 /** @} */
 
 /*===========================================================================*/
@@ -172,27 +167,28 @@ ButtonDriver moduleLldUserButton = {
   /* Button Gpio  */ &moduleGpioUserButton,
 };
 
-
-#if (BOARD_VL53L1X_CONNECTED == true)
-VL53L1XDriver moduleLldVl53l1x = {
-   /* I2C Driver       */ &MODULE_HAL_I2C3,
-  /* I²C address      */ VL53L1X_LLD_I2C_ADDR_DEFAULT,
-  /* GPIO 1:INT pin */ &moduleGpioVl53l1xINT,
-   /* Xshut  */        &moduleGpioVl53l1xXSHUT,
-};
-
-#endif /* (BOARD_VL53L1X_CONNECTED == true) */
-
 #if (BOARD_MPU6050_CONNECTED == true)
 
 MPU6050Driver moduleLldMpu6050 = {
-  /* I2C Driver       */ &MODULE_HAL_I2C3,
+  /* I2C Driver       */ &MODULE_HAL_I2C,
   /* I²C address      */ MPU6050_LLD_I2C_ADDR_FIXED,
 };
 
+#endif /* (BOARD_MPU6050_CONNECTED == true) */
 
+#if (BOARD_VL53L1X_CONNECTED == true)
 
-#endif /* (BOARD_MPU6050_CONNECTED == true) */
+VL53L1XDriver moduleLldVl53l1x = {
+  /* device data    */ {},
+  /* interface data */ {
+    /* I2C Driver     */ &MODULE_HAL_I2C,
+    /* I²C address    */ VL53L1X_LLD_I2C_ADDR_DEFAULT,
+    /* GPIO 1:INT pin */ &moduleGpioVl53l1xINT,
+    /* Xshut          */ &moduleGpioVl53l1xXSHUT,
+  },
+};
+
+#endif /* (BOARD_VL53L1X_CONNECTED == true) */
 
 /** @} */
 
@@ -215,22 +211,6 @@ static int _testLedShellCmdCb(BaseSequentialStream* stream, int argc, char* argv
 AOS_SHELL_COMMAND(moduleTestLedShellCmd, "test:LED", _testLedShellCmdCb);
 
 /*
- * LED
- */
-#include <module_test_VL53L1X.h>
-static int _testShellVL53L1XCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
-{
-  return moduleTestVL53L1XShellCb(stream, argc, argv, NULL);
-}
-AOS_SHELL_COMMAND(moduleTestVL53L1XShellCmd, "test:VL53L1X", _testShellVL53L1XCmdCb);
-
-static int _testShellVL53L1XInitCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
-{
-  return moduleTestVL53L1XInitShellCb(stream, argc, argv, NULL);
-}
-AOS_SHELL_COMMAND(moduleTestVL53L1XInitShellCmd, "test:VL53L1X:INIT", _testShellVL53L1XInitCmdCb);
-
-/*
  * User button
  */
 #include <module_test_button.h>
@@ -241,7 +221,6 @@ static int _testButtonShellCmdCb(BaseSequentialStream* stream, int argc, char* a
 AOS_SHELL_COMMAND(moduleTestButtonShellCmd, "test:button", _testButtonShellCmdCb);
 
 #if (BOARD_MPU6050_CONNECTED == true) || defined(__DOXYGEN__)
-
 /*
  * MPU6050 (accelerometer & gyroscope)
  */
@@ -251,9 +230,20 @@ static int _testMpu6050ShellCmdCb(BaseSequentialStream* stream, int argc, char*
   return moduleTestMpu6050ShellCb(stream, argc, argv, NULL);
 }
 AOS_SHELL_COMMAND(moduleTestMpu6050ShellCmd, "test:IMU", _testMpu6050ShellCmdCb);
-
 #endif /* (BOARD_MPU6050_CONNECTED == true) */
 
+#if (BOARD_VL53L1X_CONNECTED == true) || defined(__DOXYGEN__)
+/*
+ * VL53L1X
+ */
+#include <module_test_VL53L1X.h>
+static int _testShellVL53L1XCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
+{
+  return moduleTestVL53L1XShellCb(stream, argc, argv, NULL);
+}
+AOS_SHELL_COMMAND(moduleTestVL53L1XShellCmd, "test:VL53L1X", _testShellVL53L1XCmdCb);
+#endif /* (BOARD_VL53L1X_CONNECTED == true) */
+
 /*
  * entire module
  */
@@ -275,12 +265,18 @@ static int _testAllShellCmdCb(BaseSequentialStream* stream, int argc, char* argv
   status |= moduleTestButtonShellCb(stream, 0, targv, &result_test);
   result_total = aosTestResultAdd(result_total, result_test);
 
-  /* MPU6050 (accelerometer & gyroscope) */
 #if (BOARD_MPU6050_CONNECTED == true)
+  /* MPU6050 (accelerometer & gyroscope) */
   status |= moduleTestMpu6050ShellCb(stream, 0, targv, &result_test);
   result_total = aosTestResultAdd(result_total, result_test);
 #endif /* (BOARD_MPU6050_CONNECTED == true) */
 
+#if (BOARD_VL53L1X_CONNECTED == true)
+  /* VL53L1X (ToF sensor) */
+  status |= moduleTestVL53L1XShellCb(stream, 0, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+#endif /* (BOARD_VL53L1X_CONNECTED == true) */
+
   // print total result
   chprintf(stream, "\n");
   aosTestResultPrintSummary(stream, &result_total, "entire module");
