commit a845d9eb1a1c226a08921288ccaf64da277ba557
Author: Andre Raming <araming@techfak.uni-bielefeld.de>
Date:   Tue Apr 23 16:23:02 2019 +0200

    added vl53l0x + unittests

diff --git a/modules/PowerManagement_1-2/alldconf.h b/modules/PowerManagement_1-2/alldconf.h
index 7a8f4b1..6e102ba 100644
--- a/modules/PowerManagement_1-2/alldconf.h
+++ b/modules/PowerManagement_1-2/alldconf.h
@@ -121,6 +121,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #define AMIROLLD_CFG_AT42QT1050                 1
 
+/**
+ * @brief   Enable flag for the VL53L0X proximity sensor.
+ */
+#define AMIROLLD_CFG_VL53L0X                1
+
 #endif /* (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L0X) */
 
 #if (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X) || defined(__DOXYGEN__)
diff --git a/modules/PowerManagement_1-2/board.h b/modules/PowerManagement_1-2/board.h
index 47c201b..540b274 100644
--- a/modules/PowerManagement_1-2/board.h
+++ b/modules/PowerManagement_1-2/board.h
@@ -90,7 +90,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /*
  * Configuration macro to define which type of sensor ring is attached.
  */
-#define BOARD_SENSORRING                BOARD_PROXIMITYSENSOR
+#define BOARD_SENSORRING                BOARD_DISTANCESENSOR_VL53L0X
 
 /*
  * IO pins assignments.
diff --git a/modules/PowerManagement_1-2/module.c b/modules/PowerManagement_1-2/module.c
index b7c3ec6..99c4581 100644
--- a/modules/PowerManagement_1-2/module.c
+++ b/modules/PowerManagement_1-2/module.c
@@ -672,6 +672,217 @@ AT42QT1050Driver moduleLldTouch = {
   /* I²C address  */ AT42QT1050_LLD_I2C_ADDRSEL_LOW,
 };
 
+VL53L0XDriver moduleLldProximity1 = {
+    {
+        /* I²C Driver */ &MODULE_HAL_I2C_SR_PM18_PM33_GAUGEREAR,
+        /* I²C timeout */ TIME_INFINITE,
+
+        /* VL53L0X_DevData_t */
+        {
+            /* VL53L0X_DMaxData_t */
+            {
+                /* AmbTuningWindowFactor_K */ 0,
+                /* RetSignalAt0mm */ 0,
+
+            },
+            /* Part2PartOffsetNVMMicroMeter */ 0,
+            /* Part2PartOffsetAdjustmentNVMMicroMeter */ 0,
+            /* VL53L0X_DeviceParameters_t */
+            {
+                /* VL53L0X_DeviceModes DeviceMode 0 == singleranging*/ 0,
+                /* VL53L0X_HistogramModes HistogramMode 0=disable */ 0,
+                /* MeasurementTimingBudgetMicroSeconds */ 0,
+                /* InterMeasurementPeriodMilliSeconds */ 0,
+                /* !! XTalkCompensationEnable */ 0,
+                /* XTalkCompensationRangeMilliMeter */ 0,
+                /* XTalkCompensationRateMegaCps */ 0,
+                /* RangeOffsetMicroMeters */ 0,
+                /* !! LimitChecksEnable */ 0,
+                /* LimitChecksStatus */ 0,
+                /* !! WrapAroundCheckEnable */ 0,
+
+            },
+            /* VL53L0X_RangingMeasurementData_t */
+            {
+                /* TimeStamp */ 0,
+                /* MeasurementTimeUsec */ 0,
+                /* RangeMilliMeter */ 0,
+                /* !! RangeDMaxMilliMeter */ 0,
+                /* SignalRateRtnMegaCps */ 0,
+                /* AmbientRateRtnMegaCps */ 0,
+                /* EffectiveSpadRtnCount */ 0,
+                /* ZoneId */ 0,
+                /* RangeFractionalPart */ 0,
+                /* RangeStatus */ 0,
+            },
+            /* VL53L0X_HistogramMeasurementData_t */
+            {
+                /* HistogramData */ 0,
+                /* HistogramType */ 0,
+                /* FirstBin */ 0,
+                /* BufferSize */ 0,
+                /* NumberOfBins */ 0,
+                /* VL53L0X_DeviceError ErrorStatus 0 == None_error */ 0,
+            },
+            /* VL53L0X_DeviceSpecificParameters_t */
+            {
+                /* OscFrequencyMHz */ 0,
+                /* LastEncodedTimeout */ 0,
+                /* !! VL53L0X_GpioFunctionality Pin0GpioFunctionality 0==no interrupt */ 0,
+                /* FinalRangeTimeoutMicroSecs */ 0,
+                /* FinalRangeVcselPulsePeriod */ 0,
+                /* PreRangeTimeoutMicroSecs */ 0,
+                /* PreRangeVcselPulsePeriod */ 0,
+                /* SigmaEstRefArray */ 0,
+                /* SigmaEstEffPulseWidth */ 0,
+                /* SigmaEstEffAmbWidth */ 0,
+                /* ReadDataFromDeviceDone 0 == read from device was not done */ 0,
+                /* ModuleId */ 0,
+                /* Revision */ 0,
+                /* ProductId */ "0",
+                /* !! ReferenceSpadCount */ 0,
+                /* !! ReferenceSpadType */ 0,
+                /* RefSpadsInitialised */ 0,
+                /* PartUIDUpper */ 0,
+                /* PartUIDLower */ 0,
+                /* SignalRateMeasFixed400mm */ 0,
+            },
+            /* VL53L0X_SpadData_t */
+            {
+                /* RefSpadEnables */ 0,
+                /* RefGoodSpadMap */ 0,
+
+            },
+            /* SequenceConfig */ 0,
+            /* !! RangeFractionalEnable */ 0,
+            /* VL53L0X_State PalState */ 0,
+            /* !! VL53L0X_PowerModes PowerMode 0==VL53L0X_POWERMODE_STANDBY_LEVEL1 */ 0,
+            /* SigmaEstRefArray */ 0,
+            /* SigmaEstEffPulseWidth */ 0,
+            /* SigmaEstEffAmbWidth */ 0,
+            /* StopVariable */ 0,
+            /* targetRefRate */ 0,
+            /* SigmaEstimate */ 0,
+            /* SignalEstimate */0 ,
+            /* LastSignalRefMcps */ 0,
+            /* *pTuningSettingsPointer */ 0,
+            /* UseInternalTuningSettings */ 0,
+            /* LinearityCorrectiveGain */ 0,
+            /* !! DmaxCalRangeMilliMeter */ 0,
+            /* DmaxCalSignalRateRtnMegaCps */ 0,
+        },
+        /* I²C address */ VL53L0X_LLD_I2C_ADDR,
+        /* COMM TYPE*/ 1,
+        /* COMM SPEED*/ 1,
+    },
+};
+
+VL53L0XDriver moduleLldProximity2 = {
+    {
+        /* I²C Driver */ &MODULE_HAL_I2C_SR_PM42_PM50_PMVDD_EEPROM_GAUGEFRONT,
+        /* I²C timeout */ TIME_INFINITE,
+
+        /* VL53L0X_DevData_t */
+        {
+            /* VL53L0X_DMaxData_t */
+            {
+                /* AmbTuningWindowFactor_K */ 0,
+                /* RetSignalAt0mm */ 0,
+
+            },
+            /* Part2PartOffsetNVMMicroMeter */ 0,
+            /* Part2PartOffsetAdjustmentNVMMicroMeter */ 0,
+            /* VL53L0X_DeviceParameters_t */
+            {
+                /* VL53L0X_DeviceModes DeviceMode 0 == singleranging*/ 0,
+                /* VL53L0X_HistogramModes HistogramMode 0=disable */ 0,
+                /* MeasurementTimingBudgetMicroSeconds */ 0,
+                /* InterMeasurementPeriodMilliSeconds */ 0,
+                /* !! XTalkCompensationEnable */ 0,
+                /* XTalkCompensationRangeMilliMeter */ 0,
+                /* XTalkCompensationRateMegaCps */ 0,
+                /* RangeOffsetMicroMeters */ 0,
+                /* !! LimitChecksEnable */ 0,
+                /* LimitChecksStatus */ 0,
+                /* !! WrapAroundCheckEnable */ 0,
+
+            },
+            /* VL53L0X_RangingMeasurementData_t */
+            {
+                /* TimeStamp */ 0,
+                /* MeasurementTimeUsec */ 0,
+                /* RangeMilliMeter */ 0,
+                /* !! RangeDMaxMilliMeter */ 0,
+                /* SignalRateRtnMegaCps */ 0,
+                /* AmbientRateRtnMegaCps */ 0,
+                /* EffectiveSpadRtnCount */ 0,
+                /* ZoneId */ 0,
+                /* RangeFractionalPart */ 0,
+                /* RangeStatus */ 0,
+            },
+            /* VL53L0X_HistogramMeasurementData_t */
+            {
+                /* HistogramData */ 0,
+                /* HistogramType */ 0,
+                /* FirstBin */ 0,
+                /* BufferSize */ 0,
+                /* NumberOfBins */ 0,
+                /* VL53L0X_DeviceError ErrorStatus 0 == None_error */ 0,
+            },
+            /* VL53L0X_DeviceSpecificParameters_t */
+            {
+                /* OscFrequencyMHz */ 0,
+                /* LastEncodedTimeout */ 0,
+                /* !! VL53L0X_GpioFunctionality Pin0GpioFunctionality 0==no interrupt */ 0,
+                /* FinalRangeTimeoutMicroSecs */ 0,
+                /* FinalRangeVcselPulsePeriod */ 0,
+                /* PreRangeTimeoutMicroSecs */ 0,
+                /* PreRangeVcselPulsePeriod */ 0,
+                /* SigmaEstRefArray */ 0,
+                /* SigmaEstEffPulseWidth */ 0,
+                /* SigmaEstEffAmbWidth */ 0,
+                /* ReadDataFromDeviceDone 0 == read from device was not done */ 0,
+                /* ModuleId */ 0,
+                /* Revision */ 0,
+                /* ProductId */ "0",
+                /* !! ReferenceSpadCount */ 0,
+                /* !! ReferenceSpadType */ 0,
+                /* RefSpadsInitialised */ 0,
+                /* PartUIDUpper */ 0,
+                /* PartUIDLower */ 0,
+                /* SignalRateMeasFixed400mm */ 0,
+            },
+            /* VL53L0X_SpadData_t */
+            {
+                /* RefSpadEnables */ 0,
+                /* RefGoodSpadMap */ 0,
+
+            },
+            /* SequenceConfig */ 0,
+            /* !! RangeFractionalEnable */ 0,
+            /* VL53L0X_State PalState */ 0,
+            /* !! VL53L0X_PowerModes PowerMode 0==VL53L0X_POWERMODE_STANDBY_LEVEL1 */ 0,
+            /* SigmaEstRefArray */ 0,
+            /* SigmaEstEffPulseWidth */ 0,
+            /* SigmaEstEffAmbWidth */ 0,
+            /* StopVariable */ 0,
+            /* targetRefRate */ 0,
+            /* SigmaEstimate */ 0,
+            /* SignalEstimate */0 ,
+            /* LastSignalRefMcps */ 0,
+            /* *pTuningSettingsPointer */ 0,
+            /* UseInternalTuningSettings */ 0,
+            /* LinearityCorrectiveGain */ 0,
+            /* !! DmaxCalRangeMilliMeter */ 0,
+            /* DmaxCalSignalRateRtnMegaCps */ 0,
+        },
+        /* I²C address */ VL53L0X_LLD_I2C_ADDR,
+        /* COMM TYPE*/ 1,
+        /* COMM SPEED*/ 1,
+    },
+};
+
+
 #endif /* (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L0X) */
 
 #if (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X) || defined(__DOXYGEN__)
