The VL53L1CB proximity sensor, based on ST’s FlightSense™, Time-of-Flight technology.

Dependencies:   X_NUCLEO_COMMON ST_INTERFACES

Dependents:   VL53L1CB_noshield_1sensor_polls_auton VL53L1CB_noshield_1sensor_interrupt_auton X_NUCLEO_53L1A2

Based on VL53L1 library, this is a library for the VL53L1CB ToF chip.

Revision:
10:3687b5e79f98
Parent:
9:66969b9016ad
--- a/inc/VL53l1CB.h	Wed Jun 09 08:40:49 2021 +0100
+++ b/inc/VL53l1CB.h	Wed Jun 09 10:09:49 2021 +0100
@@ -34,16 +34,6 @@
 #define __VL53L1X_CLASS_H
 
 
-#ifdef _MSC_VER
-#   ifdef VL53L1X_API_EXPORTS
-#       define VL53L1X_API  __declspec(dllexport)
-#   else
-#       define VL53L1X_API
-#   endif
-#else
-#   define VL53L1X_API
-#endif
-
 
 /* Includes ------------------------------------------------------------------*/
 
@@ -63,16 +53,16 @@
 /***********************************************************/
 
 
-#define VL53L1_IMPLEMENTATION_VER_MAJOR       1
-#define VL53L1_IMPLEMENTATION_VER_MINOR       0
-#define VL53L1_IMPLEMENTATION_VER_SUB         1
-#define VL53L1_IMPLEMENTATION_VER_REVISION  0000
+#define VL53L1CB_IMPLEMENTATION_VER_MAJOR       1
+#define VL53L1CB_IMPLEMENTATION_VER_MINOR       0
+#define VL53L1CB_IMPLEMENTATION_VER_SUB         1
+#define VL53L1CB_IMPLEMENTATION_VER_REVISION  0000
 
-typedef int8_t VL53L1_ERROR;
+typedef int8_t VL53L1CB_ERROR;
 
 //#define SOFT_RESET                                          0x0000
-#define VL53L1_I2C_SLAVE__DEVICE_ADDRESS                    0x0001
-#define VL53L1_VHV_CONFIG__TIMEOUT_MACROP_LOOP_BOUND        0x0008
+#define VL53L1CB_I2C_SLAVE__DEVICE_ADDRESS                    0x0001
+#define VL53L1CB_VHV_CONFIG__TIMEOUT_MACROP_LOOP_BOUND        0x0008
 #define ALGO__CROSSTALK_COMPENSATION_PLANE_OFFSET_KCPS      0x0016
 #define ALGO__CROSSTALK_COMPENSATION_X_PLANE_GRADIENT_KCPS  0x0018
 #define ALGO__CROSSTALK_COMPENSATION_Y_PLANE_GRADIENT_KCPS  0x001A
@@ -91,7 +81,6 @@
 #define RANGE_CONFIG__SIGMA_THRESH                          0x0064
 #define RANGE_CONFIG__MIN_COUNT_RATE_RTN_LIMIT_MCPS         0x0066
 #define RANGE_CONFIG__VALID_PHASE_HIGH                      0x0069
-#define VL53L1_SYSTEM__INTERMEASUREMENT_PERIOD              0x006C
 #define SYSTEM__THRESH_HIGH                                 0x0072
 #define SYSTEM__THRESH_LOW                                  0x0074
 #define SD_CONFIG__WOI_SD0                                  0x0078
@@ -99,23 +88,17 @@
 #define ROI_CONFIG__USER_ROI_CENTRE_SPAD                    0x007F
 #define ROI_CONFIG__USER_ROI_REQUESTED_GLOBAL_XY_SIZE       0x0080
 #define SYSTEM__SEQUENCE_CONFIG                             0x0081
-#define VL53L1_SYSTEM__GROUPED_PARAMETER_HOLD               0x0082
 #define SYSTEM__INTERRUPT_CLEAR                             0x0086
 #define SYSTEM__MODE_START                                  0x0087
-#define VL53L1_RESULT__RANGE_STATUS                         0x0089
-#define VL53L1_RESULT__DSS_ACTUAL_EFFECTIVE_SPADS_SD0       0x008C
 #define RESULT__AMBIENT_COUNT_RATE_MCPS_SD                  0x0090
