commit bf8ca9aae1c1e1ac22201e87735499dff5a00d6a
Author: Andre Raming <araming@techfak.uni-bielefeld.de>
Date:   Mon Apr 29 15:29:19 2019 +0200

    driver vl53l0x is ready

diff --git a/modules/PowerManagement_1-2/module.c b/modules/PowerManagement_1-2/module.c
index 4af94a8..32ee176 100644
--- a/modules/PowerManagement_1-2/module.c
+++ b/modules/PowerManagement_1-2/module.c
@@ -697,8 +697,9 @@ VL53L0XDriver moduleLldProximity1 = {
                 /* XTalkCompensationRangeMilliMeter */ 0,
                 /* XTalkCompensationRateMegaCps */ 0,
                 /* RangeOffsetMicroMeters */ 0,
-                /* !! LimitChecksEnable */ 0,
-                /* LimitChecksStatus */ 0,
+                /* !! LimitChecksEnable */ {0},
+                /* LimitChecksStatus */ {0},
+                /* LimitChecksValue */ {0},
                 /* !! WrapAroundCheckEnable */ 0,
 
             },
@@ -749,8 +750,8 @@ VL53L0XDriver moduleLldProximity1 = {
             },
             /* VL53L0X_SpadData_t */
             {
-                /* RefSpadEnables */ 0,
-                /* RefGoodSpadMap */ 0,
+                /* RefSpadEnables */ {0},
+                /* RefGoodSpadMap */ {0},
 
             },
             /* SequenceConfig */ 0,
@@ -802,8 +803,9 @@ VL53L0XDriver moduleLldProximity2 = {
                 /* XTalkCompensationRangeMilliMeter */ 0,
                 /* XTalkCompensationRateMegaCps */ 0,
                 /* RangeOffsetMicroMeters */ 0,
-                /* !! LimitChecksEnable */ 0,
-                /* LimitChecksStatus */ 0,
+                /* !! LimitChecksEnable */ {0},
+                /* LimitChecksStatus */ {0},
+                /* LimitChecksValue */ {0},
                 /* !! WrapAroundCheckEnable */ 0,
 
             },
