31 #define ADDR 0x40 // device address
33 #define REG_STATUS 0x00
34 #define REG_DATA_H 0x01
35 #define REG_DATA_L 0x02
36 #define REG_CONFIG 0x03
39 #define STATUS_RDY_MASK 0x01
41 #define CMD_MEASURE_HUMI 0x01
42 #define CMD_MEASURE_TEMP 0x11
44 #define TH02_WR_REG_MODE 0xC0
45 #define TH02_RD_REG_MODE 0x80
96 mraa_i2c_context m_i2Ctx;
98 uint16_t i2cReadReg_N (
int reg,
unsigned int len, uint8_t * buffer);
99 mraa_result_t i2cWriteReg_N (uint8_t reg,
unsigned int len, uint8_t * buffer);
100 mraa_result_t i2cWriteReg (uint8_t reg, uint8_t data);
TH02()
Definition: th02.cxx:42
std::string name()
Definition: th02.h:90
bool getStatus()
Definition: th02.cxx:99
float getHumidity()
Definition: th02.cxx:78
~TH02()
Definition: th02.cxx:52
float getTemperature()
Definition: th02.cxx:57
C++ API for TH02 chip (Temperature and Humidity Sensor Pro)
Definition: th02.h:60