amiro-lld / drivers / VL53L1X / v1 / api / platform / vl53l1_types.h @ 4dba9195
History | View | Annotate | Download (5.31 KB)
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 |
/**
|
64 |
* @file vl53l1_types.h
|
65 |
* @brief VL53L1 types definition
|
66 |
*/
|
67 |
|
68 |
#ifndef _VL53L1_TYPES_H_
|
69 |
#define _VL53L1_TYPES_H_
|
70 |
|
71 |
/** @defgroup porting_type Basic type definition
|
72 |
* @ingroup api_platform
|
73 |
*
|
74 |
* @brief file vl53l1_types.h files hold basic type definition that may requires porting
|
75 |
*
|
76 |
* contains type that must be defined for the platform\n
|
77 |
* when target platform and compiler provide stdint.h and stddef.h it is enough to include it.\n
|
78 |
* If stdint.h is not available review and adapt all signed and unsigned 8/16/32 bits basic types. \n
|
79 |
* If stddef.h is not available review and adapt NULL definition .
|
80 |
*/
|
81 |
#include <stdint.h> |
82 |
#include <stddef.h> |
83 |
#include <string.h> |
84 |
#include <stdio.h> |
85 |
#include <stdlib.h> |
86 |
|
87 |
#ifndef NULL |
88 |
#error "Error NULL definition should be done. Please add required include " |
89 |
#endif
|
90 |
|
91 |
|
92 |
#if !defined(STDINT_H) && !defined(_STDINT_H) && !defined(_GCC_STDINT_H) && !defined(__STDINT_DECLS) && !defined(_GCC_WRAP_STDINT_H) && !defined(_STDINT)
|
93 |
|
94 |
#pragma message("Please review type definition of STDINT define for your platform and add to list above ") |
95 |
|
96 |
/*
|
97 |
* target platform do not provide stdint or use a different #define than above
|
98 |
* to avoid seeing the message below addapt the #define list above or implement
|
99 |
* all type and delete these pragma
|
100 |
*/
|
101 |
|
102 |
/** \ingroup VL53L1_portingType_group
|
103 |
* @{
|
104 |
*/
|
105 |
|
106 |
|
107 |
typedef unsigned long long uint64_t; |
108 |
|
109 |
|
110 |
/** @brief Typedef defining 32 bit unsigned int type.\n
|
111 |
* The developer should modify this to suit the platform being deployed.
|
112 |
*/
|
113 |
typedef unsigned int uint32_t; |
114 |
|
115 |
/** @brief Typedef defining 32 bit int type.\n
|
116 |
* The developer should modify this to suit the platform being deployed.
|
117 |
*/
|
118 |
typedef int int32_t; |
119 |
|
120 |
/** @brief Typedef defining 16 bit unsigned short type.\n
|
121 |
* The developer should modify this to suit the platform being deployed.
|
122 |
*/
|
123 |
typedef unsigned short uint16_t; |
124 |
|
125 |
/** @brief Typedef defining 16 bit short type.\n
|
126 |
* The developer should modify this to suit the platform being deployed.
|
127 |
*/
|
128 |
typedef short int16_t; |
129 |
|
130 |
/** @brief Typedef defining 8 bit unsigned char type.\n
|
131 |
* The developer should modify this to suit the platform being deployed.
|
132 |
*/
|
133 |
typedef unsigned char uint8_t; |
134 |
|
135 |
/** @brief Typedef defining 8 bit char type.\n
|
136 |
* The developer should modify this to suit the platform being deployed.
|
137 |
*/
|
138 |
typedef signed char int8_t; |
139 |
|
140 |
/** @} */
|
141 |
#endif /* _STDINT_H */ |
142 |
|
143 |
|
144 |
/** use where fractional values are expected
|
145 |
*
|
146 |
* Given a floating point value f it's .16 bit point is (int)(f*(1<<16))*/
|
147 |
typedef uint32_t FixPoint1616_t;
|
148 |
|
149 |
#endif /* VL53L1_TYPES_H_ */ |