@@ -822,7 +824,7 @@ VL53L0XDriver moduleLldProximity2 = {
             },
             /* VL53L0X_HistogramMeasurementData_t */
             {
-                /* HistogramData */ 0,
+                /* HistogramData */ {0},
                 /* HistogramType */ 0,
                 /* FirstBin */ 0,
                 /* BufferSize */ 0,
@@ -854,8 +856,8 @@ VL53L0XDriver moduleLldProximity2 = {
             },
             /* VL53L0X_SpadData_t */
             {
-                /* RefSpadEnables */ 0,
-                /* RefGoodSpadMap */ 0,
+                /* RefSpadEnables */ {0},
+                /* RefGoodSpadMap */ {0},
 
             },
             /* SequenceConfig */ 0,
@@ -1608,39 +1610,102 @@ static int _utShellCmdCb_AlldVL53L0X(BaseSequentialStream* stream, int argc, cha
     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
+    /*  1.1
+        set XSHUT as output(0) and GPIO/interrzpt as input(1)
+        XSHUT are P0_0 ... P0_7 P1_0 ... P1_3
+        intertupt are P1_4 ... P1_7 P2_0 ... P2_7
+    */
+    //P0_0...P0_7: 0x00 == 00000000
+    status = pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_CONFIGURATION_P0, 0x00, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    //P1_0...P1_7: 0xF0==11110000
+    status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_CONFIGURATION_P1, 0xF0, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    //P2_0...P2_7: 0xFF==11111111
+    status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_CONFIGURATION_P2, 0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+    /*  1.2
+        to set all VL53L0X to standby, you must set the XSHUT to low through pull-down.A better way is to set for all a pull-up and write the value 0 (low) to
+        Output port registers.
+        Therefore you must active the pull-ups/pull-downs for all XSHUT anf GPIO pins.
+        Set all XSHUT to low with a pull-down and all interrupts to high with a pull-up.
+    */
+
+    //activte pull-up/pull-down for all pins
+    status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDENABLE_P0, 0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDENABLE_P1, 0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
     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
+    //set pins to pull-up(1) or pull-down(0)
+    status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P0, 0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P1, 0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_PUPDSELECTION_P2, 0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    //set output ports to logical 0 to set VL53L0X to standby. If the port is an input port nothing happens.
+    status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_OUTPUT_P0, 0x00, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_OUTPUT_P1, 0x00, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
+    /*  2.1
+        Configuration of the interrupt handling on GPIO Extander.
+        The Interrupt pins are already set as Input (pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_CONFIGURATION_P1, 0xF0,...); for Pins P1_0...P1_7).
+        To enable interrupts you must set the interrupt mask register to 0 for the GPIO pins (P1_4...P1_7 P2_0...P2_7).
+        Set for unittest all pins to 1 and only enable the one used pin.
+    */
+    status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTMASK_P0, 0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTMASK_P1, 0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
+    /*  2.2
+        Set the interrupt edge register (60h to 65h) after you set the interrupt mask register (we unset this a step before) to declare if a rising edge (01)
+        or a falling edge (10) or other is an interrupt.
+        The GPIO1 pin from the VL53L0X is low and goes high if an interrupt is detected, you must use 01 for the pins P1_4...P1_7 P2_0...P2_7.
+
+    */
+    //P1_4...P1_7: 0x55==01010101
+    //status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P1B, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    //P2_3...P2_0: 0x55==01010101
+    //status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2A, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    //P2_4...P2_7: 0x55==01010101
+    //status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2B, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+    /*  3
+        Latch the input register (48h,49h,4Ah) enable and disable the input latch of the I/O pins. Write a 0 == not lachted and every read from the Input registers (00h,01h,02h)
+        and every change from the VL53L0X will clear the interrupt. Write a 1 == lachted and only a read from the Input registers (00h,01h,02h) will clear the interrupt.
+        Therefore it is not important what is set in step 2.1 and 2.2.
+    */
+    //P1_7...P1_4 set to 1 and P1_3...P1_0 set to 0: 0xF0==11110000
+    status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INPUTLATCH_P1, 0xF0, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    //P2_7...P2_0 set to 1: 0xFF==11111111
+    status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INPUTLATCH_P2, 0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
+
+
+    // same as second GPIO-Extender
+    // set input/output
+    status = pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_CONFIGURATION_P0, 0x00, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_CONFIGURATION_P1, 0xF0, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_CONFIGURATION_P2, 0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+    //activte pull-up/pull-down for all pins
     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);
+    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_PUPDENABLE_P2, 0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    //set pins to pull-up(1) or pull-down(0)
+    status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P0, 0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P1, 0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_PUPDSELECTION_P2, 0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    //set output ports to logical 0 to set VL53L0X to standby. If the port is an input port nothing happens.
+    status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_OUTPUT_P0, 0x00, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_OUTPUT_P1, 0x00, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    //un enable all interrupts
+    status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTMASK_P0, 0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTMASK_P1, 0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    // set interrupt to latch
+    status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INPUTLATCH_P1, 0xF0, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+    status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INPUTLATCH_P2, 0xFF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
+
 
 
 
@@ -1661,382 +1726,419 @@ static int _utShellCmdCb_AlldVL53L0X(BaseSequentialStream* stream, int argc, cha
     GP == GPIO Extender
       */
   if (argc == 2) {
+
+      /*  scheme to set VL53L0X with the GPIO Extender:
+       * set bitmask for XSHUT, e.g. XSHUT at 0.3 => 00001000 == buffer[0] = 0x8;
+       * find the corresponding interrupt pin, e.g. 0.3 with interrupt 1.7
+       * 1.1 start the sensor, e.g for XSHUT at 0.3
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_OUTPUT_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+       * 2.1 set the interrupt, e.g. for 1.7 == 011111111 == 0x7F
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTMASK_P1, 0x7F, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+       * 2.2 set interrupt edge register, e.g. interrupt at 1.7
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P1B, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+       */
+
+
       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
+          //start the sensor
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_OUTPUT_P1, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          //In step 2.1 the interrupt pins were unenabled, so enable the one necessary interrupt pin.
+          // 011111111 == 0x7F
           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);
+          // set interrupt edge register, see step 2.2
+          // P2_4...P2_7: 0x55==01010101, although we need only the register 2_6, but the are ignored.
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2B, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
 
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
-          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
 
           //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
+          //start the sensor
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_OUTPUT_P1, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          //In step 2.1 the interrupt pins were unenabled, so enable the one necessary interrupt pin.
+          // 1011111111 == 0xBF
           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);
+          // set interrupt edge register, see step 2.2
+          // P2_4...P2_7: 0x55==01010101, although we need only the register 2_6, but the are ignored.
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2B, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
 
 
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
-          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
 
           //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);
+          //start the sensor
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_OUTPUT_P1, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          //In step 2.1 the interrupt pins were unenabled, so enable the one necessary interrupt pin.
+          // 1101111111 == 0xDF == M2.5
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0xDF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // P2_4...P2_7: 0x55==01010101, although we need only the register 2_5, but the are ignored.
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2B, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
 
 
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
-          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
           //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
+          //start the sensor
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_OUTPUT_P1, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          //In step 2.1 the interrupt pins were unenabled, so enable the one necessary interrupt pin.
+          // 11101111 == 0xEF
           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);
