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 = 0x74,
259 REG_PRESS_MSB = 0x77,
260 REG_PRESS_LSB = 0x78,
261 REG_PRESS_XLSB = 0x79,
269 BMP280Comp compParams;
270 int32_t fineTemperature;
BMP280(SPISlave spiSlave, BMP280Config config=BMP280_CONFIG_ALL_ENABLED)
void setStandbyTime(StandbyTime standbyTime)
Sets the standby time between readings in normal mode.
void setSensorMode(Mode mode)
Sets the sensor mode.
bool init() override
Initialize the device with the specified configuration.
PressureData readPressure()
Reads only the pressure, does not set the configuration.
static const BMP280Config BMP280_CONFIG_ALL_ENABLED
Temperature enabled in forced mode.
@ FILTER_COEFF_4
Filter coefficient = 4.
@ FILTER_COEFF_2
Filter coefficient = 2.
@ FILTER_COEFF_16
Filter coefficient = 16.
@ FILTER_COEFF_8
Filter coefficient = 8.
BMP280Data sampleImpl() override
Read a data sample from the sensor. In case of errors, the method should return the last available co...
TemperatureData readTemperature()
Reads only the temperature, does not set the configuration.
static constexpr uint8_t REG_ID_VAL
Who am I value.
@ FORCED_MODE
Forced mode.
@ NORMAL_MODE
Normal mode.
void setTemperatureOversampling(Oversampling oversampling)
Sets the oversampling for temperature readings, use SKIPPED to disable temperature sampling.
static unsigned int calculateMaxMeasurementTime(BMP280Config config)
Maximum measurement time formula from datasheet page 51.
static const BMP280Config BMP280_CONFIG_TEMP_SINGLE
void setFilterCoeff(FilterCoeff filterCoeff)
Sets the coefficient for the IIR filter (applied to temperature and pressure)
unsigned int getMaxMeasurementTime()
@ OVERSAMPLING_1
Oversampling x1.
@ OVERSAMPLING_8
Oversampling x8.
@ SKIPPED
Skipped (output set to 0x8000)
@ OVERSAMPLING_16
Oversampling x16.
@ OVERSAMPLING_4
Oversampling x4.
@ OVERSAMPLING_2
Oversampling x2.
void setPressureOversampling(Oversampling oversampling)
Sets the oversampling for pressure readings, use SKIPPED to disable pressure sampling.
bool selfTest() override
Reads the WHO AM I register.
static const BMP280Config BMP280_DEFAULT_CONFIG
Datasheet values for indoor navigation.
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.
Contains information about a single SPI slave device.
struct __attribute__((packed))
struct Boardcore::BMP280::BMP280Config::@4 bytes
uint8_t ctrlPressureAndTemperature
struct __attribute__((packed)) BMP280ConfigBits
uint8_t status
Device status.
uint8_t config
Rate, filter and interface options.