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/Interfaces/RangeSensor.h@0:c523920bcc09, 2016-11-28 (annotated)
- Committer:
- johnAlexander
- Date:
- Mon Nov 28 11:25:33 2016 +0000
- Revision:
- 0:c523920bcc09
Singleshot, polled ranging example using central VL53L0X sensor.; Compatible with mass-market v1.1 C API.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| johnAlexander | 0:c523920bcc09 | 1 | /** |
| johnAlexander | 0:c523920bcc09 | 2 | ****************************************************************************** |
| johnAlexander | 0:c523920bcc09 | 3 | * @file RangeSensor.h |
| johnAlexander | 0:c523920bcc09 | 4 | * @author AST / EST |
| johnAlexander | 0:c523920bcc09 | 5 | * @version V0.0.1 |
| johnAlexander | 0:c523920bcc09 | 6 | * @date 13-April-2015 |
| johnAlexander | 0:c523920bcc09 | 7 | * @brief This file contains the abstract class describing in general |
| johnAlexander | 0:c523920bcc09 | 8 | * the interfaces of a range sensor |
| johnAlexander | 0:c523920bcc09 | 9 | ****************************************************************************** |
| johnAlexander | 0:c523920bcc09 | 10 | * @attention |
| johnAlexander | 0:c523920bcc09 | 11 | * |
| johnAlexander | 0:c523920bcc09 | 12 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
| johnAlexander | 0:c523920bcc09 | 13 | * |
| johnAlexander | 0:c523920bcc09 | 14 | * Redistribution and use in source and binary forms, with or without modification, |
| johnAlexander | 0:c523920bcc09 | 15 | * are permitted provided that the following conditions are met: |
| johnAlexander | 0:c523920bcc09 | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
| johnAlexander | 0:c523920bcc09 | 17 | * this list of conditions and the following disclaimer. |
| johnAlexander | 0:c523920bcc09 | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
| johnAlexander | 0:c523920bcc09 | 19 | * this list of conditions and the following disclaimer in the documentation |
| johnAlexander | 0:c523920bcc09 | 20 | * and/or other materials provided with the distribution. |
| johnAlexander | 0:c523920bcc09 | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
| johnAlexander | 0:c523920bcc09 | 22 | * may be used to endorse or promote products derived from this software |
| johnAlexander | 0:c523920bcc09 | 23 | * without specific prior written permission. |
| johnAlexander | 0:c523920bcc09 | 24 | * |
| johnAlexander | 0:c523920bcc09 | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| johnAlexander | 0:c523920bcc09 | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| johnAlexander | 0:c523920bcc09 | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| johnAlexander | 0:c523920bcc09 | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| johnAlexander | 0:c523920bcc09 | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| johnAlexander | 0:c523920bcc09 | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| johnAlexander | 0:c523920bcc09 | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| johnAlexander | 0:c523920bcc09 | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| johnAlexander | 0:c523920bcc09 | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| johnAlexander | 0:c523920bcc09 | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| johnAlexander | 0:c523920bcc09 | 35 | * |
| johnAlexander | 0:c523920bcc09 | 36 | ****************************************************************************** |
| johnAlexander | 0:c523920bcc09 | 37 | */ |
| johnAlexander | 0:c523920bcc09 | 38 | |
| johnAlexander | 0:c523920bcc09 | 39 | /* Define to prevent from recursive inclusion --------------------------------*/ |
| johnAlexander | 0:c523920bcc09 | 40 | #ifndef __RANGE_SENSOR_CLASS_H |
| johnAlexander | 0:c523920bcc09 | 41 | #define __RANGE_SENSOR_CLASS_H |
| johnAlexander | 0:c523920bcc09 | 42 | |
| johnAlexander | 0:c523920bcc09 | 43 | /* Includes ------------------------------------------------------------------*/ |
| johnAlexander | 0:c523920bcc09 | 44 | #include "GenericSensor.h" |
| johnAlexander | 0:c523920bcc09 | 45 | |
| johnAlexander | 0:c523920bcc09 | 46 | /* Classes ------------------------------------------------------------------*/ |
| johnAlexander | 0:c523920bcc09 | 47 | /** An abstract class for range sensors |
| johnAlexander | 0:c523920bcc09 | 48 | */ |
| johnAlexander | 0:c523920bcc09 | 49 | class RangeSensor : public GenericSensor |
| johnAlexander | 0:c523920bcc09 | 50 | { |
| johnAlexander | 0:c523920bcc09 | 51 | public: |
| johnAlexander | 0:c523920bcc09 | 52 | /** |
| johnAlexander | 0:c523920bcc09 | 53 | * @brief Get current range [mm] |
| johnAlexander | 0:c523920bcc09 | 54 | * @param[out] piData Pointer to where to store range to |
| johnAlexander | 0:c523920bcc09 | 55 | * @return 0 in case of success, an error code otherwise |
| johnAlexander | 0:c523920bcc09 | 56 | */ |
| johnAlexander | 0:c523920bcc09 | 57 | virtual int GetRange(int32_t *piData) = 0; |
| johnAlexander | 0:c523920bcc09 | 58 | }; |
| johnAlexander | 0:c523920bcc09 | 59 | |
| johnAlexander | 0:c523920bcc09 | 60 | #endif /* __RANGE_SENSOR_CLASS_H */ |
| johnAlexander | 0:c523920bcc09 | 61 |

X-NUCLEO-53L0A1 Ranging Sensor Expansion Board