+          // set interrupt edge register, see step 2.2
+          // P2_4...P2_7: 0x55==01010101, although we need only the register 2_6, but the are ignored.
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2B, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
 
 
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
-          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
           //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
+          //start the sensor
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_OUTPUT_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          //In step 2.1 the interrupt pins were unenabled, so enable the one necessary interrupt pin.
+          // 11110111 == 0xF7
           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);
-
+          // set interrupt edge register, see step 2.2
+          // P2_0...P2_3: 0x55==01010101, although we need only the register 2_6, but the are ignored.
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2A, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
 
 
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
-          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
           //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
+          //start the sensor
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_OUTPUT_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          //In step 2.1 the interrupt pins were unenabled, so enable the one necessary interrupt pin.
+          // 11111011 == 0xFB
           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);
+          // set interrupt edge register, see step 2.2
+          // P2_0...P2_3: 0x55==01010101, although we need only the register 2_6, but the are ignored.
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2A, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
 
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
-          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
           //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
+          //start the sensor
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_OUTPUT_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          //In step 2.1 the interrupt pins were unenabled, so enable the one necessary interrupt pin.
+          // 11111101 == 0xFD
           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);
+          // set interrupt edge register, see step 2.2
+          // P2_0...P2_3: 0x55==01010101, although we need only the register 2_6, but the are ignored.
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2A, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
 
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
-          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
           //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
+          //start the sensor
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_OUTPUT_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          //In step 2.1 the interrupt pins were unenabled, so enable the one necessary interrupt pin.
+          // 11111110 == 0xFE
           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);
+          // set interrupt edge register, see step 2.2
+          // P2_3...P2_0: 0x55==01010101, although we need only the register 2_6, but the are ignored.
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2A, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
 
 
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
-          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
           //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
+          //start the sensor
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_OUTPUT_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          //In step 2.1 the interrupt pins were unenabled, so enable the one necessary interrupt pin.
+          // 011111111 == 0x7F
           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);
+          // set interrupt edge register, see step 2.2
+          // P1_4...P1_7: 0x55==01010101, although we need only the register 2_6, but the are ignored.
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P1B, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
 
 
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
-          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
           //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
+          //start the sensor
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_OUTPUT_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          //In step 2.1 the interrupt pins were unenabled, so enable the one necessary interrupt pin.
+          // 10111111 == 0xBF
           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);
+          // set interrupt edge register, see step 2.2
+          // P1_4...P1_7: 0x55==01010101, although we need only the register 2_6, but the are ignored.
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P1B, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
 
 
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
-          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
           //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
+          //start the sensor
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_OUTPUT_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          //In step 2.1 the interrupt pins were unenabled, so enable the one necessary interrupt pin.
+          // 11011111 == 0xDF
           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);
-
+          // set interrupt edge register, see step 2.2
+          // P1_4...P1_7: 0x55==01010101, although we need only the register 2_6, but the are ignored.
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P1B, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
 
 
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
-          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
           //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
+          //start the sensor
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_OUTPUT_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          //In step 2.1 the interrupt pins were unenabled, so enable the one necessary interrupt pin.
+          // 11101111 == 0xEF
           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);
+          // set interrupt edge register, see step 2.2
+          // P1_4...P1_7: 0x55==01010101, although we need only the register 2_6, but the are ignored.
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P1B, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
 
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
-          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
           //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
