|
BMP581 Driver 0.1.0
API reference
|
Public types of the BMP581 driver: errors, Result<T>, configuration, measurements and the datasheet's timing and range constants.
More...
Go to the source code of this file.
Classes | |
| struct | bmp581::Result< T > |
| The value of a call, or why there is none. More... | |
| struct | bmp581::Result< void > |
| The result of a call that returns no value. More... | |
| struct | bmp581::InterruptStatus |
| The interrupt status flags, INT_STATUS (section 7.21), decoded. Reading INT_STATUS clears them on the chip (the FIFO flags stay while their condition holds, section 4.7.3.2). More... | |
| struct | bmp581::Measurement |
| One measurement in the chip's own units, as the data registers hold it (section 4.5). More... | |
| struct | bmp581::FifoSample |
| One FIFO frame, with its own validity: a multi-item read reports each item. More... | |
| struct | bmp581::Config |
Everything EnsureInitialized() and ApplyConfig() write to the chip. More... | |
| class | bmp581::CheckedConfig |
| A configuration proven valid at build time. More... | |
Namespaces | |
| namespace | bmp581 |
The BMP581 driver: everything it declares lives here; internals in detail. | |
Functions | |
| constexpr const char * | bmp581::ToString (Error error) noexcept |
| The name of an error, for logs. | |
| constexpr uint32_t | bmp581::OdrMilliHz (OutputDataRate odr) noexcept |
| An output data rate in millihertz (section 7.34). | |
| constexpr uint32_t | bmp581::MaxOdrMilliHz (Oversampling pressure, Oversampling temperature) noexcept |
| The fastest data rate normal mode accepts with this oversampling (table 7). | |
| constexpr uint32_t | bmp581::ConversionTimeMaxUs (Oversampling pressure, Oversampling temperature) noexcept |
| The longest pressure-and-temperature conversion, t_conv_p + t_conv_t, with the +5 % of table 4, rounded up. | |
| constexpr bool | bmp581::EntersDeepStandby (const Config &config) noexcept |
| Whether the chip enters deep standby with this configuration (section 4.3.2): deep standby allowed, a data rate below 5 Hz, the FIFO off and both IIR filters bypassed. | |
| constexpr uint32_t | bmp581::ForcedMeasurementMaxUs (const Config &config) noexcept |
| The longest forced measurement: the start-up from (deep) standby, then the conversion (table 4). | |
| constexpr int32_t | bmp581::SignExtend24 (uint32_t raw) noexcept |
| A 24-bit two's complement register value as a signed integer, the one place the driver reinterprets wire bits as signed (KB-CPP20-024). | |
| constexpr float | bmp581::PressurePa (int32_t raw) noexcept |
A pressure in pascals: raw / 2^6, exact (section 4.5). | |
| constexpr float | bmp581::TemperatureC (int32_t raw) noexcept |
A temperature in degrees Celsius: raw / 2^16, exact (section 4.5). | |
| constexpr bool | bmp581::PressureInRange (int32_t raw) noexcept |
| Whether a raw pressure lies in the measurement range, 30 to 125 kPa (table 1). | |
| constexpr bool | bmp581::TemperatureInRange (int32_t raw) noexcept |
| Whether a raw temperature lies in the measurement range, -40 to 85 °C (table 2). | |
| constexpr Error | bmp581::Validate (const Config &config) noexcept |
| Check a configuration without touching the chip. | |
| constexpr Config | bmp581::ForcedPreset () noexcept |
Measurements on request: standby between MeasureOnce() calls, deep standby, the standard-resolution oversampling of table 9 (pressure x4, temperature x1). | |
| constexpr Config | bmp581::LowPowerPreset () noexcept |
| Low power at 1 Hz in normal mode with deep standby between measurements (section 4.3.5). | |
| constexpr Config | bmp581::HighResolutionPreset () noexcept |
| High resolution at 25 Hz: pressure x16 (table 9), the IIR on the data registers, data ready reported. | |
| constexpr Config | bmp581::FifoPreset () noexcept |
| Pressure and temperature frames into the FIFO at 10 Hz, threshold at 8 frames. | |
| void | bmp581::ConfigIsInvalid () noexcept |
Reached only when a CheckedConfig is built from an invalid configuration: it is never defined, so the build fails and names it (KB-CPP20-013). | |
| constexpr const char * | bmp581::GetDriverVersion () noexcept |
| constexpr uint32_t | bmp581::GetDriverVersionMajor () noexcept |
| constexpr uint32_t | bmp581::GetDriverVersionMinor () noexcept |
| constexpr uint32_t | bmp581::GetDriverVersionPatch () noexcept |
Variables | |
| constexpr uint8_t | bmp581::kChipId = 0x50 |
| CHIP_ID of every BMP581 (section 7.1). | |
| constexpr int32_t | bmp581::kPressureCountsPerPa = 64 |
| Pressure LSBs per pascal: the registers hold Pa x 2^6 (section 4.5). | |
| constexpr int32_t | bmp581::kTemperatureCountsPerDegreeC = 65536 |
| Temperature LSBs per degree Celsius: the registers hold °C x 2^16 (section 4.5). | |
| constexpr int32_t | bmp581::kPressureMinPa = 30'000 |
| Lowest pressure the chip measures, in pascals (table 1). | |
| constexpr int32_t | bmp581::kPressureMaxPa = 125'000 |
| Highest pressure the chip measures, in pascals (table 1). | |
| constexpr int32_t | bmp581::kTemperatureMinC = -40 |
| Lowest temperature the chip measures, in °C (table 2). | |
| constexpr int32_t | bmp581::kTemperatureMaxC = 85 |
| Highest temperature the chip measures, in °C (table 2). | |
| constexpr uint32_t | bmp581::kOorReferenceMaxPa = 0x1'FFFF |
| Highest out-of-range reference: 17 bits of pascals (section 4.7.2.3). | |
| constexpr uint32_t | bmp581::kFifoFramesSingle = 32 |
| Frames the FIFO holds with 3-byte frames (section 4.6). | |
| constexpr uint32_t | bmp581::kFifoFramesBoth = 16 |
| Frames the FIFO holds with 6-byte frames (section 4.6). | |
| constexpr uint32_t | bmp581::kFifoMaxBytes = 96 |
| Bytes of a full FIFO, either frame size. | |
| constexpr uint32_t | bmp581::kPowerUpUs = 2000 |
| t_powup: power-up to the first communication, maximum (table 4). | |
| constexpr uint32_t | bmp581::kSoftResetUs = 2000 |
| t_soft_res: soft reset to ready, maximum (table 4). | |
| constexpr uint32_t | bmp581::kStandbyUs = 2500 |
| t_standby: any mode to standby, maximum (table 4). | |
| constexpr uint32_t | bmp581::kStartupUs = 3000 |
| t_startup: standby to the start of a measurement, maximum (table 4). | |
| constexpr uint32_t | bmp581::kStartupDeepUs = 4000 |
| t_startup_deep: deep standby to the start of a measurement, maximum (table 4). | |
| constexpr uint32_t | bmp581::kReconfUs = 3000 |
| constexpr uint32_t | bmp581::kReadBackIdleUs = 1 |
| Idle time before INT_CONFIG may be read back after a write (sections 5.5.4, 7.5). | |
| constexpr uint32_t | bmp581::kPollUs = 500 |
| Time between two polls of the chip. | |
| constexpr uint32_t | bmp581::kTimeoutMaxMs = 10'000 |
Public types of the BMP581 driver: errors, Result<T>, configuration, measurements and the datasheet's timing and range constants.
Everything here is plain data with no platform dependency, so handlers, tests and tools can include it without the driver template. The configuration defaults are the chip's reset values (datasheet section 7), so Config{} describes a chip that was just reset, with one exception the driver always applies: pressure is measured (OSR_CONFIG.press_en = 1, see bmp581.hpp).
Section, table and figure numbers refer to the Bosch BMP581 datasheet, document BST-BMP581-DS004-13, revision 1.13.