Upgrade M3 release for TOF

VL53L1 driver code from STM
Maintenance 3 release.

Modifications
1. Ambient level is now available in ranging data when no target is
   detected
2. When no target is detected the ranging data are set to fixed values
   and range status equals 255
3. New tuning parameter to choose number of measurement loops for the
   simple offset calibration
4. Support for new Xtalk calibration method(FullROI)
5. Code cleanup to comply with linux checkpatch(kernel version 4.14)
6. In Ranging/MultiZone mode, the input sub-system injecting data
   package format has to be compliant with requirements of QCOM Sensor
   Event data packing
7. In Lite/Autonomous mode, the input sub-system injecting is disabled
   temporarily
8. Support for Autonomous Low power mode in Linux driver
9. Deadlock fix (this was provided as a patch on Maint2 some time back)
10. Allow Tuning parameter update anytime

Fixes:
11. Code optimization in histogram functions saved about 4Kbytes of
    stack size
12. Improved accuracy in offset calibration functions
13. Improved accuracy in inter measurement period used for TIMED modes

Change-Id: I603d25d54a5f264eb415431ee3acecb74961a301
Signed-off-by: Ravi Vembu <raviv@motorola.com>
Reviewed-on: https://gerrit.mot.com/1304907
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Sumit Jamadar <xkbr38@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Kalyan 2019-02-04 18:02:57 -02:00 • committed by Kaio Karam Galvao
commit 4f6b53fba5
72 changed files with 10907 additions and 10275 deletions

View file

@ -1,9 +0,0 @@
DLKM_DIR := motorola/kernel/modules
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := stmvl53l1.ko
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
include $(DLKM_DIR)/AndroidKernelModule.mk

View file

@ -2,21 +2,19 @@
# Kbuild for the vl53L1 drivers.
#
EXTRA_CFLAGS += -Wall
EXTRA_CFLAGS += -I$(TOP)/motorola/kernel/modules/include
EXTRA_CFLAGS += -I$(TOP)/motorola/kernel/modules/drivers/input/misc/vl53L1/inc -I$(TOP)/motorola/kernel/modules/drivers/input/misc/vl53L1/ipp -I$(TOP)/motorola/kernel/modules/drivers/input/misc/vl53L1
ccflags-y += -I$(src)/inc -I$(src)/ipp -I$(src)
# define this environment variable if you want to compile driver for an old
# kernel
ifdef OLD_NETLINK_API
EXTRA_CFLAGS += -DOLD_NETLINK_API
ccflags-y += -DOLD_NETLINK_API
endif
ifdef VL53L1_LOG_ENABLE
EXTRA_CFLAGS += -DVL53L1_LOG_ENABLE
ccflags-y += -DVL53L1_LOG_ENABLE
endif
obj-m += stmvl53l1.o
obj-$(CONFIG_STMVL53L1) += stmvl53l1.o
stmvl53l1-objs := stmvl53l1_module.o stmvl53l1_module-i2c.o
stmvl53l1-objs += stmvl53l1_i2c.o stmvl53l1_ipp_nl.o stmvl53l1_log.o
stmvl53l1-objs += src/vl53l1_api.o src/vl53l1_api_core.o
@ -24,7 +22,7 @@ stmvl53l1-objs += src/vl53l1_api_strings.o src/vl53l1_error_strings.o
stmvl53l1-objs += src/vl53l1_core.o src/vl53l1_register_funcs.o
stmvl53l1-objs += src/vl53l1_api_preset_modes.o
stmvl53l1-objs += src/vl53l1_api_calibration.o
stmvl53l1-objs += src/vl53l1_fpga_core.o src/vl53l1_silicon_core.o
stmvl53l1-objs += src/vl53l1_silicon_core.o
stmvl53l1-objs += src/vl53l1_zone_presets.o src/vl53l1_nvm.o
stmvl53l1-objs += src/vl53l1_api_debug.o src/vl53l1_core_support.o
stmvl53l1-objs += src/vl53l1_wait.o ipp/ipp_linux.o

View file

@ -1,10 +1,12 @@
KERNEL_SRC ?= /lib/modules/$(shell uname -r)/build
ifneq ($(KERNELRELEASE),)
include Kbuild
all:
$(MAKE) -C $(KERNEL_SRC) M=$(shell pwd) modules $(KBUILD_OPTIONS)
modules_install:
$(MAKE) INSTALL_MOD_STRIP=1 -C $(KERNEL_SRC) M=$(shell pwd) modules_install
else
KDIR ?= /lib/modules/`uname -r`/build
default:
CONFIG_STMVL53L1=m $(MAKE) -C $(KDIR) M=$$PWD
clean:
$(MAKE) -C $(KERNEL_SRC) M=$(PWD) clean
CONFIG_STMVL53L1=m $(MAKE) -C $(KDIR) M=$$PWD clean
endif

View file