+          //start the sensor
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_OUTPUT_P1, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          //In step 2.1 the interrupt pins were unenabled, so enable the one necessary interrupt pin.
+          // 011111111 == 0x7F
           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);
+          // set interrupt edge register, see step 2.2
+          // P2_4...P2_7: 0x55==01010101, although we need only the register 2_6, but the are ignored.
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2B, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
 
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity2;
-          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
           //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
+          //start the sensor
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_OUTPUT_P1, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          //In step 2.1 the interrupt pins were unenabled, so enable the one necessary interrupt pin.
+          // 1011111111 == 0xBF
           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);
+          // set interrupt edge register, see step 2.2
+          // P2_4...P2_7: 0x55==01010101, although we need only the register 2_6, but the are ignored.
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2B, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
 
 
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity2;
-          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
           //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);
-
+          //start the sensor
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_OUTPUT_P1, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          //In step 2.1 the interrupt pins were unenabled, so enable the one necessary interrupt pin.
+          // 1101111111 == 0xDF == M2.5
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTMASK_P2, 0xDF, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          // P2_4...P2_7: 0x55==01010101, although we need only the register 2_5, but the are ignored.
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2B, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
 
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity2;
-          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
           //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
+          //start the sensor
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_OUTPUT_P1, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          //In step 2.1 the interrupt pins were unenabled, so enable the one necessary interrupt pin.
+          // 11101111 == 0xEF
           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);
+          // set interrupt edge register, see step 2.2
+          // P2_4...P2_7: 0x55==01010101, although we need only the register 2_6, but the are ignored.
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2B, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
 
 
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity2;
-          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
           //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
+          //start the sensor
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_OUTPUT_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          //In step 2.1 the interrupt pins were unenabled, so enable the one necessary interrupt pin.
+          // 11110111 == 0xF7
           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);
+          // set interrupt edge register, see step 2.2
+          // P2_0...P2_3: 0x55==01010101, although we need only the register 2_6, but the are ignored.
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2A, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
 
 
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity2;
-          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
           //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
+          //start the sensor
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_OUTPUT_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          //In step 2.1 the interrupt pins were unenabled, so enable the one necessary interrupt pin.
+          // 11111011 == 0xFB
           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);
+          // set interrupt edge register, see step 2.2
+          // P2_0...P2_3: 0x55==01010101, although we need only the register 2_6, but the are ignored.
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2A, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
 
 
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity2;
-          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
           //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
+          //start the sensor
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_OUTPUT_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          //In step 2.1 the interrupt pins were unenabled, so enable the one necessary interrupt pin.
+          // 11111101 == 0xFD
           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);
-
+          // set interrupt edge register, see step 2.2
+          // P2_0...P2_3: 0x55==01010101, although we need only the register 2_6, but the are ignored.
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2A, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
 
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity2;
-          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
           //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
+          //start the sensor
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_OUTPUT_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          //In step 2.1 the interrupt pins were unenabled, so enable the one necessary interrupt pin.
+          // 11111110 == 0xFE
           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);
+          // set interrupt edge register, see step 2.2
+          // P2_3...P2_0: 0x55==01010101, although we need only the register 2_6, but the are ignored.
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2A, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
 
 
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity2;
-          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
           //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
+          //start the sensor
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_OUTPUT_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          //In step 2.1 the interrupt pins were unenabled, so enable the one necessary interrupt pin.
+          // 011111111 == 0x7F
           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);
+          // set interrupt edge register, see step 2.2
+          // P1_4...P1_7: 0x55==01010101, although we need only the register 2_6, but the are ignored.
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTEDGE_P1B, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
 
 
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity2;
-          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
           //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
+          //start the sensor
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_OUTPUT_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          //In step 2.1 the interrupt pins were unenabled, so enable the one necessary interrupt pin.
+          // 10111111 == 0xBF
           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);
+          // set interrupt edge register, see step 2.2
+          // P1_4...P1_7: 0x55==01010101, although we need only the register 2_6, but the are ignored.
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTEDGE_P1B, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
 
 
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity2;
-          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
           //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
+          //start the sensor
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_OUTPUT_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          //In step 2.1 the interrupt pins were unenabled, so enable the one necessary interrupt pin.
+          // 11011111 == 0xDF
           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);