@@ -1383,6 +1594,526 @@ aos_unittest_t moduleUtAlldAt42qt1050 = {
   /* data           */ &_utAlldAt42qt1050Data,
 };
 
+/* VL53L0X (proximity sensor) */
+static int _utShellCmdCb_AlldVL53L0X(BaseSequentialStream* stream, int argc, char* argv[])
+{
+
+
+    // first GPIO-Extender (the first 4 areas)
+    PCAL6524Driver* mux1 = NULL;
+    // second GPRO-Extender (the last 4 areas)
+    PCAL6524Driver* mux2 = NULL;
+    uint32_t status;
+    uint8_t buffer[2];
+    mux1 = &moduleLldGpioExtender1;
+    mux2 = &moduleLldGpioExtender2;
+
+    // set the XHUT Pins (P0_0 ... P0_7 P1_0 ... P1_3 ) from first GPIO-Extender to LOW (Pull-down)
+    // first set Pull-up/pull-down enable register port to 1
+    status = pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDENABLE_P0, 0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    // second set Pull-up/pull-down selection register for all XSHUT to pull-down (write a 0 in every bitmask)
+    status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P0, 0x00, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
+    // first 4 register are XSHUT, last 4 are Interrupt, all need pull-up/pull-down
+    status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDENABLE_P1,0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    // XSHUT need pull-down and Interrupt need pull-up 11110000
+    // 0xF0
+    status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P1, 0x00, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    //set the interrupt register to input, write a 1 to configuration port registers (0Ch, 0Dh, 0Eh)
+    status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INPUT_P1, 0xF0, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+    // all Interrupt register need pull-up/pull-down
+    status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDENABLE_P2, 0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    // all interrupt register need Pull-up (set to 1)
+    //0xFF == 11111111, we set all interrupt register to 00000000 == pull-down and only the register we need is pulled up
+    status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P2, 0x00, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    //set the interrupt register to input, write a 1 to configuration port registers (0Ch, 0Dh, 0Eh)
+    status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INPUT_P2, 0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+    // set the XHUT Pins (P0_0 ... P0_7 P1_0 ... P1_3 ) from second GPIO-Extender to LOW
+    // same as first GPIO-Extender
+    status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDENABLE_P0, 0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P0, 0x00, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDENABLE_P1,0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P1, 0x00, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INPUT_P1, 0xF0, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDENABLE_P2, 0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P2, 0x00, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INPUT_P2, 0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
+
+    //set one sensor to active
+    /*only bus moduleLldGpioExtender1
+
+                A            GP
+            S1  S2  S3 | S4  S5  S6 | S7  S8  S9 | S10 S11 S12|
+    GPIO
+    XSHUT   1.3 1.2 1.1| 1.0 0.7 0.6| 0.5 0.4 0.3| 0.2 0.1 0.0|
+    INTER   2.7 2.6 2.5| 2.4 2.3 2.2| 2.1 2.0 1.7| 1.6 1.5 1.4|
+
+    OPTION
+    #       11  12  13 | 14  15  16 | 17  18  19 | 110 111 112|
+
+
+    A == Anschluss
+    GP == GPIO Extender
+      */
+  if (argc == 2) {
+      if (strcmp(argv[1], "#11") == 0) {
+          buffer[0] = 0x8; // == P1.3 => Interrupt 2.7
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P1, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // enable pull-up for the one used interrupt register
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P2, 0x80, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // only one pin is set to 0 as interrupt mask register => M2.7 == 01111111
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0x7F, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // interrupt edge register IE2.7 with falling edge (from HIGH to LOW) == 10 00 00 00on adress 64h
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2B, 0x80, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+
+          //set GPIO extender
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender1;
+      } else if (strcmp(argv[1], "#12") == 0) {
+          buffer[0] = 0x4; // PUD1.2 with interrupt P2_6
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P1, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0x20, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // only one pin is set to 0 as interrupt mask register  M2.6 == 0xBF == 10111111
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0xBF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // interrupt edge register IE2.6 with falling edge (from HIGH to LOW) == 00100000
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2B, 0x20, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+
+          //set GPIO extender
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender1;
+      } else if (strcmp(argv[1], "#13") == 0) {
+          buffer[0] = 0x2; // PUD1.1 with Interrupt P2_5
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P1, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0x10, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // only one pin is set to 0 as interrupt mask register  M2.5 == 0xDF == 11011111
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0xBF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // interrupt edge register IE2.5 with falling edge (from HIGH to LOW) == 0x8 == 00001000
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2B, 0x8, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+          //set GPIO extender
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender1;
+      } else if (strcmp(argv[1], "#14") == 0) {
+          buffer[0] = 0x1; // PUD1.0 with Interrupt P2_4
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P1, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0x8, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // only one pin is set to 0 as interrupt mask register  M2.4 == 0xEF == 11101111
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0xEF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // interrupt edge register IE2.4 with falling edge (from HIGH to LOW) == 0x8 == 00000010
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2B, 0x2, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+          //set GPIO extender
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender1;
+      } else if (strcmp(argv[1], "#15") == 0) {
+          buffer[0] = 0x80; // PUD0.7 with interrupt P2.3
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // enable pull-up for the one used interrupt register (set to 1) == 00001000
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P2, 0x8, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // only one pin is set to 0 as interrupt mask register => M2.3 == 11110111
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0xF7, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // interrupt edge register IE2.2 with falling edge (from HIGH to LOW) == 10000000 on adress 64h
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2A, 0x80, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
+
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+          //set GPIO extender
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender1;
+      } else if (strcmp(argv[1], "#16") == 0) {
+          buffer[0] = 0x40; // PUD0.6 with interrupt P2.2
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // enable pull-up for the one used interrupt register (set to 1) == 00000100
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P2, 0x4, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // only one pin is set to 0 as interrupt mask register => M2.2 == 11111011
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0xFB, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // interrupt edge register IE2.2 with falling edge (from HIGH to LOW) == 00100000 on adress 64h
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2A, 0x20, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+          //set GPIO extender
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender1;
+      } else if (strcmp(argv[1], "#17") == 0) {
+          buffer[0] = 0x20; // PUD0.5 wirh interrupt P2.1
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // enable pull-up for the one used interrupt register (set to 1) == 00000010
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P2, 0x2, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // only one pin is set to 0 as interrupt mask register => M2.1 == 11111101
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0xFD, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // interrupt edge register IE2.1 with falling edge (from HIGH to LOW) == 00001000 on adress 64h
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2A, 0x8, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
+
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+          //set GPIO extender
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender1;
+      } else if (strcmp(argv[1], "#18") == 0) {
+          buffer[0] = 0x10; // PUD0.4 with interrupt P2.0
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // enable pull-up for the one used interrupt register (set to 1) == 00000001
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P2, 0x1, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // only one pin is set to 0 as interrupt mask register => M2.0 == 11111110
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0xFE, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // interrupt edge register IE1.5 with falling edge (from HIGH to LOW) == 00000010 on adress 64h
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2A, 0x2, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+          //set GPIO extender
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender1;
+      } else if (strcmp(argv[1], "#19") == 0) {
+
+          buffer[0] = 0x8; // PUD0.3 with interrupt P1_7
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // enable pull-up for the one used interrupt register (set to 1) == 10000000
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P1, 0x80, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // only one pin is set to 0 as interrupt mask register => M1.7 == 01111111
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTMASK_P1, 0x7F, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // interrupt edge register IE1.5 with falling edge (from HIGH to LOW) == 10000000 on adress 63h
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P1B, 0x80, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
+
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+          //set GPIO extender
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender1;
+      } else if (strcmp(argv[1], "#110") == 0) {
+
+          buffer[0] = 0x4; //PUD0.2 with interrupt P1_6
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // enable pull-up for the one used interrupt register (set to 1) == 01000000
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P1, 0x40, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // only one pin is set to 0 as interrupt mask register => M1.6 == 10111111
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTMASK_P1, 0xBF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // interrupt edge register IE1.5 with falling edge (from HIGH to LOW) == 00100000 on adress 63h
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P1B, 0x20, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+          //set GPIO extender
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender1;
+      } else if (strcmp(argv[1], "#111") == 0) {
+          buffer[0] = 0x2; // PUD0.1 with interrupt P1_5
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // enable pull-up for the one used interrupt register (set to 1) == 00100000
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P1, 0x20, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // only one pin is set to 0 as interrupt mask register => M1.5 == 11011111
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTMASK_P1, 0xDF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // interrupt edge register IE1.5 with falling edge (from HIGH to LOW) == 00001000 on adress 63h
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P1B, 0x8, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
+
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+          //set GPIO extender
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender1;
+      } else if (strcmp(argv[1], "#112") == 0) {
+
+          buffer[0] = 0x1; // PUD0.0 with interrupt P1_4
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // enable pull-up for the one used interrupt register (set to 1) == 00010000
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P1, 0x10, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // only one pin is set to 0 as interrupt mask register => M1.4 == 11101111
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTMASK_P1, 0xEF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // interrupt edge register IE1.4 with falling edge (from HIGH to LOW) == 00 00 00 10 on adress 63h
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P1B, 0x2, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+          //set GPIO extender
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender1;
+
+      } else if (strcmp(argv[1], "#21") == 0) {
+          buffer[0] = 0x8; // == P1.3 => Interrupt 2.7
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P1, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // enable pull-up for the one used interrupt register
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P2, 0x80, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // only one pin is set to 0 as interrupt mask register => M2.7 == 01111111
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0x7F, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // interrupt edge register IE2.7 with falling edge (from HIGH to LOW) == 10 00 00 00on adress 64h
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2B, 0x80, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity2;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+          //set GPIO extender
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender2;
+      } else if (strcmp(argv[1], "#22") == 0) {
+          buffer[0] = 0x4; // PUD1.2 with interrupt P2_6
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P1, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0x20, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // only one pin is set to 0 as interrupt mask register  M2.6 == 0xBF == 10111111
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0xBF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // interrupt edge register IE2.6 with falling edge (from HIGH to LOW) == 00100000
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2B, 0x20, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity2;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+          //set GPIO extender
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender2;
+
+      } else if (strcmp(argv[1], "#23") == 0) {
+          buffer[0] = 0x2; // PUD1.1 with Interrupt P2_5
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P1, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0x10, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // only one pin is set to 0 as interrupt mask register  M2.5 == 0xDF == 11011111
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0xBF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // interrupt edge register IE2.5 with falling edge (from HIGH to LOW) == 0x8 == 00001000
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2B, 0x8, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity2;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+          //set GPIO extender
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender2;
+      } else if (strcmp(argv[1], "#24") == 0) {
+          buffer[0] = 0x1; // PUD1.0 with Interrupt P2_4
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P1, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0x8, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // only one pin is set to 0 as interrupt mask register  M2.4 == 0xEF == 11101111
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0xEF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // interrupt edge register IE2.4 with falling edge (from HIGH to LOW) == 0x8 == 00000010
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2B, 0x2, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity2;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+          //set GPIO extender
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender2;
+      } else if (strcmp(argv[1], "#25") == 0) {
+          buffer[0] = 0x80; // PUD0.7 with interrupt P2.3
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // enable pull-up for the one used interrupt register (set to 1) == 00001000
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P2, 0x8, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // only one pin is set to 0 as interrupt mask register => M2.3 == 11110111
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0xF7, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // interrupt edge register IE2.2 with falling edge (from HIGH to LOW) == 10000000 on adress 64h
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2A, 0x80, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
+
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity2;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+          //set GPIO extender
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender2;
+      } else if (strcmp(argv[1], "#26") == 0) {
+          buffer[0] = 0x40; // PUD0.6 with interrupt P2.2
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // enable pull-up for the one used interrupt register (set to 1) == 00000100
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P2, 0x4, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // only one pin is set to 0 as interrupt mask register => M2.2 == 11111011
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0xFB, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // interrupt edge register IE2.2 with falling edge (from HIGH to LOW) == 00100000 on adress 64h
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2A, 0x20, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity2;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+          //set GPIO extender
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender2;
+      } else if (strcmp(argv[1], "#27") == 0) {
+          buffer[0] = 0x20; // PUD0.5 wirh interrupt P2.1
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // enable pull-up for the one used interrupt register (set to 1) == 00000010
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P2, 0x2, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // only one pin is set to 0 as interrupt mask register => M2.1 == 11111101
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0xFD, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // interrupt edge register IE2.1 with falling edge (from HIGH to LOW) == 00001000 on adress 64h
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2A, 0x8, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
+
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity2;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+          //set GPIO extender
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender2;
+      } else if (strcmp(argv[1], "#28") == 0) {
+          buffer[0] = 0x10; // PUD0.4 with interrupt P2.0
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // enable pull-up for the one used interrupt register (set to 1) == 00000001
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P2, 0x1, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // only one pin is set to 0 as interrupt mask register => M2.0 == 11111110
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0xFE, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // interrupt edge register IE1.5 with falling edge (from HIGH to LOW) == 00000010 on adress 64h
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2A, 0x2, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity2;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+          //set GPIO extender
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender2;
+      } else if (strcmp(argv[1], "#29") == 0) {
+
+          buffer[0] = 0x8; // PUD0.3 with interrupt P1_7
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // enable pull-up for the one used interrupt register (set to 1) == 10000000
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P1, 0x80, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // only one pin is set to 0 as interrupt mask register => M1.7 == 01111111
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTMASK_P1, 0x7F, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // interrupt edge register IE1.5 with falling edge (from HIGH to LOW) == 10000000 on adress 63h
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTEDGE_P1B, 0x80, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
+
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity2;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+          //set GPIO extender
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender2;
+      } else if (strcmp(argv[1], "#210") == 0) {
+
+          buffer[0] = 0x4; //PUD0.2 with interrupt P1_6
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // enable pull-up for the one used interrupt register (set to 1) == 01000000
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P1, 0x40, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // only one pin is set to 0 as interrupt mask register => M1.6 == 10111111
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTMASK_P1, 0xBF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // interrupt edge register IE1.5 with falling edge (from HIGH to LOW) == 00100000 on adress 63h
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTEDGE_P1B, 0x20, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity2;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+          //set GPIO extender
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender2;
+      } else if (strcmp(argv[1], "#211") == 0) {
+          buffer[0] = 0x2; // PUD0.1 with interrupt P1_5
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // enable pull-up for the one used interrupt register (set to 1) == 00100000
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P1, 0x20, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // only one pin is set to 0 as interrupt mask register => M1.5 == 11011111
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTMASK_P1, 0xDF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // interrupt edge register IE1.5 with falling edge (from HIGH to LOW) == 00001000 on adress 63h
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTEDGE_P1B, 0x8, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
+
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity2;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+          //set GPIO extender
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender2;
+      } else if (strcmp(argv[1], "#212") == 0) {
+
+          buffer[0] = 0x1; // PUD0.0 with interrupt P1_4
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // enable pull-up for the one used interrupt register (set to 1) == 00010000
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P1, 0x10, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // only one pin is set to 0 as interrupt mask register => M1.4 == 11101111
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTMASK_P1, 0xEF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // interrupt edge register IE1.4 with falling edge (from HIGH to LOW) == 00 00 00 10 on adress 63h
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTEDGE_P1B, 0x2, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity2;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+          //set GPIO extender
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender2;
+      } else{
+          //use first sensor
+          chprintf(stream, "unknown argument, use first sensor\n");
+          usleep(2000000);
+          buffer[0] = 0x8; // == P1.3 => Interrupt 2.7
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P1, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // enable pull-up for the one used interrupt register
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P2, 0x80, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // only one pin is set to 0 as interrupt mask register => M2.7 == 01111111
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0x7F, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // interrupt edge register IE2.7 with falling edge (from HIGH to LOW) == 10 00 00 00on adress 64h
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2B, 0x80, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+
+          //set GPIO extender
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender1;
+      }
+
+
+
+
+
+      (void)argc;
+      (void)argv;
+      //wait 60 ms for boottime from sensor
+      usleep(60000);
+      aosUtRun(stream, &moduleUtAlldVl53l0x, "VL53");
+
+      ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = NULL;
+      ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = NULL;
+      return AOS_OK;
+  }else{
+
+  // print help
+  chprintf(stream, "Usage: %s OPTION\n", argv[0]);
+  chprintf(stream, "Options:\n");
+  chprintf(stream, "  #11\n");
+  chprintf(stream, "    Test the first VL53L0X sensor on the I2C bus #1.\n");
+  chprintf(stream, "  #12\n");
+  chprintf(stream, "    Test the second VL53L0X sensor on the I2C bus #1.\n");
+  chprintf(stream, "  ... #112\n");
+  chprintf(stream, "    Test the 12 VL53L0X sensor on the I2C bus #1.\n");
+  chprintf(stream, "  #21\n");
+  chprintf(stream, "    Test the first VL53L0X sensor on the I2C bus #2.\n");
+  chprintf(stream, "  ... #212\n");
+  chprintf(stream, "    Test the 12 VL53L0X sensor on the I2C bus #2.\n");
+  return AOS_INVALIDARGUMENTS;
+  }
+
+
+  // belegung der Hols beim Sensor:
+  //                    obster/rechter: interrupt, XSHUT, GND
+  //                    mittlerer:      GND, interrupt, XSHUT, GND
+  //                    Unterster/linker:GND, interrupt, XSHUT
+  // set the XHUT Pins (P0_0 ... P0_7 P1_0 ... P1_3 ) from first GPIO-Extender to LOW
+  //    -> first: Der pin, der auf XSHUT weißt ist ein Output !
+  //    -> second: setze alle Sensoren unter reset == Der Pin erhält eine Spannung unter 1 Volt
+  //    -> third: setze einen Pin auf High (Spannung groesser 2 Volt) und dann kann man die Adresse
+  //                ansprechen.
+
+
+
+}
+static ut_vl53l0xdata_t _utAlldVL53L0XData = {
+  /* driver       */ NULL,
+  /* timeout      */ MICROSECONDS_PER_SECOND,
+  /* event source */ &aos.events.io,
+  /* event flags  */ 0,
+  /* gpio */ NULL,
+};
+aos_unittest_t moduleUtAlldVl53l0x = {
+  /* name           */ "VL53L0X",
+  /* info           */ "proximity sensor",
+  /* test function  */ utAlldVL53L0XFunc,
+  /* shell command  */ {
+    /* name     */ "unittest:Proximity",
+    /* callback */ _utShellCmdCb_AlldVL53L0X,
+    /* next     */ NULL,
+  },
+  /* data           */ &_utAlldVL53L0XData,
+};
+
+
 #endif /* (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L0X) */
 
 #if (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X) || defined(__DOXYGEN__)
