Updates to follow mbed SDK coding style guidelines.

Dependencies:   ST_INTERFACES X_NUCLEO_COMMON

Dependents:   53L0A1_Satellites_with_Interrupts_OS5 Display_53L0A1_OS5

Fork of X_NUCLEO_53L0A1 by ST

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers vl53l0x_types.h Source File

vl53l0x_types.h

00001 /*******************************************************************************
00002 Copyright © 2015, STMicroelectronics International N.V.
00003 All rights reserved.
00004 
00005 Redistribution and use in source and binary forms, with or without
00006 modification, are permitted provided that the following conditions are met:
00007     * Redistributions of source code must retain the above copyright
00008       notice, this list of conditions and the following disclaimer.
00009     * Redistributions in binary form must reproduce the above copyright
00010       notice, this list of conditions and the following disclaimer in the
00011       documentation and/or other materials provided with the distribution.
00012     * Neither the name of STMicroelectronics nor the
00013       names of its contributors may be used to endorse or promote products
00014       derived from this software without specific prior written permission.
00015 
00016 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
00017 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00018 WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
00019 NON-INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED.
00020 IN NO EVENT SHALL STMICROELECTRONICS INTERNATIONAL N.V. BE LIABLE FOR ANY
00021 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00022 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00023 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00024 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00025 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00026 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00027 ********************************************************************************/
00028 /**
00029  * @file  vl53l0_types.h
00030  * @brief VL53L0 types definition
00031  */
00032 
00033 #ifndef VL53L0X_TYPES_H_
00034 #define VL53L0X_TYPES_H_
00035 
00036 /** @defgroup porting_type  Basic type definition
00037  *  @ingroup  VL53L0X_platform_group
00038  *
00039  *  @brief  file vl53l0_types.h files hold basic type definition that may requires porting
00040  *
00041  *  contains type that must be defined for the platform\n
00042  *  when target platform and compiler provide stdint.h and stddef.h it is enough to include it.\n
00043  *  If stdint.h is not available review and adapt all signed and unsigned 8/16/32 bits basic types. \n
00044  *  If stddef.h is not available review and adapt NULL definition .
00045  */
00046 #include <stdint.h>
00047 #include <stddef.h>
00048 
00049 #ifndef NULL
00050 #error "Error NULL definition should be done. Please add required include "
00051 #endif
00052 
00053 
00054 #if ! defined(STDINT_H) &&  !defined(_GCC_STDINT_H) &&!defined(__STDINT_DECLS) && !defined(_GCC_WRAP_STDINT_H)
00055 
00056  #pragma message("Please review  type definition of STDINT define for your platform and add to list above ")
00057 
00058  /*
00059   *  target platform do not provide stdint or use a different #define than above
00060   *  to avoid seeing the message below addapt the #define list above or implement
00061   *  all type and delete these pragma
00062   */
00063 
00064 /** \ingroup VL53L0X_portingType_group
00065  * @{
00066  */
00067 
00068 
00069 typedef unsigned long long uint64_t;
00070 
00071 
00072 /** @brief Typedef defining 32 bit unsigned int type.\n
00073  * The developer should modify this to suit the platform being deployed.
00074  */
00075 typedef unsigned int uint32_t;
00076 
00077 /** @brief Typedef defining 32 bit int type.\n
00078  * The developer should modify this to suit the platform being deployed.
00079  */
00080 typedef int int32_t;
00081 
00082 /** @brief Typedef defining 16 bit unsigned short type.\n
00083  * The developer should modify this to suit the platform being deployed.
00084  */
00085 typedef unsigned short uint16_t;
00086 
00087 /** @brief Typedef defining 16 bit short type.\n
00088  * The developer should modify this to suit the platform being deployed.
00089  */
00090 typedef short int16_t;
00091 
00092 /** @brief Typedef defining 8 bit unsigned char type.\n
00093  * The developer should modify this to suit the platform being deployed.
00094  */
00095 typedef unsigned char uint8_t;
00096 
00097 /** @brief Typedef defining 8 bit char type.\n
00098  * The developer should modify this to suit the platform being deployed.
00099  */
00100 typedef signed char int8_t;
00101 
00102 /** @}  */
00103 #endif /* _STDINT_H */
00104 
00105 
00106 /** use where fractional values are expected
00107  *
00108  * Given a floating point value f it's .16 bit point is (int)(f*(1<<16))*/
00109 typedef uint32_t FixPoint1616_t;
00110 
00111 #endif /* VL53L0X_TYPES_H_ */
00112