Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
vl53l1_api_core.h
00001 00002 /******************************************************************************* 00003 * Copyright (c) 2020, STMicroelectronics - All Rights Reserved 00004 00005 This file is part of VL53L1 Core and is dual licensed, 00006 either 'STMicroelectronics 00007 Proprietary license' 00008 or 'BSD 3-clause "New" or "Revised" License' , at your option. 00009 00010 ******************************************************************************** 00011 00012 'STMicroelectronics Proprietary license' 00013 00014 ******************************************************************************** 00015 00016 License terms: STMicroelectronics Proprietary in accordance with licensing 00017 terms at www.st.com/sla0081 00018 00019 STMicroelectronics confidential 00020 Reproduction and Communication of this document is strictly prohibited unless 00021 specifically authorized in writing by STMicroelectronics. 00022 00023 00024 ******************************************************************************** 00025 00026 Alternatively, VL53L1 Core may be distributed under the terms of 00027 'BSD 3-clause "New" or "Revised" License', in which case the following 00028 provisions apply instead of the ones 00029 mentioned above : 00030 00031 ******************************************************************************** 00032 00033 License terms: BSD 3-clause "New" or "Revised" License. 00034 00035 Redistribution and use in source and binary forms, with or without 00036 modification, are permitted provided that the following conditions are met: 00037 00038 1. Redistributions of source code must retain the above copyright notice, this 00039 list of conditions and the following disclaimer. 00040 00041 2. Redistributions in binary form must reproduce the above copyright notice, 00042 this list of conditions and the following disclaimer in the documentation 00043 and/or other materials provided with the distribution. 00044 00045 3. Neither the name of the copyright holder nor the names of its contributors 00046 may be used to endorse or promote products derived from this software 00047 without specific prior written permission. 00048 00049 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00050 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00051 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00052 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00053 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00054 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00055 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00056 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00057 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00058 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00059 00060 00061 ******************************************************************************** 00062 00063 */ 00064 00065 00066 00067 00068 #ifndef _VL53L1_API_CORE_H_ 00069 #define _VL53L1_API_CORE_H_ 00070 00071 #include "vl53l1_platform.h" 00072 00073 #ifdef __cplusplus 00074 extern "C" { 00075 #endif 00076 00077 00078 00079 00080 VL53L1_Error VL53L1_get_version( 00081 VL53L1_DEV Dev, 00082 VL53L1_ll_version_t *pversion); 00083 00084 00085 00086 00087 VL53L1_Error VL53L1_get_device_firmware_version( 00088 VL53L1_DEV Dev, 00089 uint16_t *pfw_version); 00090 00091 00092 00093 00094 VL53L1_Error VL53L1_data_init( 00095 VL53L1_DEV Dev, 00096 uint8_t read_p2p_data); 00097 00098 00099 00100 00101 VL53L1_Error VL53L1_read_p2p_data( 00102 VL53L1_DEV Dev); 00103 00104 00105 00106 00107 VL53L1_Error VL53L1_software_reset( 00108 VL53L1_DEV Dev); 00109 00110 00111 00112 00113 VL53L1_Error VL53L1_set_part_to_part_data( 00114 VL53L1_DEV Dev, 00115 VL53L1_calibration_data_t *pcal_data); 00116 00117 00118 00119 00120 VL53L1_Error VL53L1_get_part_to_part_data( 00121 VL53L1_DEV Dev, 00122 VL53L1_calibration_data_t *pcal_data); 00123 00124 00125 00126 00127 VL53L1_Error VL53L1_get_tuning_debug_data( 00128 VL53L1_DEV Dev, 00129 VL53L1_tuning_parameters_t *ptun_data); 00130 00131 00132 00133 00134 VL53L1_Error VL53L1_set_inter_measurement_period_ms( 00135 VL53L1_DEV Dev, 00136 uint32_t inter_measurement_period_ms); 00137 00138 00139 00140 00141 VL53L1_Error VL53L1_get_inter_measurement_period_ms( 00142 VL53L1_DEV Dev, 00143 uint32_t *pinter_measurement_period_ms); 00144 00145 00146 00147 00148 VL53L1_Error VL53L1_set_timeouts_us( 00149 VL53L1_DEV Dev, 00150 uint32_t phasecal_config_timeout_us, 00151 uint32_t mm_config_timeout_us, 00152 uint32_t range_config_timeout_us); 00153 00154 00155 00156 00157 VL53L1_Error VL53L1_get_timeouts_us( 00158 VL53L1_DEV Dev, 00159 uint32_t *pphasecal_config_timeout_us, 00160 uint32_t *pmm_config_timeout_us, 00161 uint32_t *prange_config_timeout_us); 00162 00163 00164 00165 00166 VL53L1_Error VL53L1_set_calibration_repeat_period( 00167 VL53L1_DEV Dev, 00168 uint16_t cal_config__repeat_period); 00169 00170 00171 00172 00173 VL53L1_Error VL53L1_get_calibration_repeat_period( 00174 VL53L1_DEV Dev, 00175 uint16_t *pcal_config__repeat_period); 00176 00177 00178 00179 00180 VL53L1_Error VL53L1_set_sequence_config_bit( 00181 VL53L1_DEV Dev, 00182 VL53L1_DeviceSequenceConfig bit_id, 00183 uint8_t value); 00184 00185 00186 00187 00188 VL53L1_Error VL53L1_get_sequence_config_bit( 00189 VL53L1_DEV Dev, 00190 VL53L1_DeviceSequenceConfig bit_id, 00191 uint8_t *pvalue); 00192 00193 00194 00195 00196 VL53L1_Error VL53L1_set_interrupt_polarity( 00197 VL53L1_DEV Dev, 00198 VL53L1_DeviceInterruptPolarity interrupt_polarity); 00199 00200 00201 00202 00203 VL53L1_Error VL53L1_get_interrupt_polarity( 00204 VL53L1_DEV Dev, 00205 VL53L1_DeviceInterruptPolarity *pinterrupt_polarity); 00206 00207 00208 00209 VL53L1_Error VL53L1_get_refspadchar_config_struct( 00210 VL53L1_DEV Dev, 00211 VL53L1_refspadchar_config_t *pdata); 00212 00213 00214 00215 VL53L1_Error VL53L1_set_refspadchar_config_struct( 00216 VL53L1_DEV Dev, 00217 VL53L1_refspadchar_config_t *pdata); 00218 00219 00220 00221 VL53L1_Error VL53L1_set_range_ignore_threshold( 00222 VL53L1_DEV Dev, 00223 uint8_t range_ignore_thresh_mult, 00224 uint16_t range_ignore_threshold_mcps); 00225 00226 00227 00228 VL53L1_Error VL53L1_get_range_ignore_threshold( 00229 VL53L1_DEV Dev, 00230 uint8_t *prange_ignore_thresh_mult, 00231 uint16_t *prange_ignore_threshold_mcps_internal, 00232 uint16_t *prange_ignore_threshold_mcps_current); 00233 00234 00235 00236 00237 VL53L1_Error VL53L1_set_user_zone( 00238 VL53L1_DEV Dev, 00239 VL53L1_user_zone_t *puser_zone); 00240 00241 00242 00243 00244 VL53L1_Error VL53L1_get_user_zone( 00245 VL53L1_DEV Dev, 00246 VL53L1_user_zone_t *puser_zone); 00247 00248 00249 00250 00251 VL53L1_Error VL53L1_get_mode_mitigation_roi( 00252 VL53L1_DEV Dev, 00253 VL53L1_user_zone_t *pmm_roi); 00254 00255 00256 00257 00258 VL53L1_Error VL53L1_set_zone_config( 00259 VL53L1_DEV Dev, 00260 VL53L1_zone_config_t *pzone_cfg); 00261 00262 00263 00264 00265 VL53L1_Error VL53L1_get_zone_config( 00266 VL53L1_DEV Dev, 00267 VL53L1_zone_config_t *pzone_cfg); 00268 00269 00270 00271 00272 VL53L1_Error VL53L1_set_preset_mode( 00273 VL53L1_DEV Dev, 00274 VL53L1_DevicePresetModes device_preset_mode, 00275 uint16_t dss_config__target_total_rate_mcps, 00276 uint32_t phasecal_config_timeout_us, 00277 uint32_t mm_config_timeout_us, 00278 uint32_t range_config_timeout_us, 00279 uint32_t inter_measurement_period_ms); 00280 00281 00282 00283 00284 VL53L1_Error VL53L1_get_preset_mode_timing_cfg( 00285 VL53L1_DEV Dev, 00286 VL53L1_DevicePresetModes device_preset_mode, 00287 uint16_t *pdss_config__target_total_rate_mcps, 00288 uint32_t *pphasecal_config_timeout_us, 00289 uint32_t *pmm_config_timeout_us, 00290 uint32_t *prange_config_timeout_us); 00291 00292 00293 00294 VL53L1_Error VL53L1_set_zone_preset( 00295 VL53L1_DEV Dev, 00296 VL53L1_DeviceZonePreset zone_preset); 00297 00298 00299 00300 VL53L1_Error VL53L1_enable_xtalk_compensation( 00301 VL53L1_DEV Dev); 00302 00303 00304 00305 VL53L1_Error VL53L1_disable_xtalk_compensation( 00306 VL53L1_DEV Dev); 00307 00308 00309 00310 00311 void VL53L1_get_xtalk_compensation_enable( 00312 VL53L1_DEV Dev, 00313 uint8_t *pcrosstalk_compensation_enable); 00314 00315 00316 00317 VL53L1_Error VL53L1_init_and_start_range( 00318 VL53L1_DEV Dev, 00319 uint8_t measurement_mode, 00320 VL53L1_DeviceConfigLevel device_config_level); 00321 00322 00323 00324 00325 VL53L1_Error VL53L1_stop_range( 00326 VL53L1_DEV Dev); 00327 00328 00329 00330 00331 VL53L1_Error VL53L1_get_measurement_results( 00332 VL53L1_DEV Dev, 00333 VL53L1_DeviceResultsLevel device_result_level); 00334 00335 00336 00337 00338 VL53L1_Error VL53L1_get_device_results( 00339 VL53L1_DEV Dev, 00340 VL53L1_DeviceResultsLevel device_result_level, 00341 VL53L1_range_results_t *prange_results); 00342 00343 00344 00345 00346 VL53L1_Error VL53L1_clear_interrupt_and_enable_next_range( 00347 VL53L1_DEV Dev, 00348 uint8_t measurement_mode); 00349 00350 00351 00352 00353 VL53L1_Error VL53L1_get_histogram_bin_data( 00354 VL53L1_DEV Dev, 00355 VL53L1_histogram_bin_data_t *phist_data); 00356 00357 00358 00359 00360 void VL53L1_copy_sys_and_core_results_to_range_results( 00361 int32_t gain_factor, 00362 VL53L1_system_results_t *psys, 00363 VL53L1_core_results_t *pcore, 00364 VL53L1_range_results_t *presults); 00365 00366 00367 00368 VL53L1_Error VL53L1_set_zone_dss_config( 00369 VL53L1_DEV Dev, 00370 VL53L1_zone_private_dyn_cfg_t *pzone_dyn_cfg); 00371 00372 00373 00374 00375 VL53L1_Error VL53L1_calc_ambient_dmax( 00376 VL53L1_DEV Dev, 00377 uint16_t target_reflectance, 00378 int16_t *pambient_dmax_mm); 00379 00380 00381 00382 00383 VL53L1_Error VL53L1_set_GPIO_interrupt_config( 00384 VL53L1_DEV Dev, 00385 VL53L1_GPIO_Interrupt_Mode intr_mode_distance, 00386 VL53L1_GPIO_Interrupt_Mode intr_mode_rate, 00387 uint8_t intr_new_measure_ready, 00388 uint8_t intr_no_target, 00389 uint8_t intr_combined_mode, 00390 uint16_t thresh_distance_high, 00391 uint16_t thresh_distance_low, 00392 uint16_t thresh_rate_high, 00393 uint16_t thresh_rate_low 00394 ); 00395 00396 00397 00398 VL53L1_Error VL53L1_set_GPIO_interrupt_config_struct( 00399 VL53L1_DEV Dev, 00400 VL53L1_GPIO_interrupt_config_t intconf); 00401 00402 00403 00404 VL53L1_Error VL53L1_get_GPIO_interrupt_config( 00405 VL53L1_DEV Dev, 00406 VL53L1_GPIO_interrupt_config_t *pintconf); 00407 00408 00409 00410 00411 VL53L1_Error VL53L1_set_dmax_mode( 00412 VL53L1_DEV Dev, 00413 VL53L1_DeviceDmaxMode dmax_mode); 00414 00415 00416 00417 VL53L1_Error VL53L1_get_dmax_mode( 00418 VL53L1_DEV Dev, 00419 VL53L1_DeviceDmaxMode *pdmax_mode); 00420 00421 00422 00423 00424 VL53L1_Error VL53L1_get_dmax_calibration_data( 00425 VL53L1_DEV Dev, 00426 VL53L1_DeviceDmaxMode dmax_mode, 00427 uint8_t zone_id, 00428 VL53L1_dmax_calibration_data_t *pdmax_cal); 00429 00430 00431 00432 00433 VL53L1_Error VL53L1_set_hist_dmax_config( 00434 VL53L1_DEV Dev, 00435 VL53L1_hist_gen3_dmax_config_t *pdmax_cfg); 00436 00437 00438 00439 VL53L1_Error VL53L1_get_hist_dmax_config( 00440 VL53L1_DEV Dev, 00441 VL53L1_hist_gen3_dmax_config_t *pdmax_cfg); 00442 00443 00444 00445 00446 VL53L1_Error VL53L1_set_offset_calibration_mode( 00447 VL53L1_DEV Dev, 00448 VL53L1_OffsetCalibrationMode offset_cal_mode); 00449 00450 00451 00452 00453 VL53L1_Error VL53L1_get_offset_calibration_mode( 00454 VL53L1_DEV Dev, 00455 VL53L1_OffsetCalibrationMode *poffset_cal_mode); 00456 00457 00458 00459 00460 VL53L1_Error VL53L1_set_offset_correction_mode( 00461 VL53L1_DEV Dev, 00462 VL53L1_OffsetCalibrationMode offset_cor_mode); 00463 00464 00465 00466 00467 VL53L1_Error VL53L1_get_offset_correction_mode( 00468 VL53L1_DEV Dev, 00469 VL53L1_OffsetCorrectionMode *poffset_cor_mode); 00470 00471 00472 00473 00474 VL53L1_Error VL53L1_set_zone_calibration_data( 00475 VL53L1_DEV Dev, 00476 VL53L1_zone_calibration_results_t *pzone_cal); 00477 00478 00479 00480 00481 VL53L1_Error VL53L1_get_zone_calibration_data( 00482 VL53L1_DEV Dev, 00483 VL53L1_zone_calibration_results_t *pzone_cal); 00484 00485 00486 00487 00488 VL53L1_Error VL53L1_get_lite_xtalk_margin_kcps( 00489 VL53L1_DEV Dev, 00490 int16_t *pxtalk_margin); 00491 00492 00493 00494 VL53L1_Error VL53L1_set_lite_xtalk_margin_kcps( 00495 VL53L1_DEV Dev, 00496 int16_t xtalk_margin); 00497 00498 00499 00500 00501 VL53L1_Error VL53L1_get_histogram_xtalk_margin_kcps( 00502 VL53L1_DEV Dev, 00503 int16_t *pxtalk_margin); 00504 00505 00506 00507 VL53L1_Error VL53L1_set_histogram_xtalk_margin_kcps( 00508 VL53L1_DEV Dev, 00509 int16_t xtalk_margin); 00510 00511 00512 00513 VL53L1_Error VL53L1_get_histogram_phase_consistency( 00514 VL53L1_DEV Dev, 00515 uint8_t *pphase_consistency); 00516 00517 00518 00519 VL53L1_Error VL53L1_set_histogram_phase_consistency( 00520 VL53L1_DEV Dev, 00521 uint8_t phase_consistency); 00522 00523 00524 00525 VL53L1_Error VL53L1_get_histogram_event_consistency( 00526 VL53L1_DEV Dev, 00527 uint8_t *pevent_consistency); 00528 00529 00530 00531 VL53L1_Error VL53L1_set_histogram_event_consistency( 00532 VL53L1_DEV Dev, 00533 uint8_t event_consistency); 00534 00535 00536 00537 VL53L1_Error VL53L1_get_histogram_ambient_threshold_sigma( 00538 VL53L1_DEV Dev, 00539 uint8_t *pamb_thresh_sigma); 00540 00541 00542 00543 VL53L1_Error VL53L1_set_histogram_ambient_threshold_sigma( 00544 VL53L1_DEV Dev, 00545 uint8_t amb_thresh_sigma); 00546 00547 00548 00549 VL53L1_Error VL53L1_get_lite_min_count_rate( 00550 VL53L1_DEV Dev, 00551 uint16_t *plite_mincountrate); 00552 00553 00554 00555 00556 VL53L1_Error VL53L1_set_lite_min_count_rate( 00557 VL53L1_DEV Dev, 00558 uint16_t lite_mincountrate); 00559 00560 00561 00562 00563 00564 VL53L1_Error VL53L1_get_lite_sigma_threshold( 00565 VL53L1_DEV Dev, 00566 uint16_t *plite_sigma); 00567 00568 00569 00570 00571 VL53L1_Error VL53L1_set_lite_sigma_threshold( 00572 VL53L1_DEV Dev, 00573 uint16_t lite_sigma); 00574 00575 00576 00577 00578 VL53L1_Error VL53L1_restore_xtalk_nvm_default( 00579 VL53L1_DEV Dev); 00580 00581 00582 00583 VL53L1_Error VL53L1_get_xtalk_detect_config( 00584 VL53L1_DEV Dev, 00585 int16_t *pmax_valid_range_mm, 00586 int16_t *pmin_valid_range_mm, 00587 uint16_t *pmax_valid_rate_kcps, 00588 uint16_t *pmax_sigma_mm); 00589 00590 00591 00592 VL53L1_Error VL53L1_set_xtalk_detect_config( 00593 VL53L1_DEV Dev, 00594 int16_t max_valid_range_mm, 00595 int16_t min_valid_range_mm, 00596 uint16_t max_valid_rate_kcps, 00597 uint16_t max_sigma_mm); 00598 00599 00600 00601 VL53L1_Error VL53L1_get_target_order_mode( 00602 VL53L1_DEV Dev, 00603 VL53L1_HistTargetOrder *phist_target_order); 00604 00605 00606 00607 VL53L1_Error VL53L1_set_target_order_mode( 00608 VL53L1_DEV Dev, 00609 VL53L1_HistTargetOrder hist_target_order); 00610 00611 00612 00613 00614 VL53L1_Error VL53L1_set_dmax_reflectance_values( 00615 VL53L1_DEV Dev, 00616 VL53L1_dmax_reflectance_array_t *pdmax_reflectances); 00617 00618 00619 00620 VL53L1_Error VL53L1_get_dmax_reflectance_values( 00621 VL53L1_DEV Dev, 00622 VL53L1_dmax_reflectance_array_t *pdmax_reflectances); 00623 00624 00625 00626 VL53L1_Error VL53L1_set_vhv_config( 00627 VL53L1_DEV Dev, 00628 uint8_t vhv_init_en, 00629 uint8_t vhv_init_value); 00630 00631 00632 00633 VL53L1_Error VL53L1_get_vhv_config( 00634 VL53L1_DEV Dev, 00635 uint8_t *pvhv_init_en, 00636 uint8_t *pvhv_init_value); 00637 00638 00639 00640 VL53L1_Error VL53L1_set_vhv_loopbound( 00641 VL53L1_DEV Dev, 00642 uint8_t vhv_loopbound); 00643 00644 00645 00646 VL53L1_Error VL53L1_get_vhv_loopbound( 00647 VL53L1_DEV Dev, 00648 uint8_t *pvhv_loopbound); 00649 00650 00651 00652 VL53L1_Error VL53L1_get_tuning_parm( 00653 VL53L1_DEV Dev, 00654 VL53L1_TuningParms tuning_parm_key, 00655 int32_t *ptuning_parm_value); 00656 00657 00658 00659 VL53L1_Error VL53L1_set_tuning_parm( 00660 VL53L1_DEV Dev, 00661 VL53L1_TuningParms tuning_parm_key, 00662 int32_t tuning_parm_value); 00663 00664 00665 00666 VL53L1_Error VL53L1_dynamic_xtalk_correction_enable( 00667 VL53L1_DEV Dev 00668 ); 00669 00670 00671 00672 VL53L1_Error VL53L1_dynamic_xtalk_correction_disable( 00673 VL53L1_DEV Dev 00674 ); 00675 00676 00677 00678 00679 VL53L1_Error VL53L1_dynamic_xtalk_correction_apply_enable( 00680 VL53L1_DEV Dev 00681 ); 00682 00683 00684 00685 VL53L1_Error VL53L1_dynamic_xtalk_correction_apply_disable( 00686 VL53L1_DEV Dev 00687 ); 00688 00689 00690 00691 VL53L1_Error VL53L1_dynamic_xtalk_correction_single_apply_enable( 00692 VL53L1_DEV Dev 00693 ); 00694 00695 00696 00697 VL53L1_Error VL53L1_dynamic_xtalk_correction_single_apply_disable( 00698 VL53L1_DEV Dev 00699 ); 00700 00701 00702 00703 VL53L1_Error VL53L1_dynamic_xtalk_correction_set_scalers( 00704 VL53L1_DEV Dev, 00705 int16_t x_scaler_in, 00706 int16_t y_scaler_in, 00707 uint8_t user_scaler_set_in 00708 ); 00709 00710 00711 00712 VL53L1_Error VL53L1_get_current_xtalk_settings( 00713 VL53L1_DEV Dev, 00714 VL53L1_xtalk_calibration_results_t *pxtalk 00715 ); 00716 00717 00718 00719 VL53L1_Error VL53L1_set_current_xtalk_settings( 00720 VL53L1_DEV Dev, 00721 VL53L1_xtalk_calibration_results_t *pxtalk 00722 ); 00723 00724 VL53L1_Error VL53L1_load_patch(VL53L1_DEV Dev); 00725 00726 VL53L1_Error VL53L1_unload_patch(VL53L1_DEV Dev); 00727 00728 #ifdef __cplusplus 00729 } 00730 #endif 00731 00732 #endif 00733 00734
Generated on Tue Jul 12 2022 20:07:14 by
1.7.2