Makes the VL53L0X library compatible with MAX32630FTHR definitions. Adjusts default sensor settings to fastest reading (20ms) vs. default (30ms).

Dependencies:   ST_INTERFACES X_NUCLEO_COMMON

Fork of VL53L0X by ST

Committer:
DVLevine
Date:
Tue Mar 13 01:23:22 2018 +0000
Revision:
5:d25feb417ac1
Parent:
2:d07edeaff6f1
changed library for compatibility with MAX32630 definitions and changed prox mode to fast readings (20ms) vs. default long distance setting (33ms).

Who changed what in which revision?

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