Statistics
| Branch: | Tag: | Revision:

amiro-lld / drivers / VL53L1X / v1 / api / core / vl53l1_api_strings.h @ 4dba9195

History | View | Annotate | Download (7.518 KB)

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

    
64
/**
65
 * @file   vl53l1_api_strings.h
66
 * @brief  VL53L1 API function declarations for decoding error codes to a
67
 *         text strings
68
 */
69

    
70

    
71
#ifndef VL53L1_API_STRINGS_H_
72
#define VL53L1_API_STRINGS_H_
73

    
74
#include "vl53l1_def.h"
75

    
76
#ifdef __cplusplus
77
extern "C" {
78
#endif
79

    
80

    
81

    
82
/**
83
 * @brief Generates a string for the input device range status code
84
 *
85
 * @param[in]   RangeStatus           : Device Range AStatus Code
86
 * @param[out]  pRangeStatusString    : pointer to character buffer
87
 *
88
 * @return  VL53L1_ERROR_NONE     Success
89
 * @return  "Other error code"    See ::VL53L1_Error
90
 */
91

    
92
VL53L1_Error VL53L1_get_range_status_string(
93
        uint8_t   RangeStatus,
94
        char    *pRangeStatusString);
95

    
96
/**
97
 * @brief Generates an error string for the input PAL error code
98
 *
99
 * @param[in]   PalErrorCode         : PAL Error Code
100
 * @param[out]  pPalErrorString      : pointer to character buffer
101
 *
102
 * @return  VL53L1_ERROR_NONE     Success
103
 * @return  "Other error code"    See ::VL53L1_Error
104
 */
105

    
106
VL53L1_Error VL53L1_get_pal_error_string(
107
        VL53L1_Error   PalErrorCode,
108
        char         *pPalErrorString);
109

    
110
/**
111
 * @brief Generates a string for the input PAL State code
112
 *
113
 * @param[in]   PalStateCode         : PAL State Code
114
 * @param[out]  pPalStateString      : pointer to character buffer
115
 *
116
 * @return  VL53L1_ERROR_NONE     Success
117
 * @return  "Other error code"    See ::VL53L1_Error
118
 */
119

    
120
VL53L1_Error VL53L1_get_pal_state_string(
121
        VL53L1_State   PalStateCode,
122
        char         *pPalStateString);
123

    
124

    
125
/**
126
 * @brief Generates a string for the sequence step Id
127
 *
128
 * @param[in]   SequenceStepId            : Sequence Step Id
129
 * @param[out]  pSequenceStepsString      : pointer to character buffer
130
 *
131
 * @return  VL53L1_ERROR_NONE     Success
132
 * @return  "Other error code"    See ::VL53L1_Error
133
 */
134
VL53L1_Error VL53L1_get_sequence_steps_info(
135
                VL53L1_SequenceStepId SequenceStepId,
136
                char *pSequenceStepsString);
137

    
138
/**
139
 * @brief Generates a string for the limit check Id
140
 *
141
 * @param[in]   LimitCheckId            : Limit check Id
142
 * @param[out]  pLimitCheckString       : pointer to character buffer
143
 *
144
 * @return  VL53L1_ERROR_NONE     Success
145
 * @return  "Other error code"    See ::VL53L1_Error
146
 */
147
VL53L1_Error VL53L1_get_limit_check_info(uint16_t LimitCheckId,
148
        char *pLimitCheckString);
149

    
150
#ifndef VL53L1_USE_EMPTY_STRING
151
        #define  VL53L1_STRING_DEVICE_INFO_NAME0          "VL53L1 cut1.0"
152
        #define  VL53L1_STRING_DEVICE_INFO_NAME1          "VL53L1 cut1.1"
153
        #define  VL53L1_STRING_DEVICE_INFO_TYPE          "VL53L1"
154

    
155
        /* Range Status */
156
        #define  VL53L1_STRING_RANGESTATUS_NONE                 "No Update"
157
        #define  VL53L1_STRING_RANGESTATUS_RANGEVALID           "Range Valid"
158
        #define  VL53L1_STRING_RANGESTATUS_SIGMA                "Sigma Fail"
159
        #define  VL53L1_STRING_RANGESTATUS_SIGNAL               "Signal Fail"
160
        #define  VL53L1_STRING_RANGESTATUS_MINRANGE             "Min Range Fail"
161
        #define  VL53L1_STRING_RANGESTATUS_PHASE                "Phase Fail"
162
        #define  VL53L1_STRING_RANGESTATUS_HW                   "Hardware Fail"
163

    
164

    
165
        /* Range Status */
166
        #define  VL53L1_STRING_STATE_POWERDOWN               "POWERDOWN State"
167
        #define  VL53L1_STRING_STATE_WAIT_STATICINIT \
168
                        "Wait for staticinit State"
169
        #define  VL53L1_STRING_STATE_STANDBY                 "STANDBY State"
170
        #define  VL53L1_STRING_STATE_IDLE                    "IDLE State"
171
        #define  VL53L1_STRING_STATE_RUNNING                 "RUNNING State"
172
        #define  VL53L1_STRING_STATE_RESET                   "RESET State"
173
        #define  VL53L1_STRING_STATE_UNKNOWN                 "UNKNOWN State"
174
        #define  VL53L1_STRING_STATE_ERROR                   "ERROR State"
175

    
176

    
177

    
178
        /* Check Enable */
179
        #define  VL53L1_STRING_CHECKENABLE_SIGMA_FINAL_RANGE \
180
                        "SIGMA FINAL RANGE"
181
        #define  VL53L1_STRING_CHECKENABLE_SIGNAL_RATE_FINAL_RANGE \
182
                        "SIGNAL RATE FINAL RANGE"
183
        #define  VL53L1_STRING_CHECKENABLE_SIGNAL_MIN_CLIP \
184
                        "SIGNAL MIN CLIP"
185
        #define  VL53L1_STRING_CHECKENABLE_RANGE_IGNORE_THRESHOLD \
186
                        "RANGE IGNORE THRESHOLD"
187
        #define  VL53L1_STRING_CHECKENABLE_RANGE_PHASE_HIGH \
188
                        "RANGE PHASE HIGH"
189
        #define  VL53L1_STRING_CHECKENABLE_RANGE_PHASE_LOW \
190
                        "RANGE PHASE LOW"
191
        #define  VL53L1_STRING_CHECKENABLE_RANGE_PHASE_CONSISTENCY \
192
                        "RANGE PHASE CONSISTENCY"
193

    
194
        /* Sequence Step */
195
        #define  VL53L1_STRING_SEQUENCESTEP_VHV         "VHV"
196
        #define  VL53L1_STRING_SEQUENCESTEP_PHASECAL    "PHASE CAL"
197
        #define  VL53L1_STRING_SEQUENCESTEP_REFPHASE    "REF PHASE"
198
        #define  VL53L1_STRING_SEQUENCESTEP_DSS1        "DSS1"
199
        #define  VL53L1_STRING_SEQUENCESTEP_DSS2        "DSS2"
200
        #define  VL53L1_STRING_SEQUENCESTEP_MM1         "MM1"
201
        #define  VL53L1_STRING_SEQUENCESTEP_MM2         "MM2"
202
        #define  VL53L1_STRING_SEQUENCESTEP_RANGE       "RANGE"
203
#endif /* VL53L1_USE_EMPTY_STRING */
204

    
205

    
206
#ifdef __cplusplus
207
}
208
#endif
209

    
210
#endif
211