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