80 oversamplingHumidity : 3;
94 uint8_t measuring : 1;
99 oversamplingPressure : 3;
101 oversamplingTemperature : 3;
166 bool init()
override;
247 void setConfiguration();
253 void loadCompensationParameters();
257 int32_t computeFineTemperature(int32_t adcTemperature);
259 int32_t compensateTemperature(int32_t fineTemperature);
261 uint32_t compensatePressure(int32_t adcPressure);
263 uint32_t compensateHumidity(int32_t adcHumidity);
272 enum Registers : uint8_t
285 REG_CTRL_MEAS = 0xF4,
288 REG_PRESS_MSB = 0xF7,
289 REG_PRESS_LSB = 0xF8,
290 REG_PRESS_XLSB = 0xF9,
293 REG_TEMP_XLSB = 0xFC,
303 BME280Comp compParams;
304 int32_t fineTemperature;
@ OVERSAMPLING_8
Oversampling x8.
@ OVERSAMPLING_2
Oversampling x2.
@ SKIPPED
Skipped (output set to 0x8000)
@ OVERSAMPLING_16
Oversampling x16.
@ OVERSAMPLING_4
Oversampling x4.
@ OVERSAMPLING_1
Oversampling x1.
bool init() override
Initialize the device with the specified configuration.
static const BME280Config BME280_CONFIG_TEMP_SINGLE
void setTemperatureOversampling(Oversampling oversampling)
Sets the oversampling for temperature readings, use SKIPPED to disable temperature sampling.
@ FILTER_COEFF_16
Filter coefficient = 16.
@ FILTER_COEFF_2
Filter coefficient = 2.
@ FILTER_COEFF_8
Filter coefficient = 8.
@ FILTER_COEFF_4
Filter coefficient = 4.
static constexpr uint8_t REG_ID_VAL
Who am I value.
void setHumidityOversampling(Oversampling oversampling)
Sets the oversampling for humidity readings, use SKIPPED to disable humidity sampling.
void setSensorMode(Mode mode)
Sets the sensor mode.
static unsigned int calculateMaxMeasurementTime(BME280Config config)
Maximum measurement time formula from datasheet page 51.
BME280Data sampleImpl() override
Read a data sample from the sensor. In case of errors, the method should return the last available co...
PressureData readPressure()
Reads only the pressure, does not set the configuration.
@ NORMAL_MODE
Normal mode.
@ FORCED_MODE
Forced mode.
static const BME280Config BME280_DEFAULT_CONFIG
Datasheet values for indoor navigation.
static const BME280Config BME280_CONFIG_ALL_ENABLED
Temperature enabled in forced mode.
HumidityData readHumidity()
Reads only the humidity, does not set the configuration.
void setPressureOversampling(Oversampling oversampling)
Sets the oversampling for pressure readings, use SKIPPED to disable pressure sampling.
BME280I2C(I2C &bus, BME280Config config=BME280_CONFIG_ALL_ENABLED)
bool selfTest() override
Reads the WHO AM I register.
void setStandbyTime(StandbyTime standbyTime)
Sets the standby time between readings in normal mode.
unsigned int getMaxMeasurementTime()
void setFilterCoeff(FilterCoeff filterCoeff)
Sets the coefficient for the IIR filter (applied to temperature and pressure)
TemperatureData readTemperature()
Reads only the temperature, does not set the configuration.
High level driver for the I2C peripherals.
static PrintLogger getLogger(const string &name)
Base sensor class with has to be extended by any sensor driver.
This file includes all the types the logdecoder script will decode.
Structure to handle humidity data.
Configuration struct for a slave device. This will be used for configuring the bus in order to commun...
struct __attribute__((packed))
struct Boardcore::BME280I2C::BME280Config::@3 bytes
struct __attribute__((packed)) BME280ConfigBits
uint8_t ctrlPressureAndTemperature
uint8_t config
Rate, filter and interface options.
uint8_t status
Device status.
uint8_t ctrlHumidity
Humidity options.