hh
Dependencies: VL6180x X_NUCLEO_COMMON X_NUCLEO_IHM01A1 mbed
Fork of 1-DoorCloser_jor by
VL6180X_bis/LightSensor.h@4:a95f90a0410d, 2016-05-05 (annotated)
- Committer:
- julientiron
- Date:
- Thu May 05 20:05:29 2016 +0000
- Revision:
- 4:a95f90a0410d
- Parent:
- 2:f6f12530dbd9
kk;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
julientiron | 0:1cb50d31c3b5 | 1 | /** |
julientiron | 0:1cb50d31c3b5 | 2 | ****************************************************************************** |
julientiron | 0:1cb50d31c3b5 | 3 | * @file LightSensor.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 an ambient light sensor (ALS) |
julientiron | 0:1cb50d31c3b5 | 9 | ****************************************************************************** |
julientiron | 0:1cb50d31c3b5 | 10 | * @attention |
julientiron | 0:1cb50d31c3b5 | 11 | * |
julientiron | 0:1cb50d31c3b5 | 12 | * <h2><center>© 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 __LIGHT_SENSOR_CLASS_H |
julientiron | 0:1cb50d31c3b5 | 41 | #define __LIGHT_SENSOR_CLASS_H |
julientiron | 0:1cb50d31c3b5 | 42 | |
julientiron | 0:1cb50d31c3b5 | 43 | /* Includes ------------------------------------------------------------------*/ |
julientiron | 0:1cb50d31c3b5 | 44 | #include "GenericSensor.h" |
julientiron | 0:1cb50d31c3b5 | 45 | |
julientiron | 0:1cb50d31c3b5 | 46 | /* Classes ------------------------------------------------------------------*/ |
julientiron | 0:1cb50d31c3b5 | 47 | /** An abstract class for ambient light sensors |
julientiron | 0:1cb50d31c3b5 | 48 | */ |
julientiron | 0:1cb50d31c3b5 | 49 | class LightSensor : public GenericSensor |
julientiron | 0:1cb50d31c3b5 | 50 | { |
julientiron | 0:1cb50d31c3b5 | 51 | public: |
julientiron | 0:1cb50d31c3b5 | 52 | /** |
julientiron | 0:1cb50d31c3b5 | 53 | * @brief Get current light [lux] |
julientiron | 0:1cb50d31c3b5 | 54 | * @param[out] piData Pointer to where to store light to |
julientiron | 0:1cb50d31c3b5 | 55 | * @return 0 in case of success, an error code otherwise |
julientiron | 0:1cb50d31c3b5 | 56 | */ |
julientiron | 0:1cb50d31c3b5 | 57 | virtual int GetLight(uint32_t *piData) = 0; |
julientiron | 0:1cb50d31c3b5 | 58 | }; |
julientiron | 0:1cb50d31c3b5 | 59 | |
julientiron | 0:1cb50d31c3b5 | 60 | #endif /* __LIGHT_SENSOR_CLASS_H */ |