+          // set interrupt edge register, see step 2.2
+          // P1_4...P1_7: 0x55==01010101, although we need only the register 2_6, but the are ignored.
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTEDGE_P1B, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
 
 
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity2;
-          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
           //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
+          //start the sensor
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_OUTPUT_P0, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          //In step 2.1 the interrupt pins were unenabled, so enable the one necessary interrupt pin.
+          // 11101111 == 0xEF
           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);
-
+          // set interrupt edge register, see step 2.2
+          // P1_4...P1_7: 0x55==01010101, although we need only the register 2_6, but the are ignored.
+          status |= pcal6524_lld_write_reg(mux2, PCAL6524_LLD_CMD_INTERRUPTEDGE_P1B, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
 
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity2;
-          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
           //set GPIO extender
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender2;
-      } else{
+      } 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
+          //start the sensor
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_OUTPUT_P1, buffer[0], ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+          //In step 2.1 the interrupt pins were unenabled, so enable the one necessary interrupt pin.
+          // 011111111 == 0x7F
           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);
+          // set interrupt edge register, see step 2.2
+          // P2_4...P2_7: 0x55==01010101, although we need only the register 2_6, but the are ignored.
+          status |= pcal6524_lld_write_reg(mux1, PCAL6524_LLD_CMD_INTERRUPTEDGE_P2B, 0x55, ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->timeout);
+
 
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->vl53d = &moduleLldProximity1;
-          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
+          ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
 
           //set GPIO extender
           ((ut_vl53l0xdata_t*)moduleUtAlldVl53l0x.data)->gpio = &moduleLldGpioExtender1;
diff --git a/periphery-lld/AMiRo-LLD b/periphery-lld/AMiRo-LLD
index 6ebebd4..c368a76 160000
--- a/periphery-lld/AMiRo-LLD
+++ b/periphery-lld/AMiRo-LLD
@@ -1 +1 @@
-Subproject commit 6ebebd4d7aa9aa16a2322c41de61d41fd62140d4
+Subproject commit c368a7653aea662f10bd6661493f26b162f0a821
diff --git a/unittests/periphery-lld/src/ut_alld_VL53L0X_v1.c b/unittests/periphery-lld/src/ut_alld_VL53L0X_v1.c
index d35163c..f6ed778 100644
--- a/unittests/periphery-lld/src/ut_alld_VL53L0X_v1.c
+++ b/unittests/periphery-lld/src/ut_alld_VL53L0X_v1.c
@@ -98,43 +98,49 @@ aos_utresult_t utAlldVL53L0XFunc(BaseSequentialStream* stream, aos_unittest_t* u
   //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) {
+
+          //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) {
+
+              //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) {
+                  //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]);
+                  }
+              } else {
+                aosUtFailedMsg(stream, &result, "0x%08X; 0x%08X\n", status, reg_8[0]);
+              }
+
+          } else {
+            aosUtFailedMsg(stream, &result, "0x%08X; 0x%08X\n", status, reg_8[0]);
+          }
+
+      } 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]);
-  }
+
+
+
+
+
+
 
 
 
@@ -151,7 +157,7 @@ aos_utresult_t utAlldVL53L0XFunc(BaseSequentialStream* stream, aos_unittest_t* u
   }
 
 
-  chprintf(stream, "writing register...\n");
+  chprintf(stream, "writing register (Byte)...\n");
 
   //VL53L0X_WrByte(Dev, 0x88, 0x00);
   uint8_t tx_buf = 0x00;
@@ -167,6 +173,7 @@ aos_utresult_t utAlldVL53L0XFunc(BaseSequentialStream* stream, aos_unittest_t* u
   }
 
 
+  chprintf(stream, "writing register (multi)...\n");
 
   //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 );
@@ -209,12 +216,12 @@ aos_utresult_t utAlldVL53L0XFunc(BaseSequentialStream* stream, aos_unittest_t* u
   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]);
