vl53l1_api_strings.h 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. /*
  2. * Copyright (c) 2017, STMicroelectronics - All Rights Reserved
  3. *
  4. * This file is part of VL53L1 Core and is dual licensed,
  5. * either 'STMicroelectronics
  6. * Proprietary license'
  7. * or 'BSD 3-clause "New" or "Revised" License' , at your option.
  8. *
  9. ********************************************************************************
  10. *
  11. * 'STMicroelectronics Proprietary license'
  12. *
  13. ********************************************************************************
  14. *
  15. * License terms: STMicroelectronics Proprietary in accordance with licensing
  16. * terms at www.st.com/sla0081
  17. *
  18. * STMicroelectronics confidential
  19. * Reproduction and Communication of this document is strictly prohibited unless
  20. * specifically authorized in writing by STMicroelectronics.
  21. *
  22. *
  23. ********************************************************************************
  24. *
  25. * Alternatively, VL53L1 Core may be distributed under the terms of
  26. * 'BSD 3-clause "New" or "Revised" License', in which case the following
  27. * provisions apply instead of the ones mentioned above :
  28. *
  29. ********************************************************************************
  30. *
  31. * License terms: BSD 3-clause "New" or "Revised" License.
  32. *
  33. * Redistribution and use in source and binary forms, with or without
  34. * modification, are permitted provided that the following conditions are met:
  35. *
  36. * 1. Redistributions of source code must retain the above copyright notice, this
  37. * list of conditions and the following disclaimer.
  38. *
  39. * 2. Redistributions in binary form must reproduce the above copyright notice,
  40. * this list of conditions and the following disclaimer in the documentation
  41. * and/or other materials provided with the distribution.
  42. *
  43. * 3. Neither the name of the copyright holder nor the names of its contributors
  44. * may be used to endorse or promote products derived from this software
  45. * without specific prior written permission.
  46. *
  47. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  48. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  49. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  50. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  51. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  52. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  53. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  54. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  55. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  56. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  57. *
  58. *
  59. ********************************************************************************
  60. *
  61. */
  62. /**
  63. * @file vl53l1_api_strings.h
  64. * @brief VL53L1 API function declarations for decoding error codes to a
  65. * text strings
  66. */
  67. #ifndef VL53L1_API_STRINGS_H_
  68. #define VL53L1_API_STRINGS_H_
  69. #include "vl53l1_def.h"
  70. #ifdef __cplusplus
  71. extern "C" {
  72. #endif
  73. /**
  74. * @brief Generates a string for the input device range status code
  75. *
  76. * @param[in] RangeStatus : Device Range AStatus Code
  77. * @param[out] pRangeStatusString : pointer to character buffer
  78. *
  79. * @return VL53L1_ERROR_NONE Success
  80. * @return "Other error code" See ::VL53L1_Error
  81. */
  82. VL53L1_Error VL53L1_get_range_status_string(
  83. uint8_t RangeStatus,
  84. char *pRangeStatusString);
  85. /**
  86. * @brief Generates an error string for the input PAL error code
  87. *
  88. * @param[in] PalErrorCode : PAL Error Code
  89. * @param[out] pPalErrorString : pointer to character buffer
  90. *
  91. * @return VL53L1_ERROR_NONE Success
  92. * @return "Other error code" See ::VL53L1_Error
  93. */
  94. VL53L1_Error VL53L1_get_pal_error_string(
  95. VL53L1_Error PalErrorCode,
  96. char *pPalErrorString);
  97. /**
  98. * @brief Generates a string for the input PAL State code
  99. *
  100. * @param[in] PalStateCode : PAL State Code
  101. * @param[out] pPalStateString : pointer to character buffer
  102. *
  103. * @return VL53L1_ERROR_NONE Success
  104. * @return "Other error code" See ::VL53L1_Error
  105. */
  106. VL53L1_Error VL53L1_get_pal_state_string(
  107. VL53L1_State PalStateCode,
  108. char *pPalStateString);
  109. /**
  110. * @brief Generates a string for the sequence step Id
  111. *
  112. * @param[in] SequenceStepId : Sequence Step Id
  113. * @param[out] pSequenceStepsString : pointer to character buffer
  114. *
  115. * @return VL53L1_ERROR_NONE Success
  116. * @return "Other error code" See ::VL53L1_Error
  117. */
  118. VL53L1_Error VL53L1_get_sequence_steps_info(
  119. VL53L1_SequenceStepId SequenceStepId,
  120. char *pSequenceStepsString);
  121. /**
  122. * @brief Generates a string for the limit check Id
  123. *
  124. * @param[in] LimitCheckId : Limit check Id
  125. * @param[out] pLimitCheckString : pointer to character buffer
  126. *
  127. * @return VL53L1_ERROR_NONE Success
  128. * @return "Other error code" See ::VL53L1_Error
  129. */
  130. VL53L1_Error VL53L1_get_limit_check_info(uint16_t LimitCheckId,
  131. char *pLimitCheckString);
  132. #ifndef VL53L1_USE_EMPTY_STRING
  133. #define VL53L1_STRING_DEVICE_INFO_NAME0 "VL53L1 cut1.0"
  134. #define VL53L1_STRING_DEVICE_INFO_NAME1 "VL53L1 cut1.1"
  135. #define VL53L1_STRING_DEVICE_INFO_TYPE "VL53L1"
  136. /* Range Status */
  137. #define VL53L1_STRING_RANGESTATUS_NONE "No Update"
  138. #define VL53L1_STRING_RANGESTATUS_RANGEVALID "Range Valid"
  139. #define VL53L1_STRING_RANGESTATUS_SIGMA "Sigma Fail"
  140. #define VL53L1_STRING_RANGESTATUS_SIGNAL "Signal Fail"
  141. #define VL53L1_STRING_RANGESTATUS_MINRANGE "Min Range Fail"
  142. #define VL53L1_STRING_RANGESTATUS_PHASE "Phase Fail"
  143. #define VL53L1_STRING_RANGESTATUS_HW "Hardware Fail"
  144. /* Range Status */
  145. #define VL53L1_STRING_STATE_POWERDOWN "POWERDOWN State"
  146. #define VL53L1_STRING_STATE_WAIT_STATICINIT \
  147. "Wait for staticinit State"
  148. #define VL53L1_STRING_STATE_STANDBY "STANDBY State"
  149. #define VL53L1_STRING_STATE_IDLE "IDLE State"
  150. #define VL53L1_STRING_STATE_RUNNING "RUNNING State"
  151. #define VL53L1_STRING_STATE_RESET "RESET State"
  152. #define VL53L1_STRING_STATE_UNKNOWN "UNKNOWN State"
  153. #define VL53L1_STRING_STATE_ERROR "ERROR State"
  154. /* Check Enable */
  155. #define VL53L1_STRING_CHECKENABLE_SIGMA_FINAL_RANGE \
  156. "SIGMA FINAL RANGE"
  157. #define VL53L1_STRING_CHECKENABLE_SIGNAL_RATE_FINAL_RANGE \
  158. "SIGNAL RATE FINAL RANGE"
  159. #define VL53L1_STRING_CHECKENABLE_SIGNAL_MIN_CLIP \
  160. "SIGNAL MIN CLIP"
  161. #define VL53L1_STRING_CHECKENABLE_RANGE_IGNORE_THRESHOLD \
  162. "RANGE IGNORE THRESHOLD"
  163. #define VL53L1_STRING_CHECKENABLE_RANGE_PHASE_HIGH \
  164. "RANGE PHASE HIGH"
  165. #define VL53L1_STRING_CHECKENABLE_RANGE_PHASE_LOW \
  166. "RANGE PHASE LOW"
  167. #define VL53L1_STRING_CHECKENABLE_RANGE_PHASE_CONSISTENCY \
  168. "RANGE PHASE CONSISTENCY"
  169. /* Sequence Step */
  170. #define VL53L1_STRING_SEQUENCESTEP_VHV "VHV"
  171. #define VL53L1_STRING_SEQUENCESTEP_PHASECAL "PHASE CAL"
  172. #define VL53L1_STRING_SEQUENCESTEP_REFPHASE "REF PHASE"
  173. #define VL53L1_STRING_SEQUENCESTEP_DSS1 "DSS1"
  174. #define VL53L1_STRING_SEQUENCESTEP_DSS2 "DSS2"
  175. #define VL53L1_STRING_SEQUENCESTEP_MM1 "MM1"
  176. #define VL53L1_STRING_SEQUENCESTEP_MM2 "MM2"
  177. #define VL53L1_STRING_SEQUENCESTEP_RANGE "RANGE"
  178. #endif /* VL53L1_USE_EMPTY_STRING */
  179. #ifdef __cplusplus
  180. }
  181. #endif
  182. #endif