Library for use with VL53L1X, intended to represent the Proximity sensor expansion board with the same name.

Dependencies:   VL53L1X_mbed

Dependents:   HelloWorld_53L1A1 VL53L1A1_Simple_Ranging_With_One_Device VL53L1A1_Simple_Ranging_With_All_Devices VL53L1X_Ranging_With_Multiple_Devices_MbedOS ... more

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?

UserRevisionLine numberNew contents of line
johnAlexander 0:c523920bcc09 1 /**
johnAlexander 0:c523920bcc09 2 ******************************************************************************
johnAlexander 0:c523920bcc09 3 * @file GenericSensor.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 generic sensor
johnAlexander 0:c523920bcc09 9 ******************************************************************************
johnAlexander 0:c523920bcc09 10 * @attention
johnAlexander 0:c523920bcc09 11 *
johnAlexander 0:c523920bcc09 12 * <h2><center>&copy; 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 __GENERIC_SENSOR_CLASS_H
johnAlexander 0:c523920bcc09 41 #define __GENERIC_SENSOR_CLASS_H
johnAlexander 0:c523920bcc09 42
johnAlexander 0:c523920bcc09 43 /* Includes ------------------------------------------------------------------*/
johnAlexander 0:c523920bcc09 44 #include <stdint.h>
johnAlexander 0:c523920bcc09 45
johnAlexander 0:c523920bcc09 46 /* Classes ------------------------------------------------------------------*/
johnAlexander 0:c523920bcc09 47 /** An abstract class for Generic sensors
johnAlexander 0:c523920bcc09 48 */
johnAlexander 0:c523920bcc09 49 class GenericSensor
johnAlexander 0:c523920bcc09 50 {
johnAlexander 0:c523920bcc09 51 public:
johnAlexander 0:c523920bcc09 52 /**
johnAlexander 0:c523920bcc09 53 * @brief Initialization of sensor
johnAlexander 0:c523920bcc09 54 * @param[out] ptr Pointer to device specific initalization structure
johnAlexander 0:c523920bcc09 55 * @return 0 in case of success, an error code otherwise
johnAlexander 0:c523920bcc09 56 */
johnAlexander 0:c523920bcc09 57 virtual int Init() = 0;
johnAlexander 0:c523920bcc09 58
johnAlexander 0:c523920bcc09 59 /**
johnAlexander 0:c523920bcc09 60 * @brief Get ID of sensor
johnAlexander 0:c523920bcc09 61 * @param[out] id Pointer to where to store the ID to
johnAlexander 0:c523920bcc09 62 * @return 0 in case of success, an error code otherwise
johnAlexander 0:c523920bcc09 63 */
johnAlexander 0:c523920bcc09 64 virtual int ReadID() = 0;
johnAlexander 0:c523920bcc09 65 };
johnAlexander 0:c523920bcc09 66
johnAlexander 0:c523920bcc09 67 #endif /* __GENERIC_SENSOR_CLASS_H */
johnAlexander 0:c523920bcc09 68