+  chprintf(stream, "\t\tdistance : %u mm\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]);
+      chprintf(stream, "\t\tdistance : %u mm\n", reg_16[0]);
   }
 
   if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING)) {
@@ -252,20 +259,13 @@ aos_utresult_t utAlldVL53L0XFunc(BaseSequentialStream* stream, aos_unittest_t* u
 
   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) {
+          pFunctionality == VL53L0X_REG_SYSTEM_INTERRUPT_GPIO_NEW_SAMPLE_READY && pPolarity == VL53L0X_INTERRUPTPOLARITY_HIGH) {
     aosUtPassed(stream, &result);
   } else {
     aosUtFailedMsg(stream, &result, "0x%08X; mode:%u; Interrupt:%u; InterruptPolarity: %u\n", status, deviceMode, pFunctionality, pPolarity);
@@ -276,6 +276,27 @@ aos_utresult_t utAlldVL53L0XFunc(BaseSequentialStream* stream, aos_unittest_t* u
 
   status = vl53l0x_lld_CheckRangingDataReady(((ut_vl53l0xdata_t*)(ut->data))->vl53d, &pMeasurementDataReady);
 
+  status |= pcal6524_lld_read_group(((ut_vl53l0xdata_t*)ut->data)->gpio, PCAL6524_LLD_CMD_INPUT_P0, buffer,
+                                  ((ut_vl53l0xdata_t*)ut->data)->timeout);
+  switch (pcal6524_lld_cmd_groupsize(PCAL6524_LLD_CMD_INPUT_P0)) {
+  case 1:
+
+      break;
+  case 2:
+      break;
+  case 3:
+      chprintf(stream, "\t\tRead input: 0x%02X 0x%02X 0x%02X\t", buffer[0], buffer[1], buffer[2]);
+      break;
+  case 6:
+      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]);
+      break;
+  default:
+      break;
+  }
+
 
   if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING) && pMeasurementDataReady == 0) {
     aosUtPassed(stream, &result);
@@ -297,7 +318,6 @@ aos_utresult_t utAlldVL53L0XFunc(BaseSequentialStream* stream, aos_unittest_t* u
 
   chprintf(stream, "start maeasurement ... \n");
 
-
   //set everything for eventshandler
   chEvtRegister(((ut_vl53l0xdata_t*)(ut->data))->evtsource, &event_listener, INTERRUPT_EVENT_ID);
   aosSysGetUptime(&tend);
@@ -312,47 +332,46 @@ aos_utresult_t utAlldVL53L0XFunc(BaseSequentialStream* stream, aos_unittest_t* u
 
   }
 
-
+chprintf(stream, "Check for interrupts ... \n");
   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 eventmask_t emask = chEvtWaitOneTimeout(EVENT_MASK(INTERRUPT_EVENT_ID), chTimeUS2I(MICROSECONDS_PER_SECOND));
     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);
+      chprintf(stream, "\t\tEVENT");
+      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_getRangingData(((ut_vl53l0xdata_t*)(ut->data))->vl53d, pRangingMeasurementData);
 
-        status |= vl53l0x_lld_CheckRangingDataReady(((ut_vl53l0xdata_t*)(ut->data))->vl53d, &pMeasurementDataReady);
 
-        if ((pMeasurementDataReady == 0x01)) {
+      switch (pcal6524_lld_cmd_groupsize(PCAL6524_LLD_CMD_INPUT_P0)) {
+      case 1:
 
-            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]);
+          break;
+      case 2:
+          break;
+      case 3:
+          chprintf(stream, "\tRead input: 0x%02X 0x%02X 0x%02X", buffer[0], buffer[1], buffer[2]);
+          break;
+      case 6:
+          chprintf(stream, "\t\tRead input: 0x%04X 0x%04X 0x%04X",
+                   (((uint16_t)buffer[0]) << 8) | buffer[1],
+                   (((uint16_t)buffer[2]) << 8) | buffer[3],
+                   (((uint16_t)buffer[4]) << 8) | buffer[5]);
+          break;
+      default:
+          break;
+      }
+      chprintf(stream, "\tdistance = %i mm\n", RangingMeasurementData.RangeMilliMeter);
 
 
-            //get the measurement from VL53L0X
-            status |= vl53l0x_lld_getRangingData(((ut_vl53l0xdata_t*)(ut->data))->vl53d, pRangingMeasurementData);
-            chprintf(stream, "distance: %i\n", RangingMeasurementData.RangeMilliMeter);
-
-        }
 