-#define VL53L1_RESULT__FINAL_CROSSTALK_CORRECTED_RANGE_MM_SD0               0x0096
-#define VL53L1_RESULT__PEAK_SIGNAL_COUNT_RATE_CROSSTALK_CORRECTED_MCPS_SD0  0x0098
-#define VL53L1_RESULT__OSC_CALIBRATE_VAL                    0x00DE
-#define VL53L1_FIRMWARE__SYSTEM_STATUS                      0x00E5
-#define VL53L1_IDENTIFICATION__MODEL_ID                     0x010F
-#define VL53L1_ROI_CONFIG__MODE_ROI_CENTRE_SPAD             0x013E
+#define VL53L1CB_RESULT__FINAL_CROSSTALK_CORRECTED_RANGE_MM_SD0               0x0096
+#define VL53L1CB_FIRMWARE__SYSTEM_STATUS                      0x00E5
 
 
-#define VL53L1_DEFAULT_DEVICE_ADDRESS                      0x52
 
-#define VL53L1_REG_IDENTIFICATION_MODEL_ID                 0x010F
+#define VL53L1CB_DEFAULT_DEVICE_ADDRESS                      0x52
+
+#define VL53L1CB_REG_IDENTIFICATION_MODEL_ID                 0x010F
 
 /****************************************
  * PRIVATE define do not edit
@@ -133,9 +116,9 @@
 
 
 /* Classes -------------------------------------------------------------------*/
-/** Class representing a VL53L1 sensor component
+/** Class representing a VL53L1CB sensor component
  */
