hh
Dependents: VL53L0X-mbedOS-master VL53L0X-mbedOS-masterbb
vl53l0x_api_core.h@0:e6fcdb78a136, 2016-08-23 (annotated)
- Committer:
- mjarvisal
- Date:
- Tue Aug 23 05:14:05 2016 +0000
- Revision:
- 0:e6fcdb78a136
Initial release
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mjarvisal | 0:e6fcdb78a136 | 1 | /******************************************************************************* |
mjarvisal | 0:e6fcdb78a136 | 2 | Copyright © 2016, STMicroelectronics International N.V. |
mjarvisal | 0:e6fcdb78a136 | 3 | All rights reserved. |
mjarvisal | 0:e6fcdb78a136 | 4 | |
mjarvisal | 0:e6fcdb78a136 | 5 | Redistribution and use in source and binary forms, with or without |
mjarvisal | 0:e6fcdb78a136 | 6 | modification, are permitted provided that the following conditions are met: |
mjarvisal | 0:e6fcdb78a136 | 7 | * Redistributions of source code must retain the above copyright |
mjarvisal | 0:e6fcdb78a136 | 8 | notice, this list of conditions and the following disclaimer. |
mjarvisal | 0:e6fcdb78a136 | 9 | * Redistributions in binary form must reproduce the above copyright |
mjarvisal | 0:e6fcdb78a136 | 10 | notice, this list of conditions and the following disclaimer in the |
mjarvisal | 0:e6fcdb78a136 | 11 | documentation and/or other materials provided with the distribution. |
mjarvisal | 0:e6fcdb78a136 | 12 | * Neither the name of STMicroelectronics nor the |
mjarvisal | 0:e6fcdb78a136 | 13 | names of its contributors may be used to endorse or promote products |
mjarvisal | 0:e6fcdb78a136 | 14 | derived from this software without specific prior written permission. |
mjarvisal | 0:e6fcdb78a136 | 15 | |
mjarvisal | 0:e6fcdb78a136 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
mjarvisal | 0:e6fcdb78a136 | 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
mjarvisal | 0:e6fcdb78a136 | 18 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND |
mjarvisal | 0:e6fcdb78a136 | 19 | NON-INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED. |
mjarvisal | 0:e6fcdb78a136 | 20 | IN NO EVENT SHALL STMICROELECTRONICS INTERNATIONAL N.V. BE LIABLE FOR ANY |
mjarvisal | 0:e6fcdb78a136 | 21 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
mjarvisal | 0:e6fcdb78a136 | 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
mjarvisal | 0:e6fcdb78a136 | 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
mjarvisal | 0:e6fcdb78a136 | 24 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
mjarvisal | 0:e6fcdb78a136 | 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
mjarvisal | 0:e6fcdb78a136 | 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mjarvisal | 0:e6fcdb78a136 | 27 | *******************************************************************************/ |
mjarvisal | 0:e6fcdb78a136 | 28 | |
mjarvisal | 0:e6fcdb78a136 | 29 | #ifndef _VL53L0X_API_CORE_H_ |
mjarvisal | 0:e6fcdb78a136 | 30 | #define _VL53L0X_API_CORE_H_ |
mjarvisal | 0:e6fcdb78a136 | 31 | |
mjarvisal | 0:e6fcdb78a136 | 32 | #include "vl53l0x_def.h" |
mjarvisal | 0:e6fcdb78a136 | 33 | #include "vl53l0x_platform.h" |
mjarvisal | 0:e6fcdb78a136 | 34 | |
mjarvisal | 0:e6fcdb78a136 | 35 | |
mjarvisal | 0:e6fcdb78a136 | 36 | #ifdef __cplusplus |
mjarvisal | 0:e6fcdb78a136 | 37 | extern "C" { |
mjarvisal | 0:e6fcdb78a136 | 38 | #endif |
mjarvisal | 0:e6fcdb78a136 | 39 | |
mjarvisal | 0:e6fcdb78a136 | 40 | |
mjarvisal | 0:e6fcdb78a136 | 41 | VL53L0X_Error VL53L0X_reverse_bytes(uint8_t *data, uint32_t size); |
mjarvisal | 0:e6fcdb78a136 | 42 | |
mjarvisal | 0:e6fcdb78a136 | 43 | VL53L0X_Error VL53L0X_measurement_poll_for_completion(VL53L0X_DEV Dev); |
mjarvisal | 0:e6fcdb78a136 | 44 | |
mjarvisal | 0:e6fcdb78a136 | 45 | uint8_t VL53L0X_encode_vcsel_period(uint8_t vcsel_period_pclks); |
mjarvisal | 0:e6fcdb78a136 | 46 | |
mjarvisal | 0:e6fcdb78a136 | 47 | uint8_t VL53L0X_decode_vcsel_period(uint8_t vcsel_period_reg); |
mjarvisal | 0:e6fcdb78a136 | 48 | |
mjarvisal | 0:e6fcdb78a136 | 49 | uint32_t VL53L0X_isqrt(uint32_t num); |
mjarvisal | 0:e6fcdb78a136 | 50 | |
mjarvisal | 0:e6fcdb78a136 | 51 | uint32_t VL53L0X_quadrature_sum(uint32_t a, uint32_t b); |
mjarvisal | 0:e6fcdb78a136 | 52 | |
mjarvisal | 0:e6fcdb78a136 | 53 | VL53L0X_Error VL53L0X_get_info_from_device(VL53L0X_DEV Dev, uint8_t option); |
mjarvisal | 0:e6fcdb78a136 | 54 | |
mjarvisal | 0:e6fcdb78a136 | 55 | VL53L0X_Error VL53L0X_set_vcsel_pulse_period(VL53L0X_DEV Dev, |
mjarvisal | 0:e6fcdb78a136 | 56 | VL53L0X_VcselPeriod VcselPeriodType, uint8_t VCSELPulsePeriodPCLK); |
mjarvisal | 0:e6fcdb78a136 | 57 | |
mjarvisal | 0:e6fcdb78a136 | 58 | VL53L0X_Error VL53L0X_get_vcsel_pulse_period(VL53L0X_DEV Dev, |
mjarvisal | 0:e6fcdb78a136 | 59 | VL53L0X_VcselPeriod VcselPeriodType, uint8_t *pVCSELPulsePeriodPCLK); |
mjarvisal | 0:e6fcdb78a136 | 60 | |
mjarvisal | 0:e6fcdb78a136 | 61 | uint32_t VL53L0X_decode_timeout(uint16_t encoded_timeout); |
mjarvisal | 0:e6fcdb78a136 | 62 | |
mjarvisal | 0:e6fcdb78a136 | 63 | VL53L0X_Error get_sequence_step_timeout(VL53L0X_DEV Dev, |
mjarvisal | 0:e6fcdb78a136 | 64 | VL53L0X_SequenceStepId SequenceStepId, |
mjarvisal | 0:e6fcdb78a136 | 65 | uint32_t *pTimeOutMicroSecs); |
mjarvisal | 0:e6fcdb78a136 | 66 | |
mjarvisal | 0:e6fcdb78a136 | 67 | VL53L0X_Error set_sequence_step_timeout(VL53L0X_DEV Dev, |
mjarvisal | 0:e6fcdb78a136 | 68 | VL53L0X_SequenceStepId SequenceStepId, |
mjarvisal | 0:e6fcdb78a136 | 69 | uint32_t TimeOutMicroSecs); |
mjarvisal | 0:e6fcdb78a136 | 70 | |
mjarvisal | 0:e6fcdb78a136 | 71 | VL53L0X_Error VL53L0X_set_measurement_timing_budget_micro_seconds(VL53L0X_DEV Dev, |
mjarvisal | 0:e6fcdb78a136 | 72 | uint32_t MeasurementTimingBudgetMicroSeconds); |
mjarvisal | 0:e6fcdb78a136 | 73 | |
mjarvisal | 0:e6fcdb78a136 | 74 | VL53L0X_Error VL53L0X_get_measurement_timing_budget_micro_seconds(VL53L0X_DEV Dev, |
mjarvisal | 0:e6fcdb78a136 | 75 | uint32_t *pMeasurementTimingBudgetMicroSeconds); |
mjarvisal | 0:e6fcdb78a136 | 76 | |
mjarvisal | 0:e6fcdb78a136 | 77 | VL53L0X_Error VL53L0X_load_tuning_settings(VL53L0X_DEV Dev, |
mjarvisal | 0:e6fcdb78a136 | 78 | uint8_t *pTuningSettingBuffer); |
mjarvisal | 0:e6fcdb78a136 | 79 | |
mjarvisal | 0:e6fcdb78a136 | 80 | VL53L0X_Error VL53L0X_calc_sigma_estimate(VL53L0X_DEV Dev, |
mjarvisal | 0:e6fcdb78a136 | 81 | VL53L0X_RangingMeasurementData_t *pRangingMeasurementData, |
mjarvisal | 0:e6fcdb78a136 | 82 | FixPoint1616_t *pSigmaEstimate, uint32_t *pDmax_mm); |
mjarvisal | 0:e6fcdb78a136 | 83 | |
mjarvisal | 0:e6fcdb78a136 | 84 | VL53L0X_Error VL53L0X_get_total_xtalk_rate(VL53L0X_DEV Dev, |
mjarvisal | 0:e6fcdb78a136 | 85 | VL53L0X_RangingMeasurementData_t *pRangingMeasurementData, |
mjarvisal | 0:e6fcdb78a136 | 86 | FixPoint1616_t *ptotal_xtalk_rate_mcps); |
mjarvisal | 0:e6fcdb78a136 | 87 | |
mjarvisal | 0:e6fcdb78a136 | 88 | VL53L0X_Error VL53L0X_get_total_signal_rate(VL53L0X_DEV Dev, |
mjarvisal | 0:e6fcdb78a136 | 89 | VL53L0X_RangingMeasurementData_t *pRangingMeasurementData, |
mjarvisal | 0:e6fcdb78a136 | 90 | FixPoint1616_t *ptotal_signal_rate_mcps); |
mjarvisal | 0:e6fcdb78a136 | 91 | |
mjarvisal | 0:e6fcdb78a136 | 92 | VL53L0X_Error VL53L0X_get_pal_range_status(VL53L0X_DEV Dev, |
mjarvisal | 0:e6fcdb78a136 | 93 | uint8_t DeviceRangeStatus, |
mjarvisal | 0:e6fcdb78a136 | 94 | FixPoint1616_t SignalRate, |
mjarvisal | 0:e6fcdb78a136 | 95 | uint16_t EffectiveSpadRtnCount, |
mjarvisal | 0:e6fcdb78a136 | 96 | VL53L0X_RangingMeasurementData_t *pRangingMeasurementData, |
mjarvisal | 0:e6fcdb78a136 | 97 | uint8_t *pPalRangeStatus); |
mjarvisal | 0:e6fcdb78a136 | 98 | |
mjarvisal | 0:e6fcdb78a136 | 99 | uint32_t VL53L0X_calc_timeout_mclks(VL53L0X_DEV Dev, |
mjarvisal | 0:e6fcdb78a136 | 100 | uint32_t timeout_period_us, uint8_t vcsel_period_pclks); |
mjarvisal | 0:e6fcdb78a136 | 101 | |
mjarvisal | 0:e6fcdb78a136 | 102 | uint16_t VL53L0X_encode_timeout(uint32_t timeout_macro_clks); |
mjarvisal | 0:e6fcdb78a136 | 103 | |
mjarvisal | 0:e6fcdb78a136 | 104 | #ifdef __cplusplus |
mjarvisal | 0:e6fcdb78a136 | 105 | } |
mjarvisal | 0:e6fcdb78a136 | 106 | #endif |
mjarvisal | 0:e6fcdb78a136 | 107 | |
mjarvisal | 0:e6fcdb78a136 | 108 | #endif /* _VL53L0X_API_CORE_H_ */ |