Skyward boardcore
|
#include <BMP280.h>
Classes | |
union | BMP280Comp |
union | BMP280Config |
Public Types | |
enum | Oversampling { SKIPPED = 0x0 , OVERSAMPLING_1 = 0x1 , OVERSAMPLING_2 = 0x2 , OVERSAMPLING_4 = 0x3 , OVERSAMPLING_8 = 0x4 , OVERSAMPLING_16 = 0x5 } |
enum | Mode { SLEEP_MODE = 0x0 , FORCED_MODE = 0x1 , NORMAL_MODE = 0x3 } |
enum | StandbyTime { STB_TIME_0_5 = 0x0 , STB_TIME_62_5 = 0x1 , STB_TIME_125 = 0x2 , STB_TIME_250 = 0x3 , STB_TIME_500 = 0x4 , STB_TIME_1000 = 0x5 , STB_TIME_20 = 0x6 , STB_TIME_40 = 0x7 } |
enum | FilterCoeff { FILTER_OFF = 0x0 , FILTER_COEFF_2 = 0x1 , FILTER_COEFF_4 = 0x2 , FILTER_COEFF_8 = 0x3 , FILTER_COEFF_16 = 0x4 } |
![]() | |
using | DataType |
Public Member Functions | |
BMP280 (SPISlave spiSlave, BMP280Config config=BMP280_CONFIG_ALL_ENABLED) | |
bool | init () override |
Initialize the device with the specified configuration. | |
void | setSensorMode (Mode mode) |
Sets the sensor mode. | |
void | setPressureOversampling (Oversampling oversampling) |
Sets the oversampling for pressure readings, use SKIPPED to disable pressure sampling. | |
void | setTemperatureOversampling (Oversampling oversampling) |
Sets the oversampling for temperature readings, use SKIPPED to disable temperature sampling. | |
void | setFilterCoeff (FilterCoeff filterCoeff) |
Sets the coefficient for the IIR filter (applied to temperature and pressure) | |
void | setStandbyTime (StandbyTime standbyTime) |
Sets the standby time between readings in normal mode. | |
PressureData | readPressure () |
Reads only the pressure, does not set the configuration. | |
TemperatureData | readTemperature () |
Reads only the temperature, does not set the configuration. | |
unsigned int | getMaxMeasurementTime () |
bool | selfTest () override |
Reads the WHO AM I register. | |
![]() | |
Sensor () | |
Sensor (Sensor &&other) | |
virtual | ~Sensor () |
void | sample () override |
Sample the sensor. | |
virtual BMP280Data | getLastSample () |
![]() | |
virtual | ~AbstractSensor () |
SensorErrors | getLastError () |
Get last error for debugging purposes. Avoid silent fails. | |
Static Public Member Functions | |
static unsigned int | calculateMaxMeasurementTime (BMP280Config config) |
Maximum measurement time formula from datasheet page 51. | |
Static Public Attributes | |
static constexpr uint8_t | REG_ID_VAL = 0x58 |
Who am I value. | |
static const BMP280Config | BMP280_DEFAULT_CONFIG |
Datasheet values for indoor navigation. | |
static const BMP280Config | BMP280_CONFIG_ALL_ENABLED |
Temperature enabled in forced mode. | |
static const BMP280Config | BMP280_CONFIG_TEMP_SINGLE |
Protected Member Functions | |
BMP280Data | sampleImpl () override |
Read a data sample from the sensor. In case of errors, the method should return the last available correct sample. | |
Additional Inherited Members | |
![]() | |
DataType | lastSample |
miosix::FastMutex | mutex |
![]() | |
SensorErrors | lastError = SensorErrors::NO_ERRORS |
|
explicit |
Definition at line 48 of file BMP280.cpp.
|
static |
Maximum measurement time formula from datasheet page 51.
Definition at line 174 of file BMP280.cpp.
unsigned int Boardcore::BMP280::getMaxMeasurementTime | ( | ) |
Definition at line 182 of file BMP280.cpp.
|
overridevirtual |
Initialize the device with the specified configuration.
Implements Boardcore::AbstractSensor.
Definition at line 53 of file BMP280.cpp.
PressureData Boardcore::BMP280::readPressure | ( | ) |
Reads only the pressure, does not set the configuration.
Definition at line 128 of file BMP280.cpp.
TemperatureData Boardcore::BMP280::readTemperature | ( | ) |
Reads only the temperature, does not set the configuration.
Definition at line 150 of file BMP280.cpp.
|
overrideprotectedvirtual |
Read a data sample from the sensor. In case of errors, the method should return the last available correct sample.
Implements Boardcore::Sensor< BMP280Data >.
Definition at line 189 of file BMP280.cpp.
|
overridevirtual |
Reads the WHO AM I register.
Implements Boardcore::AbstractSensor.
Definition at line 187 of file BMP280.cpp.
void Boardcore::BMP280::setFilterCoeff | ( | FilterCoeff | filterCoeff | ) |
Sets the coefficient for the IIR filter (applied to temperature and pressure)
Definition at line 114 of file BMP280.cpp.
void Boardcore::BMP280::setPressureOversampling | ( | Oversampling | oversampling | ) |
Sets the oversampling for pressure readings, use SKIPPED to disable pressure sampling.
Definition at line 100 of file BMP280.cpp.
void Boardcore::BMP280::setSensorMode | ( | Mode | mode | ) |
Sets the sensor mode.
Values:
Definition at line 93 of file BMP280.cpp.
void Boardcore::BMP280::setStandbyTime | ( | StandbyTime | standbyTime | ) |
Sets the standby time between readings in normal mode.
Definition at line 121 of file BMP280.cpp.
void Boardcore::BMP280::setTemperatureOversampling | ( | Oversampling | oversampling | ) |
Sets the oversampling for temperature readings, use SKIPPED to disable temperature sampling.
Definition at line 107 of file BMP280.cpp.
|
static |
Temperature enabled in forced mode.
|
static |
|
static |
Datasheet values for indoor navigation.
|
staticconstexpr |