VL53L0X API Specification: vl53l0x_api_core.h Source File

VL53L0X API

vl53l0x_api_core.h
Go to the documentation of this file.
1 /*******************************************************************************
2 Copyright � 2016, STMicroelectronics International N.V.
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7  * Redistributions of source code must retain the above copyright
8  notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in the
11  documentation and/or other materials provided with the distribution.
12  * Neither the name of STMicroelectronics nor the
13  names of its contributors may be used to endorse or promote products
14  derived from this software without specific prior written permission.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
19 NON-INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED.
20 IN NO EVENT SHALL STMICROELECTRONICS INTERNATIONAL N.V. BE LIABLE FOR ANY
21 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *******************************************************************************/
28 
29 #ifndef _VL53L0X_API_CORE_H_
30 #define _VL53L0X_API_CORE_H_
31 
32 #include "vl53l0x_def.h"
33 #include "vl53l0x_platform.h"
34 
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 
42 
44 
45 uint8_t VL53L0X_encode_vcsel_period(uint8_t vcsel_period_pclks);
46 
48 
50 
52 
54 
56  VL53L0X_VcselPeriod VcselPeriodType, uint8_t VCSELPulsePeriodPCLK);
57 
59  VL53L0X_VcselPeriod VcselPeriodType, uint8_t *pVCSELPulsePeriodPCLK);
60 
62 
64  VL53L0X_SequenceStepId SequenceStepId,
65  uint32_t *pTimeOutMicroSecs);
66 
68  VL53L0X_SequenceStepId SequenceStepId,
69  uint32_t TimeOutMicroSecs);
70 
72  uint32_t MeasurementTimingBudgetMicroSeconds);
73 
75  uint32_t *pMeasurementTimingBudgetMicroSeconds);
76 
78  uint8_t *pTuningSettingBuffer);
79 
81  VL53L0X_RangingMeasurementData_t *pRangingMeasurementData,
82  FixPoint1616_t *pSigmaEstimate, uint32_t *pDmax_mm);
83 
85  VL53L0X_RangingMeasurementData_t *pRangingMeasurementData,
86  FixPoint1616_t *ptotal_xtalk_rate_mcps);
87 
89  VL53L0X_RangingMeasurementData_t *pRangingMeasurementData,
90  FixPoint1616_t *ptotal_signal_rate_mcps);
91 
93  uint8_t DeviceRangeStatus,
94  FixPoint1616_t SignalRate,
95  uint16_t EffectiveSpadRtnCount,
96  VL53L0X_RangingMeasurementData_t *pRangingMeasurementData,
97  uint8_t *pPalRangeStatus);
98 
100  uint32_t timeout_period_us, uint8_t vcsel_period_pclks);
101 
102 uint16_t VL53L0X_encode_timeout(uint32_t timeout_macro_clks);
103 
104 #ifdef __cplusplus
105 }
106 #endif
107 
108 #endif /* _VL53L0X_API_CORE_H_ */
uint32_t VL53L0X_isqrt(uint32_t num)
VL53L0X_Error get_sequence_step_timeout(VL53L0X_DEV Dev, VL53L0X_SequenceStepId SequenceStepId, uint32_t *pTimeOutMicroSecs)
uint32_t VL53L0X_decode_timeout(uint16_t encoded_timeout)
VL53L0X_Error VL53L0X_reverse_bytes(uint8_t *data, uint32_t size)
VL53L0X_Error VL53L0X_calc_sigma_estimate(VL53L0X_DEV Dev, VL53L0X_RangingMeasurementData_t *pRangingMeasurementData, FixPoint1616_t *pSigmaEstimate, uint32_t *pDmax_mm)
uint8_t VL53L0X_SequenceStepId
Definition: vl53l0x_def.h:540
VL53L0X_Error VL53L0X_get_info_from_device(VL53L0X_DEV Dev, uint8_t option)
VL53L0X_Error VL53L0X_set_measurement_timing_budget_micro_seconds(VL53L0X_DEV Dev, uint32_t MeasurementTimingBudgetMicroSeconds)
VL53L0X_Error VL53L0X_get_vcsel_pulse_period(VL53L0X_DEV Dev, VL53L0X_VcselPeriod VcselPeriodType, uint8_t *pVCSELPulsePeriodPCLK)
Function prototype definitions for Ewok Platform layer.
VL53L0X_Error VL53L0X_get_total_signal_rate(VL53L0X_DEV Dev, VL53L0X_RangingMeasurementData_t *pRangingMeasurementData, FixPoint1616_t *ptotal_signal_rate_mcps)
uint32_t VL53L0X_quadrature_sum(uint32_t a, uint32_t b)
VL53L0X_Error VL53L0X_get_pal_range_status(VL53L0X_DEV Dev, uint8_t DeviceRangeStatus, FixPoint1616_t SignalRate, uint16_t EffectiveSpadRtnCount, VL53L0X_RangingMeasurementData_t *pRangingMeasurementData, uint8_t *pPalRangeStatus)
VL53L0X_Error VL53L0X_measurement_poll_for_completion(VL53L0X_DEV Dev)
uint8_t VL53L0X_VcselPeriod
Definition: vl53l0x_def.h:510
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
Definition: vl53l0x_types.h:85
VL53L0X_Error set_sequence_step_timeout(VL53L0X_DEV Dev, VL53L0X_SequenceStepId SequenceStepId, uint32_t TimeOutMicroSecs)
VL53L0X_Error VL53L0X_get_measurement_timing_budget_micro_seconds(VL53L0X_DEV Dev, uint32_t *pMeasurementTimingBudgetMicroSeconds)
uint16_t VL53L0X_encode_timeout(uint32_t timeout_macro_clks)
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
Definition: vl53l0x_types.h:75
VL53L0X_Error VL53L0X_set_vcsel_pulse_period(VL53L0X_DEV Dev, VL53L0X_VcselPeriod VcselPeriodType, uint8_t VCSELPulsePeriodPCLK)
uint32_t FixPoint1616_t
use where fractional values are expected
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l0x_types.h:95
Generic PAL device type that does link between API and platform abstraction layer.
VL53L0X_Error VL53L0X_get_total_xtalk_rate(VL53L0X_DEV Dev, VL53L0X_RangingMeasurementData_t *pRangingMeasurementData, FixPoint1616_t *ptotal_xtalk_rate_mcps)
uint8_t VL53L0X_encode_vcsel_period(uint8_t vcsel_period_pclks)
Type definitions for VL53L0X API.
int8_t VL53L0X_Error
Definition: vl53l0x_def.h:131
uint8_t VL53L0X_decode_vcsel_period(uint8_t vcsel_period_reg)
VL53L0X_Error VL53L0X_load_tuning_settings(VL53L0X_DEV Dev, uint8_t *pTuningSettingBuffer)
uint32_t VL53L0X_calc_timeout_mclks(VL53L0X_DEV Dev, uint32_t timeout_period_us, uint8_t vcsel_period_pclks)