vl53l1_api_debug.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  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_debug.h
  64. *
  65. * @brief EwokPlus25 low level API function definitions
  66. */
  67. #ifndef _VL53L1_API_DEBUG_H_
  68. #define _VL53L1_API_DEBUG_H_
  69. #include "vl53l1_platform.h"
  70. #ifdef __cplusplus
  71. extern "C" {
  72. #endif
  73. /* Start Patch_AdditionalDebugData_11823 */
  74. /**
  75. * @brief Gets the current LL Driver configuration parameters and the last
  76. * set of histogram data for debug
  77. *
  78. * @param[in] Dev : Device Handle
  79. * @param[out] pdata : pointer to VL53L1_additional_data_t data structure
  80. *
  81. * @return VL53L1_ERROR_NONE Success
  82. * @return "Other error code" See ::VL53L1_Error
  83. */
  84. VL53L1_Error VL53L1_get_additional_data(
  85. VL53L1_DEV Dev,
  86. VL53L1_additional_data_t *pdata);
  87. /* End Patch_AdditionalDebugData_11823 */
  88. #ifdef VL53L1_LOG_ENABLE
  89. /**
  90. * @brief Implements an sprintf function for signed fixed point numbers
  91. *
  92. * @param[in] fp_value : input signed fixed point number
  93. * @param[in] frac_bits : number of fixed point fractional bits
  94. * @param[in] buf_size : size of supplied text buffer
  95. * @param[out] pbuffer : pointer to text buffer
  96. *
  97. */
  98. void VL53L1_signed_fixed_point_sprintf(
  99. int32_t fp_value,
  100. uint8_t frac_bits,
  101. uint16_t buf_size,
  102. char *pbuffer);
  103. /**
  104. * @brief Convenience function to print out VL53L1_static_nvm_managed_t for debug
  105. *
  106. * @param[in] pdata : pointer to VL53L1_static_nvm_managed_t
  107. * @param[in] pprefix : pointer to name prefix string
  108. * @param[in] trace_flags : logging module enable bit flags
  109. */
  110. void VL53L1_print_static_nvm_managed(
  111. VL53L1_static_nvm_managed_t *pdata,
  112. char *pprefix,
  113. uint32_t trace_flags);
  114. /**
  115. * @brief Convenience function to print out VL53L1_customer_nvm_managed_t for debug
  116. *
  117. * @param[in] pdata : pointer to VL53L1_customer_nvm_managed_t
  118. * @param[in] pprefix : pointer to name prefix string
  119. * @param[in] trace_flags : logging module enable bit flags
  120. */
  121. void VL53L1_print_customer_nvm_managed(
  122. VL53L1_customer_nvm_managed_t *pdata,
  123. char *pprefix,
  124. uint32_t trace_flags);
  125. /**
  126. * @brief Convenience function to print out VL53L1_nvm_copy_data_t for debug
  127. *
  128. * @param[in] pdata : pointer to VL53L1_nvm_copy_data_t
  129. * @param[in] pprefix : pointer to name prefix string
  130. * @param[in] trace_flags : logging module enable bit flags
  131. */
  132. void VL53L1_print_nvm_copy_data(
  133. VL53L1_nvm_copy_data_t *pdata,
  134. char *pprefix,
  135. uint32_t trace_flags);
  136. /**
  137. * @brief Convenience function to print out the contents of
  138. * the Range Results structure for debug
  139. *
  140. * @param[in] pdata : pointer to a VL53L1_range_results_t structure
  141. * @param[in] pprefix : pointer to name prefix string
  142. * @param[in] trace_flags : logging module enable bit flags
  143. */
  144. void VL53L1_print_range_results(
  145. VL53L1_range_results_t *pdata,
  146. char *pprefix,
  147. uint32_t trace_flags);
  148. /**
  149. * @brief Convenience function to print out the contents of
  150. * the Range Data structure for debug
  151. *
  152. * @param[in] pdata : pointer to a VL53L1_range_data_t structure
  153. * @param[in] pprefix : pointer to name prefix string
  154. * @param[in] trace_flags : logging module enable bit flags
  155. */
  156. void VL53L1_print_range_data(
  157. VL53L1_range_data_t *pdata,
  158. char *pprefix,
  159. uint32_t trace_flags);
  160. /**
  161. * @brief Convenience function to print out the contents of
  162. * the offset range results structure for debug
  163. *
  164. * @param[in] pdata : pointer to a VL53L1_offset_range_results_t structure
  165. * @param[in] pprefix : pointer to name prefix string
  166. * @param[in] trace_flags : logging module enable bit flags
  167. */
  168. void VL53L1_print_offset_range_results(
  169. VL53L1_offset_range_results_t *pdata,
  170. char *pprefix,
  171. uint32_t trace_flags);
  172. /**
  173. * @brief Convenience function to print out the contents of
  174. * the offset range data structure for debug
  175. *
  176. * @param[in] pdata : pointer to a VL53L1_offset_range_data_t structure
  177. * @param[in] pprefix : pointer to name prefix string
  178. * @param[in] trace_flags : logging module enable bit flags
  179. */
  180. void VL53L1_print_offset_range_data(
  181. VL53L1_offset_range_data_t *pdata,
  182. char *pprefix,
  183. uint32_t trace_flags);
  184. /**
  185. * @brief Convenience function to print out the contents of
  186. * the peak rate map calibration data structure
  187. *
  188. * @param[in] pdata : pointer to a VL53L1_cal_peak_rate_map_t structure
  189. * @param[in] pprefix : pointer to name prefix string
  190. * @param[in] trace_flags : logging module enable bit flags
  191. */
  192. void VL53L1_print_cal_peak_rate_map(
  193. VL53L1_cal_peak_rate_map_t *pdata,
  194. char *pprefix,
  195. uint32_t trace_flags);
  196. /**
  197. * @brief Convenience function to print out the contents of
  198. * the additional offset calibration data structure
  199. *
  200. * @param[in] pdata : pointer to a VL53L1_additional_offset_cal_data_t structure
  201. * @param[in] pprefix : pointer to name prefix string
  202. * @param[in] trace_flags : logging module enable bit flags
  203. */
  204. void VL53L1_print_additional_offset_cal_data(
  205. VL53L1_additional_offset_cal_data_t *pdata,
  206. char *pprefix,
  207. uint32_t trace_flags);
  208. /**
  209. * @brief Convenience function to print out the contents of
  210. * the additional data structure
  211. *
  212. * @param[in] pdata : pointer to a VL53L1_additional_data_t structure
  213. * @param[in] pprefix : pointer to name prefix string
  214. * @param[in] trace_flags : logging module enable bit flags
  215. */
  216. void VL53L1_print_additional_data(
  217. VL53L1_additional_data_t *pdata,
  218. char *pprefix,
  219. uint32_t trace_flags);
  220. /**
  221. * @brief Convenience function to print out the contents of
  222. * the LL driver gain calibration data structure
  223. *
  224. * @param[in] pdata : pointer to a VL53L1_gain_calibration_data_t structure
  225. * @param[in] pprefix : pointer to name prefix string
  226. * @param[in] trace_flags : logging module enable bit flags
  227. */
  228. void VL53L1_print_gain_calibration_data(
  229. VL53L1_gain_calibration_data_t *pdata,
  230. char *pprefix,
  231. uint32_t trace_flags);
  232. /**
  233. * @brief Convenience function to print out the contents of
  234. * the xtalk configuration data for debug
  235. *
  236. * @param[in] pdata : pointer to a VL53L1_xtalk_config_t Structure
  237. * @param[in] pprefix : pointer to name prefix string
  238. * @param[in] trace_flags : logging module enable bit flags
  239. */
  240. void VL53L1_print_xtalk_config(
  241. VL53L1_xtalk_config_t *pdata,
  242. char *pprefix,
  243. uint32_t trace_flags);
  244. /**
  245. * @brief Convenience function to print out the contents of
  246. * the Optical Centre structure for debug
  247. *
  248. * @param[in] pdata : pointer to a VL53L1_optical_centre_t structure
  249. * @param[in] pprefix : pointer to name prefix string
  250. * @param[in] trace_flags : logging module enable bit flags
  251. */
  252. void VL53L1_print_optical_centre(
  253. VL53L1_optical_centre_t *pdata,
  254. char *pprefix,
  255. uint32_t trace_flags);
  256. /**
  257. * @brief Convenience function to print out the contents of
  258. * the User Zone (ROI) structure for debug
  259. *
  260. * @param[in] pdata : pointer to a VL53L1_user_zone_t structure
  261. * @param[in] pprefix : pointer to name prefix string
  262. * @param[in] trace_flags : logging module enable bit flags
  263. */
  264. void VL53L1_print_user_zone(
  265. VL53L1_user_zone_t *pdata,
  266. char *pprefix,
  267. uint32_t trace_flags);
  268. /**
  269. * @brief Convenience function for printing out VL53L1_spad_rate_data_t
  270. *
  271. * @param[in] pspad_rates : pointer to VL53L1_spad_rate_data_t
  272. * @param[in] pprefix : pointer to name prefix string
  273. * @param[in] trace_flags : logging module enable bit flags
  274. */
  275. void VL53L1_print_spad_rate_data(
  276. VL53L1_spad_rate_data_t *pspad_rates,
  277. char *pprefix,
  278. uint32_t trace_flags);
  279. /**
  280. * @brief Convenience function for printing out VL53L1_spad_rate_map_t
  281. *
  282. * @param[in] pspad_rates : pointer to VL53L1_spad_rate_map_t
  283. * @param[in] pprefix : pointer to name prefix string
  284. * @param[in] trace_flags : logging module enable bit flags
  285. */
  286. void VL53L1_print_spad_rate_map(
  287. VL53L1_spad_rate_data_t *pspad_rates,
  288. char *pprefix,
  289. uint32_t trace_flags);
  290. #endif /* VL53L1_LOG_ENABLE */
  291. #ifdef __cplusplus
  292. }
  293. #endif
  294. #endif /* _VL53L1_API_DEBUG_H_ */