vl53l1_api.h
Go to the documentation of this file.
1 
2 /*
3 * Copyright (c) 2017, STMicroelectronics - All Rights Reserved
4 *
5 * This file is part of VL53L1 Core and is dual licensed,
6 * either 'STMicroelectronics
7 * Proprietary license'
8 * or 'BSD 3-clause "New" or "Revised" License' , at your option.
9 *
10 ********************************************************************************
11 *
12 * 'STMicroelectronics Proprietary license'
13 *
14 ********************************************************************************
15 *
16 * License terms: STMicroelectronics Proprietary in accordance with licensing
17 * terms at www.st.com/sla0081
18 *
19 * STMicroelectronics confidential
20 * Reproduction and Communication of this document is strictly prohibited unless
21 * specifically authorized in writing by STMicroelectronics.
22 *
23 *
24 ********************************************************************************
25 *
26 * Alternatively, VL53L1 Core may be distributed under the terms of
27 * 'BSD 3-clause "New" or "Revised" License', in which case the following
28 * provisions apply instead of the ones mentioned above :
29 *
30 ********************************************************************************
31 *
32 * License terms: BSD 3-clause "New" or "Revised" License.
33 *
34 * Redistribution and use in source and binary forms, with or without
35 * modification, are permitted provided that the following conditions are met:
36 *
37 * 1. Redistributions of source code must retain the above copyright notice, this
38 * list of conditions and the following disclaimer.
39 *
40 * 2. Redistributions in binary form must reproduce the above copyright notice,
41 * this list of conditions and the following disclaimer in the documentation
42 * and/or other materials provided with the distribution.
43 *
44 * 3. Neither the name of the copyright holder nor the names of its contributors
45 * may be used to endorse or promote products derived from this software
46 * without specific prior written permission.
47 *
48 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
49 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
50 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
51 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
52 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
53 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
54 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
55 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
56 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
57 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
58 *
59 *
60 ********************************************************************************
61 *
62 */
63 
64 #ifndef _VL53L1_API_H_
65 #define _VL53L1_API_H_
66 
67 #include "vl53l1_api_strings.h"
68 #include "vl53l1_api_core.h"
69 
70 #ifdef __cplusplus
71 extern "C"
72 {
73 #endif
74 
75 #if !defined(VL53L1DevDataGet)
76 #warning "Usage of PALDevDataGet is deprecated define VL53L1DevDataGet instead\
77  in your vl53l1_platform_user_data.h file"
78 #define VL53L1DevDataGet(Dev, field) (Dev->Data.field)
79 #endif
80 
81 #if !defined(VL53L1DevDataSet)
82 #warning "Usage of PALDevDataSet is deprecated define VL53L1DevDataSet instead\
83  in your vl53l1_platform_user_data.h file"
84 #define VL53L1DevDataSet(Dev, field, data) ((Dev->Data.field) = (data))
85 #endif
86 
107 
121  uint8_t *pProductRevisionMajor, uint8_t *pProductRevisionMinor);
122 
135  VL53L1_DeviceInfo_t *pVL53L1_DeviceInfo);
136 
150  char *pRangeStatusString);
151 
164  char *pPalErrorString);
165 
178  char *pPalStateString);
179 
192  VL53L1_State *pPalState);
193 
194 
195 
222  uint8_t DeviceAddress);
223 
249 
250 
264 
275 
276 
310  VL53L1_PresetModes PresetMode);
311 
327  VL53L1_PresetModes *pPresetMode);
328 
329 
352  VL53L1_DistanceModes DistanceMode);
353 
365  VL53L1_DistanceModes *pDistanceMode);
366 
367 
368 
369 
390  VL53L1_DEV Dev, uint32_t MeasurementTimingBudgetMicroSeconds);
391 
407  VL53L1_DEV Dev, uint32_t *pMeasurementTimingBudgetMicroSeconds);
408 
409 
425  VL53L1_DEV Dev, uint32_t InterMeasurementPeriodMilliSeconds);
426 
438  VL53L1_DEV Dev, uint32_t *pInterMeasurementPeriodMilliSeconds);
439 
440 
462  uint16_t *pNumberOfLimitCheck);
463 
479  char *pLimitCheckString);
480 
512  uint16_t LimitCheckId, uint8_t *pLimitCheckStatus);
513 
535  uint16_t LimitCheckId, uint8_t LimitCheckEnable);
536 
559  uint16_t LimitCheckId, uint8_t *pLimitCheckEnable);
560 
582  uint16_t LimitCheckId, FixPoint1616_t LimitCheckValue);
583 
606  uint16_t LimitCheckId, FixPoint1616_t *pLimitCheckValue);
607 
626  uint16_t LimitCheckId, FixPoint1616_t *pLimitCheckCurrent);
627 
652  VL53L1_UserRoi_t *pUserROi);
653 
666  VL53L1_UserRoi_t *pUserROi);
667 
670 /* \internal */
692  uint8_t *pNumberOfSequenceSteps);
693 
710  VL53L1_SequenceStepId SequenceStepId, char *pSequenceStepsString);
711 
712 
713 
732  VL53L1_SequenceStepId SequenceStepId, uint8_t SequenceStepEnabled);
733 
752  VL53L1_SequenceStepId SequenceStepId, uint8_t *pSequenceStepEnabled);
753 
754 
756 /* \endinternal */
757 
758 
759 
788 
805 
816 
833  uint8_t *pMeasurementDataReady);
834 
849 
850 
876  VL53L1_RangingMeasurementData_t *pRangingMeasurementData);
877 
878 
879 
906  uint16_t TuningParameterId, int32_t TuningParameterValue);
907 
925  uint16_t TuningParameterId, int32_t *pTuningParameterValue);
926 
942 
943 
956 uint8_t XTalkCompensationEnable);
957 
972  uint8_t *pXTalkCompensationEnable);
973 
999  int32_t CalDistanceMilliMeter);
1000 
1001 
1019  VL53L1_OffsetCalibrationModes OffsetCalibrationMode);
1020 
1021 
1022 
1043  int32_t CalDistanceMilliMeter);
1044 
1070  int32_t CalDistanceMilliMeter);
1071 
1090  VL53L1_CalibrationData_t *pCalibrationData);
1091 
1109  VL53L1_CalibrationData_t *pCalibrationData);
1110 
1129  FixPoint1616_t *pOpticalCenterX,
1130  FixPoint1616_t *pOpticalCenterY);
1131 
1148  VL53L1_DetectionConfig_t *pConfig);
1149 
1159  VL53L1_DetectionConfig_t *pConfig);
1160 
1161 
1167 #ifdef __cplusplus
1168 }
1169 #endif
1170 
1171 #endif /* _VL53L1_API_H_ */
FixPoint1616_t
uint32_t FixPoint1616_t
Definition: vl53l1_types.h:147
VL53L1_SetLimitCheckEnable
VL53L1_Error VL53L1_SetLimitCheckEnable(VL53L1_DEV Dev, uint16_t LimitCheckId, uint8_t LimitCheckEnable)
Enable/Disable a specific limit check.
Definition: vl53l1_api.c:1430
VL53L1_DeviceInfo_t
Defines the parameters of the Get Device Info Functions.
Definition: vl53l1_def.h:113
uint32_t
unsigned int uint32_t
Typedef defining 32 bit unsigned int type. The developer should modify this to suit the platform bein...
Definition: vl53l1_types.h:113
uint8_t
unsigned char uint8_t
Typedef defining 8 bit unsigned char type. The developer should modify this to suit the platform bein...
Definition: vl53l1_types.h:133
VL53L1_DetectionConfig_t
Defines parameters for User/object Detection configuration.
Definition: vl53l1_def.h:276
VL53L1_StopMeasurement
VL53L1_Error VL53L1_StopMeasurement(VL53L1_DEV Dev)
Stop device measurement.
Definition: vl53l1_api.c:1794
VL53L1_RangingMeasurementData_t
Single Range measurement data.
Definition: vl53l1_def.h:348
VL53L1_GetPalStateString
VL53L1_Error VL53L1_GetPalStateString(VL53L1_State PalStateCode, char *pPalStateString)
Human readable driver State string.
Definition: vl53l1_api.c:717
VL53L1_GetSequenceStepsInfo
VL53L1_Error VL53L1_GetSequenceStepsInfo(VL53L1_SequenceStepId SequenceStepId, char *pSequenceStepsString)
Gets the name of a given sequence step.
Definition: vl53l1_api.c:1659
VL53L1_SetTuningParameter
VL53L1_Error VL53L1_SetTuningParameter(VL53L1_DEV Dev, uint16_t TuningParameterId, int32_t TuningParameterValue)
Set Tuning Parameter value for a given parameter ID.
Definition: vl53l1_api.c:2205
VL53L1_SetDeviceAddress
VL53L1_Error VL53L1_SetDeviceAddress(VL53L1_DEV Dev, uint8_t DeviceAddress)
Set new device address.
Definition: vl53l1_api.c:745
VL53L1_GetLimitCheckValue
VL53L1_Error VL53L1_GetLimitCheckValue(VL53L1_DEV Dev, uint16_t LimitCheckId, FixPoint1616_t *pLimitCheckValue)
Get a specific limit check value.
Definition: vl53l1_api.c:1523
VL53L1_SetUserROI
VL53L1_Error VL53L1_SetUserROI(VL53L1_DEV Dev, VL53L1_UserRoi_t *pUserROi)
Set the ROI to be used for ranging.
Definition: vl53l1_api.c:1597
VL53L1_GetNumberOfLimitCheck
VL53L1_Error VL53L1_GetNumberOfLimitCheck(uint16_t *pNumberOfLimitCheck)
Get the number of the check limit managed by a given Device.
Definition: vl53l1_api.c:1358
VL53L1_GetMeasurementDataReady
VL53L1_Error VL53L1_GetMeasurementDataReady(VL53L1_DEV Dev, uint8_t *pMeasurementDataReady)
Return Measurement Data Ready.
Definition: vl53l1_api.c:1910
VL53L1_SetXTalkCompensationEnable
VL53L1_Error VL53L1_SetXTalkCompensationEnable(VL53L1_DEV Dev, uint8_t XTalkCompensationEnable)
Enable/Disable Cross talk compensation feature.
Definition: vl53l1_api.c:2332
vl53l1_api_core.h
EwokPlus25 low level API function definitions.
VL53L1_State
uint8_t VL53L1_State
Definition: vl53l1_def.h:321
VL53L1_Version_t
Defines the parameters of the Get Version Functions.
Definition: vl53l1_def.h:101
VL53L1_DistanceModes
uint8_t VL53L1_DistanceModes
Definition: vl53l1_def.h:150
VL53L1_GetOpticalCenter
VL53L1_Error VL53L1_GetOpticalCenter(VL53L1_DEV Dev, FixPoint1616_t *pOpticalCenterX, FixPoint1616_t *pOpticalCenterY)
Gets the optical center.
Definition: vl53l1_api.c:2719
VL53L1_GetPresetMode
VL53L1_Error VL53L1_GetPresetMode(VL53L1_DEV Dev, VL53L1_PresetModes *pPresetMode)
Get current Preset Mode.
Definition: vl53l1_api.c:1009
VL53L1_GetNumberOfSequenceSteps
VL53L1_Error VL53L1_GetNumberOfSequenceSteps(VL53L1_DEV Dev, uint8_t *pNumberOfSequenceSteps)
Gets number of sequence steps managed by the API.
Definition: vl53l1_api.c:1644
VL53L1_PerformOffsetCalibration
VL53L1_Error VL53L1_PerformOffsetCalibration(VL53L1_DEV Dev, int32_t CalDistanceMilliMeter)
Perform Offset Calibration.
Definition: vl53l1_api.c:2411
VL53L1_GetDeviceInfo
VL53L1_Error VL53L1_GetDeviceInfo(VL53L1_DEV Dev, VL53L1_DeviceInfo_t *pVL53L1_DeviceInfo)
Reads the Device information for given Device.
Definition: vl53l1_api.c:648
VL53L1_WaitMeasurementDataReady
VL53L1_Error VL53L1_WaitMeasurementDataReady(VL53L1_DEV Dev)
Wait for measurement data ready. Blocking function. Note that the timeout is given by: VL53L1_RANGE_C...
Definition: vl53l1_api.c:1923
VL53L1_PerformOffsetSimpleCalibration
VL53L1_Error VL53L1_PerformOffsetSimpleCalibration(VL53L1_DEV Dev, int32_t CalDistanceMilliMeter)
Perform Offset simple Calibration.
Definition: vl53l1_api.c:2457
VL53L1_GetInterMeasurementPeriodMilliSeconds
VL53L1_Error VL53L1_GetInterMeasurementPeriodMilliSeconds(VL53L1_DEV Dev, uint32_t *pInterMeasurementPeriodMilliSeconds)
Definition: vl53l1_api.c:1334
VL53L1_PerformRefSpadManagement
VL53L1_Error VL53L1_PerformRefSpadManagement(VL53L1_DEV Dev)
Performs Reference Spad Management.
Definition: vl53l1_api.c:2249
VL53L1_SetThresholdConfig
VL53L1_Error VL53L1_SetThresholdConfig(VL53L1_DEV Dev, VL53L1_DetectionConfig_t *pConfig)
Configure the interrupt config, from the given structure.
Definition: vl53l1_api.c:2747
VL53L1_Dev_t
Definition: vl53l1_platform_user_data.h:78
VL53L1_GetPalState
VL53L1_Error VL53L1_GetPalState(VL53L1_DEV Dev, VL53L1_State *pPalState)
Reads the internal state of the driver for a given Device.
Definition: vl53l1_api.c:730
VL53L1_GetSequenceStepEnable
VL53L1_Error VL53L1_GetSequenceStepEnable(VL53L1_DEV Dev, VL53L1_SequenceStepId SequenceStepId, uint8_t *pSequenceStepEnabled)
Gets the (on/off) state of a requested sequence step.
Definition: vl53l1_api.c:1708
VL53L1_GetXTalkCompensationEnable
VL53L1_Error VL53L1_GetXTalkCompensationEnable(VL53L1_DEV Dev, uint8_t *pXTalkCompensationEnable)
Get Cross talk compensation rate enable.
Definition: vl53l1_api.c:2349
VL53L1_GetLimitCheckEnable
VL53L1_Error VL53L1_GetLimitCheckEnable(VL53L1_DEV Dev, uint16_t LimitCheckId, uint8_t *pLimitCheckEnable)
Get specific limit check enable state.
Definition: vl53l1_api.c:1464
VL53L1_GetThresholdConfig
VL53L1_Error VL53L1_GetThresholdConfig(VL53L1_DEV Dev, VL53L1_DetectionConfig_t *pConfig)
Retrieves the interrupt config structure currently programmed into the API.
Definition: vl53l1_api.c:2850
VL53L1_GetVersion
VL53L1_Error VL53L1_GetVersion(VL53L1_Version_t *pVersion)
Return the VL53L1 driver Version.
Definition: vl53l1_api.c:613
VL53L1_StaticInit
VL53L1_Error VL53L1_StaticInit(VL53L1_DEV Dev)
Do basic device init (and eventually patch loading) This function will change the VL53L1_State from V...
Definition: vl53l1_api.c:811
VL53L1_PresetModes
uint8_t VL53L1_PresetModes
Definition: vl53l1_def.h:136
VL53L1_OffsetCalibrationModes
uint8_t VL53L1_OffsetCalibrationModes
Definition: vl53l1_def.h:180
VL53L1_GetPalErrorString
VL53L1_Error VL53L1_GetPalErrorString(VL53L1_Error PalErrorCode, char *pPalErrorString)
Human readable error string for driver error status.
Definition: vl53l1_api.c:704
VL53L1_GetRangeStatusString
VL53L1_Error VL53L1_GetRangeStatusString(uint8_t RangeStatus, char *pRangeStatusString)
Human readable Range Status string for a given RangeStatus.
Definition: vl53l1_api.c:690
VL53L1_PerformSingleTargetXTalkCalibration
VL53L1_Error VL53L1_PerformSingleTargetXTalkCalibration(VL53L1_DEV Dev, int32_t CalDistanceMilliMeter)
Perform XTalk Calibration.
Definition: vl53l1_api.c:2364
VL53L1_SetMeasurementTimingBudgetMicroSeconds
VL53L1_Error VL53L1_SetMeasurementTimingBudgetMicroSeconds(VL53L1_DEV Dev, uint32_t MeasurementTimingBudgetMicroSeconds)
Set Ranging Timing Budget in microseconds.
Definition: vl53l1_api.c:1116
VL53L1_SetPresetMode
VL53L1_Error VL53L1_SetPresetMode(VL53L1_DEV Dev, VL53L1_PresetModes PresetMode)
Set a new Preset Mode.
Definition: vl53l1_api.c:968
vl53l1_api_strings.h
VL53L1 API function declarations for decoding error codes to a text strings.
int32_t
int int32_t
Typedef defining 32 bit int type. The developer should modify this to suit the platform being deploye...
Definition: vl53l1_types.h:118
VL53L1_GetLimitCheckInfo
VL53L1_Error VL53L1_GetLimitCheckInfo(uint16_t LimitCheckId, char *pLimitCheckString)
Return a description string for a given limit check number.
Definition: vl53l1_api.c:1370
VL53L1_GetLimitCheckStatus
VL53L1_Error VL53L1_GetLimitCheckStatus(VL53L1_DEV Dev, uint16_t LimitCheckId, uint8_t *pLimitCheckStatus)
Return a the Status of the specified check limit.
Definition: vl53l1_api.c:1384
VL53L1_SetInterMeasurementPeriodMilliSeconds
VL53L1_Error VL53L1_SetInterMeasurementPeriodMilliSeconds(VL53L1_DEV Dev, uint32_t InterMeasurementPeriodMilliSeconds)
Definition: vl53l1_api.c:1315
VL53L1_ClearInterruptAndStartMeasurement
VL53L1_Error VL53L1_ClearInterruptAndStartMeasurement(VL53L1_DEV Dev)
Clear the Interrupt flag and start new measurement *.
Definition: vl53l1_api.c:1883
VL53L1_GetTuningParameter
VL53L1_Error VL53L1_GetTuningParameter(VL53L1_DEV Dev, uint16_t TuningParameterId, int32_t *pTuningParameterValue)
Get Tuning Parameter value for a given parameter ID.
Definition: vl53l1_api.c:2226
VL53L1_SetCalibrationData
VL53L1_Error VL53L1_SetCalibrationData(VL53L1_DEV Dev, VL53L1_CalibrationData_t *pCalibrationData)
Sets the Calibration Data.
Definition: vl53l1_api.c:2554
VL53L1_StartMeasurement
VL53L1_Error VL53L1_StartMeasurement(VL53L1_DEV Dev)
Start device measurement.
Definition: vl53l1_api.c:1732
VL53L1_GetLimitCheckCurrent
VL53L1_Error VL53L1_GetLimitCheckCurrent(VL53L1_DEV Dev, uint16_t LimitCheckId, FixPoint1616_t *pLimitCheckCurrent)
Get the current value of the signal used for the limit check.
Definition: vl53l1_api.c:1570
VL53L1_GetUserROI
VL53L1_Error VL53L1_GetUserROI(VL53L1_DEV Dev, VL53L1_UserRoi_t *pUserROi)
Get the ROI managed by the Device.
Definition: vl53l1_api.c:1620
VL53L1_SetOffsetCalibrationMode
VL53L1_Error VL53L1_SetOffsetCalibrationMode(VL53L1_DEV Dev, VL53L1_OffsetCalibrationModes OffsetCalibrationMode)
Define the mode to be used for the offset calibration.
Definition: vl53l1_api.c:2383
VL53L1_DataInit
VL53L1_Error VL53L1_DataInit(VL53L1_DEV Dev)
One time device initialization.
Definition: vl53l1_api.c:758
VL53L1_GetProductRevision
VL53L1_Error VL53L1_GetProductRevision(VL53L1_DEV Dev, uint8_t *pProductRevisionMajor, uint8_t *pProductRevisionMinor)
Reads the Product Revision for a for given Device This function can be used to distinguish cut1....
Definition: vl53l1_api.c:629
VL53L1_SetLimitCheckValue
VL53L1_Error VL53L1_SetLimitCheckValue(VL53L1_DEV Dev, uint16_t LimitCheckId, FixPoint1616_t LimitCheckValue)
Set a specific limit check value.
Definition: vl53l1_api.c:1486
VL53L1_WaitDeviceBooted
VL53L1_Error VL53L1_WaitDeviceBooted(VL53L1_DEV Dev)
Wait for device booted after chip enable (hardware standby) This function can be run only when VL53L1...
Definition: vl53l1_api.c:840
VL53L1_Error
int8_t VL53L1_Error
Definition: vl53l1_error_codes.h:89
VL53L1_GetDistanceMode
VL53L1_Error VL53L1_GetDistanceMode(VL53L1_DEV Dev, VL53L1_DistanceModes *pDistanceMode)
Get the distance mode.
Definition: vl53l1_api.c:1100
uint16_t
unsigned short uint16_t
Typedef defining 16 bit unsigned short type. The developer should modify this to suit the platform be...
Definition: vl53l1_types.h:123
VL53L1_GetCalibrationData
VL53L1_Error VL53L1_GetCalibrationData(VL53L1_DEV Dev, VL53L1_CalibrationData_t *pCalibrationData)
Gets the Calibration Data.
Definition: vl53l1_api.c:2635
VL53L1_GetMeasurementTimingBudgetMicroSeconds
VL53L1_Error VL53L1_GetMeasurementTimingBudgetMicroSeconds(VL53L1_DEV Dev, uint32_t *pMeasurementTimingBudgetMicroSeconds)
Get Ranging Timing Budget in microseconds.
Definition: vl53l1_api.c:1233
VL53L1_SequenceStepId
uint8_t VL53L1_SequenceStepId
Definition: vl53l1_def.h:479
VL53L1_UserRoi_t
Defines User Zone(ROI) parameters.
Definition: vl53l1_def.h:404
VL53L1_GetRangingMeasurementData
VL53L1_Error VL53L1_GetRangingMeasurementData(VL53L1_DEV Dev, VL53L1_RangingMeasurementData_t *pRangingMeasurementData)
Retrieve the measurements from device for a given setup.
Definition: vl53l1_api.c:2159
VL53L1_SetDistanceMode
VL53L1_Error VL53L1_SetDistanceMode(VL53L1_DEV Dev, VL53L1_DistanceModes DistanceMode)
Set the distance mode.
Definition: vl53l1_api.c:1022
VL53L1_SetSequenceStepEnable
VL53L1_Error VL53L1_SetSequenceStepEnable(VL53L1_DEV Dev, VL53L1_SequenceStepId SequenceStepId, uint8_t SequenceStepEnabled)
Sets the (on/off) state of a requested sequence step.
Definition: vl53l1_api.c:1675
VL53L1_CalibrationData_t
Structure for storing the Calibration Data.
Definition: vl53l1_def.h:450


vl53l1x
Author(s):
autogenerated on Fri Aug 2 2024 08:35:54