The VL53L1CB proximity sensor, based on ST’s FlightSense™, Time-of-Flight technology.

Dependencies:   X_NUCLEO_COMMON ST_INTERFACES

Dependents:   VL53L1CB_noshield_1sensor_polls_auton VL53L1CB_noshield_1sensor_interrupt_auton X_NUCLEO_53L1A2

Based on VL53L1 library, this is a library for the VL53L1CB ToF chip.

Committer:
charlesmn
Date:
Fri Nov 06 10:06:37 2020 +0000
Revision:
0:3ac96e360672
Child:
7:1add29d51e72
Library for ST Vl53L1A1 time of flight sensor.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
charlesmn 0:3ac96e360672 1
charlesmn 0:3ac96e360672 2 /*******************************************************************************
charlesmn 0:3ac96e360672 3 * Copyright (c) 2020, STMicroelectronics - All Rights Reserved
charlesmn 0:3ac96e360672 4
charlesmn 0:3ac96e360672 5 This file is part of VL53L1 Core and is dual licensed,
charlesmn 0:3ac96e360672 6 either 'STMicroelectronics
charlesmn 0:3ac96e360672 7 Proprietary license'
charlesmn 0:3ac96e360672 8 or 'BSD 3-clause "New" or "Revised" License' , at your option.
charlesmn 0:3ac96e360672 9
charlesmn 0:3ac96e360672 10 ********************************************************************************
charlesmn 0:3ac96e360672 11
charlesmn 0:3ac96e360672 12 'STMicroelectronics Proprietary license'
charlesmn 0:3ac96e360672 13
charlesmn 0:3ac96e360672 14 ********************************************************************************
charlesmn 0:3ac96e360672 15
charlesmn 0:3ac96e360672 16 License terms: STMicroelectronics Proprietary in accordance with licensing
charlesmn 0:3ac96e360672 17 terms at www.st.com/sla0081
charlesmn 0:3ac96e360672 18
charlesmn 0:3ac96e360672 19 STMicroelectronics confidential
charlesmn 0:3ac96e360672 20 Reproduction and Communication of this document is strictly prohibited unless
charlesmn 0:3ac96e360672 21 specifically authorized in writing by STMicroelectronics.
charlesmn 0:3ac96e360672 22
charlesmn 0:3ac96e360672 23
charlesmn 0:3ac96e360672 24 ********************************************************************************
charlesmn 0:3ac96e360672 25
charlesmn 0:3ac96e360672 26 Alternatively, VL53L1 Core may be distributed under the terms of
charlesmn 0:3ac96e360672 27 'BSD 3-clause "New" or "Revised" License', in which case the following
charlesmn 0:3ac96e360672 28 provisions apply instead of the ones
charlesmn 0:3ac96e360672 29 mentioned above :
charlesmn 0:3ac96e360672 30
charlesmn 0:3ac96e360672 31 ********************************************************************************
charlesmn 0:3ac96e360672 32
charlesmn 0:3ac96e360672 33 License terms: BSD 3-clause "New" or "Revised" License.
charlesmn 0:3ac96e360672 34
charlesmn 0:3ac96e360672 35 Redistribution and use in source and binary forms, with or without
charlesmn 0:3ac96e360672 36 modification, are permitted provided that the following conditions are met:
charlesmn 0:3ac96e360672 37
charlesmn 0:3ac96e360672 38 1. Redistributions of source code must retain the above copyright notice, this
charlesmn 0:3ac96e360672 39 list of conditions and the following disclaimer.
charlesmn 0:3ac96e360672 40
charlesmn 0:3ac96e360672 41 2. Redistributions in binary form must reproduce the above copyright notice,
charlesmn 0:3ac96e360672 42 this list of conditions and the following disclaimer in the documentation
charlesmn 0:3ac96e360672 43 and/or other materials provided with the distribution.
charlesmn 0:3ac96e360672 44
charlesmn 0:3ac96e360672 45 3. Neither the name of the copyright holder nor the names of its contributors
charlesmn 0:3ac96e360672 46 may be used to endorse or promote products derived from this software
charlesmn 0:3ac96e360672 47 without specific prior written permission.
charlesmn 0:3ac96e360672 48
charlesmn 0:3ac96e360672 49 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
charlesmn 0:3ac96e360672 50 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
charlesmn 0:3ac96e360672 51 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
charlesmn 0:3ac96e360672 52 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
charlesmn 0:3ac96e360672 53 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
charlesmn 0:3ac96e360672 54 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
charlesmn 0:3ac96e360672 55 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
charlesmn 0:3ac96e360672 56 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
charlesmn 0:3ac96e360672 57 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
charlesmn 0:3ac96e360672 58 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
charlesmn 0:3ac96e360672 59
charlesmn 0:3ac96e360672 60
charlesmn 0:3ac96e360672 61 ********************************************************************************
charlesmn 0:3ac96e360672 62
charlesmn 0:3ac96e360672 63 */
charlesmn 0:3ac96e360672 64
charlesmn 0:3ac96e360672 65
charlesmn 0:3ac96e360672 66
charlesmn 0:3ac96e360672 67
charlesmn 0:3ac96e360672 68 #include "vl53l1_error_codes.h"
charlesmn 0:3ac96e360672 69 #include "vl53l1_error_strings.h"
charlesmn 0:3ac96e360672 70 #include "vl53l1_platform_log.h"
charlesmn 0:3ac96e360672 71 #include "vl53l1_ll_def.h"
charlesmn 0:3ac96e360672 72
charlesmn 0:3ac96e360672 73 #define LOG_FUNCTION_START(fmt, ...) \
charlesmn 0:3ac96e360672 74 _LOG_FUNCTION_START(VL53L1_TRACE_MODULE_API, fmt, ##__VA_ARGS__)
charlesmn 0:3ac96e360672 75 #define LOG_FUNCTION_END(status, ...) \
charlesmn 0:3ac96e360672 76 _LOG_FUNCTION_END(VL53L1_TRACE_MODULE_API, status, ##__VA_ARGS__)
charlesmn 0:3ac96e360672 77 #define LOG_FUNCTION_END_FMT(status, fmt, ...) \
charlesmn 0:3ac96e360672 78 _LOG_FUNCTION_END_FMT(VL53L1_TRACE_MODULE_API, \
charlesmn 0:3ac96e360672 79 status, fmt, ##__VA_ARGS__)
charlesmn 0:3ac96e360672 80
charlesmn 0:3ac96e360672 81
charlesmn 0:3ac96e360672 82 VL53L1_Error VL53L1_get_pal_error_string(
charlesmn 0:3ac96e360672 83 VL53L1_Error PalErrorCode,
charlesmn 0:3ac96e360672 84 char *pPalErrorString)
charlesmn 0:3ac96e360672 85 {
charlesmn 0:3ac96e360672 86 VL53L1_Error Status = VL53L1_ERROR_NONE;
charlesmn 0:3ac96e360672 87
charlesmn 0:3ac96e360672 88 #ifdef VL53L1_USE_EMPTY_STRING
charlesmn 0:3ac96e360672 89 SUPPRESS_UNUSED_WARNING(PalErrorCode);
charlesmn 0:3ac96e360672 90 #endif
charlesmn 0:3ac96e360672 91
charlesmn 0:3ac96e360672 92 LOG_FUNCTION_START("");
charlesmn 0:3ac96e360672 93
charlesmn 0:3ac96e360672 94 #ifdef VL53L1_USE_EMPTY_STRING
charlesmn 0:3ac96e360672 95 VL53L1_COPYSTRING(pPalErrorString, "");
charlesmn 0:3ac96e360672 96 #else
charlesmn 0:3ac96e360672 97
charlesmn 0:3ac96e360672 98 switch (PalErrorCode) {
charlesmn 0:3ac96e360672 99 case VL53L1_ERROR_NONE:
charlesmn 0:3ac96e360672 100 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 101 VL53L1_STRING_ERROR_NONE);
charlesmn 0:3ac96e360672 102 break;
charlesmn 0:3ac96e360672 103 case VL53L1_ERROR_CALIBRATION_WARNING:
charlesmn 0:3ac96e360672 104 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 105 VL53L1_STRING_ERROR_CALIBRATION_WARNING);
charlesmn 0:3ac96e360672 106 break;
charlesmn 0:3ac96e360672 107 case VL53L1_ERROR_MIN_CLIPPED:
charlesmn 0:3ac96e360672 108 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 109 VL53L1_STRING_ERROR_MIN_CLIPPED);
charlesmn 0:3ac96e360672 110 break;
charlesmn 0:3ac96e360672 111 case VL53L1_ERROR_UNDEFINED:
charlesmn 0:3ac96e360672 112 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 113 VL53L1_STRING_ERROR_UNDEFINED);
charlesmn 0:3ac96e360672 114 break;
charlesmn 0:3ac96e360672 115 case VL53L1_ERROR_INVALID_PARAMS:
charlesmn 0:3ac96e360672 116 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 117 VL53L1_STRING_ERROR_INVALID_PARAMS);
charlesmn 0:3ac96e360672 118 break;
charlesmn 0:3ac96e360672 119 case VL53L1_ERROR_NOT_SUPPORTED:
charlesmn 0:3ac96e360672 120 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 121 VL53L1_STRING_ERROR_NOT_SUPPORTED);
charlesmn 0:3ac96e360672 122 break;
charlesmn 0:3ac96e360672 123 case VL53L1_ERROR_RANGE_ERROR:
charlesmn 0:3ac96e360672 124 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 125 VL53L1_STRING_ERROR_RANGE_ERROR);
charlesmn 0:3ac96e360672 126 break;
charlesmn 0:3ac96e360672 127 case VL53L1_ERROR_TIME_OUT:
charlesmn 0:3ac96e360672 128 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 129 VL53L1_STRING_ERROR_TIME_OUT);
charlesmn 0:3ac96e360672 130 break;
charlesmn 0:3ac96e360672 131 case VL53L1_ERROR_MODE_NOT_SUPPORTED:
charlesmn 0:3ac96e360672 132 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 133 VL53L1_STRING_ERROR_MODE_NOT_SUPPORTED);
charlesmn 0:3ac96e360672 134 break;
charlesmn 0:3ac96e360672 135 case VL53L1_ERROR_BUFFER_TOO_SMALL:
charlesmn 0:3ac96e360672 136 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 137 VL53L1_STRING_ERROR_BUFFER_TOO_SMALL);
charlesmn 0:3ac96e360672 138 break;
charlesmn 0:3ac96e360672 139 case VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL:
charlesmn 0:3ac96e360672 140 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 141 VL53L1_STRING_ERROR_COMMS_BUFFER_TOO_SMALL);
charlesmn 0:3ac96e360672 142 break;
charlesmn 0:3ac96e360672 143 case VL53L1_ERROR_GPIO_NOT_EXISTING:
charlesmn 0:3ac96e360672 144 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 145 VL53L1_STRING_ERROR_GPIO_NOT_EXISTING);
charlesmn 0:3ac96e360672 146 break;
charlesmn 0:3ac96e360672 147 case VL53L1_ERROR_GPIO_FUNCTIONALITY_NOT_SUPPORTED:
charlesmn 0:3ac96e360672 148 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 149 VL53L1_STRING_ERROR_GPIO_FUNCTIONALITY_NOT_SUPPORTED);
charlesmn 0:3ac96e360672 150 break;
charlesmn 0:3ac96e360672 151 case VL53L1_ERROR_CONTROL_INTERFACE:
charlesmn 0:3ac96e360672 152 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 153 VL53L1_STRING_ERROR_CONTROL_INTERFACE);
charlesmn 0:3ac96e360672 154 break;
charlesmn 0:3ac96e360672 155 case VL53L1_ERROR_INVALID_COMMAND:
charlesmn 0:3ac96e360672 156 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 157 VL53L1_STRING_ERROR_INVALID_COMMAND);
charlesmn 0:3ac96e360672 158 break;
charlesmn 0:3ac96e360672 159 case VL53L1_ERROR_DIVISION_BY_ZERO:
charlesmn 0:3ac96e360672 160 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 161 VL53L1_STRING_ERROR_DIVISION_BY_ZERO);
charlesmn 0:3ac96e360672 162 break;
charlesmn 0:3ac96e360672 163 case VL53L1_ERROR_REF_SPAD_INIT:
charlesmn 0:3ac96e360672 164 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 165 VL53L1_STRING_ERROR_REF_SPAD_INIT);
charlesmn 0:3ac96e360672 166 break;
charlesmn 0:3ac96e360672 167 case VL53L1_ERROR_GPH_SYNC_CHECK_FAIL:
charlesmn 0:3ac96e360672 168 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 169 VL53L1_STRING_ERROR_GPH_SYNC_CHECK_FAIL);
charlesmn 0:3ac96e360672 170 break;
charlesmn 0:3ac96e360672 171 case VL53L1_ERROR_STREAM_COUNT_CHECK_FAIL:
charlesmn 0:3ac96e360672 172 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 173 VL53L1_STRING_ERROR_STREAM_COUNT_CHECK_FAIL);
charlesmn 0:3ac96e360672 174 break;
charlesmn 0:3ac96e360672 175 case VL53L1_ERROR_GPH_ID_CHECK_FAIL:
charlesmn 0:3ac96e360672 176 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 177 VL53L1_STRING_ERROR_GPH_ID_CHECK_FAIL);
charlesmn 0:3ac96e360672 178 break;
charlesmn 0:3ac96e360672 179 case VL53L1_ERROR_ZONE_STREAM_COUNT_CHECK_FAIL:
charlesmn 0:3ac96e360672 180 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 181 VL53L1_STRING_ERROR_ZONE_STREAM_COUNT_CHECK_FAIL);
charlesmn 0:3ac96e360672 182 break;
charlesmn 0:3ac96e360672 183 case VL53L1_ERROR_ZONE_GPH_ID_CHECK_FAIL:
charlesmn 0:3ac96e360672 184 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 185 VL53L1_STRING_ERROR_ZONE_GPH_ID_CHECK_FAIL);
charlesmn 0:3ac96e360672 186 break;
charlesmn 0:3ac96e360672 187
charlesmn 0:3ac96e360672 188 case VL53L1_ERROR_XTALK_EXTRACTION_NO_SAMPLE_FAIL:
charlesmn 0:3ac96e360672 189 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 190 VL53L1_STRING_ERROR_XTALK_EXTRACTION_NO_SAMPLES_FAIL);
charlesmn 0:3ac96e360672 191 break;
charlesmn 0:3ac96e360672 192 case VL53L1_ERROR_XTALK_EXTRACTION_SIGMA_LIMIT_FAIL:
charlesmn 0:3ac96e360672 193 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 194 VL53L1_STRING_ERROR_XTALK_EXTRACTION_SIGMA_LIMIT_FAIL);
charlesmn 0:3ac96e360672 195 break;
charlesmn 0:3ac96e360672 196
charlesmn 0:3ac96e360672 197 case VL53L1_ERROR_OFFSET_CAL_NO_SAMPLE_FAIL:
charlesmn 0:3ac96e360672 198 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 199 VL53L1_STRING_ERROR_OFFSET_CAL_NO_SAMPLE_FAIL);
charlesmn 0:3ac96e360672 200 break;
charlesmn 0:3ac96e360672 201 case VL53L1_ERROR_OFFSET_CAL_NO_SPADS_ENABLED_FAIL:
charlesmn 0:3ac96e360672 202 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 203 VL53L1_STRING_ERROR_OFFSET_CAL_NO_SPADS_ENABLED_FAIL);
charlesmn 0:3ac96e360672 204 break;
charlesmn 0:3ac96e360672 205 case VL53L1_ERROR_ZONE_CAL_NO_SAMPLE_FAIL:
charlesmn 0:3ac96e360672 206 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 207 VL53L1_STRING_ERROR_ZONE_CAL_NO_SAMPLE_FAIL);
charlesmn 0:3ac96e360672 208 break;
charlesmn 0:3ac96e360672 209
charlesmn 0:3ac96e360672 210 case VL53L1_WARNING_OFFSET_CAL_MISSING_SAMPLES:
charlesmn 0:3ac96e360672 211 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 212 VL53L1_STRING_WARNING_OFFSET_CAL_MISSING_SAMPLES);
charlesmn 0:3ac96e360672 213 break;
charlesmn 0:3ac96e360672 214 case VL53L1_WARNING_OFFSET_CAL_SIGMA_TOO_HIGH:
charlesmn 0:3ac96e360672 215 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 216 VL53L1_STRING_WARNING_OFFSET_CAL_SIGMA_TOO_HIGH);
charlesmn 0:3ac96e360672 217 break;
charlesmn 0:3ac96e360672 218 case VL53L1_WARNING_OFFSET_CAL_RATE_TOO_HIGH:
charlesmn 0:3ac96e360672 219 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 220 VL53L1_STRING_WARNING_OFFSET_CAL_RATE_TOO_HIGH);
charlesmn 0:3ac96e360672 221 break;
charlesmn 0:3ac96e360672 222 case VL53L1_WARNING_OFFSET_CAL_SPAD_COUNT_TOO_LOW:
charlesmn 0:3ac96e360672 223 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 224 VL53L1_STRING_WARNING_OFFSET_CAL_SPAD_COUNT_TOO_LOW);
charlesmn 0:3ac96e360672 225 break;
charlesmn 0:3ac96e360672 226
charlesmn 0:3ac96e360672 227 case VL53L1_WARNING_ZONE_CAL_MISSING_SAMPLES:
charlesmn 0:3ac96e360672 228 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 229 VL53L1_STRING_WARNING_ZONE_CAL_MISSING_SAMPLES);
charlesmn 0:3ac96e360672 230 break;
charlesmn 0:3ac96e360672 231 case VL53L1_WARNING_ZONE_CAL_SIGMA_TOO_HIGH:
charlesmn 0:3ac96e360672 232 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 233 VL53L1_STRING_WARNING_ZONE_CAL_SIGMA_TOO_HIGH);
charlesmn 0:3ac96e360672 234 break;
charlesmn 0:3ac96e360672 235 case VL53L1_WARNING_ZONE_CAL_RATE_TOO_HIGH:
charlesmn 0:3ac96e360672 236 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 237 VL53L1_STRING_WARNING_ZONE_CAL_RATE_TOO_HIGH);
charlesmn 0:3ac96e360672 238 break;
charlesmn 0:3ac96e360672 239
charlesmn 0:3ac96e360672 240 case VL53L1_WARNING_REF_SPAD_CHAR_NOT_ENOUGH_SPADS:
charlesmn 0:3ac96e360672 241 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 242 VL53L1_STRING_WARNING_REF_SPAD_CHAR_NOT_ENOUGH_SPADS);
charlesmn 0:3ac96e360672 243 break;
charlesmn 0:3ac96e360672 244 case VL53L1_WARNING_REF_SPAD_CHAR_RATE_TOO_HIGH:
charlesmn 0:3ac96e360672 245 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 246 VL53L1_STRING_WARNING_REF_SPAD_CHAR_RATE_TOO_HIGH);
charlesmn 0:3ac96e360672 247 break;
charlesmn 0:3ac96e360672 248 case VL53L1_WARNING_REF_SPAD_CHAR_RATE_TOO_LOW:
charlesmn 0:3ac96e360672 249 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 250 VL53L1_STRING_WARNING_REF_SPAD_CHAR_RATE_TOO_LOW);
charlesmn 0:3ac96e360672 251 break;
charlesmn 0:3ac96e360672 252
charlesmn 0:3ac96e360672 253 case VL53L1_WARNING_XTALK_MISSING_SAMPLES:
charlesmn 0:3ac96e360672 254 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 255 VL53L1_STRING_WARNING_XTALK_MISSING_SAMPLES);
charlesmn 0:3ac96e360672 256 break;
charlesmn 0:3ac96e360672 257 case VL53L1_WARNING_XTALK_NO_SAMPLES_FOR_GRADIENT:
charlesmn 0:3ac96e360672 258 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 259 VL53L1_STRING_WARNING_XTALK_NO_SAMPLES_FOR_GRADIENT);
charlesmn 0:3ac96e360672 260 break;
charlesmn 0:3ac96e360672 261 case VL53L1_WARNING_XTALK_SIGMA_LIMIT_FOR_GRADIENT:
charlesmn 0:3ac96e360672 262 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 263 VL53L1_STRING_WARNING_XTALK_SIGMA_LIMIT_FOR_GRADIENT);
charlesmn 0:3ac96e360672 264 break;
charlesmn 0:3ac96e360672 265
charlesmn 0:3ac96e360672 266 case VL53L1_ERROR_DEVICE_FIRMWARE_TOO_OLD:
charlesmn 0:3ac96e360672 267 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 268 VL53L1_STRING_ERROR_DEVICE_FIRMWARE_TOO_OLD);
charlesmn 0:3ac96e360672 269 break;
charlesmn 0:3ac96e360672 270 case VL53L1_ERROR_DEVICE_FIRMWARE_TOO_NEW:
charlesmn 0:3ac96e360672 271 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 272 VL53L1_STRING_ERROR_DEVICE_FIRMWARE_TOO_NEW);
charlesmn 0:3ac96e360672 273 break;
charlesmn 0:3ac96e360672 274 case VL53L1_ERROR_UNIT_TEST_FAIL:
charlesmn 0:3ac96e360672 275 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 276 VL53L1_STRING_ERROR_UNIT_TEST_FAIL);
charlesmn 0:3ac96e360672 277 break;
charlesmn 0:3ac96e360672 278 case VL53L1_ERROR_FILE_READ_FAIL:
charlesmn 0:3ac96e360672 279 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 280 VL53L1_STRING_ERROR_FILE_READ_FAIL);
charlesmn 0:3ac96e360672 281 break;
charlesmn 0:3ac96e360672 282 case VL53L1_ERROR_FILE_WRITE_FAIL:
charlesmn 0:3ac96e360672 283 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 284 VL53L1_STRING_ERROR_FILE_WRITE_FAIL);
charlesmn 0:3ac96e360672 285 break;
charlesmn 0:3ac96e360672 286 case VL53L1_ERROR_NOT_IMPLEMENTED:
charlesmn 0:3ac96e360672 287 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 288 VL53L1_STRING_ERROR_NOT_IMPLEMENTED);
charlesmn 0:3ac96e360672 289 break;
charlesmn 0:3ac96e360672 290 default:
charlesmn 0:3ac96e360672 291 VL53L1_COPYSTRING(pPalErrorString,
charlesmn 0:3ac96e360672 292 VL53L1_STRING_UNKNOW_ERROR_CODE);
charlesmn 0:3ac96e360672 293 }
charlesmn 0:3ac96e360672 294
charlesmn 0:3ac96e360672 295 #endif
charlesmn 0:3ac96e360672 296
charlesmn 0:3ac96e360672 297 LOG_FUNCTION_END(Status);
charlesmn 0:3ac96e360672 298
charlesmn 0:3ac96e360672 299 return Status;
charlesmn 0:3ac96e360672 300 }
charlesmn 0:3ac96e360672 301
charlesmn 0:3ac96e360672 302