diff --git a/modules/PowerManagement_1-2/module.h b/modules/PowerManagement_1-2/module.h
index 468e72f..646b7aa 100644
--- a/modules/PowerManagement_1-2/module.h
+++ b/modules/PowerManagement_1-2/module.h
@@ -458,6 +458,7 @@ extern ROMCONST char* moduleShellPrompt;
   }
 #elif (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L0X) || defined(__DOXYGEN__)
   #define MODULE_INIT_TEST_SENSORRING() {                                     \
+    aosShellAddCommand(&aos.shell, &moduleUtAlldVl53l0x.shellcmd);            \
     aosShellAddCommand(&aos.shell, &moduleUtAlldPcal6524.shellcmd);           \
     aosShellAddCommand(&aos.shell, &moduleUtAlldAt42qt1050.shellcmd);         \
   }
@@ -506,6 +507,8 @@ extern ROMCONST char* moduleShellPrompt;
   }
 #elif (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L0X) || defined(__DOXYGEN__)
   #define MODULE_INIT_PERIPHERY_COMM_SENSORRING() {                           \
+    moduleHalI2cSrPm18Pm33GaugeRearConfig.clock_speed = (VL53L0X_LLD_I2C_MAXFREQUENCY < moduleHalI2cSrPm18Pm33GaugeRearConfig.clock_speed) ? VL53L0X_LLD_I2C_MAXFREQUENCY : moduleHalI2cSrPm18Pm33GaugeRearConfig.clock_speed;  \
+    moduleHalI2cSrPm42Pm50PmVddEepromGaugeFrontConfig.clock_speed = (VL53L0X_LLD_I2C_MAXFREQUENCY < moduleHalI2cSrPm42Pm50PmVddEepromGaugeFrontConfig.clock_speed) ? VL53L0X_LLD_I2C_MAXFREQUENCY : moduleHalI2cSrPm42Pm50PmVddEepromGaugeFrontConfig.clock_speed; \
     moduleHalI2cSrPm18Pm33GaugeRearConfig.clock_speed = (PCAL6524_LLD_I2C_MAXFREQUENCY < moduleHalI2cSrPm18Pm33GaugeRearConfig.clock_speed) ? PCAL6524_LLD_I2C_MAXFREQUENCY : moduleHalI2cSrPm18Pm33GaugeRearConfig.clock_speed;  \
     moduleHalI2cSrPm42Pm50PmVddEepromGaugeFrontConfig.clock_speed = (PCAL6524_LLD_I2C_MAXFREQUENCY < moduleHalI2cSrPm42Pm50PmVddEepromGaugeFrontConfig.clock_speed) ? PCAL6524_LLD_I2C_MAXFREQUENCY : moduleHalI2cSrPm42Pm50PmVddEepromGaugeFrontConfig.clock_speed;  \
     moduleHalI2cSrPm42Pm50PmVddEepromGaugeFrontConfig.clock_speed = (AT42QT1050_LLD_I2C_MAXFREQUENCY < moduleHalI2cSrPm42Pm50PmVddEepromGaugeFrontConfig.clock_speed) ? AT42QT1050_LLD_I2C_MAXFREQUENCY : moduleHalI2cSrPm42Pm50PmVddEepromGaugeFrontConfig.clock_speed;  \
