-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSHT21Module.h
More file actions
59 lines (49 loc) · 1.17 KB
/
SHT21Module.h
File metadata and controls
59 lines (49 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* SHT21Module.h
*
* Created on: Feb 21, 2014
* Author: Saminda
*/
#ifndef SHT21MODULE_H_
#define SHT21MODULE_H_
#include "Template.h"
#include "SHT21Representation.h"
#include "hw_sht21.h"
//*****************************************************************************
//
// Define SHT21 I2C Address.
//
//*****************************************************************************
#define SHT21_I2C_ADDRESS 0x40
MODULE(SHT21Module)
PROVIDES(SHT21Representation)
END_MODULE
class SHT21Module: public SHT21ModuleBase
{
private:
class SHT21
{
public:
//
// the I2C address of the SHT21.
//
uint8_t ui8Addr;
//
// the 16 bit raw temperature reading
//
uint16_t ui16Temperature;
//
// the 16 bit raw humidity reading
//
uint16_t ui16Humidity;
SHT21() :
ui8Addr(SHT21_I2C_ADDRESS), ui16Temperature(0), ui16Humidity(0)
{
}
};
SHT21 parameters;
public:
void init();
void update(SHT21Representation& theSHT21Representation);
};
#endif /* SHT21MODULE_H_ */