+    }else{
+        chprintf(stream, "\tNo Interrupt, last measurement = %i mm\n", (((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.Data.LastRangeMeasure.RangeMilliMeter);
 
     }
 
@@ -403,7 +422,7 @@ aos_utresult_t utAlldVL53L0XFunc(BaseSequentialStream* stream, aos_unittest_t* u
       &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){
+          pFunctionality == VL53L0X_REG_SYSTEM_INTERRUPT_GPIO_OUT_OF_WINDOW && pPolarity == VL53L0X_INTERRUPTPOLARITY_HIGH){
           //&& ThresholdLow == 80 * 65536 && ThresholdHigh == 150 * 65536) { not possible, only strange wrong values, e.g. Threshold low:1431655765;Threshold high:0
     aosUtPassed(stream, &result);
   } else {
@@ -415,6 +434,26 @@ aos_utresult_t utAlldVL53L0XFunc(BaseSequentialStream* stream, aos_unittest_t* u
 
   status = vl53l0x_lld_CheckRangingDataReady(((ut_vl53l0xdata_t*)(ut->data))->vl53d, &pMeasurementDataReady);
 
+  status |= pcal6524_lld_read_group(((ut_vl53l0xdata_t*)ut->data)->gpio, PCAL6524_LLD_CMD_INPUT_P0, buffer,
+                                  ((ut_vl53l0xdata_t*)ut->data)->timeout);
+  switch (pcal6524_lld_cmd_groupsize(PCAL6524_LLD_CMD_INPUT_P0)) {
+  case 1:
+
+      break;
+  case 2:
+      break;
+  case 3:
+      chprintf(stream, "\t\tRead input: 0x%02X 0x%02X 0x%02X\t", buffer[0], buffer[1], buffer[2]);
+      break;
+  case 6:
+      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]);
+      break;
+  default:
+      break;
+  }
 
   if ((status == APAL_STATUS_OK || status == APAL_STATUS_WARNING) && pMeasurementDataReady == 0) {
     aosUtPassed(stream, &result);
@@ -422,6 +461,7 @@ aos_utresult_t utAlldVL53L0XFunc(BaseSequentialStream* stream, aos_unittest_t* u
     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)) {
@@ -433,9 +473,6 @@ aos_utresult_t utAlldVL53L0XFunc(BaseSequentialStream* stream, aos_unittest_t* u
 
   }
 
-
-
-
   chprintf(stream, "start maeasurement ... \n");
 
 
@@ -446,57 +483,45 @@ aos_utresult_t utAlldVL53L0XFunc(BaseSequentialStream* stream, aos_unittest_t* u
 
   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 eventmask_t emask = chEvtWaitOneTimeout(EVENT_MASK(INTERRUPT_EVENT_ID), chTimeUS2I(MICROSECONDS_PER_SECOND));
     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);
+      chprintf(stream, "\t\tEVENT");
+      // 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);
+      switch (pcal6524_lld_cmd_groupsize(PCAL6524_LLD_CMD_INPUT_P0)) {
+      case 1:
+
+          break;
+      case 2:
+          break;
+      case 3:
+          chprintf(stream, "\tRead input: 0x%02X 0x%02X 0x%02X\t", buffer[0], buffer[1], buffer[2]);
+          break;
+      case 6:
+          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]);
+          break;
+      default:
+          break;
+      }
+      status |= vl53l0x_lld_getRangingData(((ut_vl53l0xdata_t*)(ut->data))->vl53d, pRangingMeasurementData);
+
+
+      chprintf(stream, "distance = %i mm\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);
-        }
-
-
+    }else{
+      chprintf(stream, "\tNo Interrupt, last measurement = %i mm\n", (((ut_vl53l0xdata_t*)(ut->data))->vl53d)->vl53l0x_dev.Data.LastRangeMeasure.RangeMilliMeter);
     }
 
-
     aosSysGetUptime(&tcurrent);
   } while (tcurrent < tend);
 
@@ -523,7 +548,6 @@ aos_utresult_t utAlldVL53L0XFunc(BaseSequentialStream* stream, aos_unittest_t* u
 
 
 
-
   chprintf(stream, "setting default address...\n");
 
   status = vl53l0x_lld_set_address(((ut_vl53l0xdata_t*)(ut->data))->vl53d, 0x29);