-class VL53L1 : public RangeSensor
+class VL53L1CB : public RangeSensor
 {
  
 
@@ -150,7 +133,7 @@
      * @param[in] DevAddr device address, 0x52 by default
      */
 
-    VL53L1(ToF_DevI2C *i2c, DigitalOut *pin, PinName pin_gpio1, uint8_t dev_addr = VL53L1_DEFAULT_DEVICE_ADDRESS) 
+    VL53L1CB(ToF_DevI2C *i2c, DigitalOut *pin, PinName pin_gpio1, uint8_t dev_addr = VL53L1CB_DEFAULT_DEVICE_ADDRESS) 
     : RangeSensor(), dev_i2c(i2c), _gpio0(pin)
     {
         MyDevice.i2c_slave_address=dev_addr;
@@ -171,8 +154,8 @@
      * @param[in] pin_gpio1 pin Mbed InterruptIn PinName to be used as component GPIO_1 INT
      * @param[in] device address, 0x29 by default
      */
-    VL53L1(ToF_DevI2C *i2c, Stmpe1600DigiOut *pin, PinName pin_gpio1,
-            uint8_t dev_addr = VL53L1_DEFAULT_DEVICE_ADDRESS) 
+    VL53L1CB(ToF_DevI2C *i2c, Stmpe1600DigiOut *pin, PinName pin_gpio1,
+            uint8_t dev_addr = VL53L1CB_DEFAULT_DEVICE_ADDRESS) 
             : dev_i2c(i2c), _expgpio0(pin)
     {
         MyDevice.i2c_slave_address=dev_addr;
@@ -188,7 +171,7 @@
     
    /** Destructor
     */
-    virtual ~VL53L1()
+    virtual ~VL53L1CB()
     {        
         if (_gpio1Int != NULL) {
             delete _gpio1Int;
@@ -200,7 +183,7 @@
     VL53L1_DEV getDevicePtr() { return Device; }
 
     
-    /* warning: VL53L1 class inherits from GenericSensor, RangeSensor and LightSensor, that haven`t a destructor.
+    /* warning: VL53L1CB class inherits from GenericSensor, RangeSensor and LightSensor, that haven`t a destructor.
        The warning should request to introduce a virtual destructor to make sure to delete the object */
 
     /*** Interface Methods ***/
@@ -210,9 +193,9 @@
      * @return      void
      */
     /* turns on the sensor */
-    virtual void VL53L1_On(void)
+    virtual void VL53L1CB_On(void)
     {
-        printf("VL53L1_On\r\n");
+        printf("VL53L1CB_On\r\n");
         if (_gpio0) {
             *_gpio0 = 1;
         } else {
@@ -232,7 +215,7 @@
      * @return      void
      */
     /* turns off the sensor */
-    virtual void VL53L1_Off(void)
+    virtual void VL53L1CB_Off(void)
     {
         printf("VL53L1_Off\r\n");
         if (_gpio0) {
@@ -266,18 +249,18 @@
      * @return      0 on Success
      */
      
-     VL53L1_ERROR InitSensor(uint8_t address){
-        VL53L1_ERROR status = 0;
+     VL53L1CB_ERROR InitSensor(uint8_t address){
+        VL53L1CB_ERROR status = 0;
         uint8_t sensorState = 0;
-        VL53L1_Off();
-        VL53L1_On();
-        status = vl53L1_SetI2CAddress(address);
+        VL53L1CB_Off();
+        VL53L1CB_On();
+        status = VL53L1CB_SetI2CAddress(address);
         if(!status){
-            status = VL53L1_SensorInit();
+            status = VL53L1CB_SensorInit();
         }      
      
         while(!status && !sensorState) {
-            status = vl53L1_BootState(&sensorState);
+            status = VL53L1CB_BootState(&sensorState);
 
 #if (MBED_VERSION  > 60300) 
         thread_sleep_for(2);
@@ -298,7 +281,7 @@
  */
     virtual int init(void *init)
     {
-         return VL53L1_SensorInit();
+         return VL53L1CB_SensorInit();
          return 0;
     }
 
@@ -319,15 +302,15 @@
         ExpanderData[0] = 0;
         ExpanderData[1] = 0;
         rl_id = 0;
-        dev_i2c->ToF_i2c_read(&ExpanderData[0], Device->i2c_slave_address, VL53L1_REG_IDENTIFICATION_MODEL_ID, 2);
+        dev_i2c->ToF_i2c_read(&ExpanderData[0], Device->i2c_slave_address, VL53L1CB_REG_IDENTIFICATION_MODEL_ID, 2);
     
         rl_id = (ExpanderData[0] << 8) + ExpanderData[1];
         printf("Model ID is: %d (%X)  \r\n",rl_id, rl_id);
     
         uint8_t tmp = 0;
-        ExpanderData[0] = VL53L1_FIRMWARE__SYSTEM_STATUS >> 8;
-        ExpanderData[1] = VL53L1_FIRMWARE__SYSTEM_STATUS & 0x0FF;
-        dev_i2c->ToF_i2c_read(&tmp, Device->i2c_slave_address, VL53L1_FIRMWARE__SYSTEM_STATUS, 1);
+        ExpanderData[0] = VL53L1CB_FIRMWARE__SYSTEM_STATUS >> 8;
+        ExpanderData[1] = VL53L1CB_FIRMWARE__SYSTEM_STATUS & 0x0FF;
+        dev_i2c->ToF_i2c_read(&tmp, Device->i2c_slave_address, VL53L1CB_FIRMWARE__SYSTEM_STATUS, 1);
 
         printf("Firmware system is: %d\r\n",tmp);
     
@@ -402,7 +385,7 @@
     {
     int status;
     uint16_t distance;
-    status = VL53L1_GetDistance(&distance);
+    status = VL53L1CB_GetDistance(&distance);
     *piData = (uint32_t) distance;
     return status;
     }
@@ -415,281 +398,281 @@
     /**
      * @brief This function returns the SW driver version
      */
-    VL53L1_ERROR VL53L1_GetSWVersion(VL53L1_Version_t *pVersion);
+    VL53L1CB_ERROR VL53L1CB_GetSWVersion(VL53L1_Version_t *pVersion);
 
     /**
      * @brief This function sets the sensor I2C address used in case multiple devices application, default address 0x52
      */
-    VL53L1_ERROR vl53L1_SetI2CAddress(uint8_t new_address);
+    VL53L1CB_ERROR VL53L1CB_SetI2CAddress(uint8_t new_address);
 
     /**
      * @brief This function loads the 135 bytes default values to initialize the sensor.
      * @param dev Device address
      * @return 0:success, != 0:failed
      */
-    VL53L1_ERROR VL53L1_SensorInit();
+    VL53L1CB_ERROR VL53L1CB_SensorInit();
 
     /**
      * @brief This function clears the interrupt, to be called after a ranging data reading
      * to arm the interrupt for the next data ready event.
      */
-    VL53L1_ERROR VL53L1_ClearInterrupt();
+    VL53L1CB_ERROR VL53L1CB_ClearInterrupt();
 
 
     /**
      * @brief This function returns the current interrupt polarity\n
      * 1=active high (default), 0=active low
      */
-    VL53L1_ERROR VL53L1_GetInterruptPolarity(uint8_t *pIntPol);
+    VL53L1CB_ERROR VL53L1CB_GetInterruptPolarity(uint8_t *pIntPol);
 
     /**
      * @brief This function starts the ranging distance operation\n
      * The ranging operation is continuous. The clear interrupt has to be done after each get data to allow the interrupt to raise when the next data is ready\n
      * 1=active high (default), 0=active low, use SetInterruptPolarity() to change the interrupt polarity if required.
      */
-    VL53L1_ERROR VL53L1_StartRanging();
+    VL53L1CB_ERROR VL53L1CB_StartRanging();
 
     /**
      * @brief This function stops the ranging.
      */
-    VL53L1_ERROR VL53L1_StopRanging();
+    VL53L1CB_ERROR VL53L1CB_StopRanging();
 
 
 
     /**
      * @brief This function returns the boot state of the device (1:booted, 0:not booted)
      */
-    VL53L1_ERROR vl53L1_BootState(uint8_t *state);
+    VL53L1CB_ERROR VL53L1CB_BootState(uint8_t *state);
 
     /**
      * @brief This function returns the sensor id, sensor Id must be 0xEEAC
      */
-  //  VL53L1_ERROR VL53L1X_GetSensorId(uint16_t *id);
+  //  VL53L1CB_ERROR VL53L1X_GetSensorId(uint16_t *id);
 
     /**
      * @brief This function returns the distance measured by the sensor in mm
      */
-    VL53L1_ERROR VL53L1_GetDistance(uint16_t *distance);
+    VL53L1CB_ERROR VL53L1CB_GetDistance(uint16_t *distance);
 
 
     
     
     /**************************************************************************/
-    VL53L1_ERROR vl53L1_WaitDeviceBooted(VL53L1_DEV Dev);
+    VL53L1CB_ERROR VL53L1CB_WaitDeviceBooted(VL53L1_DEV Dev);
     
     
-    VL53L1_ERROR vl53L1_GetCalibrationData(VL53L1_CalibrationData_t  *pCalibrationData);
+    VL53L1CB_ERROR VL53L1CB_GetCalibrationData(VL53L1_CalibrationData_t  *pCalibrationData);
         
     
     
-    VL53L1_GPIO_Interrupt_Mode ConvertModeToLLD(VL53L1_Error *pStatus,
+    VL53L1_GPIO_Interrupt_Mode ConvertModeToLLD(VL53L1CB_ERROR *pStatus,
         VL53L1_ThresholdMode CrossMode);
       
-    VL53L1_ERROR vl53L1_GetVersion(VL53L1_Version_t *pVersion);
+    VL53L1CB_ERROR VL53L1CB_GetVersion(VL53L1_Version_t *pVersion);
     
-    VL53L1_ERROR vl53L1_GetProductRevision(
+    VL53L1CB_ERROR VL53L1CB_GetProductRevision(
     uint8_t *pProductRevisionMajor, uint8_t *pProductRevisionMinor);
     
     
-    VL53L1_ERROR vl53L1_GetDeviceInfo(
+    VL53L1CB_ERROR VL53L1CB_GetDeviceInfo(
     VL53L1_DeviceInfo_t *pVL53L1_DeviceInfo);
     
-    VL53L1_ERROR vl53L1_GetUID( uint64_t *pUid);
+    VL53L1CB_ERROR VL53L1CB_GetUID( uint64_t *pUid);
     
-    VL53L1_ERROR vl53L1_GetRangeStatusString(uint8_t RangeStatus,
+    VL53L1CB_ERROR VL53L1CB_GetRangeStatusString(uint8_t RangeStatus,
     char *pRangeStatusString);
     
     
-    VL53L1_ERROR vl53L1_GetPalErrorString(VL53L1_Error PalErrorCode,
+    VL53L1CB_ERROR VL53L1CB_GetPalErrorString(VL53L1CB_ERROR PalErrorCode,
     char *pPalErrorString);
     
     
-    VL53L1_ERROR vl53L1_GetPalStateString(VL53L1_State PalStateCode,
+    VL53L1CB_ERROR VL53L1CB_GetPalStateString(VL53L1_State PalStateCode,
     char *pPalStateString);
     
     
-    VL53L1_ERROR vl53L1_GetPalState(VL53L1_DEV Dev, VL53L1_State *pPalState);
+    VL53L1CB_ERROR VL53L1CB_GetPalState(VL53L1_DEV Dev, VL53L1_State *pPalState);
     
-    VL53L1_ERROR vl53L1_DataInit();
+    VL53L1CB_ERROR VL53L1CB_DataInit();
     
-    VL53L1_ERROR vl53L1_StaticInit();
+    VL53L1CB_ERROR VL53L1CB_StaticInit();
         
-    VL53L1_Error vl53L1_ClearInterruptAndStartMeasurement();
+    VL53L1CB_ERROR VL53L1CB_ClearInterruptAndStartMeasurement();
     
-    VL53L1_ERROR vl53L1_GetRangingMeasurementData(
+    VL53L1CB_ERROR VL53L1CB_GetRangingMeasurementData(
         VL53L1_RangingMeasurementData_t *pRangingMeasurementData);
 
-    VL53L1_ERROR vl53L1_GetMultiRangingData(
+    VL53L1CB_ERROR VL53L1CB_GetMultiRangingData(
         VL53L1_MultiRangingData_t *pMultiRangingData);   
         
-    VL53L1_ERROR vl53L1_GetAdditionalData(
+    VL53L1CB_ERROR VL53L1CB_GetAdditionalData(
                 VL53L1_AdditionalData_t *pAdditionalData);
                 
-    VL53L1_ERROR vl53L1_SetTuningParameter(
+    VL53L1CB_ERROR VL53L1CB_SetTuningParameter(
         uint16_t TuningParameterId, int32_t TuningParameterValue);
         
-    VL53L1_ERROR vl53L1_GetTuningParameter(
+    VL53L1CB_ERROR VL53L1CB_GetTuningParameter(
         uint16_t TuningParameterId, int32_t *pTuningParameterValue);
   
-    VL53L1_ERROR vl53L1_SetXTalkCompensationEnable(
+    VL53L1CB_ERROR VL53L1CB_SetXTalkCompensationEnable(
          uint8_t XTalkCompensationEnable);
          
          
-    VL53L1_ERROR vl53L1_GetXTalkCompensationEnable(
+    VL53L1CB_ERROR VL53L1CB_GetXTalkCompensationEnable(
             uint8_t *pXTalkCompensationEnable);
                        
-    VL53L1_ERROR vl53L1_PerformXTalkCalibration(
+    VL53L1CB_ERROR VL53L1CB_PerformXTalkCalibration(
     uint8_t CalibrationOption);
     
-    VL53L1_ERROR vl53L1_SetOffsetCalibrationMode(
+    VL53L1CB_ERROR VL53L1CB_SetOffsetCalibrationMode(
             VL53L1_OffsetCalibrationModes OffsetCalibrationMode);
             
 
-    VL53L1_ERROR vl53L1_SetOffsetCorrectionMode(
+    VL53L1CB_ERROR VL53L1CB_SetOffsetCorrectionMode(
             VL53L1_OffsetCorrectionModes OffsetCorrectionMode);
         
-    VL53L1_ERROR vl53L1_PerformOffsetCalibration(
+    VL53L1CB_ERROR VL53L1CB_PerformOffsetCalibration(
             int32_t CalDistanceMilliMeter, FixPoint1616_t CalReflectancePercent);
             
-    VL53L1_ERROR vl53L1_PerformOffsetSimpleCalibration(
+    VL53L1CB_ERROR VL53L1CB_PerformOffsetSimpleCalibration(
              int32_t CalDistanceMilliMeter);
     
-    VL53L1_ERROR vl53L1_PerformOffsetZeroDistanceCalibration();
+    VL53L1CB_ERROR VL53L1CB_PerformOffsetZeroDistanceCalibration();
     
-    VL53L1_ERROR vl53L1_SetCalibrationData(
+    VL53L1CB_ERROR VL53L1CB_SetCalibrationData(
         VL53L1_CalibrationData_t *pCalibrationData);
         
-    VL53L1_ERROR vl53L1_SetZoneCalibrationData(
+    VL53L1CB_ERROR VL53L1CB_SetZoneCalibrationData(
         VL53L1_ZoneCalibrationData_t *pZoneCalibrationData);
         
-    VL53L1_ERROR vl53L1_GetZoneCalibrationData(
+    VL53L1CB_ERROR VL53L1CB_GetZoneCalibrationData(
         VL53L1_ZoneCalibrationData_t  *pZoneCalibrationData);
         
-    VL53L1_ERROR vl53L1_GetOpticalCenter(
+    VL53L1CB_ERROR VL53L1CB_GetOpticalCenter(
         FixPoint1616_t *pOpticalCenterX,
         FixPoint1616_t *pOpticalCenterY);
         
-    VL53L1_ERROR vl53L1_SetThresholdConfig(VL53L1_DetectionConfig_t *pConfig);
+    VL53L1CB_ERROR VL53L1CB_SetThresholdConfig(VL53L1_DetectionConfig_t *pConfig);
     
     
-     VL53L1_ERROR vl53L1_GetLimitCheckStatus( uint16_t LimitCheckId,
+    VL53L1CB_ERROR VL53L1CB_GetLimitCheckStatus( uint16_t LimitCheckId,
                                               uint8_t *pLimitCheckStatus);    
                                               
         
-    VL53L1_ERROR vl53L1_SetLimitCheckEnable( uint16_t LimitCheckId,
+    VL53L1CB_ERROR VL53L1CB_SetLimitCheckEnable( uint16_t LimitCheckId,
                                              uint8_t LimitCheckEnable);
         
-    VL53L1_ERROR vl53L1_GetLimitCheckEnable(uint16_t LimitCheckId,
+    VL53L1CB_ERROR VL53L1CB_GetLimitCheckEnable(uint16_t LimitCheckId,
                                              uint8_t *pLimitCheckEnable);
     
-    VL53L1_ERROR vl53L1_GetThresholdConfig(VL53L1_DetectionConfig_t *pConfig);
+    VL53L1CB_ERROR VL53L1CB_GetThresholdConfig(VL53L1_DetectionConfig_t *pConfig);
         
         
-    VL53L1_ERROR vl53L1_PerformOffsetPerVcselCalibration(int32_t CalDistanceMilliMeter);
+    VL53L1CB_ERROR VL53L1CB_PerformOffsetPerVcselCalibration(int32_t CalDistanceMilliMeter);
   
-    VL53L1_ERROR vl53L1_GetNumberOfLimitCheck(uint16_t *pNumberOfLimitCheck);      
+    VL53L1CB_ERROR VL53L1CB_GetNumberOfLimitCheck(uint16_t *pNumberOfLimitCheck);      
     
-    VL53L1_ERROR vl53L1_GetLimitCheckInfo(uint16_t LimitCheckId,
+    VL53L1CB_ERROR VL53L1CB_GetLimitCheckInfo(uint16_t LimitCheckId,
                                            char *pLimitCheckString);       
         
-    VL53L1_ERROR vl53L1_SetPresetMode(VL53L1_PresetModes PresetMode);
+    VL53L1CB_ERROR VL53L1CB_SetPresetMode(VL53L1_PresetModes PresetMode);
         
-    VL53L1_ERROR vl53L1_GetPresetMode( VL53L1_PresetModes *pPresetMode);
+    VL53L1CB_ERROR VL53L1CB_GetPresetMode( VL53L1_PresetModes *pPresetMode);
                                     
-    VL53L1_ERROR vl53L1_SetDistanceMode( VL53L1_DistanceModes DistanceMode);
+    VL53L1CB_ERROR VL53L1CB_SetDistanceMode( VL53L1_DistanceModes DistanceMode);
                                                                                     
-    VL53L1_ERROR vl53L1_GetDistanceMode(VL53L1_DistanceModes *pDistanceMode);
+    VL53L1CB_ERROR VL53L1CB_GetDistanceMode(VL53L1_DistanceModes *pDistanceMode);
                                              
-    VL53L1_ERROR vl53L1_SetOutputMode(VL53L1_OutputModes OutputMode);
+    VL53L1CB_ERROR VL53L1CB_SetOutputMode(VL53L1_OutputModes OutputMode);
                                            
-    VL53L1_ERROR vl53L1_GetOutputMode(VL53L1_OutputModes *pOutputMode);
+    VL53L1CB_ERROR VL53L1CB_GetOutputMode(VL53L1_OutputModes *pOutputMode);
                                         
-    VL53L1_ERROR vl53L1_SetMeasurementTimingBudgetMicroSeconds(uint32_t MeasurementTimingBudgetMicroSeconds);
+    VL53L1CB_ERROR VL53L1CB_SetMeasurementTimingBudgetMicroSeconds(uint32_t MeasurementTimingBudgetMicroSeconds);
                                     
-    VL53L1_ERROR vl53L1_SetInterMeasurementPeriodMilliSeconds(uint32_t InterMeasurementPeriodMilliSeconds);
+    VL53L1CB_ERROR VL53L1CB_SetInterMeasurementPeriodMilliSeconds(uint32_t InterMeasurementPeriodMilliSeconds);
                                    
     
-    VL53L1_ERROR vl53L1_GetInterMeasurementPeriodMilliSeconds(
+    VL53L1CB_ERROR VL53L1CB_GetInterMeasurementPeriodMilliSeconds(
             uint32_t *pInterMeasurementPeriodMilliSeconds);
         
         
-    VL53L1_ERROR vl53L1_SetDmaxReflectance( FixPoint1616_t DmaxReflectance);
+    VL53L1CB_ERROR VL53L1CB_SetDmaxReflectance( FixPoint1616_t DmaxReflectance);
                                                 
-    VL53L1_ERROR vl53L1_GetDmaxReflectance(FixPoint1616_t *pDmaxReflectance);
+    VL53L1CB_ERROR VL53L1CB_GetDmaxReflectance(FixPoint1616_t *pDmaxReflectance);
                                                 
                                                 
-    VL53L1_ERROR vl53L1_GetDmaxMode( VL53L1_DeviceDmaxModes *pDmaxMode);    
+    VL53L1CB_ERROR VL53L1CB_GetDmaxMode( VL53L1_DeviceDmaxModes *pDmaxMode);    
                                     
-    VL53L1_ERROR vl53L1_GetMeasurementTimingBudgetMicroSeconds(
+    VL53L1CB_ERROR VL53L1CB_GetMeasurementTimingBudgetMicroSeconds(
                                  uint32_t *pMeasurementTimingBudgetMicroSeconds);  
                                  
-    VL53L1_ERROR vl53L1_SetDmaxMode(VL53L1_DeviceDmaxModes DmaxMode);    
+    VL53L1CB_ERROR VL53L1CB_SetDmaxMode(VL53L1_DeviceDmaxModes DmaxMode);    
                                      
-    VL53L1_ERROR vl53L1_SetLimitCheckValue( uint16_t LimitCheckId,
+    VL53L1CB_ERROR VL53L1CB_SetLimitCheckValue( uint16_t LimitCheckId,
                                             FixPoint1616_t LimitCheckValue);
                                             
-    VL53L1_ERROR vl53L1_GetLimitCheckValue(uint16_t LimitCheckId,
+    VL53L1CB_ERROR VL53L1CB_GetLimitCheckValue(uint16_t LimitCheckId,
                                             FixPoint1616_t *pLimitCheckValue);   
                                             
-    VL53L1_ERROR vl53L1_GetLimitCheckCurrent( uint16_t LimitCheckId,
+    VL53L1CB_ERROR VL53L1CB_GetLimitCheckCurrent( uint16_t LimitCheckId,
                                               FixPoint1616_t *pLimitCheckCurrent);   
                                             
-    VL53L1_ERROR vl53L1_GetMaxNumberOfROI( uint8_t *pMaxNumberOfROI);    
+    VL53L1CB_ERROR VL53L1CB_GetMaxNumberOfROI( uint8_t *pMaxNumberOfROI);    
                                            
-    VL53L1_ERROR vl53L1_SetROI(VL53L1_RoiConfig_t *pRoiConfig);
+    VL53L1CB_ERROR VL53L1CB_SetROI(VL53L1_RoiConfig_t *pRoiConfig);
                                 
-     VL53L1_ERROR vl53L1_GetROI(VL53L1_RoiConfig_t *pRoiConfig);
+    VL53L1CB_ERROR VL53L1CB_GetROI(VL53L1_RoiConfig_t *pRoiConfig);
                                  
-    VL53L1_ERROR vl53L1_GetNumberOfSequenceSteps(uint8_t *pNumberOfSequenceSteps);          
+    VL53L1CB_ERROR VL53L1CB_GetNumberOfSequenceSteps(uint8_t *pNumberOfSequenceSteps);          
     
-    VL53L1_ERROR vl53L1_GetSequenceStepsInfo(VL53L1_SequenceStepId SequenceStepId,
+    VL53L1CB_ERROR VL53L1CB_GetSequenceStepsInfo(VL53L1_SequenceStepId SequenceStepId,
                                               char *pSequenceStepsString);   
                                               
                                               
-    VL53L1_ERROR vl53L1_SetSequenceStepEnable(VL53L1_SequenceStepId SequenceStepId, uint8_t SequenceStepEnabled);    
+    VL53L1CB_ERROR VL53L1CB_SetSequenceStepEnable(VL53L1_SequenceStepId SequenceStepId, uint8_t SequenceStepEnabled);    
         
         
-    VL53L1_ERROR vl53L1_GetSequenceStepEnable(VL53L1_SequenceStepId SequenceStepId, uint8_t *pSequenceStepEnabled); 
+    VL53L1CB_ERROR VL53L1CB_GetSequenceStepEnable(VL53L1_SequenceStepId SequenceStepId, uint8_t *pSequenceStepEnabled); 
            
     
-    VL53L1_ERROR vl53L1_StartMeasurement();
+    VL53L1CB_ERROR VL53L1CB_StartMeasurement();
     
-    VL53L1_ERROR vl53L1_StopMeasurement();
+    VL53L1CB_ERROR VL53L1CB_StopMeasurement();
     
     
-    VL53L1_ERROR vl53L1_GetMeasurementDataReady(uint8_t *pMeasurementDataReady); 
+    VL53L1CB_ERROR VL53L1CB_GetMeasurementDataReady(uint8_t *pMeasurementDataReady); 
                                                  
-    VL53L1_ERROR vl53L1_WaitMeasurementDataReady();        
+    VL53L1CB_ERROR VL53L1CB_WaitMeasurementDataReady();        
     
-    VL53L1_Error vl53L1_SmudgeCorrectionEnable(VL53L1_SmudgeCorrectionModes Mode);                                                                                                                                                    
+    VL53L1CB_ERROR VL53L1CB_SmudgeCorrectionEnable(VL53L1_SmudgeCorrectionModes Mode);                                                                                                                                                    
     /***************************************************************************/
     
 
     /* Write and read functions from I2C */
 
-    VL53L1_ERROR VL53L1_WrByte(VL53L1_DEV dev, uint16_t index, uint8_t data);
-    VL53L1_ERROR VL53L1_WrWord(VL53L1_DEV dev, uint16_t index, uint16_t data);
-    VL53L1_ERROR VL53L1_WrDWord(VL53L1_DEV dev, uint16_t index, uint32_t data);
-    VL53L1_ERROR VL53L1_RdByte(VL53L1_DEV dev, uint16_t index, uint8_t *data);
-    VL53L1_ERROR VL53L1_RdWord(VL53L1_DEV dev, uint16_t index, uint16_t *data);
-    VL53L1_ERROR VL53L1_RdDWord(VL53L1_DEV dev, uint16_t index, uint32_t *data);
-    VL53L1_ERROR VL53L1_UpdateByte(VL53L1_DEV dev, uint16_t index, uint8_t AndData, uint8_t OrData);
+    VL53L1CB_ERROR VL53L1CB_WrByte(VL53L1_DEV dev, uint16_t index, uint8_t data);
+    VL53L1CB_ERROR VL53L1CB_WrWord(VL53L1_DEV dev, uint16_t index, uint16_t data);
+    VL53L1CB_ERROR VL53L1CB_WrDWord(VL53L1_DEV dev, uint16_t index, uint32_t data);
+    VL53L1CB_ERROR VL53L1CB_RdByte(VL53L1_DEV dev, uint16_t index, uint8_t *data);
+    VL53L1CB_ERROR VL53L1CB_RdWord(VL53L1_DEV dev, uint16_t index, uint16_t *data);
+    VL53L1CB_ERROR VL53L1CB_RdDWord(VL53L1_DEV dev, uint16_t index, uint32_t *data);
+    VL53L1CB_ERROR VL53L1CB_UpdateByte(VL53L1_DEV dev, uint16_t index, uint8_t AndData, uint8_t OrData);
 
-    VL53L1_ERROR VL53L1_WriteMulti(VL53L1_DEV Dev, uint16_t index, uint8_t *pdata, uint32_t count);
-    VL53L1_ERROR VL53L1_ReadMulti(VL53L1_DEV Dev, uint16_t index, uint8_t *pdata, uint32_t count);
+    VL53L1CB_ERROR VL53L1CB_WriteMulti(VL53L1_DEV Dev, uint16_t index, uint8_t *pdata, uint32_t count);
+    VL53L1CB_ERROR VL53L1CB_ReadMulti(VL53L1_DEV Dev, uint16_t index, uint8_t *pdata, uint32_t count);
 
-    VL53L1_ERROR VL53L1_I2CWrite(uint8_t dev, uint16_t index, uint8_t *data, uint16_t number_of_bytes);
-    VL53L1_ERROR VL53L1_I2CRead(uint8_t dev, uint16_t index, uint8_t *data, uint16_t number_of_bytes);
-    VL53L1_ERROR VL53L1_GetTickCount(uint32_t *ptick_count_ms);
-    VL53L1_ERROR VL53L1_WaitUs(VL53L1_Dev_t *pdev, int32_t wait_us);
-    VL53L1_ERROR VL53L1_WaitMs(VL53L1_Dev_t *pdev, int32_t wait_ms);
+    VL53L1CB_ERROR VL53L1CB_I2CWrite(uint8_t dev, uint16_t index, uint8_t *data, uint16_t number_of_bytes);
+    VL53L1CB_ERROR VL53L1CB_I2CRead(uint8_t dev, uint16_t index, uint8_t *data, uint16_t number_of_bytes);
+    VL53L1CB_ERROR VL53L1CB_GetTickCount(uint32_t *ptick_count_ms);
+    VL53L1CB_ERROR VL53L1CB_WaitUs(VL53L1_Dev_t *pdev, int32_t wait_us);
+    VL53L1CB_ERROR VL53L1CB_WaitMs(VL53L1_Dev_t *pdev, int32_t wait_ms);
     
-    VL53L1_ERROR vl53L1_WaitValueMaskEx(VL53L1_Dev_t *pdev, uint32_t timeout_ms, uint16_t index, uint8_t value, uint8_t mask, uint32_t poll_delay_ms);
-    VL53L1_ERROR VL53L1_SetDeviceAddress(VL53L1_DEV Dev, uint8_t DeviceAddress);
+    VL53L1CB_ERROR VL53L1CB_WaitValueMaskEx(VL53L1_Dev_t *pdev, uint32_t timeout_ms, uint16_t index, uint8_t value, uint8_t mask, uint32_t poll_delay_ms);
+    VL53L1CB_ERROR VL53L1CB_SetDeviceAddress(VL53L1_DEV Dev, uint8_t DeviceAddress);
     
     // from vl53l1_api_debug.c
 
-    VL53L1_Error vl53L1_get_additional_data(
+    VL53L1CB_ERROR VL53L1CB_get_additional_data(
         VL53L1_DEV                       Dev,
         VL53L1_additional_data_t        *pdata);