Official interfaces for ST components.

Dependents:   X_NUCLEO_IKS01A1 mDot_X_NUCLEO_IKS01A1 53L0A1 X_NUCLEO_IKS01A1 ... more

Fork of ST_INTERFACES by Davide Aliprandi

This library contains all abstract classes which together constitute the common API to which all existing and future ST components will adhere to.

Committer:
Davidroid
Date:
Fri Mar 24 12:59:21 2017 +0000
Revision:
5:d3c9b33b992c
Parent:
4:8f70f7159316
Changed a returned type in BDCMotor interface.

Who changed what in which revision?

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