amiro-lld / include / VL53L0X / v1 / Api_vl53l0x / platform / inc / vl53l0x_types.h @ 6ebebd4d
History | View | Annotate | Download (4.13 KB)
1 |
/*******************************************************************************
|
---|---|
2 |
Copyright � 2015, STMicroelectronics International N.V.
|
3 |
All rights reserved.
|
4 |
|
5 |
Redistribution and use in source and binary forms, with or without
|
6 |
modification, are permitted provided that the following conditions are met:
|
7 |
* Redistributions of source code must retain the above copyright
|
8 |
notice, this list of conditions and the following disclaimer.
|
9 |
* Redistributions in binary form must reproduce the above copyright
|
10 |
notice, this list of conditions and the following disclaimer in the
|
11 |
documentation and/or other materials provided with the distribution.
|
12 |
* Neither the name of STMicroelectronics nor the
|
13 |
names of its contributors may be used to endorse or promote products
|
14 |
derived from this software without specific prior written permission.
|
15 |
|
16 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
17 |
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
18 |
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
|
19 |
NON-INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED.
|
20 |
IN NO EVENT SHALL STMICROELECTRONICS INTERNATIONAL N.V. BE LIABLE FOR ANY
|
21 |
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
22 |
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
23 |
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
24 |
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
25 |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
26 |
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27 |
********************************************************************************/
|
28 |
/**
|
29 |
* @file vl53l0x_types.h
|
30 |
* @brief VL53L0X types definition
|
31 |
*/
|
32 |
|
33 |
#ifndef VL53L0X_TYPES_H_
|
34 |
#define VL53L0X_TYPES_H_
|
35 |
|
36 |
/** @defgroup porting_type Basic type definition
|
37 |
* @ingroup VL53L0X_platform_group
|
38 |
*
|
39 |
* @brief file vl53l0x_types.h files hold basic type definition that may requires porting
|
40 |
*
|
41 |
* contains type that must be defined for the platform\n
|
42 |
* when target platform and compiler provide stdint.h and stddef.h it is enough to include it.\n
|
43 |
* If stdint.h is not available review and adapt all signed and unsigned 8/16/32 bits basic types. \n
|
44 |
* If stddef.h is not available review and adapt NULL definition .
|
45 |
*/
|
46 |
#include <stdint.h> |
47 |
#include <stddef.h> |
48 |
|
49 |
#ifndef NULL |
50 |
#error "Error NULL definition should be done. Please add required include " |
51 |
#endif
|
52 |
|
53 |
|
54 |
#if ! defined(STDINT_H) && !defined(_GCC_STDINT_H) &&!defined(__STDINT_DECLS) && !defined(_GCC_WRAP_STDINT_H)
|
55 |
|
56 |
#pragma message("Please review type definition of STDINT define for your platform and add to list above ") |
57 |
|
58 |
/*
|
59 |
* target platform do not provide stdint or use a different #define than above
|
60 |
* to avoid seeing the message below addapt the #define list above or implement
|
61 |
* all type and delete these pragma
|
62 |
*/
|
63 |
|
64 |
/** \ingroup VL53L0X_portingType_group
|
65 |
* @{
|
66 |
*/
|
67 |
|
68 |
|
69 |
typedef unsigned long long uint64_t; |
70 |
|
71 |
|
72 |
/** @brief Typedef defining 32 bit unsigned int type.\n
|
73 |
* The developer should modify this to suit the platform being deployed.
|
74 |
*/
|
75 |
typedef unsigned int uint32_t; |
76 |
|
77 |
/** @brief Typedef defining 32 bit int type.\n
|
78 |
* The developer should modify this to suit the platform being deployed.
|
79 |
*/
|
80 |
typedef int int32_t; |
81 |
|
82 |
/** @brief Typedef defining 16 bit unsigned short type.\n
|
83 |
* The developer should modify this to suit the platform being deployed.
|
84 |
*/
|
85 |
typedef unsigned short uint16_t; |
86 |
|
87 |
/** @brief Typedef defining 16 bit short type.\n
|
88 |
* The developer should modify this to suit the platform being deployed.
|
89 |
*/
|
90 |
typedef short int16_t; |
91 |
|
92 |
/** @brief Typedef defining 8 bit unsigned char type.\n
|
93 |
* The developer should modify this to suit the platform being deployed.
|
94 |
*/
|
95 |
typedef unsigned char uint8_t; |
96 |
|
97 |
/** @brief Typedef defining 8 bit char type.\n
|
98 |
* The developer should modify this to suit the platform being deployed.
|
99 |
*/
|
100 |
typedef signed char int8_t; |
101 |
|
102 |
/** @} */
|
103 |
#endif /* _STDINT_H */ |
104 |
|
105 |
|
106 |
/** use where fractional values are expected
|
107 |
*
|
108 |
* Given a floating point value f it's .16 bit point is (int)(f*(1<<16))*/
|
109 |
typedef uint32_t FixPoint1616_t;
|
110 |
|
111 |
#endif /* VL53L0X_TYPES_H_ */ |