Library for use with VL53L0X, cut 1.1, based on mass-market API v1.1.
Dependencies: ST_INTERFACES X_NUCLEO_COMMON
Dependents: ConcorsoFinal HelloWorld_IHM01A1 m3pi_BT m3pi_LIDAR ... more
Fork of X_NUCLEO_53L0A1 by
X-NUCLEO-53L0A1 Proximity Sensor Expansion Board Firmware Package
Introduction
This firmware package includes Component Device Drivers and the Board Support Package for STMicroelectronics' X-NUCLEO-53L0A1 Proximity sensor expansion board based on VL53L0X.
Firmware Library
Class X_NUCLEO_53L0A1 is intended to represent the Proximity sensor expansion board with the same name.
The expansion board provides support for the following components:
- on-board VL53L0X proximity sensor,
- up to two additional VL53L0X Satellites,
- on-board 4-digit display
It is intentionally implemented as a singleton because only one X-NUCLEO-VL53L0A1 may be deployed at a time in a HW component stack. In order to get the singleton instance you have to call class method `Instance()`, e.g.:
// Sensors expansion board singleton instance static X_NUCLEO_53L0A1 *board = X_NUCLEO_53L0A1::Instance(device_i2c, A2, D8, D2);
Example Applications
- Hello World 53L0
- Display 53L0A1
- Display 53L0A1 Interrupts
- Display 53L0A1 with satellites
- 53L0A1 Satellites with Interrupts
- 53L0A1_HandGestureRecognition
The library and sample application code were tested against mbed revision 143, dated 26th May 2017.
Components/VL53L0X/VL53L0X_types.h@16:27d3d95c8593, 2017-08-22 (annotated)
- Committer:
- Davidroid
- Date:
- Tue Aug 22 14:39:51 2017 +0000
- Revision:
- 16:27d3d95c8593
- Parent:
- Components/VL53L0X/vl53l0x_types.h@0:c523920bcc09
Aligning to ARM mbed coding style.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| johnAlexander | 0:c523920bcc09 | 1 | /******************************************************************************* |
| johnAlexander | 0:c523920bcc09 | 2 | Copyright © 2015, STMicroelectronics International N.V. |
| johnAlexander | 0:c523920bcc09 | 3 | All rights reserved. |
| johnAlexander | 0:c523920bcc09 | 4 | |
| johnAlexander | 0:c523920bcc09 | 5 | Redistribution and use in source and binary forms, with or without |
| johnAlexander | 0:c523920bcc09 | 6 | modification, are permitted provided that the following conditions are met: |
| johnAlexander | 0:c523920bcc09 | 7 | * Redistributions of source code must retain the above copyright |
| johnAlexander | 0:c523920bcc09 | 8 | notice, this list of conditions and the following disclaimer. |
| johnAlexander | 0:c523920bcc09 | 9 | * Redistributions in binary form must reproduce the above copyright |
| johnAlexander | 0:c523920bcc09 | 10 | notice, this list of conditions and the following disclaimer in the |
| johnAlexander | 0:c523920bcc09 | 11 | documentation and/or other materials provided with the distribution. |
| johnAlexander | 0:c523920bcc09 | 12 | * Neither the name of STMicroelectronics nor the |
| johnAlexander | 0:c523920bcc09 | 13 | names of its contributors may be used to endorse or promote products |
| johnAlexander | 0:c523920bcc09 | 14 | derived from this software without specific prior written permission. |
| johnAlexander | 0:c523920bcc09 | 15 | |
| johnAlexander | 0:c523920bcc09 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| johnAlexander | 0:c523920bcc09 | 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| johnAlexander | 0:c523920bcc09 | 18 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND |
| johnAlexander | 0:c523920bcc09 | 19 | NON-INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED. |
| johnAlexander | 0:c523920bcc09 | 20 | IN NO EVENT SHALL STMICROELECTRONICS INTERNATIONAL N.V. BE LIABLE FOR ANY |
| johnAlexander | 0:c523920bcc09 | 21 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| johnAlexander | 0:c523920bcc09 | 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| johnAlexander | 0:c523920bcc09 | 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| johnAlexander | 0:c523920bcc09 | 24 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| johnAlexander | 0:c523920bcc09 | 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| johnAlexander | 0:c523920bcc09 | 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| johnAlexander | 0:c523920bcc09 | 27 | ********************************************************************************/ |
| johnAlexander | 0:c523920bcc09 | 28 | /** |
| johnAlexander | 0:c523920bcc09 | 29 | * @file vl53l0_types.h |
| johnAlexander | 0:c523920bcc09 | 30 | * @brief VL53L0 types definition |
| johnAlexander | 0:c523920bcc09 | 31 | */ |
| johnAlexander | 0:c523920bcc09 | 32 | |
| johnAlexander | 0:c523920bcc09 | 33 | #ifndef VL53L0X_TYPES_H_ |
| johnAlexander | 0:c523920bcc09 | 34 | #define VL53L0X_TYPES_H_ |
| johnAlexander | 0:c523920bcc09 | 35 | |
| johnAlexander | 0:c523920bcc09 | 36 | /** @defgroup porting_type Basic type definition |
| johnAlexander | 0:c523920bcc09 | 37 | * @ingroup VL53L0X_platform_group |
| johnAlexander | 0:c523920bcc09 | 38 | * |
| johnAlexander | 0:c523920bcc09 | 39 | * @brief file vl53l0_types.h files hold basic type definition that may requires porting |
| johnAlexander | 0:c523920bcc09 | 40 | * |
| johnAlexander | 0:c523920bcc09 | 41 | * contains type that must be defined for the platform\n |
| johnAlexander | 0:c523920bcc09 | 42 | * when target platform and compiler provide stdint.h and stddef.h it is enough to include it.\n |
| johnAlexander | 0:c523920bcc09 | 43 | * If stdint.h is not available review and adapt all signed and unsigned 8/16/32 bits basic types. \n |
| johnAlexander | 0:c523920bcc09 | 44 | * If stddef.h is not available review and adapt NULL definition . |
| johnAlexander | 0:c523920bcc09 | 45 | */ |
| johnAlexander | 0:c523920bcc09 | 46 | #include <stdint.h> |
| johnAlexander | 0:c523920bcc09 | 47 | #include <stddef.h> |
| johnAlexander | 0:c523920bcc09 | 48 | |
| johnAlexander | 0:c523920bcc09 | 49 | #ifndef NULL |
| johnAlexander | 0:c523920bcc09 | 50 | #error "Error NULL definition should be done. Please add required include " |
| johnAlexander | 0:c523920bcc09 | 51 | #endif |
| johnAlexander | 0:c523920bcc09 | 52 | |
| johnAlexander | 0:c523920bcc09 | 53 | |
| johnAlexander | 0:c523920bcc09 | 54 | #if ! defined(STDINT_H) && !defined(_GCC_STDINT_H) &&!defined(__STDINT_DECLS) && !defined(_GCC_WRAP_STDINT_H) |
| johnAlexander | 0:c523920bcc09 | 55 | |
| johnAlexander | 0:c523920bcc09 | 56 | #pragma message("Please review type definition of STDINT define for your platform and add to list above ") |
| johnAlexander | 0:c523920bcc09 | 57 | |
| johnAlexander | 0:c523920bcc09 | 58 | /* |
| johnAlexander | 0:c523920bcc09 | 59 | * target platform do not provide stdint or use a different #define than above |
| johnAlexander | 0:c523920bcc09 | 60 | * to avoid seeing the message below addapt the #define list above or implement |
| johnAlexander | 0:c523920bcc09 | 61 | * all type and delete these pragma |
| johnAlexander | 0:c523920bcc09 | 62 | */ |
| johnAlexander | 0:c523920bcc09 | 63 | |
| johnAlexander | 0:c523920bcc09 | 64 | /** \ingroup VL53L0X_portingType_group |
| johnAlexander | 0:c523920bcc09 | 65 | * @{ |
| johnAlexander | 0:c523920bcc09 | 66 | */ |
| johnAlexander | 0:c523920bcc09 | 67 | |
| johnAlexander | 0:c523920bcc09 | 68 | |
| johnAlexander | 0:c523920bcc09 | 69 | typedef unsigned long long uint64_t; |
| johnAlexander | 0:c523920bcc09 | 70 | |
| johnAlexander | 0:c523920bcc09 | 71 | |
| johnAlexander | 0:c523920bcc09 | 72 | /** @brief Typedef defining 32 bit unsigned int type.\n |
| johnAlexander | 0:c523920bcc09 | 73 | * The developer should modify this to suit the platform being deployed. |
| johnAlexander | 0:c523920bcc09 | 74 | */ |
| johnAlexander | 0:c523920bcc09 | 75 | typedef unsigned int uint32_t; |
| johnAlexander | 0:c523920bcc09 | 76 | |
| johnAlexander | 0:c523920bcc09 | 77 | /** @brief Typedef defining 32 bit int type.\n |
| johnAlexander | 0:c523920bcc09 | 78 | * The developer should modify this to suit the platform being deployed. |
| johnAlexander | 0:c523920bcc09 | 79 | */ |
| johnAlexander | 0:c523920bcc09 | 80 | typedef int int32_t; |
| johnAlexander | 0:c523920bcc09 | 81 | |
| johnAlexander | 0:c523920bcc09 | 82 | /** @brief Typedef defining 16 bit unsigned short type.\n |
| johnAlexander | 0:c523920bcc09 | 83 | * The developer should modify this to suit the platform being deployed. |
| johnAlexander | 0:c523920bcc09 | 84 | */ |
| johnAlexander | 0:c523920bcc09 | 85 | typedef unsigned short uint16_t; |
| johnAlexander | 0:c523920bcc09 | 86 | |
| johnAlexander | 0:c523920bcc09 | 87 | /** @brief Typedef defining 16 bit short type.\n |
| johnAlexander | 0:c523920bcc09 | 88 | * The developer should modify this to suit the platform being deployed. |
| johnAlexander | 0:c523920bcc09 | 89 | */ |
| johnAlexander | 0:c523920bcc09 | 90 | typedef short int16_t; |
| johnAlexander | 0:c523920bcc09 | 91 | |
| johnAlexander | 0:c523920bcc09 | 92 | /** @brief Typedef defining 8 bit unsigned char type.\n |
| johnAlexander | 0:c523920bcc09 | 93 | * The developer should modify this to suit the platform being deployed. |
| johnAlexander | 0:c523920bcc09 | 94 | */ |
| johnAlexander | 0:c523920bcc09 | 95 | typedef unsigned char uint8_t; |
| johnAlexander | 0:c523920bcc09 | 96 | |
| johnAlexander | 0:c523920bcc09 | 97 | /** @brief Typedef defining 8 bit char type.\n |
| johnAlexander | 0:c523920bcc09 | 98 | * The developer should modify this to suit the platform being deployed. |
| johnAlexander | 0:c523920bcc09 | 99 | */ |
| johnAlexander | 0:c523920bcc09 | 100 | typedef signed char int8_t; |
| johnAlexander | 0:c523920bcc09 | 101 | |
| johnAlexander | 0:c523920bcc09 | 102 | /** @} */ |
| johnAlexander | 0:c523920bcc09 | 103 | #endif /* _STDINT_H */ |
| johnAlexander | 0:c523920bcc09 | 104 | |
| johnAlexander | 0:c523920bcc09 | 105 | |
| johnAlexander | 0:c523920bcc09 | 106 | /** use where fractional values are expected |
| johnAlexander | 0:c523920bcc09 | 107 | * |
| johnAlexander | 0:c523920bcc09 | 108 | * Given a floating point value f it's .16 bit point is (int)(f*(1<<16))*/ |
| johnAlexander | 0:c523920bcc09 | 109 | typedef uint32_t FixPoint1616_t; |
| johnAlexander | 0:c523920bcc09 | 110 | |
| johnAlexander | 0:c523920bcc09 | 111 | #endif /* VL53L0X_TYPES_H_ */ |
| johnAlexander | 0:c523920bcc09 | 112 |

X-NUCLEO-53L0A1 Ranging Sensor Expansion Board