@@ -697,6 +700,7 @@ extern VCNL4020Driver moduleLldProximity2;
 
 #include <alld_PCAL6524.h>
 #include <alld_AT42QT1050.h>
+#include <alld_VL53L0X.h>
 
 /**
  * @brief   GPIO extender (I2C #1) driver.
@@ -713,6 +717,17 @@ extern PCAL6524Driver moduleLldGpioExtender2;
  */
 extern AT42QT1050Driver moduleLldTouch;
 
+
+/**
+ * @brief   Proximity sensor (I2C #1) driver.
+ */
+extern VL53L0XDriver moduleLldProximity1;
+
+/**
+ * @brief   Proximity sensor (I2C #2) driver.
+ */
+extern VL53L0XDriver moduleLldProximity2;
+
 #endif /* (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L0X) */
 
 #if (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X) || defined(__DOXYGEN__)
@@ -834,6 +849,7 @@ extern aos_unittest_t moduleUtAlldVcnl4020;
 
 #include <ut_alld_PCAL6524_v1.h>
 #include <ut_alld_AT42QT1050_v1.h>
+#include <ut_alld_VL53L0X_v1.h>
 
 /**
  * @brief   PCAL6524 (GPIO extender) unit test object.
@@ -845,6 +861,11 @@ extern aos_unittest_t moduleUtAlldPcal6524;
  */
 extern aos_unittest_t moduleUtAlldAt42qt1050;
 
