73 #define VL53L1X_IMPLEMENTATION_VER_MAJOR 3
74 #define VL53L1X_IMPLEMENTATION_VER_MINOR 3
75 #define VL53L1X_IMPLEMENTATION_VER_SUB 0
76 #define VL53L1X_IMPLEMENTATION_VER_REVISION 0000
78 typedef int8_t VL53L1X_ERROR;
80 #define SOFT_RESET 0x0000
81 #define VL53L1_I2C_SLAVE__DEVICE_ADDRESS 0x0001
82 #define VL53L1_VHV_CONFIG__TIMEOUT_MACROP_LOOP_BOUND 0x0008
83 #define ALGO__CROSSTALK_COMPENSATION_PLANE_OFFSET_KCPS 0x0016
84 #define ALGO__CROSSTALK_COMPENSATION_X_PLANE_GRADIENT_KCPS 0x0018
85 #define ALGO__CROSSTALK_COMPENSATION_Y_PLANE_GRADIENT_KCPS 0x001A
86 #define ALGO__PART_TO_PART_RANGE_OFFSET_MM 0x001E
87 #define MM_CONFIG__INNER_OFFSET_MM 0x0020
88 #define MM_CONFIG__OUTER_OFFSET_MM 0x0022
89 #define GPIO_HV_MUX__CTRL 0x0030
90 #define GPIO__TIO_HV_STATUS 0x0031
91 #define SYSTEM__INTERRUPT_CONFIG_GPIO 0x0046
92 #define PHASECAL_CONFIG__TIMEOUT_MACROP 0x004B
93 #define RANGE_CONFIG__TIMEOUT_MACROP_A_HI 0x005E
94 #define RANGE_CONFIG__VCSEL_PERIOD_A 0x0060
95 #define RANGE_CONFIG__VCSEL_PERIOD_B 0x0063
96 #define RANGE_CONFIG__TIMEOUT_MACROP_B_HI 0x0061
97 #define RANGE_CONFIG__TIMEOUT_MACROP_B_LO 0x0062
98 #define RANGE_CONFIG__SIGMA_THRESH 0x0064
99 #define RANGE_CONFIG__MIN_COUNT_RATE_RTN_LIMIT_MCPS 0x0066
100 #define RANGE_CONFIG__VALID_PHASE_HIGH 0x0069
101 #define VL53L1_SYSTEM__INTERMEASUREMENT_PERIOD 0x006C
102 #define SYSTEM__THRESH_HIGH 0x0072
103 #define SYSTEM__THRESH_LOW 0x0074
104 #define SD_CONFIG__WOI_SD0 0x0078
105 #define SD_CONFIG__INITIAL_PHASE_SD0 0x007A
106 #define ROI_CONFIG__USER_ROI_CENTRE_SPAD 0x007F
107 #define ROI_CONFIG__USER_ROI_REQUESTED_GLOBAL_XY_SIZE 0x0080
108 #define SYSTEM__SEQUENCE_CONFIG 0x0081
109 #define VL53L1_SYSTEM__GROUPED_PARAMETER_HOLD 0x0082
110 #define SYSTEM__INTERRUPT_CLEAR 0x0086
111 #define SYSTEM__MODE_START 0x0087
112 #define VL53L1_RESULT__RANGE_STATUS 0x0089
113 #define VL53L1_RESULT__DSS_ACTUAL_EFFECTIVE_SPADS_SD0 0x008C
114 #define RESULT__AMBIENT_COUNT_RATE_MCPS_SD 0x0090
115 #define VL53L1_RESULT__FINAL_CROSSTALK_CORRECTED_RANGE_MM_SD0 0x0096
116 #define VL53L1_RESULT__PEAK_SIGNAL_COUNT_RATE_CROSSTALK_CORRECTED_MCPS_SD0 0x0098
117 #define VL53L1_RESULT__OSC_CALIBRATE_VAL 0x00DE
118 #define VL53L1_FIRMWARE__SYSTEM_STATUS 0x00E5
119 #define VL53L1_IDENTIFICATION__MODEL_ID 0x010F
120 #define VL53L1_ROI_CONFIG__MODE_ROI_CENTRE_SPAD 0x013E
229 uint32_t InterMeasurementInMs);
324 uint16_t ThreshHigh, uint8_t Window,
325 uint8_t IntOnNoTarget);
348 VL53L1X_ERROR
VL53L1X_SetROI(uint16_t dev, uint16_t X, uint16_t Y);
VL53L1X_ERROR VL53L1X_GetAmbientPerSpad(uint16_t dev, uint16_t *amb)
This function returns the ambient per SPAD in kcps/SPAD.
Definition: VL53L1X_api.c:570
VL53L1X_ERROR VL53L1X_GetDistance(uint16_t dev, uint16_t *distance)
This function returns the distance measured by the sensor in mm.
Definition: VL53L1X_api.c:546
VL53L1X_ERROR VL53L1X_GetOffset(uint16_t dev, int16_t *Offset)
This function returns the programmed offset correction value in mm.
Definition: VL53L1X_api.c:658
VL53L1X_ERROR VL53L1X_SetROICenter(uint16_t dev, uint8_t ROICenter)
This function programs the new user ROI center, please to be aware that there is no check in this fun...
Definition: VL53L1X_api.c:745
VL53L1X_ERROR VL53L1X_GetSigmaThreshold(uint16_t dev, uint16_t *signal)
This function returns the current sigma threshold in mm.
Definition: VL53L1X_api.c:822
VL53L1X_ERROR VL53L1X_GetSensorId(uint16_t dev, uint16_t *id)
This function returns the sensor id, sensor Id must be 0xEEAC.
Definition: VL53L1X_api.c:536
VL53L1X_ERROR VL53L1X_GetXtalk(uint16_t dev, uint16_t *Xtalk)
This function returns the current programmed xtalk correction value in cps.
Definition: VL53L1X_api.c:685
VL53L1X_ERROR VL53L1X_SetSigmaThreshold(uint16_t dev, uint16_t sigma)
This function programs a new sigma threshold in mm (default=15 mm)
Definition: VL53L1X_api.c:810
VL53L1X_ERROR VL53L1X_StopRanging(uint16_t dev)
This function stops the ranging.
Definition: VL53L1X_api.c:283
VL53L1X_ERROR VL53L1X_GetSpadNb(uint16_t dev, uint16_t *spNb)
This function returns the current number of enabled SPADs.
Definition: VL53L1X_api.c:592
VL53L1X_ERROR VL53L1X_GetRangeStatus(uint16_t dev, uint8_t *rangeStatus)
This function returns the ranging status error (0:no error, 1:sigma failed, 2:signal failed,...
Definition: VL53L1X_api.c:613
VL53L1X_ERROR VL53L1X_SetOffset(uint16_t dev, int16_t OffsetValue)
This function programs the offset correction in mm.
Definition: VL53L1X_api.c:645
VL53L1X_ERROR VL53L1X_CheckForDataReady(uint16_t dev, uint8_t *isDataReady)
This function checks if the new ranging data is available by polling the dedicated register.
Definition: VL53L1X_api.c:291
VL53L1X_ERROR VL53L1X_GetResult(uint16_t dev, VL53L1X_Result_t *pResult)
This function returns measurements and the range status in a single read access.
Definition: VL53L1X_api.c:626
VL53L1X_ERROR VL53L1X_GetROI_XY(uint16_t dev, uint16_t *ROI_X, uint16_t *ROI_Y)
This function returns width X and height Y.
Definition: VL53L1X_api.c:780
VL53L1X_ERROR VL53L1X_StartRanging(uint16_t dev)
This function starts the ranging distance operation The ranging operation is continuous....
Definition: VL53L1X_api.c:275
VL53L1X_ERROR VL53L1X_GetSignalPerSpad(uint16_t dev, uint16_t *signalPerSp)
This function returns the returned signal per SPAD in kcps/SPAD. With kcps stands for Kilo Count Per ...
Definition: VL53L1X_api.c:557
VL53L1X_ERROR VL53L1X_GetSignalThreshold(uint16_t dev, uint16_t *signal)
This function returns the current signal threshold in kcps.
Definition: VL53L1X_api.c:799
VL53L1X_ERROR VL53L1X_SetXtalk(uint16_t dev, uint16_t XtalkValue)
This function programs the xtalk correction value in cps (Count Per Second). This is the number of ph...
Definition: VL53L1X_api.c:670
VL53L1X_ERROR VL53L1X_GetDistanceMode(uint16_t dev, uint16_t *pDistanceMode)
This function returns the current distance mode (1=short, 2=long).
Definition: VL53L1X_api.c:487
VL53L1X_ERROR VL53L1X_GetInterMeasurementInMs(uint16_t dev, uint16_t *pIM)
This function returns the Intermeasurement period in ms.
Definition: VL53L1X_api.c:512
VL53L1X_ERROR VL53L1X_GetROICenter(uint16_t dev, uint8_t *ROICenter)
This function returns the current user ROI center.
Definition: VL53L1X_api.c:752
VL53L1X_ERROR VL53L1X_GetSWVersion(VL53L1X_Version_t *pVersion)
This function returns the SW driver version.
Definition: VL53L1X_api.c:206
VL53L1X_ERROR VL53L1X_SetDistanceThreshold(uint16_t dev, uint16_t ThreshLow, uint16_t ThreshHigh, uint8_t Window, uint8_t IntOnNoTarget)
This function programs the threshold detection mode Example: VL53L1X_SetDistanceThreshold(dev,...
Definition: VL53L1X_api.c:695
VL53L1X_ERROR VL53L1X_GetDistanceThresholdLow(uint16_t dev, uint16_t *low)
This function returns the low threshold in mm.
Definition: VL53L1X_api.c:725
VL53L1X_ERROR VL53L1X_SetI2CAddress(uint16_t, uint8_t new_address)
This function sets the sensor I2C address used in case multiple devices application,...
Definition: VL53L1X_api.c:217
VL53L1X_ERROR VL53L1X_SetInterMeasurementInMs(uint16_t dev, uint32_t InterMeasurementInMs)
This function programs the Intermeasurement period in ms Intermeasurement period must be >/= timing b...
Definition: VL53L1X_api.c:499
VL53L1X_ERROR VL53L1X_ClearInterrupt(uint16_t dev)
This function clears the interrupt, to be called after a ranging data reading to arm the interrupt fo...
Definition: VL53L1X_api.c:245
VL53L1X_ERROR VL53L1X_SetROI(uint16_t dev, uint16_t X, uint16_t Y)
This function programs the ROI (Region of Interest) The ROI position is centered, only the ROI size c...
Definition: VL53L1X_api.c:761
VL53L1X_ERROR VL53L1X_BootState(uint16_t dev, uint8_t *state)
This function returns the boot state of the device (1:booted, 0:not booted)
Definition: VL53L1X_api.c:526
VL53L1X_ERROR VL53L1X_GetInterruptPolarity(uint16_t dev, uint8_t *pIntPol)
This function returns the current interrupt polarity 1=active high (default), 0=active low.
Definition: VL53L1X_api.c:264
VL53L1X_ERROR VL53L1X_GetDistanceThresholdWindow(uint16_t dev, uint16_t *window)
This function returns the window detection mode (0=below; 1=above; 2=out; 3=in)
Definition: VL53L1X_api.c:716
VL53L1X_ERROR VL53L1X_SetTimingBudgetInMs(uint16_t dev, uint16_t TimingBudgetInMs)
This function programs the timing budget in ms. Predefined values = 15, 20, 33, 50,...
Definition: VL53L1X_api.c:309
VL53L1X_ERROR VL53L1X_SetDistanceMode(uint16_t dev, uint16_t DistanceMode)
This function programs the distance mode (1=short, 2=long(default)). Short mode max distance is limit...
Definition: VL53L1X_api.c:452
VL53L1X_ERROR VL53L1X_GetDistanceThresholdHigh(uint16_t dev, uint16_t *high)
This function returns the high threshold in mm.
Definition: VL53L1X_api.c:735
VL53L1X_ERROR VL53L1X_GetTimingBudgetInMs(uint16_t dev, uint16_t *pTimingBudgetInMs)
This function returns the current timing budget in ms.
Definition: VL53L1X_api.c:411
VL53L1X_ERROR VL53L1X_SetInterruptPolarity(uint16_t dev, uint8_t IntPol)
This function programs the interrupt polarity 1=active high (default), 0=active low.
Definition: VL53L1X_api.c:253
VL53L1X_ERROR VL53L1X_StartTemperatureUpdate(uint16_t dev)
This function performs the temperature calibration. It is recommended to call this function any time ...
Definition: VL53L1X_api.c:833
VL53L1X_ERROR VL53L1X_GetSignalRate(uint16_t dev, uint16_t *signalRate)
This function returns the returned signal in kcps.
Definition: VL53L1X_api.c:581
VL53L1X_ERROR VL53L1X_GetAmbientRate(uint16_t dev, uint16_t *ambRate)
This function returns the ambient rate in kcps.
Definition: VL53L1X_api.c:603
VL53L1X_ERROR VL53L1X_SensorInit(uint16_t dev)
This function loads the 135 bytes default values to initialize the sensor.
Definition: VL53L1X_api.c:225
VL53L1X_ERROR VL53L1X_SetSignalThreshold(uint16_t dev, uint16_t signal)
This function programs a new signal threshold in kcps (default=1024 kcps .
Definition: VL53L1X_api.c:791
defines packed reading results type
Definition: VL53L1X_api.h:139
uint16_t SigPerSPAD
Definition: VL53L1X_api.h:143
uint16_t Distance
Definition: VL53L1X_api.h:141
uint16_t Ambient
Definition: VL53L1X_api.h:142
uint16_t NumSPADs
Definition: VL53L1X_api.h:144
uint8_t Status
Definition: VL53L1X_api.h:140
defines SW Version
Definition: VL53L1X_api.h:129
uint8_t build
Definition: VL53L1X_api.h:132
uint8_t minor
Definition: VL53L1X_api.h:131
uint32_t revision
Definition: VL53L1X_api.h:133
uint8_t major
Definition: VL53L1X_api.h:130