ST Expansion SW Team / VL53L1

Dependencies:   X_NUCLEO_COMMON ST_INTERFACES

Dependents:   X_NUCLEO_53L1CB

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers vl53l1_error_codes.h Source File

vl53l1_error_codes.h

Go to the documentation of this file.
00001 
00002 /* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */
00003 /******************************************************************************
00004  * Copyright (c) 2020, STMicroelectronics - All Rights Reserved
00005 
00006  This file is part of VL53L1 and is dual licensed,
00007  either GPL-2.0+
00008  or 'BSD 3-clause "New" or "Revised" License' , at your option.
00009  ******************************************************************************
00010  */
00011 
00012 /**
00013  * @file vl53l1_error_codes.h
00014  *
00015  * @brief Error Code definitions for VL53L1 API.
00016  *
00017  */
00018 
00019 #ifndef _VL53L1_ERROR_CODES_H_
00020 #define _VL53L1_ERROR_CODES_H_
00021 
00022 #include "vl53l1_types.h"
00023 
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027 
00028 
00029 /*
00030  ****************************************
00031  * PRIVATE define do not edit
00032  ***************************************
00033  */
00034 
00035 /*
00036  * @defgroup VL53L1_define_Error_group Error and Warning code returned by API
00037  *  The following DEFINE are used to identify the PAL ERROR
00038  *  @{
00039  */
00040 
00041 typedef int8_t VL53L1_Error;
00042 
00043 #define VL53L1_ERROR_NONE                              ((VL53L1_Error)  0)
00044 #define VL53L1_ERROR_CALIBRATION_WARNING               ((VL53L1_Error) - 1)
00045     /*!< Warning invalid calibration data may be in used
00046      *  \a  VL53L1_InitData()
00047      *  \a VL53L1_GetOffsetCalibrationData
00048      *  \a VL53L1_SetOffsetCalibrationData
00049      */
00050 #define VL53L1_ERROR_MIN_CLIPPED                       ((VL53L1_Error) - 2)
00051     /*!< Warning parameter passed was clipped to min before to be applied */
00052 
00053 #define VL53L1_ERROR_UNDEFINED                         ((VL53L1_Error) - 3)
00054     /*!< Unqualified error */
00055 #define VL53L1_ERROR_INVALID_PARAMS                    ((VL53L1_Error) - 4)
00056     /*!< Parameter passed is invalid or out of range */
00057 #define VL53L1_ERROR_NOT_SUPPORTED                     ((VL53L1_Error) - 5)
00058     /*!< Function is not supported in current mode or configuration */
00059 #define VL53L1_ERROR_RANGE_ERROR                       ((VL53L1_Error) - 6)
00060     /*!< Device report a ranging error interrupt status */
00061 #define VL53L1_ERROR_TIME_OUT                          ((VL53L1_Error) - 7)
00062     /*!< Aborted due to time out */
00063 #define VL53L1_ERROR_MODE_NOT_SUPPORTED                ((VL53L1_Error) - 8)
00064     /*!< Asked mode is not supported by the device */
00065 #define VL53L1_ERROR_BUFFER_TOO_SMALL                  ((VL53L1_Error) - 9)
00066     /*!< ... */
00067 #define VL53L1_ERROR_COMMS_BUFFER_TOO_SMALL            ((VL53L1_Error) - 10)
00068     /*!< Supplied buffer is larger than I2C supports */
00069 #define VL53L1_ERROR_GPIO_NOT_EXISTING                 ((VL53L1_Error) - 11)
00070     /*!< User tried to setup a non-existing GPIO pin */
00071 #define VL53L1_ERROR_GPIO_FUNCTIONALITY_NOT_SUPPORTED  ((VL53L1_Error) - 12)
00072     /*!< unsupported GPIO functionality */
00073 #define VL53L1_ERROR_CONTROL_INTERFACE                 ((VL53L1_Error) - 13)
00074     /*!< error reported from IO functions */
00075 #define VL53L1_ERROR_INVALID_COMMAND                   ((VL53L1_Error) - 14)
00076     /*!< The command is not allowed in the current device state
00077      *  (power down)
00078      */
00079 #define VL53L1_ERROR_DIVISION_BY_ZERO                  ((VL53L1_Error) - 15)
00080     /*!< In the function a division by zero occurs */
00081 #define VL53L1_ERROR_REF_SPAD_INIT                     ((VL53L1_Error) - 16)
00082     /*!< Error during reference SPAD initialization */
00083 #define VL53L1_ERROR_GPH_SYNC_CHECK_FAIL               ((VL53L1_Error) - 17)
00084     /*!<  GPH sync interrupt check fail - API out of sync with device*/
00085 #define VL53L1_ERROR_STREAM_COUNT_CHECK_FAIL           ((VL53L1_Error) - 18)
00086     /*!<  Stream count check fail - API out of sync with device */
00087 #define VL53L1_ERROR_GPH_ID_CHECK_FAIL                 ((VL53L1_Error) - 19)
00088     /*!<  GPH ID check fail - API out of sync with device */
00089 #define VL53L1_ERROR_ZONE_STREAM_COUNT_CHECK_FAIL      ((VL53L1_Error) - 20)
00090     /*!<  Zone dynamic config stream count check failed - API out of sync */
00091 #define VL53L1_ERROR_ZONE_GPH_ID_CHECK_FAIL            ((VL53L1_Error) - 21)
00092     /*!<  Zone dynamic config GPH ID check failed - API out of sync */
00093 
00094 #define VL53L1_ERROR_XTALK_EXTRACTION_NO_SAMPLE_FAIL   ((VL53L1_Error) - 22)
00095     /*!<  Thrown when run_xtalk_extraction fn has 0 succesful samples
00096      * when using the full array to sample the xtalk. In this case there is
00097      * not enough information to generate new Xtalk parm info. The function
00098      * will exit and leave the current xtalk parameters unaltered
00099      */
00100 #define VL53L1_ERROR_XTALK_EXTRACTION_SIGMA_LIMIT_FAIL ((VL53L1_Error) - 23)
00101     /*!<  Thrown when run_xtalk_extraction fn has found that the
00102      * avg sigma estimate of the full array xtalk sample is > than the
00103      * maximal limit allowed. In this case the xtalk sample is too noisy for
00104      * measurement. The function will exit and leave the current xtalk
00105      * parameters unaltered.
00106      */
00107 
00108 
00109 #define VL53L1_ERROR_OFFSET_CAL_NO_SAMPLE_FAIL           ((VL53L1_Error) - 24)
00110     /*!<  Thrown if there one of stages has no valid offset calibration
00111      *    samples. A fatal error calibration not valid
00112      */
00113 #define VL53L1_ERROR_OFFSET_CAL_NO_SPADS_ENABLED_FAIL    ((VL53L1_Error) - 25)
00114     /*!<  Thrown if there one of stages has zero effective SPADS
00115      *    Traps the case when MM1 SPADs is zero.
00116      *    A fatal error calibration not valid
00117      */
00118 #define VL53L1_ERROR_ZONE_CAL_NO_SAMPLE_FAIL             ((VL53L1_Error) - 26)
00119     /*!<  Thrown if then some of the zones have no valid samples
00120      *    A fatal error calibration not valid
00121      */
00122 
00123 #define VL53L1_ERROR_TUNING_PARM_KEY_MISMATCH             ((VL53L1_Error) - 27)
00124     /*!<  Thrown if the tuning file key table version does not match with
00125      * expected value. The driver expects the key table version to match
00126      * the compiled default version number in the define
00127      * #VL53L1_TUNINGPARM_KEY_TABLE_VERSION_DEFAULT
00128      */
00129 
00130 #define VL53L1_WARNING_REF_SPAD_CHAR_NOT_ENOUGH_SPADS   ((VL53L1_Error) - 28)
00131     /*!<  Thrown if there are less than 5 good SPADs are available. */
00132 #define VL53L1_WARNING_REF_SPAD_CHAR_RATE_TOO_HIGH      ((VL53L1_Error) - 29)
00133     /*!<  Thrown if the final reference rate is greater than
00134      * the upper reference rate limit - default is 40 Mcps.
00135      * Implies a minimum Q3 (x10) SPAD (5) selected
00136      */
00137 #define VL53L1_WARNING_REF_SPAD_CHAR_RATE_TOO_LOW       ((VL53L1_Error) - 30)
00138     /*!<  Thrown if the final reference rate is less than
00139      * the lower reference rate limit - default is 10 Mcps.
00140      * Implies maximum Q1 (x1) SPADs selected
00141      */
00142 
00143 
00144 #define VL53L1_WARNING_OFFSET_CAL_MISSING_SAMPLES       ((VL53L1_Error) - 31)
00145     /*!<  Thrown if there is less than the requested number of
00146      *    valid samples.
00147      */
00148 #define VL53L1_WARNING_OFFSET_CAL_SIGMA_TOO_HIGH        ((VL53L1_Error) - 32)
00149     /*!<  Thrown if the offset calibration range sigma estimate is greater
00150      *    than 8.0 mm. This is the recommended min value to yield a stable
00151      *    offset measurement
00152      */
00153 #define VL53L1_WARNING_OFFSET_CAL_RATE_TOO_HIGH         ((VL53L1_Error) - 33)
00154     /*!< Thrown when VL53L1_run_offset_calibration()  peak rate is greater
00155      * than that 50.0Mcps. This is the recommended  max rate to avoid
00156      * pile-up influencing the offset measurement
00157      */
00158 #define VL53L1_WARNING_OFFSET_CAL_SPAD_COUNT_TOO_LOW    ((VL53L1_Error) - 34)
00159     /*!< Thrown when VL53L1_run_offset_calibration() when one of stages
00160      * range has less that 5.0 effective SPADS. This is the recommended
00161      * min value to yield a stable offset
00162      */
00163 
00164 
00165 #define VL53L1_WARNING_ZONE_CAL_MISSING_SAMPLES       ((VL53L1_Error) - 35)
00166     /*!<  Thrown if one of more of the zones have less than
00167      * the requested number of valid samples
00168      */
00169 #define VL53L1_WARNING_ZONE_CAL_SIGMA_TOO_HIGH        ((VL53L1_Error) - 36)
00170     /*!<  Thrown if one or more zones have sigma estimate value greater
00171      *    than 8.0 mm. This is the recommended min value to yield a stable
00172      *    offset measurement
00173      */
00174 #define VL53L1_WARNING_ZONE_CAL_RATE_TOO_HIGH         ((VL53L1_Error) - 37)
00175     /*!< Thrown if one of more zones have  peak rate higher than
00176      * that 50.0Mcps. This is the recommended  max rate to avoid
00177      * pile-up influencing the offset measurement
00178      */
00179 
00180 
00181 #define VL53L1_WARNING_XTALK_MISSING_SAMPLES             ((VL53L1_Error) - 38)
00182     /*!< Thrown to notify that some of the xtalk samples did not yield
00183      * valid ranging pulse data while attempting to measure
00184      * the xtalk signal in vl53l1_run_xtalk_extract(). This can signify any
00185      * of the zones are missing samples, for further debug information the
00186      * xtalk_results struct should be referred to. This warning is for
00187      * notification only, xtalk pulse and shape have still been generated
00188      */
00189 #define VL53L1_WARNING_XTALK_NO_SAMPLES_FOR_GRADIENT     ((VL53L1_Error) - 39)
00190     /*!< Thrown to notify that some of teh xtalk samples used for gradient
00191      * generation did not yield valid ranging pulse data while attempting to
00192      * measure the xtalk signal in vl53l1_run_xtalk_extract(). This can
00193      * signify that any one of the zones 0-3 yielded no successful samples.
00194      * xtalk_results struct should be referred to for further debug info.
00195      * This warning is for notification only, the xtalk pulse and shape
00196      * have still been generated.
00197      */
00198 #define VL53L1_WARNING_XTALK_SIGMA_LIMIT_FOR_GRADIENT    ((VL53L1_Error) - 40)
00199     /*!< Thrown to notify that some of the xtalk samples used for gradient
00200      * generation did not pass the sigma limit check  while attempting to
00201      * measure the xtalk signal in vl53l1_run_xtalk_extract(). This can
00202      * signify that any one of the zones 0-3 yielded an avg sigma_mm
00203      * value > the limit. The xtalk_results struct should be referred to for
00204      * further debug info.
00205      * This warning is for notification only, the xtalk pulse and shape
00206      * have still been generated.
00207      */
00208 
00209 #define VL53L1_ERROR_NOT_IMPLEMENTED                   ((VL53L1_Error) - 41)
00210     /*!< Tells requested functionality has not been implemented yet or
00211      * not compatible with the device
00212      */
00213 #define VL53L1_ERROR_PLATFORM_SPECIFIC_START           ((VL53L1_Error) - 60)
00214     /*!< Tells the starting code for platform */
00215 /** @} VL53L1_define_Error_group */
00216 
00217 
00218 #ifdef __cplusplus
00219 }
00220 #endif
00221 
00222 
00223 #endif /* _VL53L1_ERROR_CODES_H_ */