27 #include <mraa/i2c.hpp> 30 #define HTU21D_NAME "htu21d" 31 #define HTU21D_I2C_ADDRESS 0x40 34 #define HTU21D_READ_TEMP_HOLD 0xE3 35 #define HTU21D_READ_HUMIDITY_HOLD 0xE5 36 #define HTU21D_WRITE_USER_REG 0xE6 37 #define HTU21D_READ_USER_REG 0xE7 38 #define HTU21D_SOFT_RESET 0xFE 41 #define HTU21D_DISABLE_OTP 0x02 42 #define HTU21D_HEATER_ENABLE 0x04 43 #define HTU21D_END_OF_BATTERY 0x40 44 #define HTU21D_RESO_RH12_T14 0x00 45 #define HTU21D_RESO_RH8_T12 0x01 46 #define HTU21D_RESO_RH10_T13 0x80 47 #define HTU21D_RESO_RH11_T11 0x81 90 HTU21D (
int bus,
int devAddr=HTU21D_I2C_ADDRESS);
123 float getCompRH(
int bSampleData =
false);
179 mraa::Result
i2cWriteReg (uint8_t reg, uint8_t value);
203 int32_t convertTemp(int32_t regval);
208 int32_t convertRH(int32_t regval);
214 mraa::I2c m_i2ControlCtx;
216 int32_t m_temperature;
int testSensor(void)
Definition: htu21d.cpp:198
int setHeater(int bEnable=false)
Definition: htu21d.cpp:127
uint8_t i2cReadReg_8(int reg)
Definition: htu21d.cpp:275
float getHumidity(int bSampleData=false)
Definition: htu21d.cpp:103
uint16_t i2cReadReg_16(int reg)
Definition: htu21d.cpp:270
C++ API wrapper for the bh1749 driver.
Definition: a110x.hpp:29
float getDewPoint(int bSampleData=false)
Definition: htu21d.cpp:150
API for the HTU21D Temperature & Humidity Sensor.
Definition: htu21d.hpp:82
int sampleData(void)
Definition: htu21d.cpp:80
int getHumidityData(float *fHum, float *fHumTemp, float *fDewPt)
Definition: htu21d.cpp:174
float getCompRH(int bSampleData=false)
Definition: htu21d.cpp:118
float getTemperature(int bSampleData=false)
Definition: htu21d.cpp:94
mraa::Result i2cWriteReg(uint8_t reg, uint8_t value)
Definition: htu21d.cpp:257
HTU21D(int bus, int devAddr=HTU21D_I2C_ADDRESS)
Definition: htu21d.cpp:36
void resetSensor(void)
Definition: htu21d.cpp:54