vl53l1_api_strings.c
Go to the documentation of this file.
1 
2 /*
3 * Copyright (c) 2017, STMicroelectronics - All Rights Reserved
4 *
5 * This file is part of VL53L1 Core and is dual licensed,
6 * either 'STMicroelectronics
7 * Proprietary license'
8 * or 'BSD 3-clause "New" or "Revised" License' , at your option.
9 *
10 ********************************************************************************
11 *
12 * 'STMicroelectronics Proprietary license'
13 *
14 ********************************************************************************
15 *
16 * License terms: STMicroelectronics Proprietary in accordance with licensing
17 * terms at www.st.com/sla0081
18 *
19 * STMicroelectronics confidential
20 * Reproduction and Communication of this document is strictly prohibited unless
21 * specifically authorized in writing by STMicroelectronics.
22 *
23 *
24 ********************************************************************************
25 *
26 * Alternatively, VL53L1 Core may be distributed under the terms of
27 * 'BSD 3-clause "New" or "Revised" License', in which case the following
28 * provisions apply instead of the ones mentioned above :
29 *
30 ********************************************************************************
31 *
32 * License terms: BSD 3-clause "New" or "Revised" License.
33 *
34 * Redistribution and use in source and binary forms, with or without
35 * modification, are permitted provided that the following conditions are met:
36 *
37 * 1. Redistributions of source code must retain the above copyright notice, this
38 * list of conditions and the following disclaimer.
39 *
40 * 2. Redistributions in binary form must reproduce the above copyright notice,
41 * this list of conditions and the following disclaimer in the documentation
42 * and/or other materials provided with the distribution.
43 *
44 * 3. Neither the name of the copyright holder nor the names of its contributors
45 * may be used to endorse or promote products derived from this software
46 * without specific prior written permission.
47 *
48 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
49 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
50 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
51 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
52 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
53 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
54 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
55 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
56 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
57 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
58 *
59 *
60 ********************************************************************************
61 *
62 */
63 
69 #include "vl53l1_api_core.h"
70 #include "vl53l1_api_strings.h"
71 #include "vl53l1_error_codes.h"
72 #include "vl53l1_error_strings.h"
73 
74 #define LOG_FUNCTION_START(fmt, ...) \
75  _LOG_FUNCTION_START(VL53L1_TRACE_MODULE_API, fmt, ##__VA_ARGS__)
76 #define LOG_FUNCTION_END(status, ...) \
77  _LOG_FUNCTION_END(VL53L1_TRACE_MODULE_API, status, ##__VA_ARGS__)
78 #define LOG_FUNCTION_END_FMT(status, fmt, ...) \
79  _LOG_FUNCTION_END_FMT(VL53L1_TRACE_MODULE_API, status, fmt, \
80  ##__VA_ARGS__)
81 
82 
84  uint8_t RangeStatus,
85  char *pRangeStatusString)
86 {
88 
90 
91 #ifdef VL53L1_USE_EMPTY_STRING
92  VL53L1_COPYSTRING(pRangeStatusString, "");
93 #else
94  switch (RangeStatus) {
95  case 0:
96  VL53L1_COPYSTRING(pRangeStatusString,
98  break;
99  case 1:
100  VL53L1_COPYSTRING(pRangeStatusString,
102  break;
103  case 2:
104  VL53L1_COPYSTRING(pRangeStatusString,
106  break;
107  case 3:
108  VL53L1_COPYSTRING(pRangeStatusString,
110  break;
111  case 4:
112  VL53L1_COPYSTRING(pRangeStatusString,
114  break;
115  case 5:
116  VL53L1_COPYSTRING(pRangeStatusString,
118  break;
119 
120  default:
121  VL53L1_COPYSTRING(pRangeStatusString,
123  }
124 #endif
125 
126  LOG_FUNCTION_END(status);
127  return status;
128 }
129 
130 
132  VL53L1_State PalStateCode,
133  char *pPalStateString)
134 {
136 
137  LOG_FUNCTION_START("");
138 
139 #ifdef VL53L1_USE_EMPTY_STRING
140  VL53L1_COPYSTRING(pPalStateString, "");
141 #else
142  switch (PalStateCode) {
144  VL53L1_COPYSTRING(pPalStateString,
146  break;
148  VL53L1_COPYSTRING(pPalStateString,
150  break;
152  VL53L1_COPYSTRING(pPalStateString,
154  break;
155  case VL53L1_STATE_IDLE:
156  VL53L1_COPYSTRING(pPalStateString,
158  break;
160  VL53L1_COPYSTRING(pPalStateString,
162  break;
163  case VL53L1_STATE_RESET:
164  VL53L1_COPYSTRING(pPalStateString,
166  break;
168  VL53L1_COPYSTRING(pPalStateString,
170  break;
171  case VL53L1_STATE_ERROR:
172  VL53L1_COPYSTRING(pPalStateString,
174  break;
175 
176  default:
177  VL53L1_COPYSTRING(pPalStateString,
179  }
180 #endif
181 
182  LOG_FUNCTION_END(status);
183  return status;
184 }
185 
187  VL53L1_SequenceStepId SequenceStepId,
188  char *pSequenceStepsString)
189 {
191 
192  LOG_FUNCTION_START("");
193 
194 #ifdef VL53L1_USE_EMPTY_STRING
195  VL53L1_COPYSTRING(pSequenceStepsString, "");
196 #else
197  switch (SequenceStepId) {
199  VL53L1_COPYSTRING(pSequenceStepsString,
201  break;
203  VL53L1_COPYSTRING(pSequenceStepsString,
205  break;
207  VL53L1_COPYSTRING(pSequenceStepsString,
209  break;
211  VL53L1_COPYSTRING(pSequenceStepsString,
213  break;
215  VL53L1_COPYSTRING(pSequenceStepsString,
217  break;
219  VL53L1_COPYSTRING(pSequenceStepsString,
221  break;
223  VL53L1_COPYSTRING(pSequenceStepsString,
225  break;
227  VL53L1_COPYSTRING(pSequenceStepsString,
229  break;
230  default:
232  }
233 #endif
234 
235  LOG_FUNCTION_END(Status);
236 
237  return Status;
238 }
239 
241  char *pLimitCheckString)
242 {
244 
245  LOG_FUNCTION_START("");
246 
247 #ifdef VL53L1_USE_EMPTY_STRING
248  VL53L1_COPYSTRING(pLimitCheckString, "");
249 #else
250  switch (LimitCheckId) {
252  VL53L1_COPYSTRING(pLimitCheckString,
254  break;
256  VL53L1_COPYSTRING(pLimitCheckString,
258  break;
259  default:
260  VL53L1_COPYSTRING(pLimitCheckString,
262  }
263 #endif
264 
265  LOG_FUNCTION_END(Status);
266  return Status;
267 }
268 
VL53L1_COPYSTRING
#define VL53L1_COPYSTRING(str,...)
Definition: vl53l1_ll_def.h:1089
VL53L1_STRING_CHECKENABLE_SIGNAL_RATE_FINAL_RANGE
#define VL53L1_STRING_CHECKENABLE_SIGNAL_RATE_FINAL_RANGE
Definition: vl53l1_api_strings.h:181
VL53L1_STRING_SEQUENCESTEP_MM1
#define VL53L1_STRING_SEQUENCESTEP_MM1
Definition: vl53l1_api_strings.h:200
VL53L1_STRING_SEQUENCESTEP_PHASECAL
#define VL53L1_STRING_SEQUENCESTEP_PHASECAL
Definition: vl53l1_api_strings.h:196
uint8_t
unsigned char uint8_t
Typedef defining 8 bit unsigned char type. The developer should modify this to suit the platform bein...
Definition: vl53l1_types.h:133
VL53L1_STRING_SEQUENCESTEP_DSS2
#define VL53L1_STRING_SEQUENCESTEP_DSS2
Definition: vl53l1_api_strings.h:199
VL53L1_STRING_STATE_UNKNOWN
#define VL53L1_STRING_STATE_UNKNOWN
Definition: vl53l1_api_strings.h:173
VL53L1_STRING_SEQUENCESTEP_VHV
#define VL53L1_STRING_SEQUENCESTEP_VHV
Definition: vl53l1_api_strings.h:195
VL53L1_SEQUENCESTEP_VHV
#define VL53L1_SEQUENCESTEP_VHV
Definition: vl53l1_def.h:481
VL53L1_STATE_STANDBY
#define VL53L1_STATE_STANDBY
Definition: vl53l1_def.h:327
vl53l1_error_codes.h
Error Code definitions for VL53L1 API.
VL53L1_STATE_IDLE
#define VL53L1_STATE_IDLE
Definition: vl53l1_def.h:329
VL53L1_STATE_UNKNOWN
#define VL53L1_STATE_UNKNOWN
Definition: vl53l1_def.h:335
vl53l1_api_core.h
EwokPlus25 low level API function definitions.
VL53L1_State
uint8_t VL53L1_State
Definition: vl53l1_def.h:321
VL53L1_STRING_STATE_IDLE
#define VL53L1_STRING_STATE_IDLE
Definition: vl53l1_api_strings.h:170
VL53L1_STRING_RANGESTATUS_SIGMA
#define VL53L1_STRING_RANGESTATUS_SIGMA
Definition: vl53l1_api_strings.h:158
LOG_FUNCTION_START
#define LOG_FUNCTION_START(fmt,...)
Definition: vl53l1_api_strings.c:74
VL53L1_SEQUENCESTEP_MM2
#define VL53L1_SEQUENCESTEP_MM2
Definition: vl53l1_def.h:493
VL53L1_SEQUENCESTEP_RANGE
#define VL53L1_SEQUENCESTEP_RANGE
Definition: vl53l1_def.h:495
VL53L1_get_limit_check_info
VL53L1_Error VL53L1_get_limit_check_info(uint16_t LimitCheckId, char *pLimitCheckString)
Generates a string for the limit check Id.
Definition: vl53l1_api_strings.c:240
VL53L1_STATE_ERROR
#define VL53L1_STATE_ERROR
Definition: vl53l1_def.h:337
VL53L1_STATE_POWERDOWN
#define VL53L1_STATE_POWERDOWN
Definition: vl53l1_def.h:323
VL53L1_CHECKENABLE_SIGMA_FINAL_RANGE
#define VL53L1_CHECKENABLE_SIGMA_FINAL_RANGE
Definition: vl53l1_def.h:201
VL53L1_STRING_SEQUENCESTEP_MM2
#define VL53L1_STRING_SEQUENCESTEP_MM2
Definition: vl53l1_api_strings.h:201
VL53L1_STRING_SEQUENCESTEP_RANGE
#define VL53L1_STRING_SEQUENCESTEP_RANGE
Definition: vl53l1_api_strings.h:202
VL53L1_get_range_status_string
VL53L1_Error VL53L1_get_range_status_string(uint8_t RangeStatus, char *pRangeStatusString)
Generates a string for the input device range status code.
Definition: vl53l1_api_strings.c:83
VL53L1_SEQUENCESTEP_REFPHASE
#define VL53L1_SEQUENCESTEP_REFPHASE
Definition: vl53l1_def.h:485
VL53L1_STRING_STATE_WAIT_STATICINIT
#define VL53L1_STRING_STATE_WAIT_STATICINIT
Definition: vl53l1_api_strings.h:167
VL53L1_STRING_RANGESTATUS_NONE
#define VL53L1_STRING_RANGESTATUS_NONE
Definition: vl53l1_api_strings.h:156
VL53L1_STRING_RANGESTATUS_PHASE
#define VL53L1_STRING_RANGESTATUS_PHASE
Definition: vl53l1_api_strings.h:161
VL53L1_STATE_RUNNING
#define VL53L1_STATE_RUNNING
Definition: vl53l1_def.h:331
vl53l1_error_strings.h
VL53L1 function declarations for decoding error codes to a text strings.
VL53L1_ERROR_INVALID_PARAMS
#define VL53L1_ERROR_INVALID_PARAMS
Definition: vl53l1_error_codes.h:102
VL53L1_ERROR_NONE
#define VL53L1_ERROR_NONE
Definition: vl53l1_error_codes.h:91
VL53L1_STATE_RESET
#define VL53L1_STATE_RESET
Definition: vl53l1_def.h:333
VL53L1_CHECKENABLE_SIGNAL_RATE_FINAL_RANGE
#define VL53L1_CHECKENABLE_SIGNAL_RATE_FINAL_RANGE
Definition: vl53l1_def.h:202
vl53l1_api_strings.h
VL53L1 API function declarations for decoding error codes to a text strings.
VL53L1_get_pal_state_string
VL53L1_Error VL53L1_get_pal_state_string(VL53L1_State PalStateCode, char *pPalStateString)
Generates a string for the input PAL State code.
Definition: vl53l1_api_strings.c:131
LOG_FUNCTION_END
#define LOG_FUNCTION_END(status,...)
Definition: vl53l1_api_strings.c:76
VL53L1_STRING_STATE_RUNNING
#define VL53L1_STRING_STATE_RUNNING
Definition: vl53l1_api_strings.h:171
VL53L1_STRING_RANGESTATUS_SIGNAL
#define VL53L1_STRING_RANGESTATUS_SIGNAL
Definition: vl53l1_api_strings.h:159
VL53L1_STRING_RANGESTATUS_MINRANGE
#define VL53L1_STRING_RANGESTATUS_MINRANGE
Definition: vl53l1_api_strings.h:160
VL53L1_STRING_RANGESTATUS_RANGEVALID
#define VL53L1_STRING_RANGESTATUS_RANGEVALID
Definition: vl53l1_api_strings.h:157
VL53L1_STATE_WAIT_STATICINIT
#define VL53L1_STATE_WAIT_STATICINIT
Definition: vl53l1_def.h:325
VL53L1_SEQUENCESTEP_DSS2
#define VL53L1_SEQUENCESTEP_DSS2
Definition: vl53l1_def.h:489
VL53L1_STRING_STATE_POWERDOWN
#define VL53L1_STRING_STATE_POWERDOWN
Definition: vl53l1_api_strings.h:166
VL53L1_STRING_RANGESTATUS_HW
#define VL53L1_STRING_RANGESTATUS_HW
Definition: vl53l1_api_strings.h:162
VL53L1_STRING_STATE_STANDBY
#define VL53L1_STRING_STATE_STANDBY
Definition: vl53l1_api_strings.h:169
VL53L1_STRING_STATE_ERROR
#define VL53L1_STRING_STATE_ERROR
Definition: vl53l1_api_strings.h:174
VL53L1_STRING_CHECKENABLE_SIGMA_FINAL_RANGE
#define VL53L1_STRING_CHECKENABLE_SIGMA_FINAL_RANGE
Definition: vl53l1_api_strings.h:179
VL53L1_Error
int8_t VL53L1_Error
Definition: vl53l1_error_codes.h:89
VL53L1_SEQUENCESTEP_DSS1
#define VL53L1_SEQUENCESTEP_DSS1
Definition: vl53l1_def.h:487
VL53L1_STRING_STATE_RESET
#define VL53L1_STRING_STATE_RESET
Definition: vl53l1_api_strings.h:172
uint16_t
unsigned short uint16_t
Typedef defining 16 bit unsigned short type. The developer should modify this to suit the platform be...
Definition: vl53l1_types.h:123
VL53L1_SequenceStepId
uint8_t VL53L1_SequenceStepId
Definition: vl53l1_def.h:479
VL53L1_get_sequence_steps_info
VL53L1_Error VL53L1_get_sequence_steps_info(VL53L1_SequenceStepId SequenceStepId, char *pSequenceStepsString)
Generates a string for the sequence step Id.
Definition: vl53l1_api_strings.c:186
VL53L1_STRING_SEQUENCESTEP_DSS1
#define VL53L1_STRING_SEQUENCESTEP_DSS1
Definition: vl53l1_api_strings.h:198
VL53L1_SEQUENCESTEP_PHASECAL
#define VL53L1_SEQUENCESTEP_PHASECAL
Definition: vl53l1_def.h:483
VL53L1_STRING_UNKNOW_ERROR_CODE
#define VL53L1_STRING_UNKNOW_ERROR_CODE
Definition: vl53l1_error_strings.h:198
VL53L1_SEQUENCESTEP_MM1
#define VL53L1_SEQUENCESTEP_MM1
Definition: vl53l1_def.h:491


vl53l1x
Author(s):
autogenerated on Fri Aug 2 2024 08:35:54