@ -1,64 +1,64 @@
/*
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed, either
* 'STMicroelectronics Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
********************************************************************************
*
*/
/******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
******************************************************************************
'STMicroelectronics Proprietary license'
*******************************************************************************
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
*******************************************************************************
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones mentioned above :
*******************************************************************************
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************
*/
#ifndef _VL53L1_API_H_
#define _VL53L1_API_H_
@ -71,6 +71,16 @@ extern "C"
{
#endif
#if !defined(VL53L1DevDataGet)
#warning "PALDevDataGet is deprecated define VL53L1DevDataGet instead"
#define VL53L1DevDataGet(Dev, field) (Dev->Data.field)
#endif
#if !defined(VL53L1DevDataSet)
#warning "PALDevDataSet is deprecated define VL53L1DevDataSet instead"
#define VL53L1DevDataSet(Dev, field, data) ((Dev->Data.field) = (data))
#endif
/** @defgroup VL53L1_cut11_group VL53L1 cut1.1 Function Definition
* @brief VL53L1 cut1.1 Function Definition
* @{
@ -195,6 +205,9 @@ VL53L1_Error VL53L1_GetPalState(VL53L1_DEV Dev,
* before start programming the sensor.
* When a single device us used, there is no need to call this function.
*
* When it is requested for multi devices system this function MUST be called
* prior to VL53L1_DataInit()
*
* @note This function Access to the device
*
* @param Dev Device Handle
@ -209,17 +222,17 @@ VL53L1_Error VL53L1_SetDeviceAddress(VL53L1_DEV Dev,
*
* @brief One time device initialization
*
* To be called once and only once after device is brought out of reset
* (Chip enable) and booted see @a VL53L1_WaitDeviceBooted()
* To be called after device has been powered on and booted
* see @a VL53L1_WaitDeviceBooted()
*
* @par Function Description
* When not used after a fresh device "power up" or reset, it may return
* When not used after a fresh device "power up", it may return
* @a #VL53L1_ERROR_CALIBRATION_WARNING meaning wrong calibration data
* may have been fetched from device that can result in ranging offset error\n
* If application cannot execute device reset or need to run VL53L1_DataInit
* multiple time then it must ensure proper offset calibration saving and
* restore on its own by using @a VL53L1_GetOffsetCalibrationData() on first
* power up and then @a VL53L1_SetOffsetCalibrationData() in all subsequent init
* If VL53L1_DataInit is called several times then the application must restore
* calibration calling @a VL53L1_SetOffsetCalibrationData()
* It implies application has gathered calibration data thanks to
* @a VL53L1_GetOffsetCalibrationData() after an initial calibration stage.
* This function will change the VL53L1_State from VL53L1_STATE_POWERDOWN to
* VL53L1_STATE_WAIT_STATICINIT.
*
@ -368,9 +381,9 @@ VL53L1_Error VL53L1_GetDistanceMode(VL53L1_DEV Dev,
* Set the output mode to be used for the next ranging. The output mode is used
* to select, in case of multiple objects, which one will be used in
* function @a VL53L1_GetRangingMeasurementData().
* VL53L1_SetOutputMode also sets the object used by automatic
* distance mode algorithm when @a VL53L1_SetDistanceMode() is
* set to automatic mode.
* VL53L1_SetOutputMode also sets the object used by automatic
* distance mode algorithm when @a VL53L1_SetDistanceMode() is
* set to automatic mode.
*
* @note This function doesn't Access to the device
*
@ -451,6 +464,9 @@ VL53L1_Error VL53L1_GetMeasurementTimingBudgetMicroSeconds(
*
* @param Dev Device Handle
* @param InterMeasurementPeriodMilliSeconds Inter-Measurement Period in ms.
* this value should be greater than the duration set in
* @a VL53L1_SetMeasurementTimingBudgetMicroSeconds() to ensure smooth ranging
* operation.
* @return VL53L1_ERROR_NONE Success
* @return "Other error code" See ::VL53L1_Error
*/
@ -523,7 +539,7 @@ VL53L1_Error VL53L1_SetDmaxMode(VL53L1_DEV Dev,
*
* @return VL53L1_ERROR_NONE Success
* @return "Other error code" See ::VL53L1_Error
*/
*/
VL53L1_Error VL53L1_GetDmaxMode(VL53L1_DEV Dev,
VL53L1_DeviceDmaxModes *pDmaxMode);
@ -559,7 +575,7 @@ VL53L1_Error VL53L1_GetNumberOfLimitCheck(
* The limit check is identified with the LimitCheckId.
*
* @param LimitCheckId Limit Check ID
(0<= LimitCheckId < VL53L1_GetNumberOfLimitCheck() ).
* (0<= LimitCheckId < VL53L1_GetNumberOfLimitCheck() ).
* @param pLimitCheckString Pointer to the description string of
* the given check limit. Shall be defined as char buf[VL53L1_MAX_STRING_LENGTH]
* @return VL53L1_ERROR_NONE Success
@ -886,8 +902,12 @@ VL53L1_Error VL53L1_GetSequenceStepEnable(VL53L1_DEV Dev,
* @return VL53L1_ERROR_NONE Success
* @return VL53L1_ERROR_MODE_NOT_SUPPORTED This error occurs when
* PresetMode programmed with @a VL53L1_SetPresetMode
*
* @return VL53L1_ERROR_TIME_OUT Time out on start measurement
* @return VL53L1_ERROR_INVALID_PARAMS This error might occur in timed mode
* when inter measurement period is smaller or too close to the timing budget.
* In such case measurements are not started and user must correct the timings
* passed to @a VL53L1_SetMeasurementTimingBudgetMicroSeconds() and
* @a VL53L1_SetInterMeasurementPeriodMilliSeconds() functions.
* @return "Other error code" See ::VL53L1_Error
*/
VL53L1_Error VL53L1_StartMeasurement(VL53L1_DEV Dev);
@ -1028,8 +1048,8 @@ VL53L1_Error VL53L1_GetMultiRangingData(VL53L1_DEV Dev,
* VL53L1_ClearInterruptAndStartMeasurement(). Depending on the PresetMode
* currently set parts of the returned data structure may be not relevant.
*
* @param Dev Device Handle
* @param VL53L1_AdditionalData_t Pointer to Additional data
* @param Dev Device Handle
* @param pAdditionalData Pointer to Additional data
* @return VL53L1_ERROR_NONE Success
* @return "Other error code" See ::VL53L1_Error
*/
@ -1110,7 +1130,7 @@ VL53L1_Error VL53L1_PerformRefSpadManagement(VL53L1_DEV Dev);
* See ::VL53L1_SmudgeCorrectionModes
* @return VL53L1_ERROR_NONE Success
* @return "Other error code" See ::VL53L1_Error
*/
*/
VL53L1_Error VL53L1_SmudgeCorrectionEnable(VL53L1_DEV Dev,
VL53L1_SmudgeCorrectionModes Mode);
@ -1124,7 +1144,7 @@ VL53L1_Error VL53L1_SmudgeCorrectionEnable(VL53L1_DEV Dev,
* to be set 0 = disabled or 1 = enabled.
* @return VL53L1_ERROR_NONE Success
* @return "Other error code" See ::VL53L1_Error
*/
*/
VL53L1_Error VL53L1_SetXTalkCompensationEnable(VL53L1_DEV Dev,
uint8_t XTalkCompensationEnable);
@ -1161,9 +1181,6 @@ VL53L1_Error VL53L1_GetXTalkCompensationEnable(VL53L1_DEV Dev,
*
* @param Dev Device Handle
* @param CalibrationOption Select the Calibration to be run :
* @param VL53L1_XTALKCALIBRATIONMODE_NO_TARGET the
* calibration works on its own and changes the current preset mode so user
* must call again @a VL53L1_SetPresetMode() after the calibration
* @param CalibrationOption
* @li VL53L1_XTALKCALIBRATIONMODE_SINGLE_TARGET the calibration uses current
* preset and distance mode without altering them.<br>
@ -1175,6 +1192,15 @@ VL53L1_Error VL53L1_GetXTalkCompensationEnable(VL53L1_DEV Dev,
* User must call @a VL53L1_SetPresetMode() again after calibration to set the
* desired one. during this calibration mode no object must be put below a 80cm
* distance from the target
* @li VL53L1_XTALKCALIBRATIONMODE_FULL_ROI the calibration sets appropriate
* preset and distance mode and thus override existing ones<br>
* User must call @a VL53L1_SetPresetMode() again after calibration to set the
* desired one.
* The ROI settings must define a single 16x16 ROI before to launch this
* function.
* The calibration uses a target which should be located at least @60cm from the
* device. The actual location of the target shall be passed
* through the bare driver tuning parameters table
*
* @return VL53L1_ERROR_NONE Success
* @return "Other error code" See ::VL53L1_Error
@ -1192,11 +1218,7 @@ VL53L1_Error VL53L1_PerformXTalkCalibration(VL53L1_DEV Dev,
* @param OffsetCalibrationMode Offset Calibration Mode valid values are:
* @li VL53L1_OFFSETCALIBRATIONMODE_STANDARD
* @li VL53L1_OFFSETCALIBRATIONMODE_PRERANGE_ONLY
*/
/**
* @li VL53L1_OFFSETCALIBRATIONMODE_MULTI_ZONE
*/
/**
*
* @return VL53L1_ERROR_NONE Success
* @return "Other error code" See ::VL53L1_Error
@ -1357,9 +1379,9 @@ VL53L1_Error VL53L1_GetZoneCalibrationData(VL53L1_DEV Dev,
* @note This function doesn't Accesses the device
*
* @param Dev Device Handle
* @param *pOpticalCentreX pointer to the X position of center
* @param pOpticalCenterX pointer to the X position of center
* in 16.16 fix point
* @param *pOpticalCentreY pointer to the Y position of center
* @param pOpticalCenterY pointer to the Y position of center
* in 16.16 fix point
* @return VL53L1_ERROR_NONE Success
* @return "Other error code" See ::VL53L1_Error
@ -1377,22 +1399,22 @@ VL53L1_Error VL53L1_GetOpticalCenter(VL53L1_DEV Dev,
*/
/**
* @brief Configure the interrupt config, from the given structure
*
* @param[in] Dev : Device Handle
* @param[in] pConfig : pointer to configuration structure
*/
* @brief Configure the interrupt config, from the given structure
*
* @param[in] Dev : Device Handle
* @param[in] pConfig : pointer to configuration structure
*/
VL53L1_Error VL53L1_SetThresholdConfig(VL53L1_DEV Dev,
VL53L1_DetectionConfig_t *pConfig);
/**
* @brief Retrieves the interrupt config structure currently programmed
* into the API
*
* @param[in] Dev : Device Handle
* @param[out] pConfig : pointer to configuration structure
*/
* @brief Retrieves the interrupt config structure currently programmed
* into the API
*
* @param[in] Dev : Device Handle
* @param[out] pConfig : pointer to configuration structure
*/
VL53L1_Error VL53L1_GetThresholdConfig(VL53L1_DEV Dev,
VL53L1_DetectionConfig_t *pConfig);

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/
@ -149,7 +149,8 @@ extern "C" {
VL53L1_Error VL53L1_run_ref_spad_char(VL53L1_DEV Dev, VL53L1_Error *pcal_status);
VL53L1_Error VL53L1_run_ref_spad_char(VL53L1_DEV Dev,
VL53L1_Error * pcal_status);
@ -283,6 +284,11 @@ VL53L1_Error VL53L1_run_spad_rate_map(
@ -317,61 +323,6 @@ VL53L1_Error VL53L1_run_xtalk_extraction(
VL53L1_Error VL53L1_run_xtalk_extraction_dual_reflectance(
VL53L1_DEV Dev,
uint16_t dss_config__target_total_rate_mcps,
uint32_t phasecal_config_timeout_us,
uint32_t mm_config_timeout_us,
uint32_t range_config_timeout_us,
uint8_t num_of_samples,
uint8_t calc_parms,
uint8_t higher_reflectance,
uint16_t expected_target_distance_mm,
uint16_t xtalk_filter_thresh_mm,
VL53L1_Error *pcal_status);
@ -411,37 +362,6 @@ VL53L1_Error VL53L1_get_and_avg_xtalk_samples(
VL53L1_Error VL53L1_get_and_avg_all_xtalk_samples(
VL53L1_DEV Dev,
uint8_t num_of_samples,
uint8_t measurement_mode,
int16_t xtalk_filter_thresh_mm,
VL53L1_xtalk_range_results_t *pxtalk_results,
VL53L1_histogram_bin_data_t *pavg_histo_z0,
VL53L1_histogram_bin_data_t *pavg_histo_z1,
VL53L1_histogram_bin_data_t *pavg_histo_z2,
VL53L1_histogram_bin_data_t *pavg_histo_z3,
VL53L1_histogram_bin_data_t *pavg_histo_z4);
@ -493,6 +413,7 @@ VL53L1_Error VL53L1_run_offset_calibration(
VL53L1_Error VL53L1_run_phasecal_average(
@ -540,6 +461,16 @@ VL53L1_Error VL53L1_run_phasecal_average(
@ -561,6 +492,101 @@ VL53L1_Error VL53L1_run_zone_calibration(
VL53L1_Error *pcal_status);
void VL53L1_hist_xtalk_extract_data_init(
VL53L1_hist_xtalk_extract_data_t *pxtalk_data);
VL53L1_Error VL53L1_hist_xtalk_extract_update(
int16_t target_distance_mm,
uint16_t target_width_oversize,
VL53L1_histogram_bin_data_t *phist_bins,
VL53L1_hist_xtalk_extract_data_t *pxtalk_data);
VL53L1_Error VL53L1_hist_xtalk_extract_fini(
VL53L1_histogram_bin_data_t *phist_bins,
VL53L1_hist_xtalk_extract_data_t *pxtalk_data,
VL53L1_xtalk_calibration_results_t *pxtalk_cal,
VL53L1_xtalk_histogram_shape_t *pxtalk_shape);
VL53L1_Error VL53L1_run_hist_xtalk_extraction(
VL53L1_DEV Dev,
int16_t cal_distance_mm,
VL53L1_Error *pcal_status);
#ifdef __cplusplus
}
#endif

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/
@ -281,6 +281,8 @@ VL53L1_Error VL53L1_set_inter_measurement_period_ms(
VL53L1_Error VL53L1_get_inter_measurement_period_ms(
VL53L1_DEV Dev,
uint32_t *pinter_measurement_period_ms);
@ -301,6 +303,9 @@ VL53L1_Error VL53L1_get_inter_measurement_period_ms(
VL53L1_Error VL53L1_set_timeouts_us(
VL53L1_DEV Dev,
@ -350,6 +355,7 @@ VL53L1_Error VL53L1_get_timeouts_us(
VL53L1_Error VL53L1_set_calibration_repeat_period(
@ -368,6 +374,7 @@ VL53L1_Error VL53L1_set_calibration_repeat_period(
VL53L1_Error VL53L1_get_calibration_repeat_period(
VL53L1_DEV Dev,
uint16_t *pcal_config__repeat_period);
@ -559,6 +566,7 @@ VL53L1_Error VL53L1_get_user_zone(
VL53L1_Error VL53L1_get_mode_mitigation_roi(
VL53L1_DEV Dev,
VL53L1_user_zone_t *pmm_roi);
@ -627,6 +635,12 @@ VL53L1_Error VL53L1_get_zone_config(
@ -775,6 +789,7 @@ void VL53L1_get_xtalk_compensation_enable(
VL53L1_Error VL53L1_init_and_start_range(
@ -929,6 +944,7 @@ void VL53L1_copy_sys_and_core_results_to_range_results(
VL53L1_Error VL53L1_set_zone_dss_config(
VL53L1_DEV Dev,
VL53L1_zone_private_dyn_cfg_t *pzone_dyn_cfg);
@ -1178,6 +1194,7 @@ VL53L1_Error VL53L1_get_offset_correction_mode(
VL53L1_Error VL53L1_set_zone_calibration_data(
VL53L1_DEV Dev,
VL53L1_zone_calibration_results_t *pzone_cal);
@ -1194,6 +1211,7 @@ VL53L1_Error VL53L1_set_zone_calibration_data(
VL53L1_Error VL53L1_get_zone_calibration_data(
VL53L1_DEV Dev,
VL53L1_zone_calibration_results_t *pzone_cal);
@ -1596,6 +1614,7 @@ VL53L1_Error VL53L1_set_dmax_reflectance_values(
VL53L1_Error VL53L1_get_dmax_reflectance_values(
VL53L1_DEV Dev,
VL53L1_dmax_reflectance_array_t *pdmax_reflectances);
@ -1912,6 +1931,7 @@ VL53L1_Error VL53L1_set_current_xtalk_settings(
VL53L1_xtalk_calibration_results_t *pxtalk
);
#ifdef __cplusplus
}
#endif

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/
@ -121,6 +121,7 @@ extern "C" {
VL53L1_Error VL53L1_decode_calibration_data_buffer(
uint16_t buf_size,
uint8_t *pbuffer,
@ -155,6 +156,7 @@ VL53L1_Error VL53L1_get_nvm_debug_data(
VL53L1_Error VL53L1_get_histogram_debug_data(
VL53L1_DEV Dev,
VL53L1_histogram_bin_data_t *pdata);
@ -243,6 +245,7 @@ void VL53L1_signed_fixed_point_sprintf(
void VL53L1_print_static_nvm_managed(
VL53L1_static_nvm_managed_t *pdata,
char *pprefix,
@ -258,6 +261,7 @@ void VL53L1_print_static_nvm_managed(
void VL53L1_print_customer_nvm_managed(
VL53L1_customer_nvm_managed_t *pdata,
char *pprefix,
@ -368,6 +372,7 @@ void VL53L1_print_range_data(
void VL53L1_print_offset_range_results(
VL53L1_offset_range_results_t *pdata,
char *pprefix,
@ -416,6 +421,7 @@ void VL53L1_print_cal_peak_rate_map(
void VL53L1_print_additional_offset_cal_data(
VL53L1_additional_offset_cal_data_t *pdata,
char *pprefix,
@ -447,6 +453,7 @@ void VL53L1_print_additional_data(
void VL53L1_print_gain_calibration_data(
VL53L1_gain_calibration_data_t *pdata,
char *pprefix,
@ -529,6 +536,7 @@ void VL53L1_print_xtalk_range_data(
void VL53L1_print_xtalk_calibration_results(
VL53L1_xtalk_calibration_results_t *pdata,
char *pprefix,

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/
@ -118,6 +118,7 @@ extern "C" {
VL53L1_Error VL53L1_init_refspadchar_config_struct(
VL53L1_refspadchar_config_t *pdata);
@ -147,6 +148,7 @@ VL53L1_Error VL53L1_init_ssc_config_struct(
VL53L1_Error VL53L1_init_xtalk_config_struct(
VL53L1_customer_nvm_managed_t *pnvm,
VL53L1_xtalk_config_t *pdata);
@ -161,6 +163,7 @@ VL53L1_Error VL53L1_init_xtalk_config_struct(
VL53L1_Error VL53L1_init_xtalk_extract_config_struct(
VL53L1_xtalkextract_config_t *pdata);
@ -201,6 +204,8 @@ VL53L1_Error VL53L1_init_zone_cal_config_struct(
VL53L1_Error VL53L1_init_hist_post_process_config_struct(
uint8_t xtalk_compensation_enable,
VL53L1_hist_post_process_config_t *pdata);
@ -216,6 +221,7 @@ VL53L1_Error VL53L1_init_hist_post_process_config_struct(
VL53L1_Error VL53L1_init_dmax_calibration_data_struct(
VL53L1_dmax_calibration_data_t *pdata);
@ -230,6 +236,7 @@ VL53L1_Error VL53L1_init_dmax_calibration_data_struct(
VL53L1_Error VL53L1_init_tuning_parm_storage_struct(
VL53L1_tuning_parm_storage_t *pdata);
@ -243,6 +250,7 @@ VL53L1_Error VL53L1_init_tuning_parm_storage_struct(
VL53L1_Error VL53L1_init_hist_gen3_dmax_config_struct(
VL53L1_hist_gen3_dmax_config_t *pdata);
@ -263,6 +271,8 @@ VL53L1_Error VL53L1_init_hist_gen3_dmax_config_struct(
VL53L1_Error VL53L1_preset_mode_standard_ranging(
@ -292,6 +302,8 @@ VL53L1_Error VL53L1_preset_mode_standard_ranging(
VL53L1_Error VL53L1_preset_mode_standard_ranging_short_range(
VL53L1_static_config_t *pstatic,
@ -320,6 +332,8 @@ VL53L1_Error VL53L1_preset_mode_standard_ranging_short_range(
VL53L1_Error VL53L1_preset_mode_standard_ranging_long_range(
@ -349,6 +363,8 @@ VL53L1_Error VL53L1_preset_mode_standard_ranging_long_range(
VL53L1_Error VL53L1_preset_mode_standard_ranging_mm1_cal(
@ -378,6 +394,8 @@ VL53L1_Error VL53L1_preset_mode_standard_ranging_mm1_cal(
VL53L1_Error VL53L1_preset_mode_standard_ranging_mm2_cal(
@ -407,6 +425,8 @@ VL53L1_Error VL53L1_preset_mode_standard_ranging_mm2_cal(
VL53L1_Error VL53L1_preset_mode_timed_ranging(
@ -437,6 +457,8 @@ VL53L1_Error VL53L1_preset_mode_timed_ranging(
VL53L1_Error VL53L1_preset_mode_timed_ranging_short_range(
@ -466,6 +488,8 @@ VL53L1_Error VL53L1_preset_mode_timed_ranging_short_range(
VL53L1_Error VL53L1_preset_mode_timed_ranging_long_range(
@ -494,6 +518,9 @@ VL53L1_Error VL53L1_preset_mode_timed_ranging_long_range(
@ -525,6 +552,9 @@ VL53L1_Error VL53L1_preset_mode_low_power_auto_ranging(
@ -556,6 +586,9 @@ VL53L1_Error VL53L1_preset_mode_low_power_auto_short_ranging(
@ -582,6 +615,14 @@ VL53L1_Error VL53L1_preset_mode_low_power_auto_long_ranging(
@ -615,6 +656,14 @@ VL53L1_Error VL53L1_preset_mode_histogram_ranging(
@ -648,6 +697,14 @@ VL53L1_Error VL53L1_preset_mode_histogram_ranging_with_mm1(
@ -681,6 +738,14 @@ VL53L1_Error VL53L1_preset_mode_histogram_ranging_with_mm2(
@ -714,6 +779,14 @@ VL53L1_Error VL53L1_preset_mode_histogram_ranging_mm1_cal(
@ -746,6 +819,14 @@ VL53L1_Error VL53L1_preset_mode_histogram_ranging_mm2_cal(
@ -777,6 +858,14 @@ VL53L1_Error VL53L1_preset_mode_histogram_ranging_ref(
@ -809,6 +898,14 @@ VL53L1_Error VL53L1_preset_mode_histogram_characterisation(
@ -841,6 +938,14 @@ VL53L1_Error VL53L1_preset_mode_histogram_xtalk_planar(
@ -873,6 +978,14 @@ VL53L1_Error VL53L1_preset_mode_histogram_xtalk_mm1(
@ -904,6 +1017,14 @@ VL53L1_Error VL53L1_preset_mode_histogram_xtalk_mm2(
@ -935,6 +1056,14 @@ VL53L1_Error VL53L1_preset_mode_histogram_multizone(
@ -966,6 +1095,14 @@ VL53L1_Error VL53L1_preset_mode_histogram_multizone_short_range(
@ -997,6 +1134,14 @@ VL53L1_Error VL53L1_preset_mode_histogram_multizone_long_range(
@ -1028,6 +1173,14 @@ VL53L1_Error VL53L1_preset_mode_histogram_ranging_short_timing(
@ -1059,6 +1212,14 @@ VL53L1_Error VL53L1_preset_mode_histogram_long_range(
@ -1090,6 +1251,14 @@ VL53L1_Error VL53L1_preset_mode_histogram_medium_range(
@ -1123,6 +1292,14 @@ VL53L1_Error VL53L1_preset_mode_histogram_short_range(
@ -1154,6 +1331,14 @@ VL53L1_Error VL53L1_preset_mode_special_histogram_short_range(
@ -1185,6 +1370,14 @@ VL53L1_Error VL53L1_preset_mode_histogram_long_range_mm1(
@ -1216,6 +1409,14 @@ VL53L1_Error VL53L1_preset_mode_histogram_long_range_mm2(

View file

@ -1,64 +1,64 @@
/*
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed, either
* 'STMicroelectronics Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
********************************************************************************
*
*/
/******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
******************************************************************************
'STMicroelectronics Proprietary license'
*******************************************************************************
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
*******************************************************************************
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones mentioned above :
*******************************************************************************
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************
*/
/**
* @file vl53l1_api_strings.h

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/
@ -366,7 +366,7 @@ void VL53L1_init_histogram_multizone_config_structure(
void VL53L1_init_xtalk_bin_data_struct(
uint32_t bin_value,
uint16_t VL53L1_PRM_00021,
uint16_t VL53L1_p_024,
VL53L1_xtalk_histogram_shape_t *pdata);
@ -699,7 +699,7 @@ VL53L1_Error VL53L1_force_shadow_stream_count_to_zero(
uint32_t VL53L1_calc_macro_period_us(
uint16_t fast_osc_frequency,
uint8_t VL53L1_PRM_00008);
uint8_t VL53L1_p_009);
@ -852,7 +852,7 @@ VL53L1_Error VL53L1_calc_timeout_register_values(
uint8_t VL53L1_encode_vcsel_period(
uint8_t VL53L1_PRM_00030);
uint8_t VL53L1_p_031);
@ -1130,6 +1130,113 @@ void VL53L1_hist_combine_mm1_mm2_offsets(
VL53L1_Error VL53L1_hist_xtalk_extract_calc_window(
int16_t target_distance_mm,
uint16_t target_width_oversize,
VL53L1_histogram_bin_data_t *phist_bins,
VL53L1_hist_xtalk_extract_data_t *pxtalk_data);
VL53L1_Error VL53L1_hist_xtalk_extract_calc_event_sums(
VL53L1_histogram_bin_data_t *phist_bins,
VL53L1_hist_xtalk_extract_data_t *pxtalk_data);
VL53L1_Error VL53L1_hist_xtalk_extract_calc_rate_per_spad(
VL53L1_hist_xtalk_extract_data_t *pxtalk_data);
VL53L1_Error VL53L1_hist_xtalk_extract_calc_shape(
VL53L1_hist_xtalk_extract_data_t *pxtalk_data,
VL53L1_xtalk_histogram_shape_t *pxtalk_shape);
VL53L1_Error VL53L1_hist_xtalk_shape_model(
uint16_t events_per_bin,
uint16_t pulse_centre,
uint16_t pulse_width,
VL53L1_xtalk_histogram_shape_t *pxtalk_shape);
uint16_t VL53L1_hist_xtalk_shape_model_interp(
uint16_t events_per_bin,
uint32_t phase_delta);
void VL53L1_spad_number_to_byte_bit_index(
uint8_t spad_number,
uint8_t *pbyte_index,
@ -1305,7 +1412,7 @@ void VL53L1_hist_copy_results_to_sys_and_core(
VL53L1_Error VL53L1_sum_histogram_data (
VL53L1_Error VL53L1_sum_histogram_data(
VL53L1_histogram_bin_data_t *phist_input,
VL53L1_histogram_bin_data_t *phist_output);
@ -1323,7 +1430,7 @@ VL53L1_Error VL53L1_sum_histogram_data (
VL53L1_Error VL53L1_avg_histogram_data (
VL53L1_Error VL53L1_avg_histogram_data(
uint8_t no_of_samples,
VL53L1_histogram_bin_data_t *phist_sum,
VL53L1_histogram_bin_data_t *phist_avg);
@ -1377,7 +1484,7 @@ VL53L1_Error VL53L1_dynamic_zone_update(
VL53L1_Error VL53L1_update_internal_stream_counters(
VL53L1_DEV Dev,
VL53L1_DEV Dev,
uint8_t external_stream_count,
uint8_t *pinternal_stream_count,
uint8_t *pinternal_stream_count_val
@ -1404,10 +1511,10 @@ VL53L1_Error VL53L1_multizone_hist_bins_update(
VL53L1_Error VL53L1_set_histogram_multizone_initial_bin_config(
VL53L1_zone_config_t *pzone_cfg,
VL53L1_histogram_config_t *phist_cfg,
VL53L1_histogram_config_t *pmulti_hist
);
VL53L1_zone_config_t *pzone_cfg,
VL53L1_histogram_config_t *phist_cfg,
VL53L1_histogram_config_t *pmulti_hist
);
@ -1678,10 +1785,10 @@ VL53L1_Error VL53L1_dynamic_xtalk_correction_calc_required_samples(
VL53L1_Error VL53L1_dynamic_xtalk_correction_calc_new_xtalk(
VL53L1_DEV Dev,
VL53L1_DEV Dev,
uint32_t xtalk_offset_out,
VL53L1_smudge_corrector_config_t *pconfig,
VL53L1_smudge_corrector_data_t *pout,
VL53L1_smudge_corrector_config_t *pconfig,
VL53L1_smudge_corrector_data_t *pout,
uint8_t add_smudge,
uint8_t soft_update
);

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/
@ -160,7 +160,7 @@ uint32_t VL53L1_duration_maths(
uint32_t VL53L1_events_per_spad_maths(
int32_t VL53L1_PRM_00012,
int32_t VL53L1_p_013,
uint16_t num_spads,
uint32_t duration);
@ -259,7 +259,7 @@ uint32_t VL53L1_calc_pll_period_mm(
uint16_t VL53L1_rate_maths(
int32_t VL53L1_PRM_00007,
int32_t VL53L1_p_008,
uint32_t time_us);
@ -305,7 +305,7 @@ uint16_t VL53L1_rate_per_spad_maths(
int32_t VL53L1_range_maths(
uint16_t fast_osc_frequency,
uint16_t VL53L1_PRM_00016,
uint16_t VL53L1_p_017,
uint16_t zero_distance_phase,
uint8_t fractional_bits,
int32_t gain_factor,
@ -351,7 +351,7 @@ void VL53L1_copy_xtalk_bin_data_to_histogram_data_struct(
void VL53L1_init_histogram_bin_data_struct(
int32_t bin_value,
uint16_t VL53L1_PRM_00021,
uint16_t VL53L1_p_024,
VL53L1_histogram_bin_data_t *pdata);

View file

@ -1,64 +1,63 @@
/*
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed, either
* 'STMicroelectronics Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
********************************************************************************
*
*/
/******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
******************************************************************************
'STMicroelectronics Proprietary license'
*******************************************************************************
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
*******************************************************************************
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones mentioned above :
*******************************************************************************
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************
*/
/**
* @file vl53l1_def.h
@ -84,13 +83,13 @@ extern "C" {
/** VL53L1 IMPLEMENTATION major version */
#define VL53L1_IMPLEMENTATION_VER_MAJOR 5
#define VL53L1_IMPLEMENTATION_VER_MAJOR 6
/** VL53L1 IMPLEMENTATION minor version */
#define VL53L1_IMPLEMENTATION_VER_MINOR 1
/** VL53L1 IMPLEMENTATION sub version */
#define VL53L1_IMPLEMENTATION_VER_SUB 1
#define VL53L1_IMPLEMENTATION_VER_SUB 0
/** VL53L1 IMPLEMENTATION sub version */
#define VL53L1_IMPLEMENTATION_VER_REVISION 1767
#define VL53L1_IMPLEMENTATION_VER_REVISION 2120
/****************************************
* PRIVATE define do not edit
@ -112,7 +111,7 @@ typedef struct {
*/
typedef struct {
char Name[VL53L1_DEVINFO_STRLEN];
/*!< Name of the Device e.g. Left_Distance */
/*!< Full Name of the Device e.g. VL53L1 cut1.1 */
char Type[VL53L1_DEVINFO_STRLEN];
/*!< Type of the Device e.g VL53L1 */
char ProductId[VL53L1_DEVINFO_STRLEN];
@ -120,7 +119,9 @@ typedef struct {
* @warning Not yet implemented
*/
uint8_t ProductType;
/*!< Product Type, VL53L1 = 1, VL53L1 = 2*/
/*!< Product Type, VL53L1 = 0xCC, VL53L3 = 0xAA
* Stands as module_type in the datasheet
*/
uint8_t ProductRevisionMajor;
/*!< Product revision major */
uint8_t ProductRevisionMinor;
@ -170,9 +171,9 @@ typedef uint8_t VL53L1_OutputModes;
/** @} VL53L1_define_OutputModes_group */
/** @defgroup VL53L1_define_XtalkCal_group Defines Xtalk Calibration modes
* Defines all possible Offset Calibration modes for the device
* @{
*/
* Defines all possible Offset Calibration modes for the device
* @{
*/
typedef uint8_t VL53L1_XtalkCalibrationModes;
#define VL53L1_XTALKCALIBRATIONMODE_NO_TARGET \
@ -181,13 +182,16 @@ typedef uint8_t VL53L1_XtalkCalibrationModes;
#define VL53L1_XTALKCALIBRATIONMODE_SINGLE_TARGET \
((VL53L1_OffsetCalibrationModes) 1)
/*!< To perform Xtalk calibration with one target */
#define VL53L1_XTALKCALIBRATIONMODE_FULL_ROI \
((VL53L1_OffsetCalibrationModes) 2)
/*!< To perform Xtalk calibration based on histogram with full ROI */
/** @} VL53L1_define_XtalkCal_group */
/** @defgroup VL53L1_define_OffsetCal_group Defines Offset Calibration modes
* Defines all possible Offset Calibration modes for the device
* @{
*/
* Defines all possible Offset Calibration modes for the device
* @{
*/
typedef uint8_t VL53L1_OffsetCalibrationModes;
#define VL53L1_OFFSETCALIBRATIONMODE_STANDARD \
@ -200,9 +204,9 @@ typedef uint8_t VL53L1_OffsetCalibrationModes;
/** @} VL53L1_define_OffsetCal_group */
/** @defgroup VL53L1_define_DeviceDmaxModes_group Defines Dmax source modes
* Defines all possible sources for Dmax calibration for the device
* @{
*/
* Defines all possible sources for Dmax calibration for the device
* @{
*/
typedef uint8_t VL53L1_DeviceDmaxModes;
#define VL53L1_DMAXMODE_FMT_CAL_DATA ((VL53L1_DeviceDmaxModes) 1)
@ -313,7 +317,7 @@ typedef uint8_t VL53L1_DetectionMode;
#define VL53L1_DETECTION_DISTANCE_OR_RATE \
((VL53L1_DetectionMode) 4)
/*!< Trigger interrupt if "threshold event" occurs on distance OR rate
*/
*/
/** @} end of VL53L1_DetectionMode_group */
@ -336,22 +340,14 @@ typedef struct {
/*!< Defines the Output mode to be used for the next measure */
VL53L1_DistanceModes DistanceMode;
/*!< Defines the operating mode to be used for the next measure */
VL53L1_DistanceModes InternalDistanceMode;
/*!< Defines the internal operating mode to be used for the next
* measure
*/
VL53L1_DistanceModes NewDistanceMode;
/*!< Defines the new operating mode to be programmed for the next
* measure
*/
uint32_t MeasurementTimingBudgetMicroSeconds;
/*!< Defines the allowed total time for a single measurement */
uint8_t LimitChecksEnable[VL53L1_CHECKENABLE_NUMBER_OF_CHECKS];
/*!< This Array store all the Limit Check enable for this device. */
uint8_t LimitChecksStatus[VL53L1_CHECKENABLE_NUMBER_OF_CHECKS];
/*!< This Array stores all the Status of the check linked to last
* measurement.
*/
* measurement.
*/
FixPoint1616_t LimitChecksValue[VL53L1_CHECKENABLE_NUMBER_OF_CHECKS];
/*!< This Array stores all the Limit Check value for this device */
FixPoint1616_t LimitChecksCurrent[VL53L1_CHECKENABLE_NUMBER_OF_CHECKS];
@ -534,10 +530,10 @@ typedef struct {
/*!< Denotes on which ROI the range data is related to. */
uint8_t NumberOfObjectsFound;
/*!< Indicate the number of objects found in the current ROI.
* This is used to know how many ranging data should be get.
* NumberOfObjectsFound is in the range 0 to
* VL53L1_MAX_RANGE_RESULTS.
*/
* This is used to know how many ranging data should be get.
* NumberOfObjectsFound is in the range 0 to
* VL53L1_MAX_RANGE_RESULTS.
*/
VL53L1_RoiStatus RoiStatus;
/*!< Indicate if the data read is valid or not or if this is
* the last valid data in the ROI.
@ -754,80 +750,80 @@ typedef struct {
/* Defines */
#define VL53L1_SETPARAMETERFIELD(Dev, field, value) \
(PALDevDataSet(Dev, CurrentParameters.field, value))
(VL53L1DevDataSet(Dev, CurrentParameters.field, value))
#define VL53L1_GETPARAMETERFIELD(Dev, field, variable) \
(variable = PALDevDataGet(Dev, CurrentParameters).field)
(variable = VL53L1DevDataGet(Dev, CurrentParameters).field)
#define VL53L1_SETARRAYPARAMETERFIELD(Dev, field, index, value) \
(PALDevDataSet(Dev, CurrentParameters.field[index], value))
(VL53L1DevDataSet(Dev, CurrentParameters.field[index], value))
#define VL53L1_GETARRAYPARAMETERFIELD(Dev, field, index, variable) \
(variable = PALDevDataGet(Dev, CurrentParameters).field[index])
(variable = VL53L1DevDataGet(Dev, CurrentParameters).field[index])
#define VL53L1_SETDEVICESPECIFICPARAMETER(Dev, field, value) \
(PALDevDataSet(Dev, DeviceSpecificParameters.field, value))
(VL53L1DevDataSet(Dev, DeviceSpecificParameters.field, value))
#define VL53L1_GETDEVICESPECIFICPARAMETER(Dev, field) \
(PALDevDataGet(Dev, DeviceSpecificParameters).field)
(VL53L1DevDataGet(Dev, DeviceSpecificParameters).field)
#define VL53L1_FIXPOINT1616TOFIXPOINT44(Value) \
(uint16_t)((Value>>12)&0xFFFF)
#define VL53L1_FIXPOINT44TOFIXPOINT1616(Value) \
(FixPoint1616_t)(Value<<12)
(FixPoint1616_t)((uint32_t)Value<<12)
#define VL53L1_FIXPOINT1616TOFIXPOINT72(Value) \
(uint16_t)((Value>>14)&0xFFFF)
#define VL53L1_FIXPOINT72TOFIXPOINT1616(Value) \
(FixPoint1616_t)(Value<<14)
(FixPoint1616_t)((uint32_t)Value<<14)
#define VL53L1_FIXPOINT1616TOFIXPOINT97(Value) \
(uint16_t)((Value>>9)&0xFFFF)
#define VL53L1_FIXPOINT97TOFIXPOINT1616(Value) \
(FixPoint1616_t)(Value<<9)
(FixPoint1616_t)((uint32_t)Value<<9)
#define VL53L1_FIXPOINT1616TOFIXPOINT88(Value) \
(uint16_t)((Value>>8)&0xFFFF)
#define VL53L1_FIXPOINT88TOFIXPOINT1616(Value) \
(FixPoint1616_t)(Value<<8)
(FixPoint1616_t)((uint32_t)Value<<8)
#define VL53L1_FIXPOINT1616TOFIXPOINT412(Value) \
(uint16_t)((Value>>4)&0xFFFF)
#define VL53L1_FIXPOINT412TOFIXPOINT1616(Value) \
(FixPoint1616_t)(Value<<4)
(FixPoint1616_t)((uint32_t)Value<<4)
#define VL53L1_FIXPOINT1616TOFIXPOINT313(Value) \
(uint16_t)((Value>>3)&0xFFFF)
#define VL53L1_FIXPOINT313TOFIXPOINT1616(Value) \
(FixPoint1616_t)(Value<<3)
(FixPoint1616_t)((uint32_t)Value<<3)
#define VL53L1_FIXPOINT1616TOFIXPOINT08(Value) \
(uint8_t)((Value>>8)&0x00FF)
#define VL53L1_FIXPOINT08TOFIXPOINT1616(Value) \
(FixPoint1616_t)(Value<<8)
(FixPoint1616_t)((uint32_t)Value<<8)
#define VL53L1_FIXPOINT1616TOFIXPOINT53(Value) \
(uint8_t)((Value>>13)&0x00FF)
#define VL53L1_FIXPOINT53TOFIXPOINT1616(Value) \
(FixPoint1616_t)(Value<<13)
(FixPoint1616_t)((uint32_t)Value<<13)
#define VL53L1_FIXPOINT1616TOFIXPOINT102(Value) \
(uint16_t)((Value>>14)&0x0FFF)
#define VL53L1_FIXPOINT102TOFIXPOINT1616(Value) \
(FixPoint1616_t)(Value<<14)
(FixPoint1616_t)((uint32_t)Value<<14)
#define VL53L1_FIXPOINT1616TOFIXPOINT142(Value) \
(uint16_t)((Value>>14)&0xFFFF)
#define VL53L1_FIXPOINT142TOFIXPOINT1616(Value) \
(FixPoint1616_t)(Value<<14)
(FixPoint1616_t)((uint32_t)Value<<14)
#define VL53L1_FIXPOINT1616TOFIXPOINT160(Value) \
(uint16_t)((Value>>16)&0xFFFF)
#define VL53L1_FIXPOINT160TOFIXPOINT1616(Value) \
(FixPoint1616_t)(Value<<16)
(FixPoint1616_t)((uint32_t)Value<<16)
#define VL53L1_MAKEUINT16(lsb, msb) (uint16_t)((((uint16_t)msb)<<8) + \
(uint16_t)lsb)
@ -836,11 +832,6 @@ typedef struct {
#define SUPPRESS_UNUSED_WARNING(x) ((void) (x))
#endif
#define CHECK_ERROR_GO_ENDFUNC do {\
if (Status != VL53L1_ERROR_NONE) \
goto ENDFUNC; \
} while (0)
/** @} VL53L1_define_GeneralMacro_group */
/** @} VL53L1_globaldefine_group */

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/
@ -152,7 +152,7 @@ typedef struct {
} VL53L1_dmax_calibration_data_t ;
} VL53L1_dmax_calibration_data_t;
@ -181,7 +181,8 @@ typedef struct {
uint16_t target_reflectance_for_dmax_calc[VL53L1_MAX_AMBIENT_DMAX_VALUES];
uint16_t target_reflectance_for_dmax_calc[
VL53L1_MAX_AMBIENT_DMAX_VALUES];
uint16_t max_effective_spads;

View file

@ -1,30 +1,63 @@
/*******************************************************************************
Copyright (C) 2016, STMicroelectronics International N.V.
All rights reserved.
/******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of STMicroelectronics nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
NON-INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED.
IN NO EVENT SHALL STMICROELECTRONICS INTERNATIONAL N.V. BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************/
******************************************************************************
'STMicroelectronics Proprietary license'
*******************************************************************************
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
*******************************************************************************
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones mentioned above :
*******************************************************************************
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************
*/
/**
* @file vl53l1_error_codes.h
@ -43,11 +76,14 @@ extern "C" {
#endif
/****************************************
/*
****************************************
* PRIVATE define do not edit
****************************************/
***************************************
*/
/** @defgroup VL53L1_define_Error_group Error and Warning code returned by API
/*
* @defgroup VL53L1_define_Error_group Error and Warning code returned by API
* The following DEFINE are used to identify the PAL ERROR
* @{
*/
@ -57,9 +93,10 @@ typedef int8_t VL53L1_Error;
#define VL53L1_ERROR_NONE ((VL53L1_Error) 0)
#define VL53L1_ERROR_CALIBRATION_WARNING ((VL53L1_Error) - 1)
/*!< Warning invalid calibration data may be in used
\a VL53L1_InitData()
\a VL53L1_GetOffsetCalibrationData
\a VL53L1_SetOffsetCalibrationData */
* \a VL53L1_InitData()
* \a VL53L1_GetOffsetCalibrationData
* \a VL53L1_SetOffsetCalibrationData
*/
#define VL53L1_ERROR_MIN_CLIPPED ((VL53L1_Error) - 2)
/*!< Warning parameter passed was clipped to min before to be applied */
@ -87,7 +124,8 @@ typedef int8_t VL53L1_Error;
/*!< error reported from IO functions */
#define VL53L1_ERROR_INVALID_COMMAND ((VL53L1_Error) - 14)
/*!< The command is not allowed in the current device state
* (power down) */
* (power down)
*/
#define VL53L1_ERROR_DIVISION_BY_ZERO ((VL53L1_Error) - 15)
/*!< In the function a division by zero occurs */
#define VL53L1_ERROR_REF_SPAD_INIT ((VL53L1_Error) - 16)
@ -107,105 +145,121 @@ typedef int8_t VL53L1_Error;
/*!< Thrown when run_xtalk_extraction fn has 0 succesful samples
* when using the full array to sample the xtalk. In this case there is
* not enough information to generate new Xtalk parm info. The function
* will exit and leave the current xtalk parameters unaltered */
* will exit and leave the current xtalk parameters unaltered
*/
#define VL53L1_ERROR_XTALK_EXTRACTION_SIGMA_LIMIT_FAIL ((VL53L1_Error) - 23)
/*!< Thrown when run_xtalk_extraction fn has found that the
* avg sigma estimate of the full array xtalk sample is > than the
* maximal limit allowed. In this case the xtalk sample is too noisy for
* measurement. The function will exit and leave the current xtalk parameters
* unaltered. */
* measurement. The function will exit and leave the current xtalk
* parameters unaltered.
*/
#define VL53L1_ERROR_OFFSET_CAL_NO_SAMPLE_FAIL ((VL53L1_Error) - 24)
/*!< Thrown if there one of stages has no valid offset calibration
* samples. A fatal error calibration not valid */
* samples. A fatal error calibration not valid
*/
#define VL53L1_ERROR_OFFSET_CAL_NO_SPADS_ENABLED_FAIL ((VL53L1_Error) - 25)
/*!< Thrown if there one of stages has zero effective SPADS
* Traps the case when MM1 SPADs is zero.
* A fatal error calibration not valid */
* A fatal error calibration not valid
*/
#define VL53L1_ERROR_ZONE_CAL_NO_SAMPLE_FAIL ((VL53L1_Error) - 26)
/*!< Thrown if then some of the zones have no valid samples
* A fatal error calibration not valid */
* A fatal error calibration not valid
*/
#define VL53L1_ERROR_TUNING_PARM_KEY_MISMATCH ((VL53L1_Error) - 27)
/*!< Thrown if the tuning file key table version does not match with
* expected value. The driver expects the key table version to match
* the compiled default version number in the define
* #VL53L1_TUNINGPARM_KEY_TABLE_VERSION_DEFAULT
* */
*/
#define VL53L1_WARNING_REF_SPAD_CHAR_NOT_ENOUGH_SPADS ((VL53L1_Error) - 28)
/*!< Thrown if there are less than 5 good SPADs are available. */
#define VL53L1_WARNING_REF_SPAD_CHAR_RATE_TOO_HIGH ((VL53L1_Error) - 29)
/*!< Thrown if the final reference rate is greater than
the upper reference rate limit - default is 40 Mcps.
Implies a minimum Q3 (x10) SPAD (5) selected */
* the upper reference rate limit - default is 40 Mcps.
* Implies a minimum Q3 (x10) SPAD (5) selected
*/
#define VL53L1_WARNING_REF_SPAD_CHAR_RATE_TOO_LOW ((VL53L1_Error) - 30)
/*!< Thrown if the final reference rate is less than
the lower reference rate limit - default is 10 Mcps.
Implies maximum Q1 (x1) SPADs selected */
* the lower reference rate limit - default is 10 Mcps.
* Implies maximum Q1 (x1) SPADs selected
*/
#define VL53L1_WARNING_OFFSET_CAL_MISSING_SAMPLES ((VL53L1_Error) - 31)
/*!< Thrown if there is less than the requested number of
* valid samples. */
* valid samples.
*/
#define VL53L1_WARNING_OFFSET_CAL_SIGMA_TOO_HIGH ((VL53L1_Error) - 32)
/*!< Thrown if the offset calibration range sigma estimate is greater
* than 8.0 mm. This is the recommended min value to yield a stable
* offset measurement */
* offset measurement
*/
#define VL53L1_WARNING_OFFSET_CAL_RATE_TOO_HIGH ((VL53L1_Error) - 33)
/*!< Thrown when VL53L1_run_offset_calibration() peak rate is greater
than that 50.0Mcps. This is the recommended max rate to avoid
pile-up influencing the offset measurement */
* than that 50.0Mcps. This is the recommended max rate to avoid
* pile-up influencing the offset measurement
*/
#define VL53L1_WARNING_OFFSET_CAL_SPAD_COUNT_TOO_LOW ((VL53L1_Error) - 34)
/*!< Thrown when VL53L1_run_offset_calibration() when one of stages
range has less that 5.0 effective SPADS. This is the recommended
min value to yield a stable offset */
* range has less that 5.0 effective SPADS. This is the recommended
* min value to yield a stable offset
*/
#define VL53L1_WARNING_ZONE_CAL_MISSING_SAMPLES ((VL53L1_Error) - 35)
/*!< Thrown if one of more of the zones have less than
the requested number of valid samples */
* the requested number of valid samples
*/
#define VL53L1_WARNING_ZONE_CAL_SIGMA_TOO_HIGH ((VL53L1_Error) - 36)
/*!< Thrown if one or more zones have sigma estimate value greater
* than 8.0 mm. This is the recommended min value to yield a stable
* offset measurement */
* offset measurement
*/
#define VL53L1_WARNING_ZONE_CAL_RATE_TOO_HIGH ((VL53L1_Error) - 37)
/*!< Thrown if one of more zones have peak rate higher than
that 50.0Mcps. This is the recommended max rate to avoid
pile-up influencing the offset measurement */
* that 50.0Mcps. This is the recommended max rate to avoid
* pile-up influencing the offset measurement
*/
#define VL53L1_WARNING_XTALK_MISSING_SAMPLES ((VL53L1_Error) - 38)
/*!< Thrown to notify that some of the xtalk samples did not yield
* valid ranging pulse data while attempting to measure
* the xtalk signal in vl53l1_run_xtalk_extract(). This can signify any of
* the zones are missing samples, for further debug information the
* the xtalk signal in vl53l1_run_xtalk_extract(). This can signify any
* of the zones are missing samples, for further debug information the
* xtalk_results struct should be referred to. This warning is for
* notification only, the xtalk pulse and shape have still been generated
* notification only, xtalk pulse and shape have still been generated
*/
#define VL53L1_WARNING_XTALK_NO_SAMPLES_FOR_GRADIENT ((VL53L1_Error) - 39)
/*!< Thrown to notify that some of teh xtalk samples used for gradient
* generation did not yield valid ranging pulse data while attempting to
* measure the xtalk signal in vl53l1_run_xtalk_extract(). This can signify
* that any one of the zones 0-3 yielded no successful samples. The
* measure the xtalk signal in vl53l1_run_xtalk_extract(). This can
* signify that any one of the zones 0-3 yielded no successful samples.
* xtalk_results struct should be referred to for further debug info.
* This warning is for notification only, the xtalk pulse and shape
* have still been generated.
*/
#define VL53L1_WARNING_XTALK_SIGMA_LIMIT_FOR_GRADIENT ((VL53L1_Error) - 40)
/*!< Thrown to notify that some of the xtalk samples used for gradient
/*!< Thrown to notify that some of the xtalk samples used for gradient
* generation did not pass the sigma limit check while attempting to
* measure the xtalk signal in vl53l1_run_xtalk_extract(). This can signify
* that any one of the zones 0-3 yielded an avg sigma_mm value > the limit.
* The xtalk_results struct should be referred to for further debug info.
* measure the xtalk signal in vl53l1_run_xtalk_extract(). This can
* signify that any one of the zones 0-3 yielded an avg sigma_mm
* value > the limit. The xtalk_results struct should be referred to for
* further debug info.
* This warning is for notification only, the xtalk pulse and shape
* have still been generated.
*/
#define VL53L1_ERROR_NOT_IMPLEMENTED ((VL53L1_Error) - 41)
/*!< Tells requested functionality has not been implemented yet or
* not compatible with the device */
* not compatible with the device
*/
#define VL53L1_ERROR_PLATFORM_SPECIFIC_START ((VL53L1_Error) - 60)
/*!< Tells the starting code for platform */
/** @} VL53L1_define_Error_group */

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/
@ -176,7 +176,7 @@ VL53L1_Error VL53L1_get_pal_error_string(
#define VL53L1_STRING_ERROR_XTALK_EXTRACTION_NO_SAMPLES_FAIL \
"No Xtalk using full array - Xtalk Extract Fail"
#define VL53L1_STRING_ERROR_XTALK_EXTRACTION_SIGMA_LIMIT_FAIL \
"Xtalk does not meet required VL53L1_PRM_00010 limit - Xtalk Extract Fail"
"Xtalk does not meet required VL53L1_p_011 limit - Xtalk Extract Fail"
#define VL53L1_STRING_ERROR_OFFSET_CAL_NO_SAMPLE_FAIL \
"Offset Cal - one of more stages with no valid samples - fatal"
@ -204,7 +204,7 @@ VL53L1_Error VL53L1_get_pal_error_string(
#define VL53L1_STRING_WARNING_ZONE_CAL_MISSING_SAMPLES \
"Zone Cal - One or more zone with less than requested valid samples"
#define VL53L1_STRING_WARNING_ZONE_CAL_SIGMA_TOO_HIGH \
"Zone Cal - One of more zones the VL53L1_PRM_00010 estimate too high"
"Zone Cal - One of more zones the VL53L1_p_011 estimate too high"
#define VL53L1_STRING_WARNING_ZONE_CAL_RATE_TOO_HIGH \
"Zone Cal - One of more zones with rate too high - in pile up"

View file

@ -1,134 +0,0 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed, either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
********************************************************************************
*
*/
#ifndef _VL53L1_FPGA_CORE_H_
#define _VL53L1_FPGA_CORE_H_
#include "vl53l1_platform.h"
#ifdef __cplusplus
extern "C" {
#endif
VL53L1_Error VL53L1_is_firmware_ready_fpga(
VL53L1_DEV Dev,
uint8_t *pready);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/
@ -145,7 +145,8 @@ extern "C"
#define VL53L1_HISTOGRAM_BIN_DATA_I2C_INDEX \
VL53L1_RESULT__INTERRUPT_STATUS
#define VL53L1_HISTOGRAM_BIN_DATA_I2C_SIZE_BYTES \
(VL53L1_RESULT__HISTOGRAM_BIN_23_0_LSB - VL53L1_RESULT__INTERRUPT_STATUS + 1)
(VL53L1_RESULT__HISTOGRAM_BIN_23_0_LSB - \
VL53L1_RESULT__INTERRUPT_STATUS + 1)
#ifdef __cplusplus
}

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/
@ -144,13 +144,13 @@ typedef struct {
uint8_t histogram_config__user_bin_offset;
uint8_t histogram_config__high_amb_even_bin_0_1;
uint8_t histogram_config__high_amb_even_bin_2_3;
uint8_t histogram_config__high_amb_even_bin_4_5;
uint8_t histogram_config__high_amb_even_bin_0_1;
uint8_t histogram_config__high_amb_even_bin_2_3;
uint8_t histogram_config__high_amb_even_bin_4_5;
uint8_t histogram_config__high_amb_odd_bin_0_1;
uint8_t histogram_config__high_amb_odd_bin_2_3;
uint8_t histogram_config__high_amb_odd_bin_4_5;
uint8_t histogram_config__high_amb_odd_bin_0_1;
uint8_t histogram_config__high_amb_odd_bin_2_3;
uint8_t histogram_config__high_amb_odd_bin_4_5;
uint16_t histogram_config__amb_thresh_low;
@ -333,13 +333,13 @@ typedef struct {
uint8_t VL53L1_PRM_00019;
uint8_t VL53L1_p_022;
uint8_t VL53L1_PRM_00020;
uint8_t VL53L1_p_023;
uint8_t VL53L1_PRM_00021;
uint8_t VL53L1_p_024;
@ -387,10 +387,10 @@ typedef struct {
uint16_t vcsel_width;
uint8_t VL53L1_PRM_00008;
uint8_t VL53L1_p_009;
uint16_t VL53L1_PRM_00022;
uint16_t VL53L1_p_019;
uint32_t total_periods_elapsed;
@ -420,7 +420,7 @@ typedef struct {
int32_t ambient_events_sum;
int32_t VL53L1_PRM_00028;
int32_t VL53L1_p_004;
@ -451,13 +451,13 @@ typedef struct {
uint8_t VL53L1_PRM_00019;
uint8_t VL53L1_p_022;
uint8_t VL53L1_PRM_00020;
uint8_t VL53L1_p_023;
uint8_t VL53L1_PRM_00021;
uint8_t VL53L1_p_024;
uint32_t bin_data[VL53L1_XTALK_HISTO_BINS];
@ -477,7 +477,7 @@ typedef struct {
uint16_t vcsel_width;
uint16_t VL53L1_PRM_00022;
uint16_t VL53L1_p_019;
uint16_t zero_distance_phase;

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/
@ -128,12 +128,12 @@ extern "C" {
#define VL53L1_LL_API_IMPLEMENTATION_VER_MINOR 1
#define VL53L1_LL_API_IMPLEMENTATION_VER_SUB 43
#define VL53L1_LL_API_IMPLEMENTATION_VER_SUB 48
#define VL53L1_LL_API_IMPLEMENTATION_VER_REVISION 12193
#define VL53L1_LL_API_IMPLEMENTATION_VER_REVISION 12221
#define VL53L1_LL_API_IMPLEMENTATION_VER_STRING "1.1.43.12193"
#define VL53L1_LL_API_IMPLEMENTATION_VER_STRING "1.1.48.12221"
@ -238,7 +238,7 @@ typedef struct {
uint8_t device_test_mode;
uint8_t VL53L1_PRM_00008;
uint8_t VL53L1_p_009;
uint32_t timeout_us;
@ -380,7 +380,7 @@ typedef struct {
uint8_t VL53L1_PRM_00008;
uint8_t VL53L1_p_009;
uint8_t vcsel_start;
@ -1179,29 +1179,29 @@ typedef struct {
uint32_t time_stamp;
uint8_t VL53L1_PRM_00014;
uint8_t VL53L1_p_015;
uint8_t VL53L1_PRM_00019;
uint8_t VL53L1_p_022;
uint8_t VL53L1_PRM_00023;
uint8_t VL53L1_p_025;
uint8_t VL53L1_PRM_00024;
uint8_t VL53L1_p_026;
uint8_t VL53L1_PRM_00015;
uint8_t VL53L1_p_016;
uint8_t VL53L1_PRM_00025;
uint8_t VL53L1_p_027;
uint16_t width;
uint8_t VL53L1_PRM_00029;
uint8_t VL53L1_p_030;
@ -1212,7 +1212,7 @@ typedef struct {
uint16_t zero_distance_phase;
uint16_t VL53L1_PRM_00004;
uint16_t VL53L1_p_006;
@ -1232,14 +1232,14 @@ typedef struct {
uint32_t VL53L1_PRM_00017;
uint32_t VL53L1_p_020;
uint32_t VL53L1_PRM_00018;
uint32_t VL53L1_p_021;
int32_t VL53L1_PRM_00012;
int32_t VL53L1_p_013;
@ -1259,28 +1259,28 @@ typedef struct {
uint16_t total_rate_per_spad_mcps;
uint32_t VL53L1_PRM_00011;
uint32_t VL53L1_p_012;
uint16_t VL53L1_PRM_00003;
uint16_t VL53L1_p_005;
uint16_t VL53L1_PRM_00026;
uint16_t VL53L1_p_028;
uint16_t VL53L1_PRM_00013;
uint16_t VL53L1_p_014;
uint16_t VL53L1_PRM_00027;
uint16_t VL53L1_p_029;
@ -1337,7 +1337,7 @@ typedef struct {
int16_t VL53L1_PRM_00006[VL53L1_MAX_AMBIENT_DMAX_VALUES];
int16_t VL53L1_p_007[VL53L1_MAX_AMBIENT_DMAX_VALUES];
@ -1357,7 +1357,7 @@ typedef struct {
uint8_t active_results;
VL53L1_range_data_t VL53L1_PRM_00005[VL53L1_MAX_RANGE_RESULTS];
VL53L1_range_data_t VL53L1_p_002[VL53L1_MAX_RANGE_RESULTS];
VL53L1_range_data_t xmonitor;
@ -1477,7 +1477,8 @@ typedef struct {
VL53L1_xtalk_range_data_t VL53L1_PRM_00005[VL53L1_MAX_XTALK_RANGE_RESULTS];
VL53L1_xtalk_range_data_t
VL53L1_p_002[VL53L1_MAX_XTALK_RANGE_RESULTS];
VL53L1_histogram_bin_data_t central_histogram_sum;
@ -1496,15 +1497,18 @@ typedef struct {
VL53L1_histogram_bin_data_t histogram_avg_1[VL53L1_MAX_XTALK_RANGE_RESULTS];
VL53L1_histogram_bin_data_t
histogram_avg_1[VL53L1_MAX_XTALK_RANGE_RESULTS];
VL53L1_histogram_bin_data_t histogram_avg_2[VL53L1_MAX_XTALK_RANGE_RESULTS];
VL53L1_histogram_bin_data_t
histogram_avg_2[VL53L1_MAX_XTALK_RANGE_RESULTS];
VL53L1_histogram_bin_data_t xtalk_avg[VL53L1_MAX_XTALK_RANGE_RESULTS];
VL53L1_histogram_bin_data_t
xtalk_avg[VL53L1_MAX_XTALK_RANGE_RESULTS];
@ -1541,7 +1545,7 @@ typedef struct {
uint32_t peak_rate_mcps;
uint32_t VL53L1_PRM_00003;
uint32_t VL53L1_p_005;
int32_t median_range_mm;
@ -1584,7 +1588,8 @@ typedef struct {
uint8_t active_results;
VL53L1_offset_range_data_t VL53L1_PRM_00005[VL53L1_MAX_OFFSET_RANGE_RESULTS];
VL53L1_offset_range_data_t
VL53L1_p_002[VL53L1_MAX_OFFSET_RANGE_RESULTS];
@ -1632,14 +1637,14 @@ typedef struct {
typedef struct {
uint32_t VL53L1_PRM_00017;
uint32_t VL53L1_p_020;
uint32_t VL53L1_PRM_00018;
uint32_t VL53L1_p_021;
uint16_t VL53L1_PRM_00013;
uint16_t VL53L1_p_014;
uint8_t range_status;
@ -1678,7 +1683,7 @@ typedef struct {
uint8_t active_objects;
VL53L1_object_data_t VL53L1_PRM_00005[VL53L1_MAX_RANGE_RESULTS];
VL53L1_object_data_t VL53L1_p_002[VL53L1_MAX_RANGE_RESULTS];
@ -1709,7 +1714,7 @@ typedef struct {
uint8_t active_zones;
VL53L1_zone_objects_t VL53L1_PRM_00005[VL53L1_MAX_USER_ZONES];
VL53L1_zone_objects_t VL53L1_p_002[VL53L1_MAX_USER_ZONES];
@ -1737,7 +1742,7 @@ typedef struct {
uint16_t result__dss_actual_effective_spads;
uint8_t VL53L1_PRM_00008;
uint8_t VL53L1_p_009;
uint32_t total_periods_elapsed;
@ -1768,7 +1773,7 @@ typedef struct {
uint8_t active_zones;
VL53L1_zone_hist_info_t VL53L1_PRM_00005[VL53L1_MAX_USER_ZONES];
VL53L1_zone_hist_info_t VL53L1_p_002[VL53L1_MAX_USER_ZONES];
@ -1793,10 +1798,10 @@ typedef struct {
uint32_t peak_rate_mcps;
uint32_t VL53L1_PRM_00013;
uint32_t VL53L1_p_014;
uint32_t VL53L1_PRM_00003;
uint32_t VL53L1_p_005;
@ -1853,7 +1858,7 @@ typedef struct {
uint8_t active_zones;
VL53L1_zone_calibration_data_t VL53L1_PRM_00005[VL53L1_MAX_USER_ZONES];
VL53L1_zone_calibration_data_t VL53L1_p_002[VL53L1_MAX_USER_ZONES];
@ -1950,7 +1955,7 @@ typedef struct {
uint8_t active_zones;
VL53L1_zone_private_dyn_cfg_t VL53L1_PRM_00005[VL53L1_MAX_USER_ZONES];
VL53L1_zone_private_dyn_cfg_t VL53L1_p_002[VL53L1_MAX_USER_ZONES];
@ -1985,6 +1990,109 @@ typedef struct {
typedef struct {
uint32_t sample_count;
uint32_t pll_period_mm;
uint32_t peak_duration_us_sum;
uint32_t effective_spad_count_sum;
uint32_t zero_distance_phase_sum;
uint32_t zero_distance_phase_avg;
int32_t event_scaler_sum;
int32_t event_scaler_avg;
int32_t signal_events_sum;
uint32_t xtalk_rate_kcps_per_spad;
int32_t xtalk_start_phase;
int32_t xtalk_end_phase;
int32_t xtalk_width_phase;
int32_t target_start_phase;
int32_t target_end_phase;
int32_t target_width_phase;
int32_t effective_width;
int32_t event_scaler;
uint8_t VL53L1_p_015;
uint8_t VL53L1_p_016;
uint8_t target_start;
int32_t max_shape_value;
int32_t bin_data_sums[VL53L1_XTALK_HISTO_BINS];
} VL53L1_hist_xtalk_extract_data_t;
typedef struct {
@ -2179,6 +2287,7 @@ typedef struct {
VL53L1_xtalk_histogram_data_t xtalk_shapes;
VL53L1_xtalk_range_results_t xtalk_results;
VL53L1_xtalk_calibration_results_t xtalk_cal;
VL53L1_hist_xtalk_extract_data_t xtalk_extract;
@ -2333,9 +2442,9 @@ typedef struct {
uint16_t vl53l1_tuningparm_hist_sigma_thresh_mm;
uint16_t vl53l1_tuningparm_hist_gain_factor;
uint8_t vl53l1_tuningparm_consistency_hist_phase_tolerance;
uint16_t vl53l1_tuningparm_consistency_hist_min_max_tolerance_mm;
uint16_t vl53l1_tuningparm_consistency_hist_min_max_tolerance_mm;
uint8_t vl53l1_tuningparm_consistency_hist_event_sigma;
uint16_t vl53l1_tuningparm_consistency_hist_event_sigma_min_spad_limit;
uint16_t vl53l1_tuningparm_consistency_hist_event_sigma_min_spad_limit;
uint8_t vl53l1_tuningparm_initial_phase_rtn_histo_long_range;
uint8_t vl53l1_tuningparm_initial_phase_rtn_histo_med_range;
uint8_t vl53l1_tuningparm_initial_phase_rtn_histo_short_range;
@ -2413,14 +2522,14 @@ typedef struct {
uint8_t vl53l1_tuningparm_spadmap_vcsel_period;
uint8_t vl53l1_tuningparm_spadmap_vcsel_start;
uint16_t vl53l1_tuningparm_spadmap_rate_limit_mcps;
uint16_t vl53l1_tuningparm_lite_dss_config_target_total_rate_mcps;
uint16_t vl53l1_tuningparm_ranging_dss_config_target_total_rate_mcps;
uint16_t vl53l1_tuningparm_lite_dss_config_target_total_rate_mcps;
uint16_t vl53l1_tuningparm_ranging_dss_config_target_total_rate_mcps;
uint16_t vl53l1_tuningparm_mz_dss_config_target_total_rate_mcps;
uint16_t vl53l1_tuningparm_timed_dss_config_target_total_rate_mcps;
uint16_t vl53l1_tuningparm_timed_dss_config_target_total_rate_mcps;
uint32_t vl53l1_tuningparm_lite_phasecal_config_timeout_us;
uint32_t vl53l1_tuningparm_ranging_long_phasecal_config_timeout_us;
uint32_t vl53l1_tuningparm_ranging_med_phasecal_config_timeout_us;
uint32_t vl53l1_tuningparm_ranging_short_phasecal_config_timeout_us;
uint32_t vl53l1_tuningparm_ranging_long_phasecal_config_timeout_us;
uint32_t vl53l1_tuningparm_ranging_med_phasecal_config_timeout_us;
uint32_t vl53l1_tuningparm_ranging_short_phasecal_config_timeout_us;
uint32_t vl53l1_tuningparm_mz_long_phasecal_config_timeout_us;
uint32_t vl53l1_tuningparm_mz_med_phasecal_config_timeout_us;
uint32_t vl53l1_tuningparm_mz_short_phasecal_config_timeout_us;
@ -2492,7 +2601,7 @@ typedef struct {
uint8_t spad_type;
uint16_t VL53L1_PRM_00020;
uint16_t VL53L1_p_023;
uint16_t rate_data[VL53L1_NO_OF_SPAD_ENABLES];
@ -2560,7 +2669,7 @@ typedef struct {
VL53L1_histogram_bin_data_t VL53L1_PRM_00009;
VL53L1_histogram_bin_data_t VL53L1_p_010;
@ -2574,6 +2683,7 @@ typedef struct {
#define SUPPRESS_UNUSED_WARNING(x) \
((void) (x))

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/
@ -160,22 +160,35 @@ typedef uint8_t VL53L1_DeviceState;
typedef uint8_t VL53L1_DeviceZonePreset;
#define VL53L1_DEVICEZONEPRESET_NONE ((VL53L1_DeviceZonePreset) 0)
#define VL53L1_DEVICEZONEPRESET_NONE \
((VL53L1_DeviceZonePreset) 0)
#define VL53L1_DEVICEZONEPRESET_XTALK_PLANAR ((VL53L1_DeviceZonePreset) 1)
#define VL53L1_DEVICEZONEPRESET_1X1_SIZE_16X16 ((VL53L1_DeviceZonePreset) 2)
#define VL53L1_DEVICEZONEPRESET_1X2_SIZE_16X8 ((VL53L1_DeviceZonePreset) 3)
#define VL53L1_DEVICEZONEPRESET_2X1_SIZE_8X16 ((VL53L1_DeviceZonePreset) 4)
#define VL53L1_DEVICEZONEPRESET_2X2_SIZE_8X8 ((VL53L1_DeviceZonePreset) 5)
#define VL53L1_DEVICEZONEPRESET_3X3_SIZE_5X5 ((VL53L1_DeviceZonePreset) 6)
#define VL53L1_DEVICEZONEPRESET_4X4_SIZE_4X4 ((VL53L1_DeviceZonePreset) 7)
#define VL53L1_DEVICEZONEPRESET_5X5_SIZE_4X4 ((VL53L1_DeviceZonePreset) 8)
#define VL53L1_DEVICEZONEPRESET_11X11_SIZE_5X5 ((VL53L1_DeviceZonePreset) 9)
#define VL53L1_DEVICEZONEPRESET_13X13_SIZE_4X4 ((VL53L1_DeviceZonePreset) 10)
#define VL53L1_DEVICEZONEPRESET_XTALK_PLANAR \
((VL53L1_DeviceZonePreset) 1)
#define VL53L1_DEVICEZONEPRESET_1X1_SIZE_16X16 \
((VL53L1_DeviceZonePreset) 2)
#define VL53L1_DEVICEZONEPRESET_1X2_SIZE_16X8 \
((VL53L1_DeviceZonePreset) 3)
#define VL53L1_DEVICEZONEPRESET_2X1_SIZE_8X16 \
((VL53L1_DeviceZonePreset) 4)
#define VL53L1_DEVICEZONEPRESET_2X2_SIZE_8X8 \
((VL53L1_DeviceZonePreset) 5)
#define VL53L1_DEVICEZONEPRESET_3X3_SIZE_5X5 \
((VL53L1_DeviceZonePreset) 6)
#define VL53L1_DEVICEZONEPRESET_4X4_SIZE_4X4 \
((VL53L1_DeviceZonePreset) 7)
#define VL53L1_DEVICEZONEPRESET_5X5_SIZE_4X4 \
((VL53L1_DeviceZonePreset) 8)
#define VL53L1_DEVICEZONEPRESET_11X11_SIZE_5X5 \
((VL53L1_DeviceZonePreset) 9)
#define VL53L1_DEVICEZONEPRESET_13X13_SIZE_4X4 \
((VL53L1_DeviceZonePreset) 10)
#define VL53L1_DEVICEZONEPRESET_1X1_SIZE_4X4_POS_8X8 ((VL53L1_DeviceZonePreset) 11)
#define VL53L1_DEVICEZONEPRESET_1X1_SIZE_4X4_POS_8X8 \
((VL53L1_DeviceZonePreset) 11)
#define VL53L1_DEVICEZONEPRESET_CUSTOM ((VL53L1_DeviceZonePreset) 255)
#define VL53L1_DEVICEZONEPRESET_CUSTOM \
((VL53L1_DeviceZonePreset) 255)
@ -189,46 +202,86 @@ typedef uint8_t VL53L1_DeviceZonePreset;
typedef uint8_t VL53L1_DevicePresetModes;
#define VL53L1_DEVICEPRESETMODE_NONE ((VL53L1_DevicePresetModes) 0)
#define VL53L1_DEVICEPRESETMODE_STANDARD_RANGING ((VL53L1_DevicePresetModes) 1)
#define VL53L1_DEVICEPRESETMODE_STANDARD_RANGING_SHORT_RANGE ((VL53L1_DevicePresetModes) 2)
#define VL53L1_DEVICEPRESETMODE_STANDARD_RANGING_LONG_RANGE ((VL53L1_DevicePresetModes) 3)
#define VL53L1_DEVICEPRESETMODE_STANDARD_RANGING_MM1_CAL ((VL53L1_DevicePresetModes) 4)
#define VL53L1_DEVICEPRESETMODE_STANDARD_RANGING_MM2_CAL ((VL53L1_DevicePresetModes) 5)
#define VL53L1_DEVICEPRESETMODE_TIMED_RANGING ((VL53L1_DevicePresetModes) 6)
#define VL53L1_DEVICEPRESETMODE_TIMED_RANGING_SHORT_RANGE ((VL53L1_DevicePresetModes) 7)
#define VL53L1_DEVICEPRESETMODE_TIMED_RANGING_LONG_RANGE ((VL53L1_DevicePresetModes) 8)
#define VL53L1_DEVICEPRESETMODE_NEAR_FARRANGING ((VL53L1_DevicePresetModes) 9)
#define VL53L1_DEVICEPRESETMODE_QUADRANT_RANGING ((VL53L1_DevicePresetModes) 10)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_RANGING ((VL53L1_DevicePresetModes) 11)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_RANGING_SHORT_TIMING ((VL53L1_DevicePresetModes) 12)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_CHARACTERISATION ((VL53L1_DevicePresetModes) 13)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_XTALK_PLANAR ((VL53L1_DevicePresetModes) 14)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_XTALK_MM1 ((VL53L1_DevicePresetModes) 15)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_XTALK_MM2 ((VL53L1_DevicePresetModes) 16)
#define VL53L1_DEVICEPRESETMODE_OLT ((VL53L1_DevicePresetModes) 17)
#define VL53L1_DEVICEPRESETMODE_SINGLESHOT_RANGING ((VL53L1_DevicePresetModes) 18)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_REF_ARRAY ((VL53L1_DevicePresetModes) 19)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_RANGING_WITH_MM1 ((VL53L1_DevicePresetModes) 20)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_RANGING_WITH_MM2 ((VL53L1_DevicePresetModes) 21)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_RANGING_MM1_CAL ((VL53L1_DevicePresetModes) 22)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_RANGING_MM2_CAL ((VL53L1_DevicePresetModes) 23)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_MULTIZONE ((VL53L1_DevicePresetModes) 24)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_MULTIZONE_SHORT_RANGE ((VL53L1_DevicePresetModes) 25)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_MULTIZONE_LONG_RANGE ((VL53L1_DevicePresetModes) 26)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_LONG_RANGE ((VL53L1_DevicePresetModes) 27)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_LONG_RANGE_MM1 ((VL53L1_DevicePresetModes) 28)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_LONG_RANGE_MM2 ((VL53L1_DevicePresetModes) 29)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_MEDIUM_RANGE ((VL53L1_DevicePresetModes) 30)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_MEDIUM_RANGE_MM1 ((VL53L1_DevicePresetModes) 31)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_MEDIUM_RANGE_MM2 ((VL53L1_DevicePresetModes) 32)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_SHORT_RANGE ((VL53L1_DevicePresetModes) 33)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_SHORT_RANGE_MM1 ((VL53L1_DevicePresetModes) 34)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_SHORT_RANGE_MM2 ((VL53L1_DevicePresetModes) 35)
#define VL53L1_DEVICEPRESETMODE_LOWPOWERAUTO_SHORT_RANGE ((VL53L1_DevicePresetModes) 36)
#define VL53L1_DEVICEPRESETMODE_LOWPOWERAUTO_MEDIUM_RANGE ((VL53L1_DevicePresetModes) 37)
#define VL53L1_DEVICEPRESETMODE_LOWPOWERAUTO_LONG_RANGE ((VL53L1_DevicePresetModes) 38)
#define VL53L1_DEVICEPRESETMODE_SPECIAL_HISTOGRAM_SHORT_RANGE ((VL53L1_DevicePresetModes) 39)
#define VL53L1_DEVICEPRESETMODE_NONE \
((VL53L1_DevicePresetModes) 0)
#define VL53L1_DEVICEPRESETMODE_STANDARD_RANGING \
((VL53L1_DevicePresetModes) 1)
#define VL53L1_DEVICEPRESETMODE_STANDARD_RANGING_SHORT_RANGE \
((VL53L1_DevicePresetModes) 2)
#define VL53L1_DEVICEPRESETMODE_STANDARD_RANGING_LONG_RANGE \
((VL53L1_DevicePresetModes) 3)
#define VL53L1_DEVICEPRESETMODE_STANDARD_RANGING_MM1_CAL \
((VL53L1_DevicePresetModes) 4)
#define VL53L1_DEVICEPRESETMODE_STANDARD_RANGING_MM2_CAL \
((VL53L1_DevicePresetModes) 5)
#define VL53L1_DEVICEPRESETMODE_TIMED_RANGING \
((VL53L1_DevicePresetModes) 6)
#define VL53L1_DEVICEPRESETMODE_TIMED_RANGING_SHORT_RANGE \
((VL53L1_DevicePresetModes) 7)
#define VL53L1_DEVICEPRESETMODE_TIMED_RANGING_LONG_RANGE \
((VL53L1_DevicePresetModes) 8)
#define VL53L1_DEVICEPRESETMODE_NEAR_FARRANGING \
((VL53L1_DevicePresetModes) 9)
#define VL53L1_DEVICEPRESETMODE_QUADRANT_RANGING \
((VL53L1_DevicePresetModes) 10)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_RANGING \
((VL53L1_DevicePresetModes) 11)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_RANGING_SHORT_TIMING \
((VL53L1_DevicePresetModes) 12)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_CHARACTERISATION \
((VL53L1_DevicePresetModes) 13)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_XTALK_PLANAR \
((VL53L1_DevicePresetModes) 14)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_XTALK_MM1 \
((VL53L1_DevicePresetModes) 15)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_XTALK_MM2 \
((VL53L1_DevicePresetModes) 16)
#define VL53L1_DEVICEPRESETMODE_OLT \
((VL53L1_DevicePresetModes) 17)
#define VL53L1_DEVICEPRESETMODE_SINGLESHOT_RANGING \
((VL53L1_DevicePresetModes) 18)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_REF_ARRAY \
((VL53L1_DevicePresetModes) 19)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_RANGING_WITH_MM1 \
((VL53L1_DevicePresetModes) 20)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_RANGING_WITH_MM2 \
((VL53L1_DevicePresetModes) 21)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_RANGING_MM1_CAL \
((VL53L1_DevicePresetModes) 22)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_RANGING_MM2_CAL \
((VL53L1_DevicePresetModes) 23)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_MULTIZONE \
((VL53L1_DevicePresetModes) 24)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_MULTIZONE_SHORT_RANGE \
((VL53L1_DevicePresetModes) 25)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_MULTIZONE_LONG_RANGE \
((VL53L1_DevicePresetModes) 26)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_LONG_RANGE \
((VL53L1_DevicePresetModes) 27)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_LONG_RANGE_MM1 \
((VL53L1_DevicePresetModes) 28)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_LONG_RANGE_MM2 \
((VL53L1_DevicePresetModes) 29)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_MEDIUM_RANGE \
((VL53L1_DevicePresetModes) 30)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_MEDIUM_RANGE_MM1 \
((VL53L1_DevicePresetModes) 31)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_MEDIUM_RANGE_MM2 \
((VL53L1_DevicePresetModes) 32)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_SHORT_RANGE \
((VL53L1_DevicePresetModes) 33)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_SHORT_RANGE_MM1 \
((VL53L1_DevicePresetModes) 34)
#define VL53L1_DEVICEPRESETMODE_HISTOGRAM_SHORT_RANGE_MM2 \
((VL53L1_DevicePresetModes) 35)
#define VL53L1_DEVICEPRESETMODE_LOWPOWERAUTO_SHORT_RANGE \
((VL53L1_DevicePresetModes) 36)
#define VL53L1_DEVICEPRESETMODE_LOWPOWERAUTO_MEDIUM_RANGE \
((VL53L1_DevicePresetModes) 37)
#define VL53L1_DEVICEPRESETMODE_LOWPOWERAUTO_LONG_RANGE \
((VL53L1_DevicePresetModes) 38)
#define VL53L1_DEVICEPRESETMODE_SPECIAL_HISTOGRAM_SHORT_RANGE \
((VL53L1_DevicePresetModes) 39)
@ -242,11 +295,16 @@ typedef uint8_t VL53L1_DevicePresetModes;
typedef uint8_t VL53L1_DeviceMeasurementModes;
#define VL53L1_DEVICEMEASUREMENTMODE_STOP ((VL53L1_DeviceMeasurementModes) 0x00)
#define VL53L1_DEVICEMEASUREMENTMODE_SINGLESHOT ((VL53L1_DeviceMeasurementModes) 0x10)
#define VL53L1_DEVICEMEASUREMENTMODE_BACKTOBACK ((VL53L1_DeviceMeasurementModes) 0x20)
#define VL53L1_DEVICEMEASUREMENTMODE_TIMED ((VL53L1_DeviceMeasurementModes) 0x40)
#define VL53L1_DEVICEMEASUREMENTMODE_ABORT ((VL53L1_DeviceMeasurementModes) 0x80)
#define VL53L1_DEVICEMEASUREMENTMODE_STOP \
((VL53L1_DeviceMeasurementModes) 0x00)
#define VL53L1_DEVICEMEASUREMENTMODE_SINGLESHOT \
((VL53L1_DeviceMeasurementModes) 0x10)
#define VL53L1_DEVICEMEASUREMENTMODE_BACKTOBACK \
((VL53L1_DeviceMeasurementModes) 0x20)
#define VL53L1_DEVICEMEASUREMENTMODE_TIMED \
((VL53L1_DeviceMeasurementModes) 0x40)
#define VL53L1_DEVICEMEASUREMENTMODE_ABORT \
((VL53L1_DeviceMeasurementModes) 0x80)
@ -260,12 +318,18 @@ typedef uint8_t VL53L1_DeviceMeasurementModes;
typedef uint8_t VL53L1_OffsetCalibrationMode;
#define VL53L1_OFFSETCALIBRATIONMODE__NONE ((VL53L1_OffsetCalibrationMode) 0)
#define VL53L1_OFFSETCALIBRATIONMODE__MM1_MM2__STANDARD ((VL53L1_OffsetCalibrationMode) 1)
#define VL53L1_OFFSETCALIBRATIONMODE__MM1_MM2__HISTOGRAM ((VL53L1_OffsetCalibrationMode) 2)
#define VL53L1_OFFSETCALIBRATIONMODE__MM1_MM2__STANDARD_PRE_RANGE_ONLY ((VL53L1_OffsetCalibrationMode) 3)
#define VL53L1_OFFSETCALIBRATIONMODE__MM1_MM2__HISTOGRAM_PRE_RANGE_ONLY ((VL53L1_OffsetCalibrationMode) 4)
#define VL53L1_OFFSETCALIBRATIONMODE__PER_ZONE ((VL53L1_OffsetCalibrationMode) 5)
#define VL53L1_OFFSETCALIBRATIONMODE__NONE \
((VL53L1_OffsetCalibrationMode) 0)
#define VL53L1_OFFSETCALIBRATIONMODE__MM1_MM2__STANDARD \
((VL53L1_OffsetCalibrationMode) 1)
#define VL53L1_OFFSETCALIBRATIONMODE__MM1_MM2__HISTOGRAM \
((VL53L1_OffsetCalibrationMode) 2)
#define VL53L1_OFFSETCALIBRATIONMODE__MM1_MM2__STANDARD_PRE_RANGE_ONLY \
((VL53L1_OffsetCalibrationMode) 3)
#define VL53L1_OFFSETCALIBRATIONMODE__MM1_MM2__HISTOGRAM_PRE_RANGE_ONLY \
((VL53L1_OffsetCalibrationMode) 4)
#define VL53L1_OFFSETCALIBRATIONMODE__PER_ZONE \
((VL53L1_OffsetCalibrationMode) 5)
@ -279,9 +343,12 @@ typedef uint8_t VL53L1_OffsetCalibrationMode;
typedef uint8_t VL53L1_OffsetCorrectionMode;
#define VL53L1_OFFSETCORRECTIONMODE__NONE ((VL53L1_OffsetCorrectionMode) 0)
#define VL53L1_OFFSETCORRECTIONMODE__MM1_MM2_OFFSETS ((VL53L1_OffsetCorrectionMode) 1)
#define VL53L1_OFFSETCORRECTIONMODE__PER_ZONE_OFFSETS ((VL53L1_OffsetCorrectionMode) 2)
#define VL53L1_OFFSETCORRECTIONMODE__NONE \
((VL53L1_OffsetCorrectionMode) 0)
#define VL53L1_OFFSETCORRECTIONMODE__MM1_MM2_OFFSETS \
((VL53L1_OffsetCorrectionMode) 1)
#define VL53L1_OFFSETCORRECTIONMODE__PER_ZONE_OFFSETS \
((VL53L1_OffsetCorrectionMode) 2)
@ -295,10 +362,14 @@ typedef uint8_t VL53L1_OffsetCorrectionMode;
typedef uint8_t VL53L1_DeviceDmaxMode;
#define VL53L1_DEVICEDMAXMODE__NONE ((VL53L1_DeviceDmaxMode) 0)
#define VL53L1_DEVICEDMAXMODE__FMT_CAL_DATA ((VL53L1_DeviceDmaxMode) 1)
#define VL53L1_DEVICEDMAXMODE__CUST_CAL_DATA ((VL53L1_DeviceDmaxMode) 2)
#define VL53L1_DEVICEDMAXMODE__PER_ZONE_CAL_DATA ((VL53L1_DeviceDmaxMode) 3)
#define VL53L1_DEVICEDMAXMODE__NONE \
((VL53L1_DeviceDmaxMode) 0)
#define VL53L1_DEVICEDMAXMODE__FMT_CAL_DATA \
((VL53L1_DeviceDmaxMode) 1)
#define VL53L1_DEVICEDMAXMODE__CUST_CAL_DATA \
((VL53L1_DeviceDmaxMode) 2)
#define VL53L1_DEVICEDMAXMODE__PER_ZONE_CAL_DATA \
((VL53L1_DeviceDmaxMode) 3)
@ -313,14 +384,22 @@ typedef uint8_t VL53L1_DeviceDmaxMode;
typedef uint8_t VL53L1_DeviceSequenceConfig;
#define VL53L1_DEVICESEQUENCECONFIG_VHV ((VL53L1_DeviceSequenceConfig) 0)
#define VL53L1_DEVICESEQUENCECONFIG_PHASECAL ((VL53L1_DeviceSequenceConfig) 1)
#define VL53L1_DEVICESEQUENCECONFIG_REFERENCE_PHASE ((VL53L1_DeviceSequenceConfig) 2)
#define VL53L1_DEVICESEQUENCECONFIG_DSS1 ((VL53L1_DeviceSequenceConfig) 3)
#define VL53L1_DEVICESEQUENCECONFIG_DSS2 ((VL53L1_DeviceSequenceConfig) 4)
#define VL53L1_DEVICESEQUENCECONFIG_MM1 ((VL53L1_DeviceSequenceConfig) 5)
#define VL53L1_DEVICESEQUENCECONFIG_MM2 ((VL53L1_DeviceSequenceConfig) 6)
#define VL53L1_DEVICESEQUENCECONFIG_RANGE ((VL53L1_DeviceSequenceConfig) 7)
#define VL53L1_DEVICESEQUENCECONFIG_VHV \
((VL53L1_DeviceSequenceConfig) 0)
#define VL53L1_DEVICESEQUENCECONFIG_PHASECAL \
((VL53L1_DeviceSequenceConfig) 1)
#define VL53L1_DEVICESEQUENCECONFIG_REFERENCE_PHASE \
((VL53L1_DeviceSequenceConfig) 2)
#define VL53L1_DEVICESEQUENCECONFIG_DSS1 \
((VL53L1_DeviceSequenceConfig) 3)
#define VL53L1_DEVICESEQUENCECONFIG_DSS2 \
((VL53L1_DeviceSequenceConfig) 4)
#define VL53L1_DEVICESEQUENCECONFIG_MM1 \
((VL53L1_DeviceSequenceConfig) 5)
#define VL53L1_DEVICESEQUENCECONFIG_MM2 \
((VL53L1_DeviceSequenceConfig) 6)
#define VL53L1_DEVICESEQUENCECONFIG_RANGE \
((VL53L1_DeviceSequenceConfig) 7)
@ -334,10 +413,14 @@ typedef uint8_t VL53L1_DeviceSequenceConfig;
typedef uint8_t VL53L1_DeviceInterruptPolarity;
#define VL53L1_DEVICEINTERRUPTPOLARITY_ACTIVE_HIGH ((VL53L1_DeviceInterruptPolarity) 0x00)
#define VL53L1_DEVICEINTERRUPTPOLARITY_ACTIVE_LOW ((VL53L1_DeviceInterruptPolarity) 0x10)
#define VL53L1_DEVICEINTERRUPTPOLARITY_BIT_MASK ((VL53L1_DeviceInterruptPolarity) 0x10)
#define VL53L1_DEVICEINTERRUPTPOLARITY_CLEAR_MASK ((VL53L1_DeviceInterruptPolarity) 0xEF)
#define VL53L1_DEVICEINTERRUPTPOLARITY_ACTIVE_HIGH \
((VL53L1_DeviceInterruptPolarity) 0x00)
#define VL53L1_DEVICEINTERRUPTPOLARITY_ACTIVE_LOW \
((VL53L1_DeviceInterruptPolarity) 0x10)
#define VL53L1_DEVICEINTERRUPTPOLARITY_BIT_MASK \
((VL53L1_DeviceInterruptPolarity) 0x10)
#define VL53L1_DEVICEINTERRUPTPOLARITY_CLEAR_MASK \
((VL53L1_DeviceInterruptPolarity) 0xEF)
@ -351,13 +434,20 @@ typedef uint8_t VL53L1_DeviceInterruptPolarity;
typedef uint8_t VL53L1_DeviceGpioMode;
#define VL53L1_DEVICEGPIOMODE_OUTPUT_CONSTANT_ZERO ((VL53L1_DeviceGpioMode) 0x00)
#define VL53L1_DEVICEGPIOMODE_OUTPUT_RANGE_AND_ERROR_INTERRUPTS ((VL53L1_DeviceGpioMode) 0x01)
#define VL53L1_DEVICEGPIOMODE_OUTPUT_TIMIER_INTERRUPTS ((VL53L1_DeviceGpioMode) 0x02)
#define VL53L1_DEVICEGPIOMODE_OUTPUT_RANGE_MODE_INTERRUPT_STATUS ((VL53L1_DeviceGpioMode) 0x03)
#define VL53L1_DEVICEGPIOMODE_OUTPUT_SLOW_OSCILLATOR_CLOCK ((VL53L1_DeviceGpioMode) 0x04)
#define VL53L1_DEVICEGPIOMODE_BIT_MASK ((VL53L1_DeviceGpioMode) 0x0F)
#define VL53L1_DEVICEGPIOMODE_CLEAR_MASK ((VL53L1_DeviceGpioMode) 0xF0)
#define VL53L1_DEVICEGPIOMODE_OUTPUT_CONSTANT_ZERO \
((VL53L1_DeviceGpioMode) 0x00)
#define VL53L1_DEVICEGPIOMODE_OUTPUT_RANGE_AND_ERROR_INTERRUPTS \
((VL53L1_DeviceGpioMode) 0x01)
#define VL53L1_DEVICEGPIOMODE_OUTPUT_TIMIER_INTERRUPTS \
((VL53L1_DeviceGpioMode) 0x02)
#define VL53L1_DEVICEGPIOMODE_OUTPUT_RANGE_MODE_INTERRUPT_STATUS \
((VL53L1_DeviceGpioMode) 0x03)
#define VL53L1_DEVICEGPIOMODE_OUTPUT_SLOW_OSCILLATOR_CLOCK \
((VL53L1_DeviceGpioMode) 0x04)
#define VL53L1_DEVICEGPIOMODE_BIT_MASK \
((VL53L1_DeviceGpioMode) 0x0F)
#define VL53L1_DEVICEGPIOMODE_CLEAR_MASK \
((VL53L1_DeviceGpioMode) 0xF0)
@ -375,35 +465,59 @@ typedef uint8_t VL53L1_DeviceGpioMode;
typedef uint8_t VL53L1_DeviceError;
#define VL53L1_DEVICEERROR_NOUPDATE ((VL53L1_DeviceError) 0)
#define VL53L1_DEVICEERROR_NOUPDATE \
((VL53L1_DeviceError) 0)
#define VL53L1_DEVICEERROR_VCSELCONTINUITYTESTFAILURE ((VL53L1_DeviceError) 1)
#define VL53L1_DEVICEERROR_VCSELWATCHDOGTESTFAILURE ((VL53L1_DeviceError) 2)
#define VL53L1_DEVICEERROR_NOVHVVALUEFOUND ((VL53L1_DeviceError) 3)
#define VL53L1_DEVICEERROR_MSRCNOTARGET ((VL53L1_DeviceError) 4)
#define VL53L1_DEVICEERROR_RANGEPHASECHECK ((VL53L1_DeviceError) 5)
#define VL53L1_DEVICEERROR_SIGMATHRESHOLDCHECK ((VL53L1_DeviceError) 6)
#define VL53L1_DEVICEERROR_PHASECONSISTENCY ((VL53L1_DeviceError) 7)
#define VL53L1_DEVICEERROR_MINCLIP ((VL53L1_DeviceError) 8)
#define VL53L1_DEVICEERROR_RANGECOMPLETE ((VL53L1_DeviceError) 9)
#define VL53L1_DEVICEERROR_ALGOUNDERFLOW ((VL53L1_DeviceError) 10)
#define VL53L1_DEVICEERROR_ALGOOVERFLOW ((VL53L1_DeviceError) 11)
#define VL53L1_DEVICEERROR_RANGEIGNORETHRESHOLD ((VL53L1_DeviceError) 12)
#define VL53L1_DEVICEERROR_USERROICLIP ((VL53L1_DeviceError) 13)
#define VL53L1_DEVICEERROR_REFSPADCHARNOTENOUGHDPADS ((VL53L1_DeviceError) 14)
#define VL53L1_DEVICEERROR_REFSPADCHARMORETHANTARGET ((VL53L1_DeviceError) 15)
#define VL53L1_DEVICEERROR_REFSPADCHARLESSTHANTARGET ((VL53L1_DeviceError) 16)
#define VL53L1_DEVICEERROR_MULTCLIPFAIL ((VL53L1_DeviceError) 17)
#define VL53L1_DEVICEERROR_GPHSTREAMCOUNT0READY ((VL53L1_DeviceError) 18)
#define VL53L1_DEVICEERROR_RANGECOMPLETE_NO_WRAP_CHECK ((VL53L1_DeviceError) 19)
#define VL53L1_DEVICEERROR_EVENTCONSISTENCY ((VL53L1_DeviceError) 20)
#define VL53L1_DEVICEERROR_MINSIGNALEVENTCHECK ((VL53L1_DeviceError) 21)
#define VL53L1_DEVICEERROR_RANGECOMPLETE_MERGED_PULSE ((VL53L1_DeviceError) 22)
#define VL53L1_DEVICEERROR_VCSELCONTINUITYTESTFAILURE \
((VL53L1_DeviceError) 1)
#define VL53L1_DEVICEERROR_VCSELWATCHDOGTESTFAILURE \
((VL53L1_DeviceError) 2)
#define VL53L1_DEVICEERROR_NOVHVVALUEFOUND \
((VL53L1_DeviceError) 3)
#define VL53L1_DEVICEERROR_MSRCNOTARGET \
((VL53L1_DeviceError) 4)
#define VL53L1_DEVICEERROR_RANGEPHASECHECK \
((VL53L1_DeviceError) 5)
#define VL53L1_DEVICEERROR_SIGMATHRESHOLDCHECK \
((VL53L1_DeviceError) 6)
#define VL53L1_DEVICEERROR_PHASECONSISTENCY \
((VL53L1_DeviceError) 7)
#define VL53L1_DEVICEERROR_MINCLIP \
((VL53L1_DeviceError) 8)
#define VL53L1_DEVICEERROR_RANGECOMPLETE \
((VL53L1_DeviceError) 9)
#define VL53L1_DEVICEERROR_ALGOUNDERFLOW \
((VL53L1_DeviceError) 10)
#define VL53L1_DEVICEERROR_ALGOOVERFLOW \
((VL53L1_DeviceError) 11)
#define VL53L1_DEVICEERROR_RANGEIGNORETHRESHOLD \
((VL53L1_DeviceError) 12)
#define VL53L1_DEVICEERROR_USERROICLIP \
((VL53L1_DeviceError) 13)
#define VL53L1_DEVICEERROR_REFSPADCHARNOTENOUGHDPADS \
((VL53L1_DeviceError) 14)
#define VL53L1_DEVICEERROR_REFSPADCHARMORETHANTARGET \
((VL53L1_DeviceError) 15)
#define VL53L1_DEVICEERROR_REFSPADCHARLESSTHANTARGET \
((VL53L1_DeviceError) 16)
#define VL53L1_DEVICEERROR_MULTCLIPFAIL \
((VL53L1_DeviceError) 17)
#define VL53L1_DEVICEERROR_GPHSTREAMCOUNT0READY \
((VL53L1_DeviceError) 18)
#define VL53L1_DEVICEERROR_RANGECOMPLETE_NO_WRAP_CHECK \
((VL53L1_DeviceError) 19)
#define VL53L1_DEVICEERROR_EVENTCONSISTENCY \
((VL53L1_DeviceError) 20)
#define VL53L1_DEVICEERROR_MINSIGNALEVENTCHECK \
((VL53L1_DeviceError) 21)
#define VL53L1_DEVICEERROR_RANGECOMPLETE_MERGED_PULSE \
((VL53L1_DeviceError) 22)
#define VL53L1_DEVICEERROR_PREV_RANGE_NO_TARGETS ((VL53L1_DeviceError) 23)
#define VL53L1_DEVICEERROR_PREV_RANGE_NO_TARGETS \
((VL53L1_DeviceError) 23)
@ -417,19 +531,30 @@ typedef uint8_t VL53L1_DeviceError;
typedef uint8_t VL53L1_DeviceReportStatus;
#define VL53L1_DEVICEREPORTSTATUS_NOUPDATE ((VL53L1_DeviceReportStatus) 0)
#define VL53L1_DEVICEREPORTSTATUS_NOUPDATE \
((VL53L1_DeviceReportStatus) 0)
#define VL53L1_DEVICEREPORTSTATUS_ROI_SETUP ((VL53L1_DeviceReportStatus) 1)
#define VL53L1_DEVICEREPORTSTATUS_VHV ((VL53L1_DeviceReportStatus) 2)
#define VL53L1_DEVICEREPORTSTATUS_PHASECAL ((VL53L1_DeviceReportStatus) 3)
#define VL53L1_DEVICEREPORTSTATUS_REFERENCE_PHASE ((VL53L1_DeviceReportStatus) 4)
#define VL53L1_DEVICEREPORTSTATUS_DSS1 ((VL53L1_DeviceReportStatus) 5)
#define VL53L1_DEVICEREPORTSTATUS_DSS2 ((VL53L1_DeviceReportStatus) 6)
#define VL53L1_DEVICEREPORTSTATUS_MM1 ((VL53L1_DeviceReportStatus) 7)
#define VL53L1_DEVICEREPORTSTATUS_MM2 ((VL53L1_DeviceReportStatus) 8)
#define VL53L1_DEVICEREPORTSTATUS_RANGE ((VL53L1_DeviceReportStatus) 9)
#define VL53L1_DEVICEREPORTSTATUS_HISTOGRAM ((VL53L1_DeviceReportStatus) 10)
#define VL53L1_DEVICEREPORTSTATUS_ROI_SETUP \
((VL53L1_DeviceReportStatus) 1)
#define VL53L1_DEVICEREPORTSTATUS_VHV \
((VL53L1_DeviceReportStatus) 2)
#define VL53L1_DEVICEREPORTSTATUS_PHASECAL \
((VL53L1_DeviceReportStatus) 3)
#define VL53L1_DEVICEREPORTSTATUS_REFERENCE_PHASE \
((VL53L1_DeviceReportStatus) 4)
#define VL53L1_DEVICEREPORTSTATUS_DSS1 \
((VL53L1_DeviceReportStatus) 5)
#define VL53L1_DEVICEREPORTSTATUS_DSS2 \
((VL53L1_DeviceReportStatus) 6)
#define VL53L1_DEVICEREPORTSTATUS_MM1 \
((VL53L1_DeviceReportStatus) 7)
#define VL53L1_DEVICEREPORTSTATUS_MM2 \
((VL53L1_DeviceReportStatus) 8)
#define VL53L1_DEVICEREPORTSTATUS_RANGE \
((VL53L1_DeviceReportStatus) 9)
#define VL53L1_DEVICEREPORTSTATUS_HISTOGRAM \
((VL53L1_DeviceReportStatus) 10)
@ -761,7 +886,8 @@ typedef uint8_t VL53L1_DeviceSscArray;
#define VL53L1_MACRO_PERIOD_VCSEL_PERIODS \
(VL53L1_AMBIENT_WINDOW_VCSEL_PERIODS + VL53L1_RANGING_WINDOW_VCSEL_PERIODS)
(VL53L1_AMBIENT_WINDOW_VCSEL_PERIODS + \
VL53L1_RANGING_WINDOW_VCSEL_PERIODS)
#define VL53L1_MAX_ALLOWED_PHASE 0xFFFF
@ -858,7 +984,7 @@ typedef uint16_t VL53L1_TuningParms;
#define VL53L1_TUNINGPARMS_LLD_PUBLIC_MIN_ADDRESS \
((VL53L1_TuningParms) VL53L1_TUNINGPARM_PUBLIC_PAGE_BASE_ADDRESS)
#define VL53L1_TUNINGPARMS_LLD_PUBLIC_MAX_ADDRESS \
((VL53L1_TuningParms) VL53L1_TUNINGPARM_VERY_SHORT_DSS_RATE_MCPS)
((VL53L1_TuningParms) VL53L1_TUNINGPARM_VERY_SHORT_DSS_RATE_MCPS)
#define VL53L1_TUNINGPARMS_LLD_PRIVATE_MIN_ADDRESS \
((VL53L1_TuningParms) VL53L1_TUNINGPARM_PRIVATE_PAGE_BASE_ADDRESS)

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/

File diff suppressed because it is too large Load diff

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/
@ -790,7 +790,10 @@ typedef struct {
VL53L1_optical_centre_t fmt_optical_centre;
VL53L1_cal_peak_rate_map_t fmt_peak_rate_map;
VL53L1_additional_offset_cal_data_t fmt_add_offset_data;
VL53L1_decoded_nvm_fmt_range_data_t fmt_range_data[VL53L1_NVM_MAX_FMT_RANGE_DATA];
VL53L1_decoded_nvm_fmt_range_data_t
fmt_range_data[VL53L1_NVM_MAX_FMT_RANGE_DATA];
VL53L1_decoded_nvm_fmt_info_t fmt_info;
VL53L1_decoded_nvm_ews_info_t ews_info;

View file

@ -1,64 +1,64 @@
/*
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed, either
* 'STMicroelectronics Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
********************************************************************************
*
*/
/******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
******************************************************************************
'STMicroelectronics Proprietary license'
*******************************************************************************
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
*******************************************************************************
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones mentioned above :
*******************************************************************************
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************
*/
#ifndef _VL53L1_PRESET_SETUP_H_
#define _VL53L1_PRESET_SETUP_H_
@ -75,13 +75,29 @@ enum VL53L1_Tuning_t {
VL53L1_TUNING_SINGLE_TARGET_XTALK_TARGET_DISTANCE_MM,
VL53L1_TUNING_SINGLE_TARGET_XTALK_SAMPLE_NUMBER,
VL53L1_TUNING_MIN_AMBIENT_DMAX_VALID,
VL53L1_TUNING_MAX_SIMPLE_OFFSET_CALIBRATION_RANGES,
VL53L1_TUNING_MAX_SIMPLE_OFFSET_CALIBRATION_SAMPLE_NUMBER,
VL53L1_TUNING_XTALK_FULL_ROI_TARGET_DISTANCE_MM,
VL53L1_TUNING_SIMPLE_OFFSET_CALIBRATION_REPEAT,
VL53L1_TUNING_MAX_TUNABLE_KEY
};
/* default values for the tuning settings parameters */
#define TUNING_VERSION 0x0002
#define TUNING_VERSION 0x0004
#define TUNING_PROXY_MIN -30 /* min distance in mm */
#define TUNING_SINGLE_TARGET_XTALK_TARGET_DISTANCE_MM 600
/* Target distance in mm for single target Xtalk */
#define TUNING_SINGLE_TARGET_XTALK_SAMPLE_NUMBER 50
/* Number of sample used for single target Xtalk */
#define TUNING_MIN_AMBIENT_DMAX_VALID 8
/* Minimum ambient level to state the Dmax returned by the device is valid */
#define TUNING_MAX_SIMPLE_OFFSET_CALIBRATION_SAMPLE_NUMBER 5
/* Maximum loops to perform simple offset calibration */
#define TUNING_XTALK_FULL_ROI_TARGET_DISTANCE_MM 600
/* Target distance in mm for target Xtalk from Bins method*/
#define TUNING_SIMPLE_OFFSET_CALIBRATION_REPEAT 3
/* Number of loops done during the simple offset calibration*/
/* the following table should actually be defined as static and shall be part
* of the VL53L1_StaticInit() function code

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/

File diff suppressed because it is too large Load diff

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/
@ -105,27 +105,48 @@
#include "vl53l1_types.h"
#include "vl53l1_register_map.h"
#define VL53L1_STATIC_NVM_MANAGED_I2C_INDEX VL53L1_I2C_SLAVE__DEVICE_ADDRESS
#define VL53L1_CUSTOMER_NVM_MANAGED_I2C_INDEX VL53L1_GLOBAL_CONFIG__SPAD_ENABLES_REF_0
#define VL53L1_STATIC_CONFIG_I2C_INDEX VL53L1_DSS_CONFIG__TARGET_TOTAL_RATE_MCPS
#define VL53L1_GENERAL_CONFIG_I2C_INDEX VL53L1_GPH_CONFIG__STREAM_COUNT_UPDATE_VALUE
#define VL53L1_TIMING_CONFIG_I2C_INDEX VL53L1_MM_CONFIG__TIMEOUT_MACROP_A_HI
#define VL53L1_DYNAMIC_CONFIG_I2C_INDEX VL53L1_SYSTEM__GROUPED_PARAMETER_HOLD_0
#define VL53L1_SYSTEM_CONTROL_I2C_INDEX VL53L1_POWER_MANAGEMENT__GO1_POWER_FORCE
#define VL53L1_SYSTEM_RESULTS_I2C_INDEX VL53L1_RESULT__INTERRUPT_STATUS
#define VL53L1_CORE_RESULTS_I2C_INDEX VL53L1_RESULT_CORE__AMBIENT_WINDOW_EVENTS_SD0
#define VL53L1_DEBUG_RESULTS_I2C_INDEX VL53L1_PHASECAL_RESULT__REFERENCE_PHASE
#define VL53L1_NVM_COPY_DATA_I2C_INDEX VL53L1_IDENTIFICATION__MODEL_ID
#define VL53L1_PREV_SHADOW_SYSTEM_RESULTS_I2C_INDEX VL53L1_PREV_SHADOW_RESULT__INTERRUPT_STATUS
#define VL53L1_PREV_SHADOW_CORE_RESULTS_I2C_INDEX VL53L1_PREV_SHADOW_RESULT_CORE__AMBIENT_WINDOW_EVENTS_SD0
#define VL53L1_PATCH_DEBUG_I2C_INDEX VL53L1_RESULT__DEBUG_STATUS
#define VL53L1_GPH_GENERAL_CONFIG_I2C_INDEX VL53L1_GPH__SYSTEM__THRESH_RATE_HIGH
#define VL53L1_GPH_STATIC_CONFIG_I2C_INDEX VL53L1_GPH__DSS_CONFIG__ROI_MODE_CONTROL
#define VL53L1_GPH_TIMING_CONFIG_I2C_INDEX VL53L1_GPH__MM_CONFIG__TIMEOUT_MACROP_A_HI
#define VL53L1_FW_INTERNAL_I2C_INDEX VL53L1_FIRMWARE__INTERNAL_STREAM_COUNT_DIV
#define VL53L1_PATCH_RESULTS_I2C_INDEX VL53L1_DSS_CALC__ROI_CTRL
#define VL53L1_SHADOW_SYSTEM_RESULTS_I2C_INDEX VL53L1_SHADOW_PHASECAL_RESULT__VCSEL_START
#define VL53L1_SHADOW_CORE_RESULTS_I2C_INDEX VL53L1_SHADOW_RESULT_CORE__AMBIENT_WINDOW_EVENTS_SD0
#define VL53L1_STATIC_NVM_MANAGED_I2C_INDEX \
VL53L1_I2C_SLAVE__DEVICE_ADDRESS
#define VL53L1_CUSTOMER_NVM_MANAGED_I2C_INDEX \
VL53L1_GLOBAL_CONFIG__SPAD_ENABLES_REF_0
#define VL53L1_STATIC_CONFIG_I2C_INDEX \
VL53L1_DSS_CONFIG__TARGET_TOTAL_RATE_MCPS
#define VL53L1_GENERAL_CONFIG_I2C_INDEX \
VL53L1_GPH_CONFIG__STREAM_COUNT_UPDATE_VALUE
#define VL53L1_TIMING_CONFIG_I2C_INDEX \
VL53L1_MM_CONFIG__TIMEOUT_MACROP_A_HI
#define VL53L1_DYNAMIC_CONFIG_I2C_INDEX \
VL53L1_SYSTEM__GROUPED_PARAMETER_HOLD_0
#define VL53L1_SYSTEM_CONTROL_I2C_INDEX \
VL53L1_POWER_MANAGEMENT__GO1_POWER_FORCE
#define VL53L1_SYSTEM_RESULTS_I2C_INDEX \
VL53L1_RESULT__INTERRUPT_STATUS
#define VL53L1_CORE_RESULTS_I2C_INDEX \
VL53L1_RESULT_CORE__AMBIENT_WINDOW_EVENTS_SD0
#define VL53L1_DEBUG_RESULTS_I2C_INDEX \
VL53L1_PHASECAL_RESULT__REFERENCE_PHASE
#define VL53L1_NVM_COPY_DATA_I2C_INDEX \
VL53L1_IDENTIFICATION__MODEL_ID
#define VL53L1_PREV_SHADOW_SYSTEM_RESULTS_I2C_INDEX \
VL53L1_PREV_SHADOW_RESULT__INTERRUPT_STATUS
#define VL53L1_PREV_SHADOW_CORE_RESULTS_I2C_INDEX \
VL53L1_PREV_SHADOW_RESULT_CORE__AMBIENT_WINDOW_EVENTS_SD0
#define VL53L1_PATCH_DEBUG_I2C_INDEX \
VL53L1_RESULT__DEBUG_STATUS
#define VL53L1_GPH_GENERAL_CONFIG_I2C_INDEX \
VL53L1_GPH__SYSTEM__THRESH_RATE_HIGH
#define VL53L1_GPH_STATIC_CONFIG_I2C_INDEX \
VL53L1_GPH__DSS_CONFIG__ROI_MODE_CONTROL
#define VL53L1_GPH_TIMING_CONFIG_I2C_INDEX \
VL53L1_GPH__MM_CONFIG__TIMEOUT_MACROP_A_HI
#define VL53L1_FW_INTERNAL_I2C_INDEX \
VL53L1_FIRMWARE__INTERNAL_STREAM_COUNT_DIV
#define VL53L1_PATCH_RESULTS_I2C_INDEX \
VL53L1_DSS_CALC__ROI_CTRL
#define VL53L1_SHADOW_SYSTEM_RESULTS_I2C_INDEX \
VL53L1_SHADOW_PHASECAL_RESULT__VCSEL_START
#define VL53L1_SHADOW_CORE_RESULTS_I2C_INDEX \
VL53L1_SHADOW_RESULT_CORE__AMBIENT_WINDOW_EVENTS_SD0
#define VL53L1_STATIC_NVM_MANAGED_I2C_SIZE_BYTES 11
#define VL53L1_CUSTOMER_NVM_MANAGED_I2C_SIZE_BYTES 23
@ -3096,7 +3117,8 @@ typedef struct {
uint16_t prev_shadow_result__peak_signal_count_rate_crosstalk_corrected_mcps_sd0;
uint16_t
psr__peak_signal_count_rate_crosstalk_corrected_mcps_sd0;
@ -4540,7 +4562,8 @@ typedef struct {
uint16_t shadow_result__peak_signal_count_rate_crosstalk_corrected_mcps_sd0;
uint16_t
shr__peak_signal_count_rate_crosstalk_corrected_mcps_sd0;

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/
@ -150,13 +150,13 @@ extern "C" {
#define VL53L1_TUNINGPARM_HIST_SIGMA_THRESH_MM_DEFAULT \
((uint16_t) 160)
#define VL53L1_TUNINGPARM_HIST_GAIN_FACTOR_DEFAULT \
((uint16_t) 1997)
((uint16_t) 1987)
#define VL53L1_TUNINGPARM_CONSISTENCY_HIST_PHASE_TOLERANCE_DEFAULT \
((uint8_t) 8)
#define VL53L1_TUNINGPARM_CONSISTENCY_HIST_MIN_MAX_TOLERANCE_MM_DEFAULT \
((uint16_t) 250)
#define VL53L1_TUNINGPARM_CONSISTENCY_HIST_EVENT_SIGMA_DEFAULT \
((uint8_t) 240)
((uint8_t) 0)
#define VL53L1_TUNINGPARM_CONSISTENCY_HIST_EVENT_SIGMA_MIN_SPAD_LIMIT_DEFAULT \
((uint16_t) 2048)
#define VL53L1_TUNINGPARM_INITIAL_PHASE_RTN_HISTO_LONG_RANGE_DEFAULT \

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/

View file

@ -1,33 +1,33 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**************************************************************************
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
/**
* @file ipp_linux.c kernel side implementation of vl53l1 protected processing
@ -53,7 +53,7 @@ static int stmvl53l1_ipp_do_wrapper(struct stmvl53l1_data *data,
rc = IPP_ERR_CODE;
goto done;
}
BUG_ON(pin->payload > IPP_WORK_MAX_PAYLOAD);
WARN_ON(pin->payload > IPP_WORK_MAX_PAYLOAD);
stmvl531_ipp_tim_start(data);
rc = stmvl53l1_ipp_do(data, pin, pout);
if (rc != 0) {
@ -71,7 +71,7 @@ static int stmvl53l1_ipp_do_wrapper(struct stmvl53l1_data *data,
rc = IPP_ERR_CODE;
goto done;
}
BUG_ON(pout->payload > IPP_WORK_MAX_PAYLOAD);
WARN_ON(pout->payload > IPP_WORK_MAX_PAYLOAD);
if (pout->payload != payload_out) {
/* bad formated answer */
vl53l1_errmsg("bad payload %d != %d in ipp work back",

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/
@ -240,7 +240,7 @@ VL53L1_Error VL53L1_get_additional_data(
status =
VL53L1_get_histogram_debug_data(
Dev,
&(pdata->VL53L1_PRM_00009));
&(pdata->VL53L1_p_010));
LOG_FUNCTION_END(status);
@ -530,6 +530,7 @@ void VL53L1_print_customer_nvm_managed(
char fp_text[VL53L1_MAX_STRING_LENGTH];
int16_t tmpi16;
trace_print(VL53L1_TRACE_LEVEL_INFO,
"%s%s = %u\n",
@ -597,8 +598,9 @@ void VL53L1_print_customer_nvm_managed(
"algo__crosstalk_compensation_plane_offset_kcps",
fp_text);
tmpi16 = pdata->algo__crosstalk_compensation_x_plane_gradient_kcps;
VL53L1_signed_fixed_point_sprintf(
(int32_t)pdata->algo__crosstalk_compensation_x_plane_gradient_kcps,
(int32_t)tmpi16,
11,
VL53L1_MAX_STRING_LENGTH,
fp_text);
@ -609,8 +611,9 @@ void VL53L1_print_customer_nvm_managed(
"algo__crosstalk_compensation_x_plane_gradient_kcps",
fp_text);
tmpi16 = pdata->algo__crosstalk_compensation_y_plane_gradient_kcps;
VL53L1_signed_fixed_point_sprintf(
(int32_t)pdata->algo__crosstalk_compensation_y_plane_gradient_kcps,
(int32_t)tmpi16,
11,
VL53L1_MAX_STRING_LENGTH,
fp_text);
@ -1041,22 +1044,22 @@ void VL53L1_print_histogram_bin_data(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %u\n",
pprefix,
"VL53L1_PRM_00019",
pdata->VL53L1_PRM_00019);
"VL53L1_p_022",
pdata->VL53L1_p_022);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %u\n",
pprefix,
"VL53L1_PRM_00020",
pdata->VL53L1_PRM_00020);
"VL53L1_p_023",
pdata->VL53L1_p_023);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %u\n",
pprefix,
"VL53L1_PRM_00021",
pdata->VL53L1_PRM_00021);
"VL53L1_p_024",
pdata->VL53L1_p_024);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
@ -1065,7 +1068,7 @@ void VL53L1_print_histogram_bin_data(
"number_of_ambient_bins",
pdata->number_of_ambient_bins);
for (i = 0 ; i < VL53L1_MAX_BIN_SEQUENCE_LENGTH ; i++) {
for (i = 0; i < VL53L1_MAX_BIN_SEQUENCE_LENGTH; i++) {
sprintf(ppre_text, "%sbin_seq[%u]", pprefix, i);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
@ -1074,7 +1077,7 @@ void VL53L1_print_histogram_bin_data(
pdata->bin_seq[i]);
}
for (i = 0 ; i < VL53L1_MAX_BIN_SEQUENCE_LENGTH ; i++) {
for (i = 0; i < VL53L1_MAX_BIN_SEQUENCE_LENGTH; i++) {
sprintf(ppre_text, "%sbin_rep[%u]", pprefix, i);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
@ -1083,7 +1086,7 @@ void VL53L1_print_histogram_bin_data(
pdata->bin_rep[i]);
}
for (i = 0 ; i < pdata->VL53L1_PRM_00021 ; i++) {
for (i = 0; i < pdata->VL53L1_p_024; i++) {
sprintf(ppre_text, "%sbin_data[%u]", pprefix, i);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
@ -1177,11 +1180,11 @@ void VL53L1_print_histogram_bin_data(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %u\n",
pprefix,
"VL53L1_PRM_00008",
pdata->VL53L1_PRM_00008);
"VL53L1_p_009",
pdata->VL53L1_p_009);
VL53L1_signed_fixed_point_sprintf(
(int32_t)pdata->VL53L1_PRM_00022,
(int32_t)pdata->VL53L1_p_019,
12,
VL53L1_MAX_STRING_LENGTH,
fp_text);
@ -1190,7 +1193,7 @@ void VL53L1_print_histogram_bin_data(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %s\n",
pprefix,
"VL53L1_PRM_00022",
"VL53L1_p_019",
fp_text);
trace_print(
@ -1259,8 +1262,8 @@ void VL53L1_print_histogram_bin_data(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %d\n",
pprefix,
"VL53L1_PRM_00028",
pdata->VL53L1_PRM_00028);
"VL53L1_p_004",
pdata->VL53L1_p_004);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
@ -1298,24 +1301,24 @@ void VL53L1_print_xtalk_histogram_shape_data(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %u\n",
pprefix,
"VL53L1_PRM_00019",
pdata->VL53L1_PRM_00019);
"VL53L1_p_022",
pdata->VL53L1_p_022);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %u\n",
pprefix,
"VL53L1_PRM_00020",
pdata->VL53L1_PRM_00020);
"VL53L1_p_023",
pdata->VL53L1_p_023);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %u\n",
pprefix,
"VL53L1_PRM_00021",
pdata->VL53L1_PRM_00021);
"VL53L1_p_024",
pdata->VL53L1_p_024);
for (i = 0 ; i < pdata->VL53L1_PRM_00021 ; i++) {
for (i = 0; i < pdata->VL53L1_p_024; i++) {
sprintf(ppre_text, "%sbin_data[%u]", pprefix, i);
@ -1373,7 +1376,7 @@ void VL53L1_print_xtalk_histogram_shape_data(
fp_text);
VL53L1_signed_fixed_point_sprintf(
(int32_t)pdata->VL53L1_PRM_00022,
(int32_t)pdata->VL53L1_p_019,
12,
VL53L1_MAX_STRING_LENGTH,
fp_text);
@ -1382,7 +1385,7 @@ void VL53L1_print_xtalk_histogram_shape_data(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %s\n",
pprefix,
"VL53L1_PRM_00022",
"VL53L1_p_019",
fp_text);
VL53L1_signed_fixed_point_sprintf(
@ -1459,43 +1462,43 @@ void VL53L1_print_range_data(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %u\n",
pprefix,
"VL53L1_PRM_00014",
pdata->VL53L1_PRM_00014);
"VL53L1_p_015",
pdata->VL53L1_p_015);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %u\n",
pprefix,
"VL53L1_PRM_00019",
pdata->VL53L1_PRM_00019);
"VL53L1_p_022",
pdata->VL53L1_p_022);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %u\n",
pprefix,
"VL53L1_PRM_00023",
pdata->VL53L1_PRM_00023);
"VL53L1_p_025",
pdata->VL53L1_p_025);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %u\n",
pprefix,
"VL53L1_PRM_00024",
pdata->VL53L1_PRM_00024);
"VL53L1_p_026",
pdata->VL53L1_p_026);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %u\n",
pprefix,
"VL53L1_PRM_00015",
pdata->VL53L1_PRM_00015);
"VL53L1_p_016",
pdata->VL53L1_p_016);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %u\n",
pprefix,
"VL53L1_PRM_00025",
pdata->VL53L1_PRM_00025);
"VL53L1_p_027",
pdata->VL53L1_p_027);
VL53L1_signed_fixed_point_sprintf(
(int32_t)pdata->width,
@ -1512,8 +1515,8 @@ void VL53L1_print_range_data(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %u\n",
pprefix,
"VL53L1_PRM_00029",
pdata->VL53L1_PRM_00029);
"VL53L1_p_030",
pdata->VL53L1_p_030);
@ -1547,7 +1550,7 @@ void VL53L1_print_range_data(
VL53L1_signed_fixed_point_sprintf(
(int32_t)pdata->VL53L1_PRM_00004,
(int32_t)pdata->VL53L1_p_006,
8, VL53L1_MAX_STRING_LENGTH, fp_text);
trace_print(
@ -1582,22 +1585,22 @@ void VL53L1_print_range_data(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %d\n",
pprefix,
"VL53L1_PRM_00017",
pdata->VL53L1_PRM_00017);
"VL53L1_p_020",
pdata->VL53L1_p_020);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %d\n",
pprefix,
"VL53L1_PRM_00018",
pdata->VL53L1_PRM_00018);
"VL53L1_p_021",
pdata->VL53L1_p_021);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %d\n",
pprefix,
"VL53L1_PRM_00012",
pdata->VL53L1_PRM_00012);
"VL53L1_p_013",
pdata->VL53L1_p_013);
@ -1647,64 +1650,64 @@ void VL53L1_print_range_data(
fp_text);
VL53L1_signed_fixed_point_sprintf(
(int32_t)pdata->VL53L1_PRM_00011,
(int32_t)pdata->VL53L1_p_012,
11, VL53L1_MAX_STRING_LENGTH, fp_text);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %s\n",
pprefix,
"VL53L1_PRM_00011",
"VL53L1_p_012",
fp_text);
VL53L1_signed_fixed_point_sprintf(
(int32_t)pdata->VL53L1_PRM_00003,
(int32_t)pdata->VL53L1_p_005,
2, VL53L1_MAX_STRING_LENGTH, fp_text);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %s\n",
pprefix,
"VL53L1_PRM_00003",
"VL53L1_p_005",
fp_text);
VL53L1_signed_fixed_point_sprintf(
(int32_t)pdata->VL53L1_PRM_00026,
(int32_t)pdata->VL53L1_p_028,
11, VL53L1_MAX_STRING_LENGTH, fp_text);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %s\n",
pprefix,
"VL53L1_PRM_00026",
"VL53L1_p_028",
fp_text);
VL53L1_signed_fixed_point_sprintf(
(int32_t)pdata->VL53L1_PRM_00013,
(int32_t)pdata->VL53L1_p_014,
11, VL53L1_MAX_STRING_LENGTH, fp_text);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %s\n",
pprefix,
"VL53L1_PRM_00013",
"VL53L1_p_014",
fp_text);
VL53L1_signed_fixed_point_sprintf(
(int32_t)pdata->VL53L1_PRM_00027,
(int32_t)pdata->VL53L1_p_029,
11, VL53L1_MAX_STRING_LENGTH, fp_text);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %s\n",
pprefix,
"VL53L1_PRM_00027",
"VL53L1_p_029",
fp_text);
@ -1783,7 +1786,7 @@ void VL53L1_print_range_results(
"stream_count",
pdata->stream_count);
for (i = 0 ; i < VL53L1_MAX_AMBIENT_DMAX_VALUES ; i++) {
for (i = 0; i < VL53L1_MAX_AMBIENT_DMAX_VALUES; i++) {
sprintf(
ppre_text,
"%sambient_dmax_mm[%u]",
@ -1793,7 +1796,7 @@ void VL53L1_print_range_results(
VL53L1_TRACE_LEVEL_INFO,
"%s = %u\n",
ppre_text,
pdata->VL53L1_PRM_00006[i]);
pdata->VL53L1_p_007[i]);
}
trace_print(
@ -1824,10 +1827,10 @@ void VL53L1_print_range_results(
"active_results",
pdata->active_results);
for (i = 0 ; i < pdata->active_results ; i++) {
for (i = 0; i < pdata->active_results; i++) {
sprintf(ppre_text, "%sdata[%u].", pprefix, i);
VL53L1_print_range_data(
&pdata->VL53L1_PRM_00005[i],
&pdata->VL53L1_p_002[i],
ppre_text, trace_flags);
}
@ -1902,10 +1905,10 @@ void VL53L1_print_offset_range_results(
"active_results",
pdata->active_results);
for (i = 0 ; i < pdata->active_results ; i++) {
for (i = 0; i < pdata->active_results; i++) {
sprintf(ppre_text, "%sdata[%u].", pprefix, i);
VL53L1_print_offset_range_data(
&(pdata->VL53L1_PRM_00005[i]),
&(pdata->VL53L1_p_002[i]),
ppre_text, trace_flags);
}
}
@ -1985,7 +1988,7 @@ void VL53L1_print_offset_range_data(
fp_text);
VL53L1_signed_fixed_point_sprintf(
(int32_t)pdata->VL53L1_PRM_00003,
(int32_t)pdata->VL53L1_p_005,
2,
VL53L1_MAX_STRING_LENGTH,
fp_text);
@ -1994,7 +1997,7 @@ void VL53L1_print_offset_range_data(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %s\n",
pprefix,
"VL53L1_PRM_00003",
"VL53L1_p_005",
fp_text);
trace_print(
@ -2079,8 +2082,8 @@ void VL53L1_print_cal_peak_rate_map(
pdata->height);
i = 0;
for (y = 0 ; y < pdata->height ; y++) {
for (x = 0 ; x < pdata->width ; x++) {
for (y = 0; y < pdata->height; y++) {
for (x = 0; x < pdata->width; x++) {
sprintf(ppre_text, "%speak_rate_mcps[%u]", pprefix, i);
@ -2200,9 +2203,9 @@ void VL53L1_print_additional_data(
"dss_config__target_total_rate_mcps",
fp_text);
sprintf(ppre_text, "%s VL53L1_PRM_00009.", pprefix);
sprintf(ppre_text, "%s VL53L1_p_010.", pprefix);
VL53L1_print_histogram_bin_data(
&pdata->VL53L1_PRM_00009,
&pdata->VL53L1_p_010,
ppre_text, trace_flags);
@ -2361,7 +2364,7 @@ void VL53L1_print_zone_calibration_data(
fp_text);
VL53L1_signed_fixed_point_sprintf(
(int32_t)pdata->VL53L1_PRM_00013,
(int32_t)pdata->VL53L1_p_014,
11,
VL53L1_MAX_STRING_LENGTH,
fp_text);
@ -2370,11 +2373,11 @@ void VL53L1_print_zone_calibration_data(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %s\n",
pprefix,
"VL53L1_PRM_00013",
"VL53L1_p_014",
fp_text);
VL53L1_signed_fixed_point_sprintf(
(int32_t)pdata->VL53L1_PRM_00003,
(int32_t)pdata->VL53L1_p_005,
2,
VL53L1_MAX_STRING_LENGTH,
fp_text);
@ -2383,7 +2386,7 @@ void VL53L1_print_zone_calibration_data(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %s\n",
pprefix,
"VL53L1_PRM_00003",
"VL53L1_p_005",
fp_text);
VL53L1_signed_fixed_point_sprintf(
@ -2511,10 +2514,10 @@ void VL53L1_print_zone_calibration_results(
"active_zones",
pdata->active_zones);
for (i = 0 ; i < pdata->active_zones ; i++) {
for (i = 0; i < pdata->active_zones; i++) {
sprintf(ppre_text, "%sdata[%u].", pprefix, i);
VL53L1_print_zone_calibration_data(
&(pdata->VL53L1_PRM_00005[i]),
&(pdata->VL53L1_p_002[i]),
ppre_text, trace_flags);
}
}
@ -2577,10 +2580,10 @@ void VL53L1_print_xtalk_range_results(
"active_results",
pdata->active_results);
for (i = 0 ; i < pdata->active_results ; i++) {
for (i = 0; i < pdata->active_results; i++) {
sprintf(ppre_text, "%sdata[%u].", pprefix, i);
VL53L1_print_xtalk_range_data(
&(pdata->VL53L1_PRM_00005[i]),
&(pdata->VL53L1_p_002[i]),
ppre_text, trace_flags);
}
@ -2598,19 +2601,19 @@ void VL53L1_print_xtalk_range_results(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %u\n",
pprefix,
"VL53L1_PRM_00014",
"VL53L1_p_015",
pdata->central_histogram__window_start);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
"%s%s = %u\n",
pprefix,
"VL53L1_PRM_00015",
"VL53L1_p_016",
pdata->central_histogram__window_end);
pbin_data = &(pdata->histogram_avg_1[0]);
for (i = 0 ; i < 5 ; i++) {
for (i = 0; i < 5; i++) {
sprintf(ppre_text, "%shistogram_avg_1[%u].", pprefix, i);
VL53L1_print_histogram_bin_data(
pbin_data,
@ -2620,7 +2623,7 @@ void VL53L1_print_xtalk_range_results(
pbin_data = &(pdata->histogram_avg_2[0]);
for (i = 0 ; i < 5 ; i++) {
for (i = 0; i < 5; i++) {
sprintf(ppre_text, "%shistogram_avg_2[%u].", pprefix, i);
VL53L1_print_histogram_bin_data(
pbin_data,
@ -2630,7 +2633,7 @@ void VL53L1_print_xtalk_range_results(
pbin_data = &(pdata->xtalk_avg[0]);
for (i = 0 ; i < 5 ; i++) {
for (i = 0; i < 5; i++) {
sprintf(ppre_text, "%sxtalk_avg[%u].", pprefix, i);
VL53L1_print_histogram_bin_data(
pbin_data,
@ -2713,7 +2716,7 @@ void VL53L1_print_xtalk_calibration_results(
char fp_text[VL53L1_MAX_STRING_LENGTH];
int16_t tmpi16;
VL53L1_signed_fixed_point_sprintf(
(int32_t)pdata->algo__crosstalk_compensation_plane_offset_kcps,
@ -2728,8 +2731,9 @@ void VL53L1_print_xtalk_calibration_results(
"algo__crosstalk_compensation_plane_offset_kcps",
fp_text);
tmpi16 = pdata->algo__crosstalk_compensation_x_plane_gradient_kcps;
VL53L1_signed_fixed_point_sprintf(
(int32_t)pdata->algo__crosstalk_compensation_x_plane_gradient_kcps,
(int32_t)tmpi16,
11,
VL53L1_MAX_STRING_LENGTH,
fp_text);
@ -2741,8 +2745,9 @@ void VL53L1_print_xtalk_calibration_results(
"algo__crosstalk_compensation_x_plane_gradient_kcps",
fp_text);
tmpi16 = pdata->algo__crosstalk_compensation_y_plane_gradient_kcps;
VL53L1_signed_fixed_point_sprintf(
(int32_t)pdata->algo__crosstalk_compensation_y_plane_gradient_kcps,
(int32_t)tmpi16,
11,
VL53L1_MAX_STRING_LENGTH,
fp_text);
@ -2767,6 +2772,7 @@ void VL53L1_print_xtalk_config(
char fp_text[VL53L1_MAX_STRING_LENGTH];
int16_t tmpi16;
VL53L1_signed_fixed_point_sprintf(
(int32_t)pdata->algo__crosstalk_compensation_plane_offset_kcps,
@ -2781,8 +2787,9 @@ void VL53L1_print_xtalk_config(
"algo__crosstalk_compensation_plane_offset_kcps",
fp_text);
tmpi16 = pdata->algo__crosstalk_compensation_x_plane_gradient_kcps;
VL53L1_signed_fixed_point_sprintf(
(int32_t)pdata->algo__crosstalk_compensation_x_plane_gradient_kcps,
(int32_t)tmpi16,
11,
VL53L1_MAX_STRING_LENGTH,
fp_text);
@ -2794,8 +2801,9 @@ void VL53L1_print_xtalk_config(
"algo__crosstalk_compensation_x_plane_gradient_kcps",
fp_text);
tmpi16 = pdata->algo__crosstalk_compensation_y_plane_gradient_kcps;
VL53L1_signed_fixed_point_sprintf(
(int32_t)pdata->algo__crosstalk_compensation_y_plane_gradient_kcps,
(int32_t)tmpi16,
11,
VL53L1_MAX_STRING_LENGTH,
fp_text);
@ -3492,7 +3500,7 @@ void VL53L1_print_spad_rate_data(
char fp_text[VL53L1_MAX_STRING_LENGTH];
trace_print(
trace_print(
VL53L1_TRACE_LEVEL_INFO,
"%s%8s,%4s,%4s, %s\n",
pprefix,
@ -3501,7 +3509,7 @@ void VL53L1_print_spad_rate_data(
"col",
"peak_rate_mcps");
for (spad_no = 0 ; spad_no < pspad_rates->no_of_values ; spad_no++) {
for (spad_no = 0; spad_no < pspad_rates->no_of_values; spad_no++) {
@ -3530,7 +3538,7 @@ void VL53L1_print_spad_rate_data(
row,
col,
fp_text);
}
}
}
@ -3559,7 +3567,7 @@ void VL53L1_print_spad_rate_map(
pprefix,
" ");
for (col = 0 ; col < VL53L1_SPAD_ARRAY_WIDTH ; col++)
for (col = 0; col < VL53L1_SPAD_ARRAY_WIDTH; col++)
trace_print(
VL53L1_TRACE_LEVEL_INFO,
",%8u",
@ -3572,7 +3580,7 @@ void VL53L1_print_spad_rate_map(
for (row = 0 ; row < VL53L1_SPAD_ARRAY_HEIGHT ; row++) {
for (row = 0; row < VL53L1_SPAD_ARRAY_HEIGHT; row++) {
trace_print(
VL53L1_TRACE_LEVEL_INFO,
@ -3580,7 +3588,7 @@ void VL53L1_print_spad_rate_map(
pprefix,
row);
for (col = 0 ; col < VL53L1_SPAD_ARRAY_HEIGHT ; col++) {
for (col = 0; col < VL53L1_SPAD_ARRAY_HEIGHT; col++) {
@ -3611,7 +3619,7 @@ void VL53L1_print_spad_rate_map(
trace_print(
VL53L1_TRACE_LEVEL_INFO,
"\n");
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/

File diff suppressed because it is too large Load diff

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/
@ -220,9 +220,8 @@ uint32_t VL53L1_duration_maths(
if (tmp_long_int > 0xFFFFFFFF) {
if (tmp_long_int > 0xFFFFFFFF)
tmp_long_int = 0xFFFFFFFF;
}
duration_us = (uint32_t)tmp_long_int;
@ -231,7 +230,7 @@ uint32_t VL53L1_duration_maths(
uint32_t VL53L1_events_per_spad_maths(
int32_t VL53L1_PRM_00012,
int32_t VL53L1_p_013,
uint16_t num_spads,
uint32_t duration)
{
@ -255,7 +254,7 @@ uint32_t VL53L1_events_per_spad_maths(
uint64_t dividend = ((uint64_t)VL53L1_PRM_00012
uint64_t dividend = ((uint64_t)VL53L1_p_013
* 1000 * 256);
total_hist_counts = do_division_u(dividend, (uint64_t)num_spads);
@ -302,9 +301,8 @@ uint32_t VL53L1_isqrt(uint32_t num)
while (bit > num) {
while (bit > num)
bit >>= 2;
}
while (bit != 0) {
if (num >= res + bit) {
@ -330,21 +328,21 @@ void VL53L1_hist_calc_zero_distance_phase(
uint32_t period = 0;
uint32_t VL53L1_PRM_00016 = 0;
uint32_t VL53L1_p_017 = 0;
LOG_FUNCTION_START("");
period = 2048 *
(uint32_t)VL53L1_decode_vcsel_period(pdata->VL53L1_PRM_00008);
(uint32_t)VL53L1_decode_vcsel_period(pdata->VL53L1_p_009);
VL53L1_PRM_00016 = period;
VL53L1_PRM_00016 += (uint32_t)pdata->phasecal_result__reference_phase;
VL53L1_PRM_00016 += (2048 * (uint32_t)pdata->phasecal_result__vcsel_start);
VL53L1_PRM_00016 -= (2048 * (uint32_t)pdata->cal_config__vcsel_start);
VL53L1_p_017 = period;
VL53L1_p_017 += (uint32_t)pdata->phasecal_result__reference_phase;
VL53L1_p_017 += (2048 * (uint32_t)pdata->phasecal_result__vcsel_start);
VL53L1_p_017 -= (2048 * (uint32_t)pdata->cal_config__vcsel_start);
VL53L1_PRM_00016 = VL53L1_PRM_00016 % period;
VL53L1_p_017 = VL53L1_p_017 % period;
pdata->zero_distance_phase = (uint16_t)VL53L1_PRM_00016;
pdata->zero_distance_phase = (uint16_t)VL53L1_p_017;
LOG_FUNCTION_END(0);
}
@ -364,7 +362,7 @@ void VL53L1_hist_estimate_ambient_from_thresholded_bins(
uint8_t bin = 0;
int32_t VL53L1_PRM_00031 = 0;
int32_t VL53L1_p_032 = 0;
LOG_FUNCTION_START("");
@ -381,11 +379,12 @@ void VL53L1_hist_estimate_ambient_from_thresholded_bins(
VL53L1_PRM_00031 = (int32_t)VL53L1_isqrt((uint32_t)pdata->min_bin_value);
VL53L1_PRM_00031 *= ambient_threshold_sigma;
VL53L1_PRM_00031 += 0x07;
VL53L1_PRM_00031 = VL53L1_PRM_00031 >> 4;
VL53L1_PRM_00031 += pdata->min_bin_value;
VL53L1_p_032 =
(int32_t)VL53L1_isqrt((uint32_t)pdata->min_bin_value);
VL53L1_p_032 *= ambient_threshold_sigma;
VL53L1_p_032 += 0x07;
VL53L1_p_032 = VL53L1_p_032 >> 4;
VL53L1_p_032 += pdata->min_bin_value;
@ -395,12 +394,11 @@ void VL53L1_hist_estimate_ambient_from_thresholded_bins(
pdata->number_of_ambient_samples = 0;
pdata->ambient_events_sum = 0;
for (bin = 0 ; bin < pdata->VL53L1_PRM_00021 ; bin++) {
if (pdata->bin_data[bin] < VL53L1_PRM_00031) {
for (bin = 0; bin < pdata->VL53L1_p_024; bin++)
if (pdata->bin_data[bin] < VL53L1_p_032) {
pdata->ambient_events_sum += pdata->bin_data[bin];
pdata->number_of_ambient_samples++;
}
}
@ -408,9 +406,12 @@ void VL53L1_hist_estimate_ambient_from_thresholded_bins(
if (pdata->number_of_ambient_samples > 0) {
pdata->VL53L1_PRM_00028 = pdata->ambient_events_sum;
pdata->VL53L1_PRM_00028 += ((int32_t)pdata->number_of_ambient_samples/2);
pdata->VL53L1_PRM_00028 /= (int32_t)pdata->number_of_ambient_samples;
pdata->VL53L1_p_004 =
pdata->ambient_events_sum;
pdata->VL53L1_p_004 +=
((int32_t)pdata->number_of_ambient_samples/2);
pdata->VL53L1_p_004 /=
(int32_t)pdata->number_of_ambient_samples;
}
LOG_FUNCTION_END(0);
@ -428,7 +429,7 @@ void VL53L1_hist_remove_ambient_bins(
uint8_t bin = 0;
uint8_t VL53L1_PRM_00001 = 0;
uint8_t lc = 0;
uint8_t i = 0;
@ -437,10 +438,10 @@ void VL53L1_hist_remove_ambient_bins(
if ((pdata->bin_seq[0] & 0x07) == 0x07) {
i = 0;
for (VL53L1_PRM_00001 = 0 ; VL53L1_PRM_00001 < VL53L1_MAX_BIN_SEQUENCE_LENGTH ; VL53L1_PRM_00001++) {
if ((pdata->bin_seq[VL53L1_PRM_00001] & 0x07) != 0x07) {
pdata->bin_seq[i] = pdata->bin_seq[VL53L1_PRM_00001];
pdata->bin_rep[i] = pdata->bin_rep[VL53L1_PRM_00001];
for (lc = 0; lc < VL53L1_MAX_BIN_SEQUENCE_LENGTH; lc++) {
if ((pdata->bin_seq[lc] & 0x07) != 0x07) {
pdata->bin_seq[i] = pdata->bin_seq[lc];
pdata->bin_rep[i] = pdata->bin_rep[lc];
i++;
}
}
@ -450,9 +451,9 @@ void VL53L1_hist_remove_ambient_bins(
for (VL53L1_PRM_00001 = i ; VL53L1_PRM_00001 < VL53L1_MAX_BIN_SEQUENCE_LENGTH ; VL53L1_PRM_00001++) {
pdata->bin_seq[VL53L1_PRM_00001] = VL53L1_MAX_BIN_SEQUENCE_CODE + 1;
pdata->bin_rep[VL53L1_PRM_00001] = 0;
for (lc = i; lc < VL53L1_MAX_BIN_SEQUENCE_LENGTH; lc++) {
pdata->bin_seq[lc] = VL53L1_MAX_BIN_SEQUENCE_CODE + 1;
pdata->bin_rep[lc] = 0;
}
}
@ -460,16 +461,16 @@ void VL53L1_hist_remove_ambient_bins(
for (bin = pdata->number_of_ambient_bins ;
bin < pdata->VL53L1_PRM_00020 ; bin++) {
for (bin = pdata->number_of_ambient_bins;
bin < pdata->VL53L1_p_023; bin++) {
pdata->bin_data[bin-pdata->number_of_ambient_bins] =
pdata->bin_data[bin];
}
pdata->VL53L1_PRM_00021 =
pdata->VL53L1_PRM_00021 -
pdata->VL53L1_p_024 =
pdata->VL53L1_p_024 -
pdata->number_of_ambient_bins;
pdata->number_of_ambient_bins = 0;
}
@ -523,7 +524,7 @@ uint32_t VL53L1_calc_pll_period_mm(
uint16_t VL53L1_rate_maths(
int32_t VL53L1_PRM_00007,
int32_t VL53L1_p_008,
uint32_t time_us)
{
@ -548,11 +549,10 @@ uint16_t VL53L1_rate_maths(
if (VL53L1_PRM_00007 > VL53L1_SPAD_TOTAL_COUNT_MAX) {
if (VL53L1_p_008 > VL53L1_SPAD_TOTAL_COUNT_MAX)
tmp_int = VL53L1_SPAD_TOTAL_COUNT_MAX;
} else if (VL53L1_PRM_00007 > 0) {
tmp_int = (uint32_t)VL53L1_PRM_00007;
}
else if (VL53L1_p_008 > 0)
tmp_int = (uint32_t)VL53L1_p_008;
@ -560,11 +560,11 @@ uint16_t VL53L1_rate_maths(
if (VL53L1_PRM_00007 > VL53L1_SPAD_TOTAL_COUNT_RES_THRES) {
if (VL53L1_p_008 > VL53L1_SPAD_TOTAL_COUNT_RES_THRES)
frac_bits = 3;
} else {
else
frac_bits = 7;
}
@ -572,17 +572,15 @@ uint16_t VL53L1_rate_maths(
if (time_us > 0) {
if (time_us > 0)
tmp_int = ((tmp_int << frac_bits) + (time_us / 2)) / time_us;
}
if (VL53L1_PRM_00007 > VL53L1_SPAD_TOTAL_COUNT_RES_THRES) {
if (VL53L1_p_008 > VL53L1_SPAD_TOTAL_COUNT_RES_THRES)
tmp_int = tmp_int << 4;
}
@ -590,9 +588,8 @@ uint16_t VL53L1_rate_maths(
if (tmp_int > 0xFFFF) {
if (tmp_int > 0xFFFF)
tmp_int = 0xFFFF;
}
rate_mcps = (uint16_t)tmp_int;
@ -623,7 +620,9 @@ uint16_t VL53L1_rate_per_spad_maths(
if (num_spads > 0) {
tmp_int = (peak_count_rate << 8) << frac_bits;
tmp_int = (tmp_int + ((uint32_t)num_spads / 2)) / (uint32_t)num_spads;
tmp_int = (tmp_int +
((uint32_t)num_spads / 2)) /
(uint32_t)num_spads;
} else {
tmp_int = ((peak_count_rate) << frac_bits);
}
@ -631,9 +630,8 @@ uint16_t VL53L1_rate_per_spad_maths(
if (tmp_int > max_output_value) {
if (tmp_int > max_output_value)
tmp_int = max_output_value;
}
rate_per_spad = (uint16_t)tmp_int;
@ -643,7 +641,7 @@ uint16_t VL53L1_rate_per_spad_maths(
int32_t VL53L1_range_maths(
uint16_t fast_osc_frequency,
uint16_t VL53L1_PRM_00016,
uint16_t VL53L1_p_017,
uint16_t zero_distance_phase,
uint8_t fractional_bits,
int32_t gain_factor,
@ -658,6 +656,7 @@ int32_t VL53L1_range_maths(
int64_t tmp_long_int = 0;
int32_t range_mm = 0;
int32_t range_mm_10 = 0;
@ -673,7 +672,7 @@ int32_t VL53L1_range_maths(
tmp_long_int = (int64_t)VL53L1_PRM_00016 - (int64_t)zero_distance_phase;
tmp_long_int = (int64_t)VL53L1_p_017 - (int64_t)zero_distance_phase;
@ -724,9 +723,14 @@ int32_t VL53L1_range_maths(
if (fractional_bits == 0)
range_mm = range_mm / (0x01 << 2);
else if (fractional_bits == 1)
if (fractional_bits == 0) {
range_mm_10 = range_mm * 10;
range_mm_10 = range_mm_10 / (0x01 << 2);
if ((range_mm_10 % 10) < 5)
range_mm = (int16_t)(range_mm_10 / 10);
else
range_mm = (int16_t)(range_mm_10 / 10 + 1);
} else if (fractional_bits == 1)
range_mm = range_mm / (0x01 << 1);
return range_mm;
@ -741,11 +745,11 @@ uint8_t VL53L1_decode_vcsel_period(uint8_t vcsel_period_reg)
uint8_t VL53L1_PRM_00030 = 0;
uint8_t VL53L1_p_031 = 0;
VL53L1_PRM_00030 = (vcsel_period_reg + 1) << 1;
VL53L1_p_031 = (vcsel_period_reg + 1) << 1;
return VL53L1_PRM_00030;
return VL53L1_p_031;
}
@ -761,10 +765,10 @@ void VL53L1_copy_xtalk_bin_data_to_histogram_data_struct(
phist->cal_config__vcsel_start =
pxtalk->cal_config__vcsel_start;
phist->VL53L1_PRM_00022 =
pxtalk->VL53L1_PRM_00022;
phist->VL53L1_PRM_00019 =
pxtalk->VL53L1_PRM_00019;
phist->VL53L1_p_019 =
pxtalk->VL53L1_p_019;
phist->VL53L1_p_022 =
pxtalk->VL53L1_p_022;
phist->phasecal_result__reference_phase =
pxtalk->phasecal_result__reference_phase;
@ -777,14 +781,14 @@ void VL53L1_copy_xtalk_bin_data_to_histogram_data_struct(
pxtalk->zero_distance_phase;
phist->zone_id = pxtalk->zone_id;
phist->VL53L1_PRM_00020 = pxtalk->VL53L1_PRM_00020;
phist->VL53L1_p_023 = pxtalk->VL53L1_p_023;
phist->time_stamp = pxtalk->time_stamp;
}
void VL53L1_init_histogram_bin_data_struct(
int32_t bin_value,
uint16_t VL53L1_PRM_00021,
uint16_t VL53L1_p_024,
VL53L1_histogram_bin_data_t *pdata)
{
@ -801,9 +805,9 @@ void VL53L1_init_histogram_bin_data_struct(
pdata->zone_id = 0;
pdata->time_stamp = 0;
pdata->VL53L1_PRM_00019 = 0;
pdata->VL53L1_PRM_00020 = VL53L1_HISTOGRAM_BUFFER_SIZE;
pdata->VL53L1_PRM_00021 = (uint8_t)VL53L1_PRM_00021;
pdata->VL53L1_p_022 = 0;
pdata->VL53L1_p_023 = VL53L1_HISTOGRAM_BUFFER_SIZE;
pdata->VL53L1_p_024 = (uint8_t)VL53L1_p_024;
pdata->number_of_ambient_bins = 0;
pdata->result__interrupt_status = 0;
@ -817,8 +821,8 @@ void VL53L1_init_histogram_bin_data_struct(
pdata->cal_config__vcsel_start = 0;
pdata->vcsel_width = 0;
pdata->VL53L1_PRM_00008 = 0;
pdata->VL53L1_PRM_00022 = 0;
pdata->VL53L1_p_009 = 0;
pdata->VL53L1_p_019 = 0;
pdata->total_periods_elapsed = 0;
pdata->min_bin_value = 0;
@ -827,22 +831,22 @@ void VL53L1_init_histogram_bin_data_struct(
pdata->zero_distance_phase = 0;
pdata->number_of_ambient_samples = 0;
pdata->ambient_events_sum = 0;
pdata->VL53L1_PRM_00028 = 0;
pdata->VL53L1_p_004 = 0;
for (i = 0 ; i < VL53L1_MAX_BIN_SEQUENCE_LENGTH ; i++) {
for (i = 0; i < VL53L1_MAX_BIN_SEQUENCE_LENGTH; i++)
pdata->bin_seq[i] = (uint8_t)i;
}
for (i = 0 ; i < VL53L1_MAX_BIN_SEQUENCE_LENGTH ; i++) {
pdata->bin_rep[i] = 1;
}
for (i = 0 ; i < VL53L1_HISTOGRAM_BUFFER_SIZE ; i++) {
if (i < VL53L1_PRM_00021) {
for (i = 0; i < VL53L1_MAX_BIN_SEQUENCE_LENGTH; i++)
pdata->bin_rep[i] = 1;
for (i = 0; i < VL53L1_HISTOGRAM_BUFFER_SIZE; i++)
if (i < VL53L1_p_024)
pdata->bin_data[i] = bin_value;
} else {
else
pdata->bin_data[i] = 0;
}
}
}
@ -880,15 +884,14 @@ void VL53L1_hist_find_min_max_bin_values(
LOG_FUNCTION_START("");
for (bin = 0 ; bin < pdata->VL53L1_PRM_00021 ; bin++) {
for (bin = 0; bin < pdata->VL53L1_p_024; bin++) {
if (bin == 0 || pdata->min_bin_value >= pdata->bin_data[bin]) {
if (bin == 0 || pdata->min_bin_value >= pdata->bin_data[bin])
pdata->min_bin_value = pdata->bin_data[bin];
}
if (bin == 0 || pdata->max_bin_value <= pdata->bin_data[bin]) {
if (bin == 0 || pdata->max_bin_value <= pdata->bin_data[bin])
pdata->max_bin_value = pdata->bin_data[bin];
}
}
LOG_FUNCTION_END(0);
@ -918,14 +921,13 @@ void VL53L1_hist_estimate_ambient_from_ambient_bins(
pdata->ambient_events_sum = 0;
for (bin = 0 ; bin < pdata->number_of_ambient_bins ; bin++) {
for (bin = 0; bin < pdata->number_of_ambient_bins; bin++)
pdata->ambient_events_sum += pdata->bin_data[bin];
}
pdata->VL53L1_PRM_00028 = pdata->ambient_events_sum;
pdata->VL53L1_PRM_00028 +=
pdata->VL53L1_p_004 = pdata->ambient_events_sum;
pdata->VL53L1_p_004 +=
((int32_t)pdata->number_of_ambient_bins / 2);
pdata->VL53L1_PRM_00028 /=
pdata->VL53L1_p_004 /=
(int32_t)pdata->number_of_ambient_bins;
}

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/
@ -284,17 +284,17 @@ VL53L1_Error VL53L1_get_pal_error_string(
break;
case VL53L1_WARNING_XTALK_MISSING_SAMPLES:
VL53L1_COPYSTRING(pPalErrorString,
VL53L1_STRING_WARNING_XTALK_MISSING_SAMPLES);
break;
VL53L1_COPYSTRING(pPalErrorString,
VL53L1_STRING_WARNING_XTALK_MISSING_SAMPLES);
break;
case VL53L1_WARNING_XTALK_NO_SAMPLES_FOR_GRADIENT:
VL53L1_COPYSTRING(pPalErrorString,
VL53L1_STRING_WARNING_XTALK_NO_SAMPLES_FOR_GRADIENT);
break;
VL53L1_COPYSTRING(pPalErrorString,
VL53L1_STRING_WARNING_XTALK_NO_SAMPLES_FOR_GRADIENT);
break;
case VL53L1_WARNING_XTALK_SIGMA_LIMIT_FOR_GRADIENT:
VL53L1_COPYSTRING(pPalErrorString,
VL53L1_STRING_WARNING_XTALK_SIGMA_LIMIT_FOR_GRADIENT);
break;
VL53L1_COPYSTRING(pPalErrorString,
VL53L1_STRING_WARNING_XTALK_SIGMA_LIMIT_FOR_GRADIENT);
break;
case VL53L1_ERROR_DEVICE_FIRMWARE_TOO_OLD:
VL53L1_COPYSTRING(pPalErrorString,

View file

@ -1,167 +0,0 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed, either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
********************************************************************************
*
*/
#include "vl53l1_ll_def.h"
#include "vl53l1_platform.h"
#include "vl53l1_register_map.h"
#include "vl53l1_core.h"
#include "vl53l1_fpga_core.h"
#define LOG_FUNCTION_START(fmt, ...) \
_LOG_FUNCTION_START(VL53L1_TRACE_MODULE_CORE, fmt, ##__VA_ARGS__)
#define LOG_FUNCTION_END(status, ...) \
_LOG_FUNCTION_END(VL53L1_TRACE_MODULE_CORE, status, ##__VA_ARGS__)
#define LOG_FUNCTION_END_FMT(status, fmt, ...) \
_LOG_FUNCTION_END_FMT(VL53L1_TRACE_MODULE_CORE, status, fmt, ##__VA_ARGS__)
VL53L1_Error VL53L1_is_firmware_ready_fpga(
VL53L1_DEV Dev,
uint8_t *pready)
{
VL53L1_Error status = VL53L1_ERROR_NONE;
VL53L1_LLDriverData_t *pdev = VL53L1DevStructGetLLDriverHandle(Dev);
uint8_t comms_buffer[5];
LOG_FUNCTION_START("");
status = VL53L1_ReadMulti(
Dev,
VL53L1_INTERRUPT_MANAGER__ENABLES,
comms_buffer,
5);
if (status == VL53L1_ERROR_NONE) {
pdev->dbg_results.interrupt_manager__enables =
comms_buffer[0];
pdev->dbg_results.interrupt_manager__clear =
comms_buffer[1];
pdev->dbg_results.interrupt_manager__status =
comms_buffer[2];
pdev->dbg_results.mcu_to_host_bank__wr_access_en =
comms_buffer[3];
pdev->dbg_results.power_management__go1_reset_status =
comms_buffer[4];
if (((pdev->dbg_results.interrupt_manager__enables & 0x1F) == 0x1F) &&
((pdev->dbg_results.interrupt_manager__clear & 0x1F) == 0x1F))
*pready = 0x01;
else
*pready = 0x00;
}
LOG_FUNCTION_END(status);
return status;
}

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/
@ -117,7 +117,8 @@
#define LOG_FUNCTION_END(status, ...) \
_LOG_FUNCTION_END(VL53L1_TRACE_MODULE_HISTOGRAM, status, ##__VA_ARGS__)
#define LOG_FUNCTION_END_FMT(status, fmt, ...) \
_LOG_FUNCTION_END_FMT(VL53L1_TRACE_MODULE_HISTOGRAM, status, fmt, ##__VA_ARGS__)
_LOG_FUNCTION_END_FMT(VL53L1_TRACE_MODULE_HISTOGRAM,\
status, fmt, ##__VA_ARGS__)
VL53L1_Error VL53L1_set_calib_config(
@ -142,14 +143,12 @@ VL53L1_Error VL53L1_set_calib_config(
if (status == VL53L1_ERROR_NONE) {
status = VL53L1_enable_powerforce(Dev);
status = VL53L1_enable_powerforce(Dev);
}
if (status == VL53L1_ERROR_NONE) {
if (status == VL53L1_ERROR_NONE)
status = VL53L1_disable_firmware(Dev);
}

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/
@ -125,7 +125,8 @@
#define LOG_FUNCTION_END(status, ...) \
_LOG_FUNCTION_END(VL53L1_TRACE_MODULE_NVM, status, ##__VA_ARGS__)
#define LOG_FUNCTION_END_FMT(status, fmt, ...) \
_LOG_FUNCTION_END_FMT(VL53L1_TRACE_MODULE_NVM, status, fmt, ##__VA_ARGS__)
_LOG_FUNCTION_END_FMT(VL53L1_TRACE_MODULE_NVM,\
status, fmt, ##__VA_ARGS__)
#define trace_print(level, ...) \
_LOG_TRACE_PRINT(VL53L1_TRACE_MODULE_NVM, \
@ -174,8 +175,8 @@ VL53L1_Error VL53L1_nvm_enable(
if (status == VL53L1_ERROR_NONE)
status = VL53L1_WaitUs(
Dev,
VL53L1_ENABLE_POWERFORCE_SETTLING_TIME_US);
Dev,
VL53L1_ENABLE_POWERFORCE_SETTLING_TIME_US);
@ -214,9 +215,9 @@ VL53L1_Error VL53L1_nvm_enable(
if (status == VL53L1_ERROR_NONE)
status = VL53L1_WrWord(
Dev,
VL53L1_RANGING_CORE__NVM_CTRL__PULSE_WIDTH_MSB,
nvm_ctrl_pulse_width);
Dev,
VL53L1_RANGING_CORE__NVM_CTRL__PULSE_WIDTH_MSB,
nvm_ctrl_pulse_width);
LOG_FUNCTION_END(status);
@ -256,53 +257,54 @@ VL53L1_Error VL53L1_nvm_read(
"%-12s = 0x%02X (%3u)\n",
"count", count, count);
for (nvm_addr = start_address; nvm_addr < (start_address+count) ; nvm_addr++) {
for (nvm_addr = start_address;
nvm_addr < (start_address+count) ; nvm_addr++) {
if (status == VL53L1_ERROR_NONE)
status = VL53L1_WrByte(
Dev,
VL53L1_RANGING_CORE__NVM_CTRL__ADDR,
nvm_addr);
Dev,
VL53L1_RANGING_CORE__NVM_CTRL__ADDR,
nvm_addr);
if (status == VL53L1_ERROR_NONE)
status = VL53L1_WrByte(
Dev,
VL53L1_RANGING_CORE__NVM_CTRL__READN,
0x00);
Dev,
VL53L1_RANGING_CORE__NVM_CTRL__READN,
0x00);
if (status == VL53L1_ERROR_NONE)
status = VL53L1_WaitUs(
Dev,
VL53L1_NVM_READ_TRIGGER_DELAY_US);
Dev,
VL53L1_NVM_READ_TRIGGER_DELAY_US);
if (status == VL53L1_ERROR_NONE)
status = VL53L1_WrByte(
Dev,
VL53L1_RANGING_CORE__NVM_CTRL__READN,
0x01);
Dev,
VL53L1_RANGING_CORE__NVM_CTRL__READN,
0x01);
if (status == VL53L1_ERROR_NONE)
status = VL53L1_ReadMulti(
Dev,
VL53L1_RANGING_CORE__NVM_CTRL__DATAOUT_MMM,
pdata,
4);
Dev,
VL53L1_RANGING_CORE__NVM_CTRL__DATAOUT_MMM,
pdata,
4);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
"NVM address : 0x%02X = 0x%02X%02X%02X%02X\n",
nvm_addr, *pdata, *(pdata+1), *(pdata+2), *(pdata+3));
VL53L1_TRACE_LEVEL_INFO,
"NVM address : 0x%02X = 0x%02X%02X%02X%02X\n",
nvm_addr, *pdata, *(pdata+1), *(pdata+2), *(pdata+3));
@ -386,7 +388,7 @@ VL53L1_Error VL53L1_nvm_format_decode(
LOG_FUNCTION_START("");
if (VL53L1_NVM_SIZE_IN_BYTES > buf_size)
if (buf_size < VL53L1_NVM_SIZE_IN_BYTES)
return VL53L1_ERROR_BUFFER_TOO_SMALL;
pdata->nvm__identification_model_id =
@ -434,7 +436,8 @@ VL53L1_Error VL53L1_nvm_format_decode(
pdata->nvm__ews__fast_osc_frequency =
(uint16_t)VL53L1_i2c_decode_with_mask(
2,
pbuffer + VL53L1_NVM__EWS__OSC_MEASURED__FAST_OSC_FREQUENCY,
pbuffer +
VL53L1_NVM__EWS__OSC_MEASURED__FAST_OSC_FREQUENCY,
0x0000FFFF,
0,
0);
@ -462,7 +465,8 @@ VL53L1_Error VL53L1_nvm_format_decode(
pdata->nvm__fmt__fast_osc_frequency =
(uint16_t)VL53L1_i2c_decode_with_mask(
2,
pbuffer + VL53L1_NVM__FMT__OSC_MEASURED__FAST_OSC_FREQUENCY,
pbuffer +
VL53L1_NVM__FMT__OSC_MEASURED__FAST_OSC_FREQUENCY,
0x0000FFFF,
0,
0);
@ -525,14 +529,16 @@ VL53L1_Error VL53L1_nvm_format_decode(
pdata->nvm__vhv_timeout__macrop =
(uint8_t)VL53L1_i2c_decode_with_mask(
1,
pbuffer + VL53L1_NVM__VHV_CONFIG__TIMEOUT_MACROP_LOOP_BOUND,
pbuffer +
VL53L1_NVM__VHV_CONFIG__TIMEOUT_MACROP_LOOP_BOUND,
0x00000003,
0,
0);
pdata->nvm__vhv_loop_bound =
(uint8_t)VL53L1_i2c_decode_with_mask(
1,
pbuffer + VL53L1_NVM__VHV_CONFIG__TIMEOUT_MACROP_LOOP_BOUND,
pbuffer +
VL53L1_NVM__VHV_CONFIG__TIMEOUT_MACROP_LOOP_BOUND,
0x000000FC,
2,
0);
@ -691,14 +697,16 @@ VL53L1_Error VL53L1_nvm_format_decode(
pdata->nvm__fmt__roi_config__mode_roi_centre_spad =
(uint8_t)VL53L1_i2c_decode_with_mask(
1,
pbuffer + VL53L1_NVM__FMT__ROI_CONFIG__MODE_ROI_CENTRE_SPAD,
pbuffer +
VL53L1_NVM__FMT__ROI_CONFIG__MODE_ROI_CENTRE_SPAD,
0x000000FF,
0,
0);
pdata->nvm__fmt__roi_config__mode_roi_x_size =
(uint8_t)VL53L1_i2c_decode_with_mask(
1,
pbuffer + VL53L1_NVM__FMT__ROI_CONFIG__MODE_ROI_XY_SIZE,
pbuffer +
VL53L1_NVM__FMT__ROI_CONFIG__MODE_ROI_XY_SIZE,
0x000000F0,
4,
0);
@ -712,7 +720,8 @@ VL53L1_Error VL53L1_nvm_format_decode(
pdata->nvm__fmt__ref_spad_apply__num_requested_ref_spad =
(uint8_t)VL53L1_i2c_decode_with_mask(
1,
pbuffer + VL53L1_NVM__FMT__REF_SPAD_APPLY__NUM_REQUESTED_REF_SPAD,
pbuffer +
VL53L1_NVM__FMT__REF_SPAD_APPLY__NUM_REQUESTED_REF_SPAD,
0x000000FF,
0,
0);
@ -740,42 +749,48 @@ VL53L1_Error VL53L1_nvm_format_decode(
pdata->nvm__fmt__algo_part_to_part_range_offset_mm =
(uint16_t)VL53L1_i2c_decode_with_mask(
2,
pbuffer + VL53L1_NVM__FMT__ALGO__PART_TO_PART_RANGE_OFFSET_MM,
pbuffer +
VL53L1_NVM__FMT__ALGO__PART_TO_PART_RANGE_OFFSET_MM,
0x00000FFF,
0,
0);
pdata->nvm__fmt__algo__crosstalk_compensation_plane_offset_kcps =
(uint16_t)VL53L1_i2c_decode_with_mask(
2,
pbuffer + VL53L1_NVM__FMT__ALGO__CROSSTALK_COMPENSATION_PLANE_OFFSET_KCPS,
0x0000FFFF,
0,
0);
2,
pbuffer +
VL53L1_NVM__FMT__ALGO__CROSSTALK_COMPENSATION_PLANE_OFFSET_KCPS,
0x0000FFFF,
0,
0);
pdata->nvm__fmt__algo__crosstalk_compensation_x_plane_gradient_kcps =
(uint16_t)VL53L1_i2c_decode_with_mask(
2,
pbuffer + VL53L1_NVM__FMT__ALGO__CROSSTALK_COMPENSATION_X_PLANE_GRADIENT_KCPS,
0x0000FFFF,
0,
0);
(uint16_t)VL53L1_i2c_decode_with_mask(
2,
pbuffer +
VL53L1_NVM__FMT__ALGO__CROSSTALK_COMPENSATION_X_PLANE_GRADIENT_KCPS,
0x0000FFFF,
0,
0);
pdata->nvm__fmt__algo__crosstalk_compensation_y_plane_gradient_kcps =
(uint16_t)VL53L1_i2c_decode_with_mask(
2,
pbuffer + VL53L1_NVM__FMT__ALGO__CROSSTALK_COMPENSATION_Y_PLANE_GRADIENT_KCPS,
0x0000FFFF,
0,
0);
(uint16_t)VL53L1_i2c_decode_with_mask(
2,
pbuffer +
VL53L1_NVM__FMT__ALGO__CROSSTALK_COMPENSATION_Y_PLANE_GRADIENT_KCPS,
0x0000FFFF,
0,
0);
pdata->nvm__fmt__spare__host_config__nvm_config_spare_0 =
(uint8_t)VL53L1_i2c_decode_with_mask(
1,
pbuffer + VL53L1_NVM__FMT__SPARE_HOST_CONFIG__NVM_CONFIG_SPARE_0,
pbuffer +
VL53L1_NVM__FMT__SPARE_HOST_CONFIG__NVM_CONFIG_SPARE_0,
0x000000FF,
0,
0);
pdata->nvm__fmt__spare__host_config__nvm_config_spare_1 =
(uint8_t)VL53L1_i2c_decode_with_mask(
1,
pbuffer + VL53L1_NVM__FMT__SPARE_HOST_CONFIG__NVM_CONFIG_SPARE_1,
pbuffer +
VL53L1_NVM__FMT__SPARE_HOST_CONFIG__NVM_CONFIG_SPARE_1,
0x000000FF,
0,
0);
@ -795,11 +810,12 @@ VL53L1_Error VL53L1_nvm_format_decode(
0);
pdata->nvm__cust__ref_spad_apply__num_requested_ref_spad =
(uint8_t)VL53L1_i2c_decode_with_mask(
1,
pbuffer + VL53L1_NVM__CUST__REF_SPAD_APPLY__NUM_REQUESTED_REF_SPAD,
0x000000FF,
0,
0);
1,
pbuffer +
VL53L1_NVM__CUST__REF_SPAD_APPLY__NUM_REQUESTED_REF_SPAD,
0x000000FF,
0,
0);
pdata->nvm__cust__ref_spad_man__ref_location =
(uint8_t)VL53L1_i2c_decode_with_mask(
1,
@ -824,75 +840,81 @@ VL53L1_Error VL53L1_nvm_format_decode(
pdata->nvm__cust__algo_part_to_part_range_offset_mm =
(uint16_t)VL53L1_i2c_decode_with_mask(
2,
pbuffer + VL53L1_NVM__CUST__ALGO__PART_TO_PART_RANGE_OFFSET_MM,
pbuffer +
VL53L1_NVM__CUST__ALGO__PART_TO_PART_RANGE_OFFSET_MM,
0x00000FFF,
0,
0);
pdata->nvm__cust__algo__crosstalk_compensation_plane_offset_kcps =
(uint16_t)VL53L1_i2c_decode_with_mask(
2,
pbuffer + VL53L1_NVM__CUST__ALGO__CROSSTALK_COMPENSATION_PLANE_OFFSET_KCPS,
0x0000FFFF,
0,
0);
(uint16_t)VL53L1_i2c_decode_with_mask(
2,
pbuffer +
VL53L1_NVM__CUST__ALGO__CROSSTALK_COMPENSATION_PLANE_OFFSET_KCPS,
0x0000FFFF,
0,
0);
pdata->nvm__cust__algo__crosstalk_compensation_x_plane_gradient_kcps =
(uint16_t)VL53L1_i2c_decode_with_mask(
2,
pbuffer + VL53L1_NVM__CUST__ALGO__CROSSTALK_COMPENSATION_X_PLANE_GRADIENT_KCPS,
0x0000FFFF,
0,
0);
(uint16_t)VL53L1_i2c_decode_with_mask(
2,
pbuffer +
VL53L1_NVM__CUST__ALGO__CROSSTALK_COMPENSATION_X_PLANE_GRADIENT_KCPS,
0x0000FFFF,
0,
0);
pdata->nvm__cust__algo__crosstalk_compensation_y_plane_gradient_kcps =
(uint16_t)VL53L1_i2c_decode_with_mask(
2,
pbuffer + VL53L1_NVM__CUST__ALGO__CROSSTALK_COMPENSATION_Y_PLANE_GRADIENT_KCPS,
0x0000FFFF,
0,
0);
(uint16_t)VL53L1_i2c_decode_with_mask(
2,
pbuffer +
VL53L1_NVM__CUST__ALGO__CROSSTALK_COMPENSATION_Y_PLANE_GRADIENT_KCPS,
0x0000FFFF,
0,
0);
pdata->nvm__cust__spare__host_config__nvm_config_spare_0 =
(uint8_t)VL53L1_i2c_decode_with_mask(
1,
pbuffer + VL53L1_NVM__CUST__SPARE_HOST_CONFIG__NVM_CONFIG_SPARE_0,
0x000000FF,
0,
0);
(uint8_t)VL53L1_i2c_decode_with_mask(
1,
pbuffer + VL53L1_NVM__CUST__SPARE_HOST_CONFIG__NVM_CONFIG_SPARE_0,
0x000000FF,
0,
0);
pdata->nvm__cust__spare__host_config__nvm_config_spare_1 =
(uint8_t)VL53L1_i2c_decode_with_mask(
1,
pbuffer + VL53L1_NVM__CUST__SPARE_HOST_CONFIG__NVM_CONFIG_SPARE_1,
0x000000FF,
0,
0);
1,
pbuffer +
VL53L1_NVM__CUST__SPARE_HOST_CONFIG__NVM_CONFIG_SPARE_1,
0x000000FF,
0,
0);
if (status == VL53L1_ERROR_NONE)
status =
VL53L1_nvm_decode_optical_centre(
buf_size,
pbuffer + VL53L1_NVM__FMT__OPTICAL_CENTRE_DATA_INDEX,
&(pdata->fmt_optical_centre));
VL53L1_nvm_decode_optical_centre(
buf_size,
pbuffer + VL53L1_NVM__FMT__OPTICAL_CENTRE_DATA_INDEX,
&(pdata->fmt_optical_centre));
if (status == VL53L1_ERROR_NONE)
status =
VL53L1_nvm_decode_cal_peak_rate_map(
buf_size,
pbuffer + VL53L1_NVM__FMT__CAL_PEAK_RATE_MAP_DATA_INDEX,
&(pdata->fmt_peak_rate_map));
VL53L1_nvm_decode_cal_peak_rate_map(
buf_size,
pbuffer + VL53L1_NVM__FMT__CAL_PEAK_RATE_MAP_DATA_INDEX,
&(pdata->fmt_peak_rate_map));
if (status == VL53L1_ERROR_NONE)
status =
VL53L1_nvm_decode_additional_offset_cal_data(
buf_size,
pbuffer + VL53L1_NVM__FMT__ADDITIONAL_OFFSET_CAL_DATA_INDEX,
&(pdata->fmt_add_offset_data));
VL53L1_nvm_decode_additional_offset_cal_data(
buf_size,
pbuffer +
VL53L1_NVM__FMT__ADDITIONAL_OFFSET_CAL_DATA_INDEX,
&(pdata->fmt_add_offset_data));
@ -943,7 +965,7 @@ VL53L1_Error VL53L1_nvm_decode_optical_centre(
uint16_t tmp = 0;
if (VL53L1_NVM__FMT__OPTICAL_CENTRE_DATA_SIZE > buf_size)
if (buf_size < VL53L1_NVM__FMT__OPTICAL_CENTRE_DATA_SIZE)
return VL53L1_ERROR_BUFFER_TOO_SMALL;
@ -973,7 +995,7 @@ VL53L1_Error VL53L1_nvm_decode_cal_peak_rate_map(
uint8_t *ptmp = NULL;
uint8_t i = 0;
if (VL53L1_NVM__FMT__CAL_PEAK_RATE_MAP_DATA_SIZE > buf_size)
if (buf_size < VL53L1_NVM__FMT__CAL_PEAK_RATE_MAP_DATA_SIZE)
return VL53L1_ERROR_BUFFER_TOO_SMALL;
pdata->cal_distance_mm =
@ -1007,7 +1029,7 @@ VL53L1_Error VL53L1_nvm_decode_additional_offset_cal_data(
VL53L1_Error status = VL53L1_ERROR_NONE;
if (VL53L1_NVM__FMT__ADDITIONAL_OFFSET_CAL_DATA_SIZE > buf_size)
if (buf_size < VL53L1_NVM__FMT__ADDITIONAL_OFFSET_CAL_DATA_SIZE)
return VL53L1_ERROR_BUFFER_TOO_SMALL;
pdata->result__mm_inner_actual_effective_spads =
@ -1034,7 +1056,7 @@ VL53L1_Error VL53L1_nvm_decode_fmt_range_results_data(
VL53L1_Error status = VL53L1_ERROR_NONE;
if (VL53L1_NVM__FMT__RANGE_RESULTS__SIZE_BYTES > buf_size)
if (buf_size < VL53L1_NVM__FMT__RANGE_RESULTS__SIZE_BYTES)
return VL53L1_ERROR_BUFFER_TOO_SMALL;
pdata->result__actual_effective_rtn_spads =
@ -1076,7 +1098,7 @@ VL53L1_Error VL53L1_nvm_decode_fmt_info(
VL53L1_Error status = VL53L1_ERROR_NONE;
if (VL53L1_NVM_SIZE_IN_BYTES > buf_size)
if (buf_size < VL53L1_NVM_SIZE_IN_BYTES)
return VL53L1_ERROR_BUFFER_TOO_SMALL;
pdata->nvm__fmt__fgc[0] =
@ -1297,7 +1319,7 @@ VL53L1_Error VL53L1_nvm_decode_ews_info(
VL53L1_Error status = VL53L1_ERROR_NONE;
if (VL53L1_NVM_SIZE_IN_BYTES > buf_size)
if (buf_size < VL53L1_NVM_SIZE_IN_BYTES)
return VL53L1_ERROR_BUFFER_TOO_SMALL;
pdata->nvm__ews__test_program_major =
@ -1559,8 +1581,10 @@ VL53L1_Error VL53L1_read_nvm_optical_centre(
status =
VL53L1_read_nvm_raw_data(
Dev,
(uint8_t)(VL53L1_NVM__FMT__OPTICAL_CENTRE_DATA_INDEX >> 2),
(uint8_t)(VL53L1_NVM__FMT__OPTICAL_CENTRE_DATA_SIZE >> 2),
(uint8_t)(VL53L1_NVM__FMT__OPTICAL_CENTRE_DATA_INDEX
>> 2),
(uint8_t)(VL53L1_NVM__FMT__OPTICAL_CENTRE_DATA_SIZE
>> 2),
nvm_data);
@ -1603,8 +1627,10 @@ VL53L1_Error VL53L1_read_nvm_cal_peak_rate_map(
status =
VL53L1_read_nvm_raw_data(
Dev,
(uint8_t)(VL53L1_NVM__FMT__CAL_PEAK_RATE_MAP_DATA_INDEX >> 2),
(uint8_t)(VL53L1_NVM__FMT__CAL_PEAK_RATE_MAP_DATA_SIZE >> 2),
(uint8_t)(VL53L1_NVM__FMT__CAL_PEAK_RATE_MAP_DATA_INDEX
>> 2),
(uint8_t)(VL53L1_NVM__FMT__CAL_PEAK_RATE_MAP_DATA_SIZE
>> 2),
nvm_data);
@ -1652,8 +1678,10 @@ VL53L1_Error VL53L1_read_nvm_additional_offset_cal_data(
status =
VL53L1_read_nvm_raw_data(
Dev,
(uint8_t)(VL53L1_NVM__FMT__ADDITIONAL_OFFSET_CAL_DATA_INDEX >> 2),
(uint8_t)(VL53L1_NVM__FMT__ADDITIONAL_OFFSET_CAL_DATA_SIZE >> 2),
(uint8_t)(
VL53L1_NVM__FMT__ADDITIONAL_OFFSET_CAL_DATA_INDEX >> 2),
(uint8_t)(
VL53L1_NVM__FMT__ADDITIONAL_OFFSET_CAL_DATA_SIZE >> 2),
nvm_data);

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/
@ -109,7 +109,8 @@
#define LOG_FUNCTION_END(status, ...) \
_LOG_FUNCTION_END(VL53L1_TRACE_MODULE_NVM, status, ##__VA_ARGS__)
#define LOG_FUNCTION_END_FMT(status, fmt, ...) \
_LOG_FUNCTION_END_FMT(VL53L1_TRACE_MODULE_NVM, status, fmt, ##__VA_ARGS__)
_LOG_FUNCTION_END_FMT(VL53L1_TRACE_MODULE_NVM,\
status, fmt, ##__VA_ARGS__)
#define trace_print(level, ...) \
_LOG_TRACE_PRINT(trace_flags, \
@ -607,10 +608,11 @@ void VL53L1_print_decoded_nvm_data(
fp_text);
VL53L1_signed_fixed_point_sprintf(
(int32_t)pdata->nvm__fmt__algo__crosstalk_compensation_plane_offset_kcps,
9,
VL53L1_MAX_STRING_LENGTH,
fp_text);
(int32_t)(
pdata->nvm__fmt__algo__crosstalk_compensation_plane_offset_kcps),
9,
VL53L1_MAX_STRING_LENGTH,
fp_text);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
@ -620,10 +622,11 @@ void VL53L1_print_decoded_nvm_data(
fp_text);
VL53L1_signed_fixed_point_sprintf(
(int32_t)pdata->nvm__fmt__algo__crosstalk_compensation_x_plane_gradient_kcps,
11,
VL53L1_MAX_STRING_LENGTH,
fp_text);
(int32_t)(
pdata->nvm__fmt__algo__crosstalk_compensation_x_plane_gradient_kcps),
11,
VL53L1_MAX_STRING_LENGTH,
fp_text);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
@ -633,10 +636,11 @@ void VL53L1_print_decoded_nvm_data(
fp_text);
VL53L1_signed_fixed_point_sprintf(
(int32_t)pdata->nvm__fmt__algo__crosstalk_compensation_y_plane_gradient_kcps,
11,
VL53L1_MAX_STRING_LENGTH,
fp_text);
(int32_t)(
pdata->nvm__fmt__algo__crosstalk_compensation_y_plane_gradient_kcps),
11,
VL53L1_MAX_STRING_LENGTH,
fp_text);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
@ -715,10 +719,11 @@ void VL53L1_print_decoded_nvm_data(
fp_text);
VL53L1_signed_fixed_point_sprintf(
(uint32_t)pdata->nvm__cust__algo__crosstalk_compensation_plane_offset_kcps,
9,
VL53L1_MAX_STRING_LENGTH,
fp_text);
(uint32_t)(
pdata->nvm__cust__algo__crosstalk_compensation_plane_offset_kcps),
9,
VL53L1_MAX_STRING_LENGTH,
fp_text);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
@ -728,10 +733,11 @@ void VL53L1_print_decoded_nvm_data(
fp_text);
VL53L1_signed_fixed_point_sprintf(
(int32_t)pdata->nvm__cust__algo__crosstalk_compensation_x_plane_gradient_kcps,
11,
VL53L1_MAX_STRING_LENGTH,
fp_text);
(int32_t)(
pdata->nvm__cust__algo__crosstalk_compensation_x_plane_gradient_kcps),
11,
VL53L1_MAX_STRING_LENGTH,
fp_text);
trace_print(
VL53L1_TRACE_LEVEL_INFO,
@ -741,10 +747,11 @@ void VL53L1_print_decoded_nvm_data(
fp_text);
VL53L1_signed_fixed_point_sprintf(
(int32_t)pdata->nvm__cust__algo__crosstalk_compensation_y_plane_gradient_kcps,
11,
VL53L1_MAX_STRING_LENGTH,
fp_text);
(int32_t)(
pdata->nvm__cust__algo__crosstalk_compensation_y_plane_gradient_kcps),
11,
VL53L1_MAX_STRING_LENGTH,
fp_text);
trace_print(
VL53L1_TRACE_LEVEL_INFO,

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/
@ -112,7 +112,8 @@
#define LOG_FUNCTION_END(status, ...) \
_LOG_FUNCTION_END(VL53L1_TRACE_MODULE_REGISTERS, status, ##__VA_ARGS__)
#define LOG_FUNCTION_END_FMT(status, fmt, ...) \
_LOG_FUNCTION_END_FMT(VL53L1_TRACE_MODULE_REGISTERS, status, fmt, ##__VA_ARGS__)
_LOG_FUNCTION_END_FMT(VL53L1_TRACE_MODULE_REGISTERS,\
status, fmt, ##__VA_ARGS__)
VL53L1_Error VL53L1_i2c_encode_static_nvm_managed(
@ -130,7 +131,7 @@ VL53L1_Error VL53L1_i2c_encode_static_nvm_managed(
LOG_FUNCTION_START("");
if (VL53L1_STATIC_NVM_MANAGED_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_STATIC_NVM_MANAGED_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
*(pbuffer + 0) =
@ -177,7 +178,7 @@ VL53L1_Error VL53L1_i2c_decode_static_nvm_managed(
LOG_FUNCTION_START("");
if (VL53L1_STATIC_NVM_MANAGED_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_STATIC_NVM_MANAGED_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
pdata->i2c_slave__device_address =
@ -292,7 +293,7 @@ VL53L1_Error VL53L1_i2c_encode_customer_nvm_managed(
LOG_FUNCTION_START("");
if (VL53L1_CUSTOMER_NVM_MANAGED_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_CUSTOMER_NVM_MANAGED_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
*(pbuffer + 0) =
@ -363,7 +364,7 @@ VL53L1_Error VL53L1_i2c_decode_customer_nvm_managed(
LOG_FUNCTION_START("");
if (VL53L1_CUSTOMER_NVM_MANAGED_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_CUSTOMER_NVM_MANAGED_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
pdata->global_config__spad_enables_ref_0 =
@ -490,7 +491,7 @@ VL53L1_Error VL53L1_i2c_encode_static_config(
LOG_FUNCTION_START("");
if (VL53L1_STATIC_CONFIG_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_STATIC_CONFIG_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
VL53L1_i2c_encode_uint16_t(
@ -579,7 +580,7 @@ VL53L1_Error VL53L1_i2c_decode_static_config(
LOG_FUNCTION_START("");
if (VL53L1_STATIC_CONFIG_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_STATIC_CONFIG_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
pdata->dss_config__target_total_rate_mcps =
@ -734,7 +735,7 @@ VL53L1_Error VL53L1_i2c_encode_general_config(
LOG_FUNCTION_START("");
if (VL53L1_GENERAL_CONFIG_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_GENERAL_CONFIG_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
*(pbuffer + 0) =
@ -801,7 +802,7 @@ VL53L1_Error VL53L1_i2c_decode_general_config(
LOG_FUNCTION_START("");
if (VL53L1_GENERAL_CONFIG_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_GENERAL_CONFIG_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
pdata->gph_config__stream_count_update_value =
@ -930,7 +931,7 @@ VL53L1_Error VL53L1_i2c_encode_timing_config(
LOG_FUNCTION_START("");
if (VL53L1_TIMING_CONFIG_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_TIMING_CONFIG_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
*(pbuffer + 0) =
@ -993,7 +994,7 @@ VL53L1_Error VL53L1_i2c_decode_timing_config(
LOG_FUNCTION_START("");
if (VL53L1_TIMING_CONFIG_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_TIMING_CONFIG_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
pdata->mm_config__timeout_macrop_a_hi =
@ -1120,7 +1121,7 @@ VL53L1_Error VL53L1_i2c_encode_dynamic_config(
LOG_FUNCTION_START("");
if (VL53L1_DYNAMIC_CONFIG_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_DYNAMIC_CONFIG_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
*(pbuffer + 0) =
@ -1181,7 +1182,7 @@ VL53L1_Error VL53L1_i2c_decode_dynamic_config(
LOG_FUNCTION_START("");
if (VL53L1_DYNAMIC_CONFIG_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_DYNAMIC_CONFIG_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
pdata->system__grouped_parameter_hold_0 =
@ -1308,7 +1309,7 @@ VL53L1_Error VL53L1_i2c_encode_system_control(
LOG_FUNCTION_START("");
if (VL53L1_SYSTEM_CONTROL_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_SYSTEM_CONTROL_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
*(pbuffer + 0) =
@ -1343,7 +1344,7 @@ VL53L1_Error VL53L1_i2c_decode_system_control(
LOG_FUNCTION_START("");
if (VL53L1_SYSTEM_CONTROL_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_SYSTEM_CONTROL_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
pdata->power_management__go1_power_force =
@ -1448,7 +1449,7 @@ VL53L1_Error VL53L1_i2c_encode_system_results(
LOG_FUNCTION_START("");
if (VL53L1_SYSTEM_RESULTS_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_SYSTEM_RESULTS_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
*(pbuffer + 0) =
@ -1484,9 +1485,9 @@ VL53L1_Error VL53L1_i2c_encode_system_results(
2,
pbuffer + 14);
VL53L1_i2c_encode_uint16_t(
pdata->result__peak_signal_count_rate_crosstalk_corrected_mcps_sd0,
2,
pbuffer + 16);
pdata->result__peak_signal_count_rate_crosstalk_corrected_mcps_sd0,
2,
pbuffer + 16);
VL53L1_i2c_encode_uint16_t(
pdata->result__mm_inner_actual_effective_spads_sd0,
2,
@ -1561,7 +1562,7 @@ VL53L1_Error VL53L1_i2c_decode_system_results(
LOG_FUNCTION_START("");
if (VL53L1_SYSTEM_RESULTS_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_SYSTEM_RESULTS_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
pdata->result__interrupt_status =
@ -1706,7 +1707,7 @@ VL53L1_Error VL53L1_i2c_encode_core_results(
LOG_FUNCTION_START("");
if (VL53L1_CORE_RESULTS_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_CORE_RESULTS_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
VL53L1_i2c_encode_uint32_t(
@ -1765,7 +1766,7 @@ VL53L1_Error VL53L1_i2c_decode_core_results(
LOG_FUNCTION_START("");
if (VL53L1_CORE_RESULTS_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_CORE_RESULTS_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
pdata->result_core__ambient_window_events_sd0 =
@ -1884,7 +1885,7 @@ VL53L1_Error VL53L1_i2c_encode_debug_results(
LOG_FUNCTION_START("");
if (VL53L1_DEBUG_RESULTS_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_DEBUG_RESULTS_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
VL53L1_i2c_encode_uint16_t(
@ -2009,7 +2010,7 @@ VL53L1_Error VL53L1_i2c_decode_debug_results(
LOG_FUNCTION_START("");
if (VL53L1_DEBUG_RESULTS_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_DEBUG_RESULTS_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
pdata->phasecal_result__reference_phase =
@ -2196,7 +2197,7 @@ VL53L1_Error VL53L1_i2c_encode_nvm_copy_data(
LOG_FUNCTION_START("");
if (VL53L1_NVM_COPY_DATA_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_NVM_COPY_DATA_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
*(pbuffer + 0) =
@ -2319,7 +2320,7 @@ VL53L1_Error VL53L1_i2c_decode_nvm_copy_data(
LOG_FUNCTION_START("");
if (VL53L1_NVM_COPY_DATA_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_NVM_COPY_DATA_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
pdata->identification__model_id =
@ -2516,7 +2517,7 @@ VL53L1_Error VL53L1_i2c_encode_prev_shadow_system_results(
LOG_FUNCTION_START("");
if (VL53L1_PREV_SHADOW_SYSTEM_RESULTS_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_PREV_SHADOW_SYSTEM_RESULTS_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
*(pbuffer + 0) =
@ -2548,13 +2549,13 @@ VL53L1_Error VL53L1_i2c_encode_prev_shadow_system_results(
2,
pbuffer + 12);
VL53L1_i2c_encode_uint16_t(
pdata->prev_shadow_result__final_crosstalk_corrected_range_mm_sd0,
2,
pbuffer + 14);
pdata->prev_shadow_result__final_crosstalk_corrected_range_mm_sd0,
2,
pbuffer + 14);
VL53L1_i2c_encode_uint16_t(
pdata->prev_shadow_result__peak_signal_count_rate_crosstalk_corrected_mcps_sd0,
2,
pbuffer + 16);
pdata->psr__peak_signal_count_rate_crosstalk_corrected_mcps_sd0,
2,
pbuffer + 16);
VL53L1_i2c_encode_uint16_t(
pdata->prev_shadow_result__mm_inner_actual_effective_spads_sd0,
2,
@ -2588,9 +2589,9 @@ VL53L1_Error VL53L1_i2c_encode_prev_shadow_system_results(
2,
pbuffer + 32);
VL53L1_i2c_encode_uint16_t(
pdata->prev_shadow_result__final_crosstalk_corrected_range_mm_sd1,
2,
pbuffer + 34);
pdata->prev_shadow_result__final_crosstalk_corrected_range_mm_sd1,
2,
pbuffer + 34);
VL53L1_i2c_encode_uint16_t(
pdata->prev_shadow_result__spare_0_sd1,
2,
@ -2629,7 +2630,7 @@ VL53L1_Error VL53L1_i2c_decode_prev_shadow_system_results(
LOG_FUNCTION_START("");
if (VL53L1_PREV_SHADOW_SYSTEM_RESULTS_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_PREV_SHADOW_SYSTEM_RESULTS_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
pdata->prev_shadow_result__interrupt_status =
@ -2652,7 +2653,7 @@ VL53L1_Error VL53L1_i2c_decode_prev_shadow_system_results(
(VL53L1_i2c_decode_uint16_t(2, pbuffer + 12));
pdata->prev_shadow_result__final_crosstalk_corrected_range_mm_sd0 =
(VL53L1_i2c_decode_uint16_t(2, pbuffer + 14));
pdata->prev_shadow_result__peak_signal_count_rate_crosstalk_corrected_mcps_sd0 =
pdata->psr__peak_signal_count_rate_crosstalk_corrected_mcps_sd0 =
(VL53L1_i2c_decode_uint16_t(2, pbuffer + 16));
pdata->prev_shadow_result__mm_inner_actual_effective_spads_sd0 =
(VL53L1_i2c_decode_uint16_t(2, pbuffer + 18));
@ -2784,7 +2785,7 @@ VL53L1_Error VL53L1_i2c_encode_prev_shadow_core_results(
LOG_FUNCTION_START("");
if (VL53L1_PREV_SHADOW_CORE_RESULTS_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_PREV_SHADOW_CORE_RESULTS_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
VL53L1_i2c_encode_uint32_t(
@ -2843,7 +2844,7 @@ VL53L1_Error VL53L1_i2c_decode_prev_shadow_core_results(
LOG_FUNCTION_START("");
if (VL53L1_PREV_SHADOW_CORE_RESULTS_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_PREV_SHADOW_CORE_RESULTS_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
pdata->prev_shadow_result_core__ambient_window_events_sd0 =
@ -2898,10 +2899,10 @@ VL53L1_Error VL53L1_set_prev_shadow_core_results(
if (status == VL53L1_ERROR_NONE)
status = VL53L1_WriteMulti(
Dev,
VL53L1_PREV_SHADOW_RESULT_CORE__AMBIENT_WINDOW_EVENTS_SD0,
comms_buffer,
VL53L1_PREV_SHADOW_CORE_RESULTS_I2C_SIZE_BYTES);
Dev,
VL53L1_PREV_SHADOW_RESULT_CORE__AMBIENT_WINDOW_EVENTS_SD0,
comms_buffer,
VL53L1_PREV_SHADOW_CORE_RESULTS_I2C_SIZE_BYTES);
if (status == VL53L1_ERROR_NONE)
status = VL53L1_enable_firmware(Dev);
@ -2933,10 +2934,10 @@ VL53L1_Error VL53L1_get_prev_shadow_core_results(
if (status == VL53L1_ERROR_NONE)
status = VL53L1_ReadMulti(
Dev,
VL53L1_PREV_SHADOW_RESULT_CORE__AMBIENT_WINDOW_EVENTS_SD0,
comms_buffer,
VL53L1_PREV_SHADOW_CORE_RESULTS_I2C_SIZE_BYTES);
Dev,
VL53L1_PREV_SHADOW_RESULT_CORE__AMBIENT_WINDOW_EVENTS_SD0,
comms_buffer,
VL53L1_PREV_SHADOW_CORE_RESULTS_I2C_SIZE_BYTES);
if (status == VL53L1_ERROR_NONE)
status = VL53L1_enable_firmware(Dev);
@ -2968,7 +2969,7 @@ VL53L1_Error VL53L1_i2c_encode_patch_debug(
LOG_FUNCTION_START("");
if (VL53L1_PATCH_DEBUG_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_PATCH_DEBUG_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
*(pbuffer + 0) =
@ -2997,7 +2998,7 @@ VL53L1_Error VL53L1_i2c_decode_patch_debug(
LOG_FUNCTION_START("");
if (VL53L1_PATCH_DEBUG_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_PATCH_DEBUG_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
pdata->result__debug_status =
@ -3108,7 +3109,7 @@ VL53L1_Error VL53L1_i2c_encode_gph_general_config(
LOG_FUNCTION_START("");
if (VL53L1_GPH_GENERAL_CONFIG_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_GPH_GENERAL_CONFIG_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
VL53L1_i2c_encode_uint16_t(
@ -3143,7 +3144,7 @@ VL53L1_Error VL53L1_i2c_decode_gph_general_config(
LOG_FUNCTION_START("");
if (VL53L1_GPH_GENERAL_CONFIG_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_GPH_GENERAL_CONFIG_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
pdata->gph__system__thresh_rate_high =
@ -3256,7 +3257,7 @@ VL53L1_Error VL53L1_i2c_encode_gph_static_config(
LOG_FUNCTION_START("");
if (VL53L1_GPH_STATIC_CONFIG_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_GPH_STATIC_CONFIG_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
*(pbuffer + 0) =
@ -3293,7 +3294,7 @@ VL53L1_Error VL53L1_i2c_decode_gph_static_config(
LOG_FUNCTION_START("");
if (VL53L1_GPH_STATIC_CONFIG_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_GPH_STATIC_CONFIG_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
pdata->gph__dss_config__roi_mode_control =
@ -3410,7 +3411,7 @@ VL53L1_Error VL53L1_i2c_encode_gph_timing_config(
LOG_FUNCTION_START("");
if (VL53L1_GPH_TIMING_CONFIG_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_GPH_TIMING_CONFIG_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
*(pbuffer + 0) =
@ -3467,7 +3468,7 @@ VL53L1_Error VL53L1_i2c_decode_gph_timing_config(
LOG_FUNCTION_START("");
if (VL53L1_GPH_TIMING_CONFIG_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_GPH_TIMING_CONFIG_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
pdata->gph__mm_config__timeout_macrop_a_hi =
@ -3602,7 +3603,7 @@ VL53L1_Error VL53L1_i2c_encode_fw_internal(
LOG_FUNCTION_START("");
if (VL53L1_FW_INTERNAL_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_FW_INTERNAL_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
*(pbuffer + 0) =
@ -3631,7 +3632,7 @@ VL53L1_Error VL53L1_i2c_decode_fw_internal(
LOG_FUNCTION_START("");
if (VL53L1_FW_INTERNAL_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_FW_INTERNAL_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
pdata->firmware__internal_stream_count_div =
@ -3742,7 +3743,7 @@ VL53L1_Error VL53L1_i2c_encode_patch_results(
LOG_FUNCTION_START("");
if (VL53L1_PATCH_RESULTS_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_PATCH_RESULTS_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
*(pbuffer + 0) =
@ -3915,7 +3916,7 @@ VL53L1_Error VL53L1_i2c_decode_patch_results(
LOG_FUNCTION_START("");
if (VL53L1_PATCH_RESULTS_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_PATCH_RESULTS_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
pdata->dss_calc__roi_ctrl =
@ -4142,7 +4143,7 @@ VL53L1_Error VL53L1_i2c_encode_shadow_system_results(
LOG_FUNCTION_START("");
if (VL53L1_SHADOW_SYSTEM_RESULTS_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_SHADOW_SYSTEM_RESULTS_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
*(pbuffer + 0) =
@ -4180,7 +4181,7 @@ VL53L1_Error VL53L1_i2c_encode_shadow_system_results(
2,
pbuffer + 16);
VL53L1_i2c_encode_uint16_t(
pdata->shadow_result__peak_signal_count_rate_crosstalk_corrected_mcps_sd0,
pdata->shr__peak_signal_count_rate_crosstalk_corrected_mcps_sd0,
2,
pbuffer + 18);
VL53L1_i2c_encode_uint16_t(
@ -4261,7 +4262,7 @@ VL53L1_Error VL53L1_i2c_decode_shadow_system_results(
LOG_FUNCTION_START("");
if (VL53L1_SHADOW_SYSTEM_RESULTS_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_SHADOW_SYSTEM_RESULTS_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
pdata->shadow_phasecal_result__vcsel_start =
@ -4286,7 +4287,7 @@ VL53L1_Error VL53L1_i2c_decode_shadow_system_results(
(VL53L1_i2c_decode_uint16_t(2, pbuffer + 14));
pdata->shadow_result__final_crosstalk_corrected_range_mm_sd0 =
(VL53L1_i2c_decode_uint16_t(2, pbuffer + 16));
pdata->shadow_result__peak_signal_count_rate_crosstalk_corrected_mcps_sd0 =
pdata->shr__peak_signal_count_rate_crosstalk_corrected_mcps_sd0 =
(VL53L1_i2c_decode_uint16_t(2, pbuffer + 18));
pdata->shadow_result__mm_inner_actual_effective_spads_sd0 =
(VL53L1_i2c_decode_uint16_t(2, pbuffer + 20));
@ -4424,7 +4425,7 @@ VL53L1_Error VL53L1_i2c_encode_shadow_core_results(
LOG_FUNCTION_START("");
if (VL53L1_SHADOW_CORE_RESULTS_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_SHADOW_CORE_RESULTS_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
VL53L1_i2c_encode_uint32_t(
@ -4483,7 +4484,7 @@ VL53L1_Error VL53L1_i2c_decode_shadow_core_results(
LOG_FUNCTION_START("");
if (VL53L1_SHADOW_CORE_RESULTS_I2C_SIZE_BYTES > buf_size)
if (buf_size < VL53L1_SHADOW_CORE_RESULTS_I2C_SIZE_BYTES)
return VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL;
pdata->shadow_result_core__ambient_window_events_sd0 =

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/
@ -110,7 +110,8 @@
#define LOG_FUNCTION_END(status, ...) \
_LOG_FUNCTION_END(VL53L1_TRACE_MODULE_CORE, status, ##__VA_ARGS__)
#define LOG_FUNCTION_END_FMT(status, fmt, ...) \
_LOG_FUNCTION_END_FMT(VL53L1_TRACE_MODULE_CORE, status, fmt, ##__VA_ARGS__)
_LOG_FUNCTION_END_FMT(VL53L1_TRACE_MODULE_CORE,\
status, fmt, ##__VA_ARGS__)
VL53L1_Error VL53L1_is_firmware_ready_silicon(
@ -136,44 +137,49 @@ VL53L1_Error VL53L1_is_firmware_ready_silicon(
status = VL53L1_ReadMulti(
Dev,
VL53L1_INTERRUPT_MANAGER__ENABLES,
comms_buffer,
5);
Dev,
VL53L1_INTERRUPT_MANAGER__ENABLES,
comms_buffer,
5);
if (status == VL53L1_ERROR_NONE) {
if (status != VL53L1_ERROR_NONE)
goto ENDFUNC;
pdev->dbg_results.interrupt_manager__enables =
comms_buffer[0];
pdev->dbg_results.interrupt_manager__clear =
comms_buffer[1];
pdev->dbg_results.interrupt_manager__status =
comms_buffer[2];
pdev->dbg_results.mcu_to_host_bank__wr_access_en =
comms_buffer[3];
pdev->dbg_results.power_management__go1_reset_status =
comms_buffer[4];
pdev->dbg_results.interrupt_manager__enables =
comms_buffer[0];
pdev->dbg_results.interrupt_manager__clear =
comms_buffer[1];
pdev->dbg_results.interrupt_manager__status =
comms_buffer[2];
pdev->dbg_results.mcu_to_host_bank__wr_access_en =
comms_buffer[3];
pdev->dbg_results.power_management__go1_reset_status =
comms_buffer[4];
if ((pdev->sys_ctrl.power_management__go1_power_force & 0x01) == 0x01) {
if ((pdev->sys_ctrl.power_management__go1_power_force & 0x01)
== 0x01) {
if (((pdev->dbg_results.interrupt_manager__enables & 0x1F) == 0x1F) &&
((pdev->dbg_results.interrupt_manager__clear & 0x1F) == 0x1F))
*pready = 0x01;
else
*pready = 0x00;
if (((pdev->dbg_results.interrupt_manager__enables &
0x1F) == 0x1F) &&
((pdev->dbg_results.interrupt_manager__clear
& 0x1F) == 0x1F))
*pready = 0x01;
else
*pready = 0x00;
} else {
} else {
if ((pdev->dbg_results.power_management__go1_reset_status & 0x01) == 0x00)
*pready = 0x01;
else
*pready = 0x00;
}
if ((pdev->dbg_results.power_management__go1_reset_status
& 0x01) == 0x00)
*pready = 0x01;
else
*pready = 0x00;
}
ENDFUNC:
LOG_FUNCTION_END(status);
return status;

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/
@ -207,9 +207,9 @@ VL53L1_Error VL53L1_wait_for_firmware_ready(
status =
VL53L1_poll_for_firmware_ready(
Dev,
VL53L1_RANGE_COMPLETION_POLLING_TIMEOUT_MS);
VL53L1_poll_for_firmware_ready(
Dev,
VL53L1_RANGE_COMPLETION_POLLING_TIMEOUT_MS);
} else {
@ -217,7 +217,8 @@ VL53L1_Error VL53L1_wait_for_firmware_ready(
fw_ready = 0;
while (fw_ready == 0x00 && status == VL53L1_ERROR_NONE) {
while (fw_ready == 0x00 && status ==
VL53L1_ERROR_NONE) {
status = VL53L1_is_firmware_ready(
Dev,
&fw_ready);

View file

@ -1,65 +1,65 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* This file is part of VL53L1 Core and is dual licensed,
* either 'STMicroelectronics
* Proprietary license'
* or 'BSD 3-clause "New" or "Revised" License' , at your option.
*
/*******************************************************************************
* Copyright (c) 2017, STMicroelectronics - All Rights Reserved
This file is part of VL53L1 Core and is dual licensed,
either 'STMicroelectronics
Proprietary license'
or 'BSD 3-clause "New" or "Revised" License' , at your option.
********************************************************************************
*
* 'STMicroelectronics Proprietary license'
*
'STMicroelectronics Proprietary license'
********************************************************************************
*
* License terms: STMicroelectronics Proprietary in accordance with licensing
* terms at www.st.com/sla0044
*
* STMicroelectronics confidential
* Reproduction and Communication of this document is strictly prohibited unless
* specifically authorized in writing by STMicroelectronics.
*
*
License terms: STMicroelectronics Proprietary in accordance with licensing
terms at www.st.com/sla0081
STMicroelectronics confidential
Reproduction and Communication of this document is strictly prohibited unless
specifically authorized in writing by STMicroelectronics.
********************************************************************************
*
* Alternatively, VL53L1 Core may be distributed under the terms of
* 'BSD 3-clause "New" or "Revised" License', in which case the following
* provisions apply instead of the ones
* mentioned above :
*
Alternatively, VL53L1 Core may be distributed under the terms of
'BSD 3-clause "New" or "Revised" License', in which case the following
provisions apply instead of the ones
mentioned above :
********************************************************************************
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
*
*/
@ -108,7 +108,8 @@
#define LOG_FUNCTION_END(status, ...) \
_LOG_FUNCTION_END(VL53L1_TRACE_MODULE_CORE, status, ##__VA_ARGS__)
#define LOG_FUNCTION_END_FMT(status, fmt, ...) \
_LOG_FUNCTION_END_FMT(VL53L1_TRACE_MODULE_CORE, status, fmt, ##__VA_ARGS__)
_LOG_FUNCTION_END_FMT(VL53L1_TRACE_MODULE_CORE,\
status, fmt, ##__VA_ARGS__)
VL53L1_Error VL53L1_init_zone_config_structure(
@ -147,18 +148,18 @@ VL53L1_Error VL53L1_init_zone_config_structure(
pdata->active_zones = (uint8_t)i;
pdata->user_zones[i].height = height;
pdata->user_zones[i].width = width;
pdata->user_zones[i].x_centre = x_off + (x * x_inc);
pdata->user_zones[i].y_centre = y_off + (y * y_inc);
pdata->user_zones[i].x_centre =
x_off + (x * x_inc);
pdata->user_zones[i].y_centre =
y_off + (y * y_inc);
}
i++;
}
}
if (status == VL53L1_ERROR_NONE) {
status = VL53L1_init_zone_config_histogram_bins(pdata);
status = VL53L1_init_zone_config_histogram_bins(pdata);
}
LOG_FUNCTION_END(status);
@ -219,10 +220,8 @@ VL53L1_Error VL53L1_zone_preset_xtalk_planar(
pzone_cfg->user_zones[4].x_centre = 8;
pzone_cfg->user_zones[4].y_centre = 8;
if (status == VL53L1_ERROR_NONE) {
status = VL53L1_init_zone_config_histogram_bins(pzone_cfg);
status = VL53L1_init_zone_config_histogram_bins(pzone_cfg);
}
LOG_FUNCTION_END(status);

View file

@ -1,33 +1,33 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**************************************************************************
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
/** @file stmvl53l1-i2c.h
* Linux kernel i2c/cci wrapper for ST VL53L1 sensor i2c interface
@ -52,13 +52,13 @@ struct i2c_data {
/*!< power enable gpio number
*
* if -1 no gpio if vdd not avl pwr is not controllable
*/
*/
int pwren_gpio;
/*!< xsdn reset (low active) gpio number to device
*
* -1 mean none assume no "resetable"
*/
*/
int xsdn_gpio;
/*!< intr gpio number to device
@ -67,7 +67,7 @@ struct i2c_data {
*
* -1 mean none assume use polling
* @warning if the dev tree and intr gpio is require please adapt code
*/
*/
int intr_gpio;
/*!< device boot i2c register address
@ -87,7 +87,7 @@ struct i2c_data {
/** the irq vectore assigned to gpio
* -1 if no irq hanled
*/
*/
int irq;
struct msgtctrl_t {
@ -96,14 +96,14 @@ struct i2c_data {
};
int stmvl53l1_init_i2c(void);
void __exit stmvl53l1_exit_i2c(void *);
int stmvl53l1_power_up_i2c(void *);
int stmvl53l1_power_down_i2c(void *);
int stmvl53l1_reset_release_i2c(void *);
int stmvl53l1_reset_hold_i2c(void *);
void __exit stmvl53l1_exit_i2c(void *arg);
int stmvl53l1_power_up_i2c(void *arg);
int stmvl53l1_power_down_i2c(void *arg);
int stmvl53l1_reset_release_i2c(void *arg);
int stmvl53l1_reset_hold_i2c(void *arg);
void stmvl53l1_clean_up_i2c(void);
int stmvl53l1_start_intr(void *object, int *poll_mode);
void *stmvl53l1_get(void *);
void stmvl53l1_put(void *);
void *stmvl53l1_get(void *arg);
void stmvl53l1_put(void *arg);
#endif /* STMVL53L1_I2C_H */

View file

@ -1,33 +1,33 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**************************************************************************
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
/**
* @file stmvl53l1.h header for vl53l1 sensor driver
*/
@ -57,7 +57,9 @@
/**
* Configure the Netlink-id use
*/
#define STMVL531_CFG_NETLINK_USER 23
#ifndef STMVL531_CFG_NETLINK_USER
#define STMVL531_CFG_NETLINK_USER 29
#endif
#define STMVL53L1_MAX_CCI_XFER_SZ 256
#define STMVL53L1_DRV_NAME "stmvl53l1"
@ -69,7 +71,7 @@
*/
/* define CFG_STMVL53L1_HAVE_REGULATOR */
#define DRIVER_VERSION "12.13.0"
#define DRIVER_VERSION "13.1.0"
/** @ingroup vl53l1_config
* @{
@ -97,12 +99,12 @@ extern int stmvl53l1_enable_debug;
#define vl53l1_dbgmsg(str, ...) do { \
if (stmvl53l1_enable_debug) \
pr_info("%s: " str, __func__, ##__VA_ARGS__); \
} while (0)
} while (0)
# else
#define vl53l1_dbgmsg(str, ...) do { \
if (stmvl53l1_enable_debug) \
pr_debug("%s: " str, __func__, ##__VA_ARGS__); \
} while (0)
} while (0)
# endif
#else
# define vl53l1_dbgmsg(...) (void)0
@ -114,13 +116,13 @@ extern int stmvl53l1_enable_debug;
#define WORK_DEBUG 0
#if WORK_DEBUG
# define work_dbg(msg, ...)\
printk("[D WK53L1] :" msg "\n", ##__VA_ARGS__)
printk("[D WK53L1] :" msg "\n", ##__VA_ARGS__)
#else
# define work_dbg(...) (void)0
#endif
#define vl53l1_info(str, args...) \
pr_info("%s: " str, __func__, ##args)
pr_info("%s: " str "\n", __func__, ##args)
#define vl53l1_errmsg(str, args...) \
pr_err("%s: " str, __func__, ##args)
@ -152,21 +154,22 @@ struct ipp_data_t {
struct ipp_work_t work;
struct ipp_work_t work_out;
int test_n;
int buzy; /*!< buzy state 0 is idle
* any other value do not try to use (state value defined in source)
*/
/*!< buzy state 0 is idle
*any other value do not try to use (state value defined in source)
*/
int buzy;
int waited_xfer_id;
/*!< when buzy is set that is the id we are expecting
* note that value 0 is reserved and stand for "not waiting"
* as such never id 0 will be in any round trip exchange
* it's ok for daemon to use 0 in "ping" when it identify himself
*/
*/
int status; /** if that is not 0 do not look at out work data */
wait_queue_head_t waitq;
/*!< ipp caller are put in that queue wait while job is posted to user
* @warning ipp and dev mutex will be released before waiting
* see @ref ipp_abort
*/
*/
#if IPP_LOG_TIMING
struct timeval start_tv, stop_tv;
#endif
@ -183,7 +186,6 @@ struct stmvl53l1_waiters {
struct stmvl53l1_data {
int id; /*!< multiple device id 0 based*/
char name[64]; /*!< misc device name */
int32_t hw_rev; /*!< hardware revision number*/
VL53L1_DevData_t stdev; /*!<embed ST VL53L0 Dev data as "stdev" */
@ -220,8 +222,6 @@ struct stmvl53l1_data {
int crosstalk_enable; /*!< is crosstalk compensation is enable */
int output_mode; /*!< output mode of the device */
bool force_device_on_en;/*!< keep device active when stopped */
int sar_mode; /*!< is sar mode enable/disabled */
int cam_mode; /*!< is camera mode enable/disabled */
VL53L1_Error last_error;/*!< last device internal error */
int offset_correction_mode;/*!< offset correction mode to apply */
FixPoint1616_t dmax_reflectance;/*!< reflectance use for dmax calc */
@ -237,11 +237,6 @@ struct stmvl53l1_data {
/* Calibration parameters */
bool is_calibrating; /*!< active during calibration phases */
uint16_t xtalk_offset; /*!< crosstalk compensation plane offset kcps */
int16_t xtalk_x; /*!< crosstalk compensation x plane gradient kcps */
int16_t xtalk_y; /*!< crosstalk compensation y plane gradient kcps */
int16_t inner_offset; /*!< inner offset mm */
int16_t outer_offset; /*!< outer offset mm */
/* Range Data and stat */
struct range_t {
@ -293,22 +288,17 @@ struct stmvl53l1_data {
uint32_t auto_pollingTimeInMs;
VL53L1_DetectionConfig_t auto_config;
/* autonomous config for camera */
uint32_t auto_pollingTimeInMs_cam;
VL53L1_DetectionConfig_t auto_config_cam;
int sysfs_base;
/* Debug */
struct ipp_data_t ipp;
#if IPP_LOG_TIMING
# define stmvl531_ipp_tim_stop(data)\
do_gettimeofday(&data->ipp.stop_tv)
do_gettimeofday(&data->ipp.stop_tv)
# define stmvl531_ipp_tim_start(data)\
do_gettimeofday(&data->ipp.start_tv)
do_gettimeofday(&data->ipp.start_tv)
# define stmvl531_ipp_time(data)\
stmvl53l1_tv_dif(&data->ipp.start_tv, &data->ipp.stop_tv)
stmvl53l1_tv_dif(&data->ipp.start_tv, &data->ipp.stop_tv)
# define stmvl531_ipp_stat(data, fmt, ...)\
vl53l1_dbgmsg("IPPSTAT " fmt "\n", ##__VA_ARGS__)
vl53l1_dbgmsg("IPPSTAT " fmt "\n", ##__VA_ARGS__)
#else
# define stmvl531_ipp_tim_stop(data) (void)0
# define stmvl531_ipp_tim_start(data) (void)0
@ -335,9 +325,11 @@ extern struct stmvl53l1_data *stmvl53l1_dev_table[];
int stmvl53l1_setup(struct stmvl53l1_data *data);
void stmvl53l1_cleanup(struct stmvl53l1_data *data);
#ifdef CONFIG_PM_SLEEP
void stmvl53l1_pm_suspend_stop(struct stmvl53l1_data *data);
#endif
int stmvl53l1_intr_handler(struct stmvl53l1_data *data);
int stmvl53l1_sysfs_laser(struct stmvl53l1_data *data, bool create);
/**
* request ipp to abort or stop

View file

@ -1,33 +1,33 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**************************************************************************
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
/**
* @file stmvl53l1_i2c.c vl53l1 linux native i2c interface
@ -37,8 +37,6 @@
#include "stmvl53l1-i2c.h"
#include <linux/i2c.h>
#if STMVL53L1_LOG_POLL_TIMING
/**
* helper to elapse time in polling
@ -46,7 +44,7 @@
*/
# define poll_timing_log(ptv) \
vl53l1_dbgmsg("poll in %d us\n", tv_elapsed_us(ptv))
vl53l1_dbgmsg("poll in %d us\n", tv_elapsed_us(ptv))
#else
# define poll_timing_log(...) (void)0
#endif
@ -68,15 +66,16 @@ static uint32_t tv_elapsed_us(struct timeval *tv)
struct timeval now;
do_gettimeofday(&now);
return (now.tv_sec - tv->tv_sec)*1000000 + (now.tv_usec - tv->tv_usec);
return (now.tv_sec - tv->tv_sec) * 1000000 + (now.tv_usec -
tv->tv_usec);
}
# define cci_access_var struct timeval cci_log_start_tv
# define cci_access_start()\
do_gettimeofday(&cci_log_start_tv)
do_gettimeofday(&cci_log_start_tv)
# define cci_access_over(fmt, ...) \
vl53l1_dbgmsg("cci_timing %d us" fmt "\n", \
tv_elapsed_us(&cci_log_start_tv), ##__VA_ARGS__)
vl53l1_dbgmsg("cci_timing %d us" fmt "\n", \
tv_elapsed_us(&cci_log_start_tv), ##__VA_ARGS__)
#else
# define cci_access_var
# define cci_access_start(...) (void)0
@ -89,12 +88,12 @@ static uint32_t tv_elapsed_us(struct timeval *tv)
# define i2c_debug(fmt, ...) (void)0
#endif
VL53L1_Error VL53L1_GetTickCount(uint32_t *ptime_ms)
{
(void)ptime_ms;
BUG_ON(1);
}
/**
* compute elapsed time in in milli sec based on do_gettimeofday
* @param tv pointer to start time_val
@ -110,13 +109,12 @@ static uint32_t tv_elapsed_ms(struct timeval *tv)
}
static int cci_write(struct stmvl53l1_data *dev, int index,
uint8_t *data, uint16_t len){
uint8_t buffer[STMVL53L1_MAX_CCI_XFER_SZ+2];
uint8_t *data, uint16_t len)
{
uint8_t buffer[STMVL53L1_MAX_CCI_XFER_SZ + 2];
struct i2c_msg msg;
struct i2c_data *i2c_client_obj =
(struct i2c_data *) dev->client_object;
struct i2c_client *client =
(struct i2c_client *) i2c_client_obj->client;
struct i2c_data *i2c_client_obj = (struct i2c_data *)dev->client_object;
struct i2c_client *client = (struct i2c_client *)i2c_client_obj->client;
int rc;
cci_access_var;
@ -129,17 +127,17 @@ static int cci_write(struct stmvl53l1_data *dev, int index,
buffer[0] = (index >> 8) & 0xFF;
buffer[1] = (index >> 0) & 0xFF;
/* copy write data to buffer after index */
memcpy(buffer+2, data, len);
memcpy(buffer + 2, data, len);
/* set i2c msg */
msg.addr = client->addr;
msg.flags = client->flags;
msg.buf = buffer;
msg.len = len+2;
msg.len = len + 2;
rc = i2c_transfer(client->adapter, &msg, 1);
if (rc != 1) {
vl53l1_errmsg("wr i2c_transfer err:%d, index 0x%x len %d\n",
rc, index, len);
rc, index, len);
}
cci_access_over("rd status %d long %d ", rc != 1, len);
return rc != 1;
@ -150,10 +148,8 @@ static int cci_read(struct stmvl53l1_data *dev, int index,
{
uint8_t buffer[2];
struct i2c_msg msg[2];
struct i2c_data *i2c_client_obj =
(struct i2c_data *) dev->client_object;
struct i2c_client *client =
(struct i2c_client *) i2c_client_obj->client;
struct i2c_data *i2c_client_obj = (struct i2c_data *)dev->client_object;
struct i2c_client *client = (struct i2c_client *)i2c_client_obj->client;
int rc;
cci_access_var;
@ -168,51 +164,46 @@ static int cci_read(struct stmvl53l1_data *dev, int index,
buffer[1] = (index >> 0) & 0xFF;
msg[0].addr = client->addr;
msg[0].flags = client->flags;/* Write */
msg[0].flags = client->flags; /* Write */
msg[0].buf = buffer;
msg[0].len = 2;
/* read part of the i2c transaction */
msg[1].addr = client->addr;
msg[1].flags = I2C_M_RD|client->flags;
msg[1].flags = I2C_M_RD | client->flags;
msg[1].buf = data;
msg[1].len = len;
rc = i2c_transfer(client->adapter, msg, 2);
if (rc != 2) {
pr_err("%s: i2c_transfer :%d, @%x index 0x%x len %d\n",
__func__, rc, client->addr, index, len);
__func__, rc, client->addr, index, len);
}
cci_access_over(" wr len %d status %d", rc != 2, len);
return rc != 2;
}
VL53L1_Error VL53L1_WrByte(VL53L1_DEV pdev,
uint16_t index,
uint8_t data)
VL53L1_Error VL53L1_WrByte(VL53L1_DEV pdev, uint16_t index, uint8_t data)
{
struct stmvl53l1_data *dev;
dev = (struct stmvl53l1_data *)container_of(pdev,
struct stmvl53l1_data, stdev);
struct stmvl53l1_data,
stdev);
return cci_write(dev, index, &data, 1);
return cci_write(dev, index, &data, 1);
}
VL53L1_Error VL53L1_RdByte(
VL53L1_DEV pdev,
uint16_t index,
uint8_t *pdata)
VL53L1_Error VL53L1_RdByte(VL53L1_DEV pdev, uint16_t index, uint8_t *pdata)
{
struct stmvl53l1_data *dev;
dev = (struct stmvl53l1_data *) container_of(pdev,
struct stmvl53l1_data, stdev);
dev = (struct stmvl53l1_data *)container_of(pdev,
struct stmvl53l1_data,
stdev);
return cci_read(dev, index, pdata, 1) ?
return cci_read(dev, index, pdata, 1) ?
VL53L1_ERROR_CONTROL_INTERFACE : VL53L1_ERROR_NONE;
}
@ -226,13 +217,12 @@ VL53L1_Error VL53L1_WrWord(VL53L1_DEV pdev, uint16_t index, uint16_t data)
buffer[0] = (uint8_t) (data >> 8);
buffer[1] = (uint8_t) (data & 0x00FF);
i2c_debug(" @%x d= %x => [ %x , %x ] ", index, data, buffer[0],
buffer[1]);
buffer[1]);
status = VL53L1_WriteMulti(pdev, index, buffer, 2);
return status;
}
VL53L1_Error VL53L1_RdWord(VL53L1_DEV pdev, uint16_t index, uint16_t *pdata)
{
VL53L1_Error status;
@ -245,7 +235,6 @@ VL53L1_Error VL53L1_RdWord(VL53L1_DEV pdev, uint16_t index, uint16_t *pdata)
return status;
}
VL53L1_Error VL53L1_WrDWord(VL53L1_DEV pdev, uint16_t index, uint32_t data)
{
VL53L1_Error status = VL53L1_ERROR_NONE;
@ -270,7 +259,7 @@ VL53L1_Error VL53L1_RdDWord(VL53L1_DEV pdev, uint16_t index, uint32_t *pdata)
status = VL53L1_ReadMulti(pdev, index, buffer, 4);
*pdata = ((uint32_t) buffer[0] << 24) + ((uint32_t) buffer[1] << 16)
+ ((uint32_t) buffer[2] << 8) + (uint32_t) buffer[3];
+ ((uint32_t) buffer[2] << 8) + (uint32_t) buffer[3];
return status;
}
@ -280,11 +269,12 @@ VL53L1_Error VL53L1_WriteMulti(VL53L1_DEV pdev, uint16_t index,
{
struct stmvl53l1_data *dev;
dev = (struct stmvl53l1_data *) container_of(pdev,
struct stmvl53l1_data, stdev);
dev = (struct stmvl53l1_data *)container_of(pdev,
struct stmvl53l1_data,
stdev);
return cci_write(dev, index, pdata, count) ?
VL53L1_ERROR_CONTROL_INTERFACE : VL53L1_ERROR_NONE;
VL53L1_ERROR_CONTROL_INTERFACE : VL53L1_ERROR_NONE;
}
VL53L1_Error VL53L1_ReadMulti(VL53L1_DEV pdev, uint16_t index,
@ -292,11 +282,12 @@ VL53L1_Error VL53L1_ReadMulti(VL53L1_DEV pdev, uint16_t index,
{
struct stmvl53l1_data *dev;
dev = (struct stmvl53l1_data *) container_of(pdev,
struct stmvl53l1_data, stdev);
dev = (struct stmvl53l1_data *)container_of(pdev,
struct stmvl53l1_data,
stdev);
return cci_read(dev, index, pdata, count) ?
VL53L1_ERROR_CONTROL_INTERFACE : VL53L1_ERROR_NONE;
VL53L1_ERROR_CONTROL_INTERFACE : VL53L1_ERROR_NONE;
}
static int is_time_over(struct timeval *tv, uint32_t msec)
@ -304,21 +295,20 @@ static int is_time_over(struct timeval *tv, uint32_t msec)
return tv_elapsed_ms(tv) >= msec;
}
VL53L1_Error VL53L1_WaitValueMaskEx(
VL53L1_DEV pdev,
uint32_t timeout_ms,
uint16_t index,
uint8_t value,
uint8_t mask,
uint32_t poll_delay_ms)
VL53L1_Error VL53L1_WaitValueMaskEx(VL53L1_DEV pdev,
uint32_t timeout_ms,
uint16_t index,
uint8_t value,
uint8_t mask, uint32_t poll_delay_ms)
{
struct timeval start_tv;
struct stmvl53l1_data *dev;
int rc, time_over;
uint8_t rd_val;
dev = (struct stmvl53l1_data *) container_of(pdev,
struct stmvl53l1_data, stdev);
dev = (struct stmvl53l1_data *)container_of(pdev,
struct stmvl53l1_data,
stdev);
do_gettimeofday(&start_tv);
do {
@ -343,8 +333,9 @@ VL53L1_Error VL53L1_WaitUs(VL53L1_DEV pdev, int32_t wait_us)
{
struct stmvl53l1_data *data;
data = (struct stmvl53l1_data *) container_of(pdev,
struct stmvl53l1_data, stdev);
data = (struct stmvl53l1_data *)container_of(pdev,
struct stmvl53l1_data,
stdev);
if (!data->is_delay_allowed)
return VL53L1_ERROR_PLATFORM_SPECIFIC_START;

View file

@ -1,39 +1,39 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**************************************************************************
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
/**
* @file stmvl53l1_if.h vl53l1 kernel driver user interface
*
* @note to use this header in a user space application it requires
* @note to use this header in a user space application it requires
* all st bare/ll driver platform wrapper files (for data struct def)
* this files (types etc ..) shall be same or compliant with bar driver version
* used in the kernel module
@ -57,7 +57,7 @@
* @li stmvl53l1_ranging1
* @li stmvl53l1_ranging2
*/
#define VL53L1_MISC_DEV_NAME "laser"
#define VL53L1_MISC_DEV_NAME "stmvl53l1_ranging"
/**
* register data use for simple/single ranging data @ref VL53L1_IOCTL_GETDATAS
*
@ -100,8 +100,19 @@ enum __stmv53l1_parameter_name_e {
*/
VL53L1_TIMINGBUDGET_PAR = 11,
/*!< VL53L1_TIMINGBUDGET_PAR
* @ref stmvl53l1_parameter.value field is timing budget in micro second
*/
* @ref stmvl53l1_parameter.value field is timing budget in micro second
*
* @note Please refer to VL53L1 user manual for minimum timing budget according to the selected mode
*
* Mode / timing budget | Min | Typical
* ------------------------------------- | ----- | -------
* VL53L1_PRESETMODE_RANGING | 8 ms | 16 ms
* VL53L1_PRESETMODE_MULTIZONES_SCANNING | 8 ms | 16 ms
* VL53L1_PRESETMODE_AUTONOMOUS | 41 ms | 76 ms
* VL53L1_PRESETMODE_LITE_RANGING | 17 ms | 66 ms
* VL53L1_PRESETMODE_LOWPOWER_AUTONOMOUS | 20 ms | 20 ms
*
*/
VL53L1_DISTANCEMODE_PAR = 12,
/*!< VL53L1_DISTANCEMODE_PAR
@ -204,18 +215,6 @@ enum __stmv53l1_parameter_name_e {
* @li 0 Xtalk values has not been changed.
* @li 1 Xtalk values has been changed.
*/
VL53L1_CAMERAMODE_PAR = 23,
/*!< VL53L1_CAMERAMODE_PAR
* valid camera mode value :
* @li 0 device is out of camera mode.
* @li 1 device is in camera mode.
*/
VL53L1_HWREV_PAR = 24,
/*!< VL53L1_HWREV_PAR
* This is a read only parameter. It will return HW revision number
*/
};
#define stmv53l1_parameter_name_e enum __stmv53l1_parameter_name_e
@ -224,10 +223,10 @@ enum __stmv53l1_parameter_name_e {
*/
struct stmvl53l1_parameter {
uint32_t is_read; /*!< [in] 1: Get 0: Set*/
stmv53l1_parameter_name_e name; /*!< [in] parameter to set/get
* see @ref stmv53l1_parameter_name_e
*/
/*!< [in] parameter to set/get
* see @ref stmv53l1_parameter_name_e
*/
stmv53l1_parameter_name_e name;
int32_t value; /*!< [in/out] value to set /get */
int32_t value2; /*!< [in/out] optional 2nd value */
int32_t status; /*!< [out] status of the operation */
@ -245,7 +244,7 @@ struct stmvl53l1_roi_t {
/*!< specify roi transfer direction \n
* @li 0 to get roi
* @li !0 to set roi
*/
*/
/*! roi data and count type use in @ VL53L1_IOCTL_ROI */
struct roi_cfg_t {
uint8_t NumberOfRoi;
@ -259,7 +258,7 @@ struct stmvl53l1_roi_t {
* [in] max number provided\n
* [out] number of ROI copied back to user\n
* @warning 0 will not return any roi datas!
*/
*/
VL53L1_UserRoi_t UserRois[1];
/*!< roi data array length definition is 1 but
* NumberOfRoi+ FirstRoiToScan in array are required
@ -283,7 +282,7 @@ struct stmvl53l1_roi_full_t {
/*!< specify roi transfer direction \n
* @li 0 to get roi
* @li !0 to set roi
*/
*/
VL53L1_RoiConfig_t roi_cfg;
/*!< roi data array of max length but only requested copy to/from user
* space effectively used
@ -333,6 +332,9 @@ struct stmvl53l1_ioctl_zone_calibration_data_t {
/** Select crosstalk calibration in @ref VL53L1_IOCTL_PERFORM_CALIBRATION.
*
* param1 is calibration method. param2 and param3 not use.
* @li VL53L1_XTALKCALIBRATIONMODE_NO_TARGET
* @li VL53L1_XTALKCALIBRATIONMODE_SINGLE_TARGET
* @li VL53L1_XTALKCALIBRATIONMODE_FULL_ROI
*/
#define VL53L1_CALIBRATION_CROSSTALK 1
@ -490,7 +492,7 @@ int smtvl53l1_stop(int fd){
* to ensure race free usage acquiring mutex and/or locks.
*/
#define VL53L1_IOCTL_GETDATAS \
_IOWR('p', 0x0b, stmvl531_range_data_t)
_IOWR('p', 0x0b, stmvl531_range_data_t)
/**
* set or get parameter
@ -507,7 +509,7 @@ int smtvl53l1_stop(int fd){
* @note a set parameter may not be absorbed straight aways !
*/
#define VL53L1_IOCTL_PARAMETER \
_IOWR('p', 0x0d, struct stmvl53l1_parameter)
_IOWR('p', 0x0d, struct stmvl53l1_parameter)
/**
@ -538,7 +540,7 @@ int smtvl53l1_stop(int fd){
* @li other errno code could be ll driver specific
*/
#define VL53L1_IOCTL_ROI\
_IOWR('p', 0x0e, struct stmvl53l1_roi_t)
_IOWR('p', 0x0e, struct stmvl53l1_roi_t)
/**
* Get multi object/zone ranging data
@ -556,7 +558,7 @@ int smtvl53l1_stop(int fd){
* as in that case MZ data may not be fully valid
*/
#define VL53L1_IOCTL_MZ_DATA\
_IOR('p', 0x0f, VL53L1_MultiRangingData_t)
_IOR('p', 0x0f, VL53L1_MultiRangingData_t)
/**
* get single ranging data @sa for multi zone/objet
@ -573,7 +575,7 @@ int smtvl53l1_stop(int fd){
* @li -ERESTARTSYS interrupt while sleeping.
*/
#define VL53L1_IOCTL_GETDATAS_BLOCKING\
_IOWR('p', 0x10, stmvl531_range_data_t)
_IOWR('p', 0x10, stmvl531_range_data_t)
/**
* Get multi object/zone ranging data
@ -592,7 +594,7 @@ int smtvl53l1_stop(int fd){
* as in that case MZ data may not be fully valid
*/
#define VL53L1_IOCTL_MZ_DATA_BLOCKING\
_IOR('p', 0x11, VL53L1_MultiRangingData_t)
_IOR('p', 0x11, VL53L1_MultiRangingData_t)
/**
* Get / set calibration data
@ -676,34 +678,5 @@ int smtvl53l1_stop(int fd){
#define VL53L1_IOCTL_AUTONOMOUS_CONFIG\
_IOWR('p', 0x14, struct stmvl53l1_autonomous_config_t)
/**
* suspend ranging (no argument)
* @note sysfs and ioctl control are assumed mutual exclusive use
* control from ioctl execute action with no consideration of sysfs path.
*
* @return
* @li 0 on success
* @li -EBUSY if it was already
* @li other specific error code shall be >0
*
* c example userland :
@code
int smtvl53l1_stop(int fd){
int rc;
rc= ioctl(fd, VL53L1_IOCTL_SUSPEND,NULL);
if( rc ){
if( errno == EBUSY ){
ioctl_warn("already suspended");
return errno;
}
ioctl_error("%d %s", rc,strerror(errno));
}
return rc;
}
@endcode
*/
#define VL53L1_IOCTL_SUSPEND _IO('p', 0x15)
/** @} */ /* ioctl group */
#endif /* STMVL53L1_IF_H */
#endif /* STMVL53L1_IF_H */

View file

@ -1,33 +1,33 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**************************************************************************
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
#ifndef STMVL53L1_INTERNAL_IF_H
#define STMVL53L1_INTERNAL_IF_H
@ -49,14 +49,17 @@ struct stmvl53l1_register {
uint8_t b; /*!< single data byte*/
uint16_t w; /*!< single data word (16 bits)*/
uint32_t dw; /*!< single data dword (32 bits)*/
uint8_t bytes[256]; /*!< any size byte array
* @note only effectively used array size is needed and will be
* set/used another possible register definition is
* @ref stmvl53l1_register_flexi
*/
} data; /*!< data only *@warning device is big endian and
* no endianess adaptation is performed by @ref VL53L1_IOCTL_REGISTER
*/
/*!< any size byte array
* @note only effectively used array size is needed and will be
* set/used another possible register definition is
* @ref stmvl53l1_register_flexi
*/
uint8_t bytes[256];
/*!< data only *@warning device is big endian and
* no endianess adaptation is performed by
* @ref VL53L1_IOCTL_REGISTER
*/
} data;
};
struct stmvl53l1_register_flexi {
@ -66,8 +69,8 @@ struct stmvl53l1_register_flexi {
int32_t status; /*!< [out] operation status 0 ok else error */
uint8_t data[]; /*!< [in/out] flexible array size data */
/*!< data only *@warning device is big endian and
* no endianess adaptation is performed by @ref VL53L1_IOCTL_REGISTER
*/
* no endianess adaptation is performed by @ref VL53L1_IOCTL_REGISTER
*/
};
#define VL53L1_IOCTL_REGISTER _IOWR('p', 0x0c, struct stmvl53l1_register)

View file

@ -1,33 +1,33 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**************************************************************************
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
/**
* @file stmvl53l1_ipp.h
@ -319,7 +319,7 @@ struct ipp_work_t {
*
* we substract size of of item above
* must be lesss than one netlink packet
*/
*/
#define MAX_IPP_DATA ((4096-4*3)/8)
ipp_arg_t data[MAX_IPP_DATA]; /*!< [in][out] */
};
@ -327,7 +327,7 @@ struct ipp_work_t {
/**
* size of header only message ( no payload)
* require \#include <stddef.h> in user land
*/
*/
#define IPP_WORK_HDR_SIZE (offsetof(struct ipp_work_t, data[0]))
/**
* max payload per ipp transfer

View file

@ -1,33 +1,33 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**************************************************************************
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
/**
* @file stmvl53l1_ipp_nl.c vl53l1 ipp proxy over netlink kernel side
@ -153,6 +153,9 @@ int ipp_in_process(struct ipp_work_t *pwork)
/* work id check already done */
data = stmvl53l1_dev_table[pwork->dev_id];
ipp_dbg("to lock ");
/* Release now useless ipp_mutex for below work since we may deadlock
* with irq path.
*/
mutex_unlock(&ipp_mutex);
mutex_lock(&data->work_mutex);
if (data->ipp.buzy == IPP_STATE_PENDING) {
@ -280,7 +283,7 @@ static void stmvl53l1_nl_recv_msg(struct sk_buff *skb_in)
mutex_lock(&ipp_mutex);
if (pwork->dev_id >= STMVL53L1_CFG_MAX_DEV) {
if ((pwork->dev_id >= STMVL53L1_CFG_MAX_DEV) || (pwork->dev_id < 0)) {
ipp_err("invalid dev id on msg %d", pwork->dev_id);
_ipp_dump_work(pwork, IPP_WORK_MAX_PAYLOAD,
STMVL53L1_CFG_MAX_DEV);

View file

@ -1,33 +1,33 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**************************************************************************
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
/**
* @file /stmvl53l1_module.c vl53l1_module ST VL53L1 linux kernel module
*

View file

@ -1,33 +1,33 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**************************************************************************
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
/**
* @file stmvl53l1_module-i2c.c
@ -109,7 +109,7 @@ static struct i2c_client *stm_test_i2c_client;
* panda
* insmod stmvl53l1.ko force_device=1 adapter_nb=4 xsdn_gpio_nb=56
* intr_gpio_nb=59 pwren_gpio_nb=55
*/
*/
static int force_device;
static int adapter_nb = -1;
@ -117,19 +117,19 @@ static int xsdn_gpio_nb = -1;
static int pwren_gpio_nb = -1;
static int intr_gpio_nb = -1;
module_param(force_device, int, 0);
module_param(force_device, int, 0000);
MODULE_PARM_DESC(force_device, "force device insertion at module init");
module_param(adapter_nb, int, 0);
module_param(adapter_nb, int, 0000);
MODULE_PARM_DESC(adapter_nb, "i2c adapter to use");
module_param(xsdn_gpio_nb, int, 0);
module_param(xsdn_gpio_nb, int, 0000);
MODULE_PARM_DESC(xsdn_gpio_nb, "select gpio numer to use for vl53l1 reset");
module_param(pwren_gpio_nb, int, 0);
module_param(pwren_gpio_nb, int, 0000);
MODULE_PARM_DESC(pwren_gpio_nb, "select gpio numer to use for vl53l1 power");
module_param(intr_gpio_nb, int, 0);
module_param(intr_gpio_nb, int, 0000);
MODULE_PARM_DESC(intr_gpio_nb, "select gpio numer to use for vl53l1 interrupt");
/**
@ -157,12 +157,6 @@ MODULE_PARM_DESC(intr_gpio_nb, "select gpio numer to use for vl53l1 interrupt");
# define modi2c_dbg(...) (void)0
#endif
struct vl53l1_pinctrl_info {
struct pinctrl *pinctrl;
struct pinctrl_state *gpio_state_active;
struct pinctrl_state *gpio_state_suspend;
} g_pinctrl_info;
static int insert_device(void)
{
int ret = 0;
@ -335,35 +329,6 @@ static void put_intr(struct i2c_data *i2c_data)
i2c_data->intr_gpio = -1;
}
static int get_dt_xtalk_data(struct device_node *of_node,
struct stmvl53l1_data *vl53l1_data)
{
int rc = 0;
uint32_t x_array[3] = {0};
if(of_node == NULL || vl53l1_data == NULL)
return -EINVAL;
rc = of_property_read_u32_array(of_node, "st,xtalkval",
x_array, 3);
if (rc) {
vl53l1_errmsg("failed to read xtalk-offset\n");
vl53l1_data->xtalk_offset = 0;
vl53l1_data->xtalk_x = 0;
vl53l1_data->xtalk_y = 0;
} else {
vl53l1_data->xtalk_offset = (uint16_t)x_array[0] & 0xFFFF;
vl53l1_data->xtalk_x = (int16_t)(x_array[1] & 0xFFFF);
vl53l1_data->xtalk_y = (int16_t)(x_array[2] & 0xFFFF);
}
vl53l1_info("xtalk info: %u %d %d\n",
vl53l1_data->xtalk_offset,
vl53l1_data->xtalk_x,
vl53l1_data->xtalk_y);
return rc;
}
/**
* parse dev tree for all platform specific input
*/
@ -385,7 +350,7 @@ static int stmvl53l1_parse_tree(struct device *dev, struct i2c_data *i2c_data)
i2c_data->intr_gpio = intr_gpio_nb;
} else if (dev->of_node) {
/* power : either vdd or pwren_gpio. try reulator first */
i2c_data->vdd = regulator_get(dev, "vdd-vl53l1");
i2c_data->vdd = regulator_get_optional(dev, "vdd");
if (IS_ERR(i2c_data->vdd) || i2c_data->vdd == NULL) {
i2c_data->vdd = NULL;
/* try gpio */
@ -397,40 +362,19 @@ static int stmvl53l1_parse_tree(struct device *dev, struct i2c_data *i2c_data)
"no regulator, nor power gpio => power ctrl disabled");
}
}
g_pinctrl_info.pinctrl = devm_pinctrl_get(dev);
if (!IS_ERR_OR_NULL(g_pinctrl_info.pinctrl)) {
g_pinctrl_info.gpio_state_active =
pinctrl_lookup_state(g_pinctrl_info.pinctrl,
"laser_default");
g_pinctrl_info.gpio_state_suspend =
pinctrl_lookup_state(g_pinctrl_info.pinctrl,
"laser_suspend");
} else
vl53l1_errmsg("Getting pinctrl handle failed\n");
rc = of_property_read_u32_array(dev->of_node, "xsdn-gpio",
&i2c_data->xsdn_gpio, 1);
if (rc) {
vl53l1_wanrmsg("Unable to find xsdn-gpio %d %d",
rc, i2c_data->xsdn_gpio);
if (of_gpio_count(dev->of_node) >= 2)
i2c_data->xsdn_gpio = of_get_gpio(dev->of_node,
0);
else
i2c_data->xsdn_gpio = -1;
i2c_data->xsdn_gpio = -1;
}
rc = of_property_read_u32_array(dev->of_node, "intr-gpio",
&i2c_data->intr_gpio, 1);
if (rc) {
vl53l1_wanrmsg("Unable to find intr-gpio %d %d",
rc, i2c_data->intr_gpio);
if (of_gpio_count(dev->of_node) >= 2)
i2c_data->intr_gpio = of_get_gpio(dev->of_node,
1);
else
i2c_data->intr_gpio = -1;
i2c_data->intr_gpio = -1;
}
rc = of_property_read_u32_array(dev->of_node, "boot-reg",
&i2c_data->boot_reg, 1);
@ -439,8 +383,6 @@ static int stmvl53l1_parse_tree(struct device *dev, struct i2c_data *i2c_data)
rc, i2c_data->boot_reg);
i2c_data->boot_reg = STMVL53L1_SLAVE_ADDR;
}
get_dt_xtalk_data(dev->of_node, i2c_data->vl53l1_data);
}
/* configure gpios */
@ -522,11 +464,6 @@ static int stmvl53l1_probe(struct i2c_client *client,
/* end up by core driver setup */
rc = stmvl53l1_setup(vl53l1_data);
if (rc)
goto release_gpios;
vl53l1_data->sysfs_base = i2c_data->client->addr;
rc = stmvl53l1_sysfs_laser(vl53l1_data, true);
if (rc)
goto release_gpios;
vl53l1_dbgmsg("End\n");
@ -553,9 +490,6 @@ static int stmvl53l1_remove(struct i2c_client *client)
vl53l1_dbgmsg("Enter\n");
mutex_lock(&data->work_mutex);
stmvl53l1_sysfs_laser(data, false);
/* main driver cleanup */
stmvl53l1_cleanup(data);
@ -571,6 +505,48 @@ static int stmvl53l1_remove(struct i2c_client *client)
return 0;
}
#ifdef CONFIG_PM_SLEEP
static int stmvl53l1_suspend(struct device *dev)
{
struct stmvl53l1_data *data = i2c_get_clientdata(to_i2c_client(dev));
vl53l1_dbgmsg("Enter\n");
mutex_lock(&data->work_mutex);
/* Stop ranging */
stmvl53l1_pm_suspend_stop(data);
mutex_unlock(&data->work_mutex);
vl53l1_dbgmsg("End\n");
return 0;
}
static int stmvl53l1_resume(struct device *dev)
{
#if 0
struct stmvl53l1_data *data = i2c_get_clientdata(to_i2c_client(dev));
vl53l1_dbgmsg("Enter\n");
mutex_lock(&data->work_mutex);
/* do nothing user will restart measurements */
mutex_unlock(&data->work_mutex);
vl53l1_dbgmsg("End\n");
#else
vl53l1_dbgmsg("Enter\n");
vl53l1_dbgmsg("End\n");
#endif
return 0;
}
#endif
static SIMPLE_DEV_PM_OPS(stmvl53l1_pm_ops, stmvl53l1_suspend, stmvl53l1_resume);
static const struct i2c_device_id stmvl53l1_id[] = {
{ STMVL53L1_DRV_NAME, 0 },
{ },
@ -587,6 +563,7 @@ static struct i2c_driver stmvl53l1_driver = {
.name = STMVL53L1_DRV_NAME,
.owner = THIS_MODULE,
.of_match_table = st_stmvl53l1_dt_match,
.pm = &stmvl53l1_pm_ops,
},
.probe = stmvl53l1_probe,
.remove = stmvl53l1_remove,
@ -725,8 +702,6 @@ int stmvl53l1_reset_release_i2c(void *i2c_object)
vl53l1_dbgmsg("Enter\n");
rc = release_reset(data);
pinctrl_select_state(g_pinctrl_info.pinctrl,
g_pinctrl_info.gpio_state_active);
if (rc)
goto error;
@ -761,9 +736,6 @@ int stmvl53l1_reset_hold_i2c(void *i2c_object)
gpio_set_value(data->xsdn_gpio, 0);
pinctrl_select_state(g_pinctrl_info.pinctrl,
g_pinctrl_info.gpio_state_suspend);
vl53l1_dbgmsg("End\n");
return 0;

File diff suppressed because it is too large Load diff

View file

@ -1,37 +1,37 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**************************************************************************
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
/*
* THIS IS A GENERATED FILE
*/
* THIS IS A GENERATED FILE
*/
#ifndef STMVL53L1_TUNINGS_H
#define STMVL53L1_TUNINGS_H

View file

@ -1,33 +1,33 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**************************************************************************
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
#ifndef _VL53L1_PLATFORM_H_
@ -269,25 +269,25 @@ VL53L1_Error VL53L1_WaitMs(
/**
* @brief Get the frequency of the timer used for ranging results time stamps
*
* @param[out] ptimer_freq_hz : pointer for timer frequency
*
* @brief Get the frequency of the timer used for ranging results time stamps
*
* @param[out] ptimer_freq_hz : pointer for timer frequency
*
* @return VL53L1_ERROR_NONE Success
* @return "Other error code" See ::VL53L1_Error
*/
*/
VL53L1_Error VL53L1_GetTimerFrequency(int32_t *ptimer_freq_hz);
/**
* @brief Get the timer value in units of timer_freq_hz (see
* VL53L1_get_timestamp_frequency())
*
* @param[out] ptimer_count : pointer for timer count value
*
* @brief Get the timer value in units of timer_freq_hz (see
* VL53L1_get_timestamp_frequency())
*
* @param[out] ptimer_count : pointer for timer count value
*
* @return VL53L1_ERROR_NONE Success
* @return "Other error code" See ::VL53L1_Error
*/
*/
VL53L1_Error VL53L1_GetTimerValue(int32_t *ptimer_count);

View file

@ -1,33 +1,33 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**************************************************************************
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
#ifndef _VL53L1_PLATFORM_IPP_H_

View file

@ -1,33 +1,33 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**************************************************************************
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
#ifndef _VL53L1_PLATFORM_IPP_IMPORTS_H_

View file

@ -1,33 +1,33 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**************************************************************************
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
/**
* @file vl53l1_platform_log.h

View file

@ -1,33 +1,33 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**************************************************************************
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
/**
* @file vl53l1_platform_user_config.h

View file

@ -1,33 +1,33 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**************************************************************************
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
#ifndef _VL53L1_PLATFORM_USER_DATA_H_
@ -48,11 +48,12 @@ extern "C"
#define VL53L1_Dev_t VL53L1_DevData_t
#define VL53L1_DEV VL53L1_DevData_t *
#define PALDevDataGet(Dev, field) (Dev->field)
#define PALDevDataSet(Dev, field, data) ((Dev->field) = (data))
#define VL53L1DevDataGet(Dev, field) (Dev->field)
#define VL53L1DevDataSet(Dev, field, data) ((Dev->field) = (data))
#define VL53L1DevStructGetLLDriverHandle(Dev) (&PALDevDataGet(Dev, LLData))
#define VL53L1DevStructGetLLResultsHandle(Dev) (&PALDevDataGet(Dev, llresults))
#define VL53L1DevStructGetLLDriverHandle(Dev) (&VL53L1DevDataGet(Dev, LLData))
#define VL53L1DevStructGetLLResultsHandle(Dev) (&VL53L1DevDataGet(Dev,\
llresults))
#ifdef __cplusplus
}

View file

@ -1,33 +1,33 @@
/*
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**************************************************************************
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
#ifndef _VL53L1_PLATFORM_USER_DEFINES_H_

View file

@ -1,33 +1,33 @@
/*******************************************************************************
*Copyright (c) 2016, STMicroelectronics - All Rights Reserved
*
* License terms: BSD 3-clause "New" or "Revised" License.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************/
/**************************************************************************
* Copyright (c) 2016, STMicroelectronics - All Rights Reserved
License terms: BSD 3-clause "New" or "Revised" License.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
/**
* @file vl53l1_types.h
* @brief VL53L1 types definition