+/**
+ * @brief   VL53L0X (proximity sensor) unit test object.
+ */
+extern aos_unittest_t moduleUtAlldVl53l0x;
+
 #endif /* (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L0X) */
 
 #if (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X) || defined(__DOXYGEN__)
diff --git a/periphery-lld/periphAL.h b/periphery-lld/periphAL.h
index 18c9f0f..19df56d 100644
--- a/periphery-lld/periphAL.h
+++ b/periphery-lld/periphAL.h
@@ -44,6 +44,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <aosconf.h>
 #include <hal.h>
 
+
 /*============================================================================*/
 /* DEBUG                                                                      */
 /*============================================================================*/
diff --git a/unittests/periphery-lld/inc/ut_alld_VL53L0X_v1.h b/unittests/periphery-lld/inc/ut_alld_VL53L0X_v1.h
new file mode 100644
index 0000000..1af6017
--- /dev/null
+++ b/unittests/periphery-lld/inc/ut_alld_VL53L0X_v1.h
@@ -0,0 +1,97 @@
+/*
+AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
+Copyright (C) 2016..2018  Thomas Schöpping et al.
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef AMIROOS_UT_ALLD_VL53L0X_V1_H
+#define AMIROOS_UT_ALLD_VL53L0X_V1_H
+
+#include <amiroos.h>
+
+#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_VL53L0X) && (AMIROLLD_CFG_VL53L0X == 1)) || defined(__DOXYGEN__)
+
+
+#include <alld_VL53L0X.h>
+
+
+/******************************************************************************/
+/* CONSTANTS                                                                  */
+/******************************************************************************/
+
+/******************************************************************************/
+/* SETTINGS                                                                   */
+/******************************************************************************/
+
+/******************************************************************************/
+/* CHECKS                                                                     */
+/******************************************************************************/
+
+/******************************************************************************/
+/* DATA STRUCTURES AND TYPES                                                  */
+/******************************************************************************/
+
+/**
+ * @brief   Custom data structure for the unit test.
+ */
+typedef struct {
+  /**
+   * @brief   VL53L0X driver to use.
+   */
+  VL53L0XDriver *vl53d;
+
+  /**
+   * @brief   Timeout for certain tests.
+   */
+  apalTime_t timeout;
+
+  /**
+   * @brief   Event source to listen to.
+   */
+  event_source_t* evtsource;
+
+  /**
+   * @brief   Event flags to watch.
+   */
+  eventflags_t evtflags;
+
+ /**
+  * @brief GPIO PCAL6524 driver to get interrupts.
+  */
+  PCAL6524Driver *gpio;
+
+} ut_vl53l0xdata_t;
+
+
+/******************************************************************************/
+/* MACROS                                                                     */
+/******************************************************************************/
+
+/******************************************************************************/
+/* EXTERN DECLARATIONS                                                        */
+/******************************************************************************/
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+  aos_utresult_t utAlldVL53L0XFunc(BaseSequentialStream* stream, aos_unittest_t* ut);
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_VL53L0X) */
+
+#endif /* _AMIROOS_UT_VL53L0X_LLD_HPP_ */
diff --git a/unittests/periphery-lld/src/ut_alld_VL53L0X_v1.c b/unittests/periphery-lld/src/ut_alld_VL53L0X_v1.c
new file mode 100644
index 0000000..d35163c
--- /dev/null
+++ b/unittests/periphery-lld/src/ut_alld_VL53L0X_v1.c
@@ -0,0 +1,537 @@
+/*
+AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
+Copyright (C) 2016..2019  Thomas Schöpping et al.
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <amiroos.h>
+#include <ut_alld_VL53L0X_v1.h>
+
+#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_VL53L0X) && (AMIROLLD_CFG_VL53L0X == 1)) || defined(__DOXYGEN__)
+
+/******************************************************************************/
+/* LOCAL DEFINITIONS                                                          */
+/******************************************************************************/
+
+#define INTERRUPT_EVENT_ID            1
+
+/******************************************************************************/
+/* EXPORTED VARIABLES                                                         */
+/******************************************************************************/
+
+/******************************************************************************/
+/* LOCAL TYPES                                                                */
+/******************************************************************************/
+
+/******************************************************************************/
+/* LOCAL VARIABLES                                                            */
+/******************************************************************************/
+
+/******************************************************************************/
+/* LOCAL FUNCTIONS                                                            */
+/******************************************************************************/
+
+/******************************************************************************/
+/* EXPORTED FUNCTIONS                                                         */
+/******************************************************************************/
+
+/**
+ * @brief utAlldVL53L0XFunc
+ * @param stream
+ * @param ut
+ * @return
+ *
+ *
+ * debug:
+ *  chprintf(stream, "timeout %lu\n", MyDevice.timeout); or chprintf((BaseSequentialStream*)&SD1, "%s: %d\n", __FILE__, __LINE__);
+ *  aosThdMSleep(100);
+ *
+ *
+ */
+aos_utresult_t utAlldVL53L0XFunc(BaseSequentialStream* stream, aos_unittest_t* ut)
+{
+
+  // Check if the different things are here from the module.c
+  aosDbgCheck((ut->data != NULL) &&
+                (((ut_vl53l0xdata_t*)(ut->data))->vl53d != NULL) && (((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.i2cd != NULL);
+
+  // local variables
+  aos_utresult_t result = {0, 0};
+  uint32_t status = APAL_STATUS_OK;
+  uint8_t reg_buf[4] = {0,0,0,0};
+  uint8_t* reg_8 = (uint8_t*)(reg_buf);
+  uint16_t* reg_16 = (uint16_t*)(reg_buf);
+  event_listener_t event_listener;
+  aos_timestamp_t tcurrent, tend;
+
+  VL53L0X_DeviceModes deviceMode;
+  VL53L0X_GpioFunctionality pFunctionality;
+  VL53L0X_InterruptPolarity pPolarity;
+  uint8_t pMeasurementDataReady=0;
+  VL53L0X_RangingMeasurementData_t    RangingMeasurementData;
+  VL53L0X_RangingMeasurementData_t   *pRangingMeasurementData    = &RangingMeasurementData;
+
+  uint32_t ThresholdLow;
+  uint32_t ThresholdHigh;
+
+  uint8_t buffer[24];
+  memset(buffer, 0xAA, sizeof(buffer));
+
+
+  chprintf(stream, "validate I2C bus...\n");
+
+
+  // check I2C communication after fresh reset, without API loaded (before VL53L0X_DataInit() is called)
+
+  //validate I2C bus on 0xC0 0xEE
+  status = VL53L0X_read_multi((((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.i2cd, (apalI2Caddr_t)(((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.I2cDevAddr , 0xc0, &reg_8[0], 1, (((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.timeout );
+  if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING) && reg_8[0]==0xEE) {
+    aosUtPassed(stream, &result);
+  } else {
+    aosUtFailedMsg(stream, &result, "0x%08X; 0x%08X\n", status, reg_8[0]);
+  }
+
+
+  //validate I2C bus on 0xC1 0xAA
+  status = VL53L0X_read_multi((((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.i2cd, (apalI2Caddr_t)(((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.I2cDevAddr , 0xc1, &reg_8[0], 1, (((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.timeout );
+  if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING) && reg_8[0]==0xAA) {
+    aosUtPassed(stream, &result);
+  } else {
+    aosUtFailedMsg(stream, &result, "0x%08X; 0x%08X\n", status, reg_8[0]);
+  }
+
+  //validate I2C bus on 0xC2 0x10
+  status = VL53L0X_read_multi((((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.i2cd, (apalI2Caddr_t)(((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.I2cDevAddr , 0xc2, &reg_8[0], 1, (((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.timeout );
+  if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING) && reg_8[0]==0x10) {
+    aosUtPassed(stream, &result);
+  } else {
+    aosUtFailedMsg(stream, &result, "0x%08X; 0x%08X\n", status, reg_8[0]);
+  }
+
+  //validate I2C bus on  0x51 0x0099
+  status = VL53L0X_read_multi((((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.i2cd, (apalI2Caddr_t)(((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.I2cDevAddr , 0x51, &reg_8[0], 2, (((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.timeout );
+  if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING) && reg_8[0]==0x00 && reg_8[1]==0x99) {
+    aosUtPassed(stream, &result);
+  } else {
+    aosUtFailedMsg(stream, &result, "0x%08X; 0x%08X\n", status, reg_8[0]);
+  }
+
+  //validate I2C bus on  0x61 0x0000
+  status = VL53L0X_read_multi((((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.i2cd, (apalI2Caddr_t)(((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.I2cDevAddr , 0x61, &reg_8[0], 2, (((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.timeout );
+  if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING) && reg_8[0]==0x00 && reg_8[1]==0x00) {
+    aosUtPassed(stream, &result);
+  } else {
+    aosUtFailedMsg(stream, &result, "0x%08X; 0x%08X\n", status, reg_8[0]);
+  }
+
+
+
+
+
+  chprintf(stream, "reading register...\n");
+
+  //read register 0x88 register has status 0x24
+  status = VL53L0X_read_multi((((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.i2cd, (apalI2Caddr_t)(((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.I2cDevAddr , 0x88, &reg_8[0], 1, (((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.timeout );
+  if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING) && reg_8[0]==0x24) {
+    aosUtPassed(stream, &result);
+  } else {
+    aosUtFailedMsg(stream, &result, "0x%08X; 0x%08X\n", status, reg_8[0]);
+  }
+
+
+  chprintf(stream, "writing register...\n");
+
+  //VL53L0X_WrByte(Dev, 0x88, 0x00);
+  uint8_t tx_buf = 0x00;
+  //status = VL53L0X_write_multi((((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.i2cd, (apalI2Caddr_t)(((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.I2cDevAddr, 0x88, (uint8_t*)&tx_buf, 1 ,(((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.timeout );
+
+  status = VL53L0X_write_byte((((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.i2cd, (apalI2Caddr_t)(((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.I2cDevAddr, 0x88, tx_buf,(((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.timeout );
+
+
+  if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING)) {
+    aosUtPassed(stream, &result);
+  } else {
+    aosUtFailedMsg(stream, &result, "0x%08X; 0x%08X\n", status, reg_8[0]);
+  }
+
+
+
+  //read register 0x88
+  status = VL53L0X_read_multi((((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.i2cd, (apalI2Caddr_t)(((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.I2cDevAddr , 0x88, &reg_8[0], 1, (((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.timeout );
+  if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING) && reg_8[0]==0x00) {
+    aosUtPassed(stream, &result);
+  } else {
+    aosUtFailedMsg(stream, &result, "0x%08X; 0x%08X\n", status, reg_8[0]);
+  }
+
+
+
+
+  chprintf(stream, "init sensor data...\n");
+
+  status = vl53l0x_lld_init(((ut_vl53l0xdata_t*)(ut->data))->vl53d);
+
+
+  if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING)) {
+    aosUtPassed(stream, &result);
+  } else {
+    aosUtFailedMsg(stream, &result, "0x%08X\n", status);
+  }
+
+
+  chprintf(stream, "set single mode...\n");
+
+  status = vl53l0x_lld_set_mode(((ut_vl53l0xdata_t*)(ut->data))->vl53d, VL53L0X_DEVICEMODE_SINGLE_RANGING,
+                                VL53L0X_REG_SYSTEM_INTERRUPT_GPIO_DISABLED,0,0);
+
+
+  status |= VL53L0X_GetDeviceMode(&(((ut_vl53l0xdata_t*)(ut->data))->vl53d->vl53l0x_dev), &deviceMode);
+
+
+  if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING) && deviceMode == VL53L0X_DEVICEMODE_SINGLE_RANGING) {
+    aosUtPassed(stream, &result);
+  } else {
+    aosUtFailedMsg(stream, &result, "0x%08X; %u\n", status, deviceMode);
+  }
+
+  chprintf(stream, "reading results...\n");
+
+  status = vl53l0x_lld_perform_mesaurement(((ut_vl53l0xdata_t*)(ut->data))->vl53d, &reg_16[0]);
+  chprintf(stream, "\t\tdistance : %u\n", reg_16[0]);
+  int i = 0;
+  for (i = 0; i<4; i++){
+      status |= vl53l0x_lld_perform_mesaurement(((ut_vl53l0xdata_t*)(ut->data))->vl53d, &reg_16[0]);
+
+      chprintf(stream, "\t\tdistance : %u\n", reg_16[0]);
+  }
+
+  if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING)) {
+    aosUtPassed(stream, &result);
+  } else {
+    aosUtFailedMsg(stream, &result, "0x%08X\n", status);
+  }
+
+
+
+  chprintf(stream, "setting new address...\n");
+
+  status = vl53l0x_lld_set_address(((ut_vl53l0xdata_t*)(ut->data))->vl53d, 0x49);
+
+
+  if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING)) {
+    aosUtPassed(stream, &result);
+  } else {
+    aosUtFailedMsg(stream, &result, "0x%08X\n", status);
+
+  }
+  
+  
+  //-----------------------------------------------------------------------
+
+
+
+  chprintf(stream, "reading with interrupt ...\n");
+
+
+  chprintf(stream, "\tgeneral information: eventmask VL53L0X: %lu and eventflag VL53L0X: %lu \n",
+           EVENT_MASK(INTERRUPT_EVENT_ID), ((ut_vl53l0xdata_t*)(ut->data))->evtflags);
+
+  chprintf(stream, "set single mode and interrupt to VL53L0X_REG_SYSTEM_INTERRUPT_GPIO_NEW_SAMPLE_READY ...\n");
+
+  status = vl53l0x_lld_set_mode(((ut_vl53l0xdata_t*)(ut->data))->vl53d, VL53L0X_DEVICEMODE_SINGLE_RANGING,
+                                VL53L0X_REG_SYSTEM_INTERRUPT_GPIO_NEW_SAMPLE_READY,0,0);
+  /*
+  same as
+
+  status |= VL53L0X_SetDeviceMode(&(((ut_vl53l0xdata_t*)(ut->data))->vl53d->vl53l0x_dev), VL53L0X_DEVICEMODE_SINGLE_RANGING);
+  status |= VL53L0X_SetGpioConfig(&(((ut_vl53l0xdata_t*)(ut->data))->vl53d->vl53l0x_dev), 0, VL53L0X_DEVICEMODE_SINGLE_RANGING,
+                                 VL53L0X_REG_SYSTEM_INTERRUPT_GPIO_NEW_SAMPLE_READY, VL53L0X_INTERRUPTPOLARITY_LOW);
+*/
+
+
+
+  status |= VL53L0X_GetGpioConfig(&(((ut_vl53l0xdata_t*)(ut->data))->vl53d->vl53l0x_dev), 0, &deviceMode, &pFunctionality, &pPolarity);
+
+  if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING) && deviceMode == VL53L0X_DEVICEMODE_SINGLE_RANGING &&
+          pFunctionality == VL53L0X_REG_SYSTEM_INTERRUPT_GPIO_NEW_SAMPLE_READY && pPolarity == VL53L0X_INTERRUPTPOLARITY_LOW) {
+    aosUtPassed(stream, &result);
+  } else {
+    aosUtFailedMsg(stream, &result, "0x%08X; mode:%u; Interrupt:%u; InterruptPolarity: %u\n", status, deviceMode, pFunctionality, pPolarity);
+  }
+
+
+  chprintf(stream, "check for blocking interrupts...\n");
+
+  status = vl53l0x_lld_CheckRangingDataReady(((ut_vl53l0xdata_t*)(ut->data))->vl53d, &pMeasurementDataReady);
+
+
+  if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING) && pMeasurementDataReady == 0) {
+    aosUtPassed(stream, &result);
+  } else {
+    aosUtFailedMsg(stream, &result, "0x%08X, there are blocking interrupts :%u\n", status, pMeasurementDataReady);
+    chprintf(stream, "clear blocking interrupts...\n");
+
+    status = vl53l0x_lld_getRangingData(((ut_vl53l0xdata_t*)(ut->data))->vl53d, pRangingMeasurementData);
+
+    if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING)) {
+      aosUtPassed(stream, &result);
+    } else {
+      aosUtFailedMsg(stream, &result, "0x%08X;\n", status);
+
+    }
+
+  }
+
+
+  chprintf(stream, "start maeasurement ... \n");
+
+
+  //set everything for eventshandler
+  chEvtRegister(((ut_vl53l0xdata_t*)(ut->data))->evtsource, &event_listener, INTERRUPT_EVENT_ID);
+  aosSysGetUptime(&tend);
+  tend += 2 * MICROSECONDS_PER_SECOND;
+
+  status = vl53l0x_lld_start_measurement(((ut_vl53l0xdata_t*)(ut->data))->vl53d);
+
+  if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING)) {
+    aosUtPassed(stream, &result);
+  } else {
+    aosUtFailedMsg(stream, &result, "0x%08X;\n", status);
+
+  }
+
+
+  do {
+    // read proximity data, interrupt event information and interrupt status
+    const eventmask_t emask = chEvtWaitOneTimeout(EVENT_MASK(INTERRUPT_EVENT_ID), chTimeUS2I(10*MICROSECONDS_PER_MILLISECOND));
+    const eventflags_t eflags = chEvtGetAndClearFlags(&event_listener);
+
+
+    if (emask == EVENT_MASK(INTERRUPT_EVENT_ID) &&
+        eflags == ((ut_vl53l0xdata_t*)(ut->data))->evtflags) {
+      // true positive (correct case)
+      chprintf(stream, "EVENT\n");
+      status |= VL53L0X_GetRangingMeasurementData(&(((ut_vl53l0xdata_t*)(ut->data))->vl53d->vl53l0x_dev), pRangingMeasurementData);
+      chprintf(stream, "\t\tinterrupt detected: prox = %i\n", RangingMeasurementData.RangeMilliMeter);
+      status |= VL53L0X_ClearInterruptMask(&(((ut_vl53l0xdata_t*)(ut->data))->vl53d->vl53l0x_dev),
+                                           VL53L0X_REG_SYSTEM_INTERRUPT_GPIO_LEVEL_HIGH);
+    }else if (eflags == ((ut_vl53l0xdata_t*)(ut->data))->evtflags){
+        chprintf(stream, "mask: %lu\n", emask);
+        chprintf(stream, "flag: %lu\n", eflags);
+    }else if (emask == EVENT_MASK(INTERRUPT_EVENT_ID)){
+        chprintf(stream, "first::mask: %lu and flag: %lu\n", emask, eflags);
+
+        // read from GPIO
+        status |= pcal6524_lld_read_group(((ut_vl53l0xdata_t*)ut->data)->gpio, PCAL6524_LLD_CMD_INPUT_P0, buffer,
+                                        ((ut_vl53l0xdata_t*)ut->data)->timeout);
+
+        status |= vl53l0x_lld_CheckRangingDataReady(((ut_vl53l0xdata_t*)(ut->data))->vl53d, &pMeasurementDataReady);
+
+        if ((pMeasurementDataReady == 0x01)) {
+
+            chprintf(stream, "\t\tRead input: 0x%04X 0x%04X 0x%04X\t",
+                     (((uint16_t)buffer[0]) << 8) | buffer[1],
+                     (((uint16_t)buffer[2]) << 8) | buffer[3],
+                     (((uint16_t)buffer[4]) << 8) | buffer[5]);
+
+
+            //get the measurement from VL53L0X
+            status |= vl53l0x_lld_getRangingData(((ut_vl53l0xdata_t*)(ut->data))->vl53d, pRangingMeasurementData);
+            chprintf(stream, "distance: %i\n", RangingMeasurementData.RangeMilliMeter);
+
+        }
+
+
+    }
+
+
+    aosSysGetUptime(&tcurrent);
+  } while (tcurrent < tend);
+
+  if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING)) {
+    aosUtPassed(stream, &result);
+  } else {
+    aosUtFailedMsg(stream, &result, "0x%08X; 0x%08X\n", status, pRangingMeasurementData);
+
+  }
+
+  chprintf(stream, "stop maeasurement ... \n");
+
+  status = vl53l0x_lld_stop_measurement(((ut_vl53l0xdata_t*)(ut->data))->vl53d);
+
+
+  chEvtUnregister(((ut_vl53l0xdata_t*)(ut->data))->evtsource, &event_listener);
+
+  if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING)) {
+    aosUtPassed(stream, &result);
+  } else {
+    aosUtFailedMsg(stream, &result, "0x%08X;\n", status);
+
+  }
+
+
+
+
+
+//-----------------------------------------------------
+
+  chprintf(stream, "set continuous mode and interrupt to VL53L0X_REG_SYSTEM_INTERRUPT_GPIO_OUT_OF_WINDOW (80mm/150mm) ...\n");
+
+  // wand a threshold of 80
+  // 100 mm < max Threshold von 254 mm
+  ThresholdHigh = 150;
+  ThresholdLow = 80;
+
+  status = vl53l0x_lld_set_mode(((ut_vl53l0xdata_t*)(ut->data))->vl53d, VL53L0X_DEVICEMODE_CONTINUOUS_RANGING,
+                                VL53L0X_REG_SYSTEM_INTERRUPT_GPIO_OUT_OF_WINDOW,ThresholdLow,ThresholdHigh);
+
+  status |= VL53L0X_GetGpioConfig(&(((ut_vl53l0xdata_t*)(ut->data))->vl53d->vl53l0x_dev), 0, &deviceMode, &pFunctionality, &pPolarity);
+  status |= VL53L0X_GetInterruptThresholds(&(((ut_vl53l0xdata_t*)(ut->data))->vl53d->vl53l0x_dev),
+      VL53L0X_DEVICEMODE_CONTINUOUS_RANGING,
+      &ThresholdLow, &ThresholdHigh);
+
+  if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING) && deviceMode == VL53L0X_DEVICEMODE_CONTINUOUS_RANGING &&
+          pFunctionality == VL53L0X_REG_SYSTEM_INTERRUPT_GPIO_OUT_OF_WINDOW && pPolarity == VL53L0X_INTERRUPTPOLARITY_LOW){
+          //&& ThresholdLow == 80 * 65536 && ThresholdHigh == 150 * 65536) { not possible, only strange wrong values, e.g. Threshold low:1431655765;Threshold high:0
+    aosUtPassed(stream, &result);
+  } else {
+    aosUtFailedMsg(stream, &result, "0x%08X; mode:%u; Interrupt:%u; InterruptPolarity:%u; Threshold low:%lu"
+                                    ";Threshold high:%lu\n", status, deviceMode, pFunctionality, pPolarity, ThresholdLow/65536.0, ThresholdHigh/65536.0);
+  }
+
+  chprintf(stream, "check for blocking interrupts...\n");
+
+  status = vl53l0x_lld_CheckRangingDataReady(((ut_vl53l0xdata_t*)(ut->data))->vl53d, &pMeasurementDataReady);
+
+
+  if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING) && pMeasurementDataReady == 0) {
+    aosUtPassed(stream, &result);
+  } else {
+    aosUtFailedMsg(stream, &result, "0x%08X, there are blocking interrupts :%u\n", status, pMeasurementDataReady);
+    chprintf(stream, "clear blocking interrupts...\n");
+
+    status = vl53l0x_lld_getRangingData(((ut_vl53l0xdata_t*)(ut->data))->vl53d, pRangingMeasurementData);
+
+    if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING)) {
+      aosUtPassed(stream, &result);
+    } else {
+      aosUtFailedMsg(stream, &result, "0x%08X;\n", status);
+
+    }
+
+  }
+
+
+
+
+  chprintf(stream, "start maeasurement ... \n");
+
+
+  //set everything for eventshandler
+  chEvtRegister(((ut_vl53l0xdata_t*)(ut->data))->evtsource, &event_listener, INTERRUPT_EVENT_ID);
+  aosSysGetUptime(&tend);
+  tend += 10 * MICROSECONDS_PER_SECOND;
+
+  status = vl53l0x_lld_start_measurement(((ut_vl53l0xdata_t*)(ut->data))->vl53d);
+
+  if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING)) {
+    aosUtPassed(stream, &result);
+  } else {
+    aosUtFailedMsg(stream, &result, "0x%08X;\n", status);
+
+  }
+
+
+  do {
+    // read proximity data, interrupt event information and interrupt status
+    const eventmask_t emask = chEvtWaitOneTimeout(EVENT_MASK(INTERRUPT_EVENT_ID), chTimeUS2I(10*MICROSECONDS_PER_MILLISECOND));
+    const eventflags_t eflags = chEvtGetAndClearFlags(&event_listener);
+
+    if (emask == EVENT_MASK(INTERRUPT_EVENT_ID) &&
+        eflags == ((ut_vl53l0xdata_t*)(ut->data))->evtflags) {
+      // true positive (correct case)
+      chprintf(stream, "EVENT\n");
+      status |= VL53L0X_GetRangingMeasurementData(&(((ut_vl53l0xdata_t*)(ut->data))->vl53d->vl53l0x_dev), pRangingMeasurementData);
+
+
+      chprintf(stream, "\t\tinterrupt detected: prox = %i\n", RangingMeasurementData.RangeMilliMeter);
+      status |= VL53L0X_ClearInterruptMask(&(((ut_vl53l0xdata_t*)(ut->data))->vl53d->vl53l0x_dev),0);
+    }else if (eflags == ((ut_vl53l0xdata_t*)(ut->data))->evtflags){
+        chprintf(stream, "mask: %lu\n", emask);
+        chprintf(stream, "flag: %lu\n", eflags);
+    }else if (emask == EVENT_MASK(INTERRUPT_EVENT_ID)){
+        chprintf(stream, "last::mask: %lu and flag: %lu\n", emask, eflags);
+
+        // read from GPIO
+        status |= pcal6524_lld_read_group(((ut_vl53l0xdata_t*)ut->data)->gpio, PCAL6524_LLD_CMD_INPUT_P0, buffer,
+                                        ((ut_vl53l0xdata_t*)ut->data)->timeout);
+
+        status |= vl53l0x_lld_CheckRangingDataReady(((ut_vl53l0xdata_t*)(ut->data))->vl53d, &pMeasurementDataReady);
+
+        if ((pMeasurementDataReady == 0x01)) {
+
+            chprintf(stream, "\t\tRead input: 0x%04X 0x%04X 0x%04X\t",
+                     (((uint16_t)buffer[0]) << 8) | buffer[1],
+                     (((uint16_t)buffer[2]) << 8) | buffer[3],
+                     (((uint16_t)buffer[4]) << 8) | buffer[5]);
+
+
+            //get the measurement from VL53L0X
+            status |= vl53l0x_lld_getRangingData(((ut_vl53l0xdata_t*)(ut->data))->vl53d, pRangingMeasurementData);
+            chprintf(stream, "distance: %i\n", RangingMeasurementData.RangeMilliMeter);
+        }
+
+
+    }
+
+
+    aosSysGetUptime(&tcurrent);
+  } while (tcurrent < tend);
+
+  if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING)) {
+    aosUtPassed(stream, &result);
+  } else {
+    aosUtFailedMsg(stream, &result, "0x%08X; 0x%08X\n", status, pRangingMeasurementData);
+
+  }
+
+  chprintf(stream, "stop maeasurement ... \n");
+
+  status = vl53l0x_lld_stop_measurement(((ut_vl53l0xdata_t*)(ut->data))->vl53d);
+
+
+  chEvtUnregister(((ut_vl53l0xdata_t*)(ut->data))->evtsource, &event_listener);
+
+  if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING)) {
+    aosUtPassed(stream, &result);
+  } else {
+    aosUtFailedMsg(stream, &result, "0x%08X;\n", status);
+
+  }
+
+
+
+
+  chprintf(stream, "setting default address...\n");
+
+  status = vl53l0x_lld_set_address(((ut_vl53l0xdata_t*)(ut->data))->vl53d, 0x29);
+
+
+  aosUtInfoMsg(stream, "driver object memory footprint: %u bytes\n", sizeof(VL53L0XDriver));
+
+  return result;
+}
+#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_VL53L0X) && (AMIROLLD_CFG_VL53L0X == 1) */
+
