hh

Dependencies:   VL6180x X_NUCLEO_COMMON X_NUCLEO_IHM01A1 mbed

Fork of 1-DoorCloser_jor by Jordan Ml

Committer:
mohabendaoud
Date:
Sat Apr 02 14:21:53 2016 +0000
Revision:
2:f6f12530dbd9
Parent:
VL6180X/GenericSensor.h@0:1cb50d31c3b5
16h20

Who changed what in which revision?

UserRevisionLine numberNew contents of line
julientiron 0:1cb50d31c3b5 1 /**
julientiron 0:1cb50d31c3b5 2 ******************************************************************************
julientiron 0:1cb50d31c3b5 3 * @file GenericSensor.h
julientiron 0:1cb50d31c3b5 4 * @author AST / EST
julientiron 0:1cb50d31c3b5 5 * @version V0.0.1
julientiron 0:1cb50d31c3b5 6 * @date 13-April-2015
julientiron 0:1cb50d31c3b5 7 * @brief This file contains the abstract class describing in general
julientiron 0:1cb50d31c3b5 8 * the interfaces of a generic sensor
julientiron 0:1cb50d31c3b5 9 ******************************************************************************
julientiron 0:1cb50d31c3b5 10 * @attention
julientiron 0:1cb50d31c3b5 11 *
julientiron 0:1cb50d31c3b5 12 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
julientiron 0:1cb50d31c3b5 13 *
julientiron 0:1cb50d31c3b5 14 * Redistribution and use in source and binary forms, with or without modification,
julientiron 0:1cb50d31c3b5 15 * are permitted provided that the following conditions are met:
julientiron 0:1cb50d31c3b5 16 * 1. Redistributions of source code must retain the above copyright notice,
julientiron 0:1cb50d31c3b5 17 * this list of conditions and the following disclaimer.
julientiron 0:1cb50d31c3b5 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
julientiron 0:1cb50d31c3b5 19 * this list of conditions and the following disclaimer in the documentation
julientiron 0:1cb50d31c3b5 20 * and/or other materials provided with the distribution.
julientiron 0:1cb50d31c3b5 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
julientiron 0:1cb50d31c3b5 22 * may be used to endorse or promote products derived from this software
julientiron 0:1cb50d31c3b5 23 * without specific prior written permission.
julientiron 0:1cb50d31c3b5 24 *
julientiron 0:1cb50d31c3b5 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
julientiron 0:1cb50d31c3b5 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
julientiron 0:1cb50d31c3b5 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
julientiron 0:1cb50d31c3b5 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
julientiron 0:1cb50d31c3b5 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
julientiron 0:1cb50d31c3b5 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
julientiron 0:1cb50d31c3b5 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
julientiron 0:1cb50d31c3b5 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
julientiron 0:1cb50d31c3b5 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
julientiron 0:1cb50d31c3b5 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
julientiron 0:1cb50d31c3b5 35 *
julientiron 0:1cb50d31c3b5 36 ******************************************************************************
julientiron 0:1cb50d31c3b5 37 */
julientiron 0:1cb50d31c3b5 38
julientiron 0:1cb50d31c3b5 39 /* Define to prevent from recursive inclusion --------------------------------*/
julientiron 0:1cb50d31c3b5 40 #ifndef __GENERIC_SENSOR_CLASS_H
julientiron 0:1cb50d31c3b5 41 #define __GENERIC_SENSOR_CLASS_H
julientiron 0:1cb50d31c3b5 42
julientiron 0:1cb50d31c3b5 43 /* Includes ------------------------------------------------------------------*/
julientiron 0:1cb50d31c3b5 44 #include <stdint.h>
julientiron 0:1cb50d31c3b5 45
julientiron 0:1cb50d31c3b5 46 /* Classes ------------------------------------------------------------------*/
julientiron 0:1cb50d31c3b5 47 /** An abstract class for Generic sensors
julientiron 0:1cb50d31c3b5 48 */
julientiron 0:1cb50d31c3b5 49 class GenericSensor
julientiron 0:1cb50d31c3b5 50 {
julientiron 0:1cb50d31c3b5 51 public:
julientiron 0:1cb50d31c3b5 52 /**
julientiron 0:1cb50d31c3b5 53 * @brief Initialization of sensor
julientiron 0:1cb50d31c3b5 54 * @param[out] ptr Pointer to device specific initalization structure
julientiron 0:1cb50d31c3b5 55 * @return 0 in case of success, an error code otherwise
julientiron 0:1cb50d31c3b5 56 */
julientiron 0:1cb50d31c3b5 57 virtual int Init() = 0;
julientiron 0:1cb50d31c3b5 58
julientiron 0:1cb50d31c3b5 59 /**
julientiron 0:1cb50d31c3b5 60 * @brief Get ID of sensor
julientiron 0:1cb50d31c3b5 61 * @param[out] id Pointer to where to store the ID to
julientiron 0:1cb50d31c3b5 62 * @return 0 in case of success, an error code otherwise
julientiron 0:1cb50d31c3b5 63 */
julientiron 0:1cb50d31c3b5 64 virtual int ReadID() = 0;
julientiron 0:1cb50d31c3b5 65 };
julientiron 0:1cb50d31c3b5 66
julientiron 0:1cb50d31c3b5 67 #endif /* __GENERIC_SENSOR_CLASS_H */