VL53L0X World smallest Time-of-Flight (ToF) ranging sensor

Dependencies:   X_NUCLEO_COMMON ST_INTERFACES

Dependents:   HelloWorld_ST_Sensors mbed-os-mqtt-client Multi_VL53L0X DISCO-IOT01_HomeEnv ... more

Fork of VL53L0X by Nicola Capovilla

Committer:
johnAlexander
Date:
Thu Jun 06 09:21:39 2019 +0000
Revision:
6:8ac15bf6d635
Publish mbed-certified sensor class.

Who changed what in which revision?

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