27 #include <mraa/i2c.hpp>
28 #include <mraa/spi.hpp>
29 #include <mraa/gpio.hpp>
31 #include "upm/iHumiditySensor.hpp"
35 #define BME280_DEFAULT_I2C_BUS 0
36 #define BME280_DEFAULT_SPI_BUS 0
37 #define BME280_DEFAULT_ADDR 0x77
38 #define BME280_DEFAULT_CHIPID 0x60
72 typedef enum : uint8_t {
80 REG_CALIB_DIG_H1 = 0xa1,
82 REG_CALIB_DIG_H2_LSB = 0xe1,
83 REG_CALIB_DIG_H2_MSB = 0xe2,
85 REG_CALIB_DIG_H3 = 0xe3,
87 REG_CALIB_DIG_H4_0 = 0xe4,
88 REG_CALIB_DIG_H4_1 = 0xe5,
90 REG_CALIB_DIG_H5_0 = 0xe5,
91 REG_CALIB_DIG_H5_1 = 0xe6,
93 REG_CALIB_DIG_H6 = 0xe7,
97 REG_HUMIDITY_MSB = 0xfd,
98 REG_HUMIDITY_LSB = 0xfe
105 CTRL_HUM_OSRS_H0 = 0x01,
106 CTRL_HUM_OSRS_H1 = 0x02,
107 CTRL_HUM_OSRS_H2 = 0x04,
108 _CTRL_HUM_OSRS_H_MASK = 3,
109 _CTRL_HUM_OSRS_H_SHIFT = 0
119 OSRS_H_OVERSAMPLING_1 = 1,
120 OSRS_H_OVERSAMPLING_2 = 2,
121 OSRS_H_OVERSAMPLING_4 = 3,
122 OSRS_H_OVERSAMPLING_8 = 4,
123 OSRS_H_OVERSAMPLING_16 = 5
143 BME280(
int bus=BME280_DEFAULT_I2C_BUS,
int addr=BME280_DEFAULT_ADDR,
144 int cs=-1, uint8_t theChipID=BME280_DEFAULT_CHIPID);
190 int getHumidityRelative()
200 virtual void readCalibrationData();
213 uint32_t bme280_compensate_H_int32(int32_t adc_H);
const char * getModuleName()
Definition: bme280.hpp:185
CTRL_HUM_T
Definition: bme280.hpp:104
virtual void setUsageMode(USAGE_MODE_T mode)
Definition: bme280.cxx:144
float getHumidity()
Definition: bme280.cxx:128
API for the BME280 Digital Humidity, Pressure, and Temperature Sensor.
Definition: bme280.hpp:66
virtual void update()
Definition: bme280.cxx:64
BME280_REGS_T
Definition: bme280.hpp:72
BME280(int bus=BME280_DEFAULT_I2C_BUS, int addr=BME280_DEFAULT_ADDR, int cs=-1, uint8_t theChipID=BME280_DEFAULT_CHIPID)
Definition: bme280.cxx:37
OSRS_H_T
Definition: bme280.hpp:117
USAGE_MODE_T
Definition: bmp280.hpp:250
virtual ~BME280()
Definition: bme280.cxx:60
void setOversampleRateHumidity(OSRS_H_T rate)
Definition: bme280.cxx:133
API for the BMP280 Digital Pressure Sensor.
Definition: bmp280.hpp:75
Interface for Humidity Sensors.
Definition: iHumiditySensor.hpp:34