Statistics
| Branch: | Tag: | Revision:

amiro-lld / include / VL53L0X / v1 / Api_vl53l0x / core / inc / vl53l0x_api_core.h @ 6ebebd4d

History | View | Annotate | Download (4.31 KB)

1 6ebebd4d Andre Raming
/*******************************************************************************
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
37
#ifdef __cplusplus
38
extern "C" {
39
#endif
40
41
42
VL53L0X_Error VL53L0X_reverse_bytes(uint8_t *data, uint32_t size);
43
44
VL53L0X_Error VL53L0X_measurement_poll_for_completion(VL53L0X_DEV Dev);
45
46
uint8_t VL53L0X_encode_vcsel_period(uint8_t vcsel_period_pclks);
47
48
uint8_t VL53L0X_decode_vcsel_period(uint8_t vcsel_period_reg);
49
50
uint32_t VL53L0X_isqrt(uint32_t num);
51
52
uint32_t VL53L0X_quadrature_sum(uint32_t a, uint32_t b);
53
54
VL53L0X_Error VL53L0X_get_info_from_device(VL53L0X_DEV Dev, uint8_t option);
55
56
VL53L0X_Error VL53L0X_set_vcsel_pulse_period(VL53L0X_DEV Dev,
57
    VL53L0X_VcselPeriod VcselPeriodType, uint8_t VCSELPulsePeriodPCLK);
58
59
VL53L0X_Error VL53L0X_get_vcsel_pulse_period(VL53L0X_DEV Dev,
60
    VL53L0X_VcselPeriod VcselPeriodType, uint8_t *pVCSELPulsePeriodPCLK);
61
62
uint32_t VL53L0X_decode_timeout(uint16_t encoded_timeout);
63
64
VL53L0X_Error get_sequence_step_timeout(VL53L0X_DEV Dev,
65
            VL53L0X_SequenceStepId SequenceStepId,
66
            uint32_t *pTimeOutMicroSecs);
67
68
VL53L0X_Error set_sequence_step_timeout(VL53L0X_DEV Dev,
69
            VL53L0X_SequenceStepId SequenceStepId,
70
            uint32_t TimeOutMicroSecs);
71
72
VL53L0X_Error VL53L0X_set_measurement_timing_budget_micro_seconds(VL53L0X_DEV Dev,
73
    uint32_t MeasurementTimingBudgetMicroSeconds);
74
75
VL53L0X_Error VL53L0X_get_measurement_timing_budget_micro_seconds(VL53L0X_DEV Dev,
76
        uint32_t *pMeasurementTimingBudgetMicroSeconds);
77
78
VL53L0X_Error VL53L0X_load_tuning_settings(VL53L0X_DEV Dev,
79
        uint8_t *pTuningSettingBuffer);
80
81
VL53L0X_Error VL53L0X_calc_sigma_estimate(VL53L0X_DEV Dev,
82
        VL53L0X_RangingMeasurementData_t *pRangingMeasurementData,
83
        FixPoint1616_t *pSigmaEstimate, uint32_t *pDmax_mm);
84
85
VL53L0X_Error VL53L0X_get_total_xtalk_rate(VL53L0X_DEV Dev,
86
    VL53L0X_RangingMeasurementData_t *pRangingMeasurementData,
87
    FixPoint1616_t *ptotal_xtalk_rate_mcps);
88
89
VL53L0X_Error VL53L0X_get_total_signal_rate(VL53L0X_DEV Dev,
90
    VL53L0X_RangingMeasurementData_t *pRangingMeasurementData,
91
    FixPoint1616_t *ptotal_signal_rate_mcps);
92
93
VL53L0X_Error VL53L0X_get_pal_range_status(VL53L0X_DEV Dev,
94
         uint8_t DeviceRangeStatus,
95
         FixPoint1616_t SignalRate,
96
         uint16_t EffectiveSpadRtnCount,
97
         VL53L0X_RangingMeasurementData_t *pRangingMeasurementData,
98
         uint8_t *pPalRangeStatus);
99
100
uint32_t VL53L0X_calc_timeout_mclks(VL53L0X_DEV Dev,
101
    uint32_t timeout_period_us, uint8_t vcsel_period_pclks);
102
103
uint16_t VL53L0X_encode_timeout(uint32_t timeout_macro_clks);
104
105
#ifdef __cplusplus
106
}
107
#endif
108
109
#endif /* _VL53L0X_API_CORE_H_ */