90 uint8_t measuring : 1;
95 oversamplingPressure : 3;
97 oversamplingTemperature : 3;
155 bool init()
override;
225 void setConfiguration();
231 void loadCompensationParameters();
235 int32_t computeFineTemperature(int32_t adcTemperature);
237 int32_t compensateTemperature(int32_t fineTemperature);
239 uint32_t compensatePressure(int32_t adcPressure);
247 enum Registers : uint8_t
256 REG_CTRL_MEAS = 0xF4,
259 REG_PRESS_MSB = 0xF7,
260 REG_PRESS_LSB = 0xF8,
261 REG_PRESS_XLSB = 0xF9,
272 BMP280Comp compParams;
273 int32_t fineTemperature;
void setSensorMode(Mode mode)
Sets the sensor mode.
bool init() override
Initialize the device with the specified configuration.
BMP280I2C(I2C &bus, BMP280Config config=BMP280_CONFIG_ALL_ENABLED)
void setTemperatureOversampling(Oversampling oversampling)
Sets the oversampling for temperature readings, use SKIPPED to disable temperature sampling.
@ FORCED_MODE
Forced mode.
@ NORMAL_MODE
Normal mode.
void setPressureOversampling(Oversampling oversampling)
Sets the oversampling for pressure readings, use SKIPPED to disable pressure sampling.
PressureData readPressure()
Reads only the pressure, does not set the configuration.
BMP280Data sampleImpl() override
Read a data sample from the sensor. In case of errors, the method should return the last available co...
static const BMP280Config BMP280_CONFIG_TEMP_SINGLE
@ OVERSAMPLING_2
Oversampling x2.
@ OVERSAMPLING_8
Oversampling x8.
@ OVERSAMPLING_16
Oversampling x16.
@ OVERSAMPLING_1
Oversampling x1.
@ SKIPPED
Skipped (output set to 0x8000)
@ OVERSAMPLING_4
Oversampling x4.
void setStandbyTime(StandbyTime standbyTime)
Sets the standby time between readings in normal mode.
bool selfTest() override
Reads the WHO AM I register.
TemperatureData readTemperature()
Reads only the temperature, does not set the configuration.
static constexpr uint8_t REG_ID_VAL
Who am I value.
static const BMP280Config BMP280_DEFAULT_CONFIG
Datasheet values for indoor navigation.
unsigned int getMaxMeasurementTime()
static unsigned int calculateMaxMeasurementTime(BMP280Config config)
Maximum measurement time formula from datasheet page 51.
@ FILTER_COEFF_4
Filter coefficient = 4.
@ FILTER_COEFF_2
Filter coefficient = 2.
@ FILTER_COEFF_16
Filter coefficient = 16.
@ FILTER_COEFF_8
Filter coefficient = 8.
static const BMP280Config BMP280_CONFIG_ALL_ENABLED
Temperature enabled in forced mode.
void setFilterCoeff(FilterCoeff filterCoeff)
Sets the coefficient for the IIR filter (applied to temperature and pressure)
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.
Configuration struct for a slave device. This will be used for configuring the bus in order to commun...
struct __attribute__((packed))
struct __attribute__((packed)) BMP280ConfigBits
uint8_t ctrlPressureAndTemperature
struct Boardcore::BMP280I2C::BMP280Config::@5 bytes
uint8_t config
Rate, filter and interface options.
uint8_t status
Device status.