|
BMP581 Driver 1.0.0
API reference
|
BMP581 client. More...
#include <bmp581_driver.hpp>
Public Member Functions | |
| Driver (BusT &bus) noexcept | |
| uint8_t | ChipId () const noexcept |
Chip id read by the last successful Init() (0 before). | |
| bool | Initialized () const noexcept |
| DriverResult< void > | Init () noexcept |
| Verify chip id (0x50 / 0x51) and NVM readiness. | |
| DriverResult< void > | SoftReset () noexcept |
| Soft reset: CMD = 0xB6, wait t_soft_res (2 ms), reselect SPI, verify. | |
| DriverResult< void > | Configure (const Config &cfg) noexcept |
| Standby → OSR/ODR → IIR → power mode, in the order the device requires. | |
| DriverResult< PowerMode > | GetPowerMode () noexcept |
| DriverResult< void > | SetPowerMode (PowerMode mode) noexcept |
| Set power mode. Always hops through standby (t_standby 2.5 ms) as the data sheet requires before entering Normal/Forced/Continuous. | |
| DriverResult< OsrOdrConfig > | GetOsrOdr () noexcept |
| DriverResult< void > | SetOsrOdr (const OsrOdrConfig &c) noexcept |
| Write OSR_CONFIG / ODR_CONFIG preserving power-mode bits. ODR faster than 5 Hz is only valid with deep standby disabled; the driver forces the device to plain standby first in that case (Bosch API behaviour). | |
| DriverResult< EffectiveOsr > | GetEffectiveOsr () noexcept |
| DriverResult< IirConfig > | GetIir () noexcept |
| DriverResult< void > | SetIir (const IirConfig &c) noexcept |
| IIR registers are writable in standby only; previous mode is restored. | |
| DriverResult< void > | ConfigureInterrupt (const InterruptConfig &c) noexcept |
| Disable sources, clear status, then write mode/polarity/drive/enable. | |
| DriverResult< void > | SelectInterruptSources (const InterruptSources &s) noexcept |
| DriverResult< uint8_t > | ReadInterruptStatus () noexcept |
| INT_STATUS (read clears in pulsed mode). | |
| DriverResult< bool > | DataReady () noexcept |
| Convenience: INT_STATUS.drdy_data_reg. | |
| DriverResult< Sample > | ReadSample (bool pressure_enabled=true) noexcept |
| Burst-read 0x1D..0x22 → temperature (1/65536 °C) and pressure (1/64 Pa). | |
| DriverResult< uint16_t > | ReadNvm (uint8_t nvm_addr) noexcept |
| Read one 16-bit NVM user word (0x20..0x22). Requires standby; previous mode is restored. | |
| DriverResult< uint8_t > | ReadRegister (uint8_t r) noexcept |
| DriverResult< void > | WriteRegister (uint8_t r, uint8_t v) noexcept |
Static Public Member Functions | |
| static Sample | DecodeSample (const uint8_t d[6], bool pressure_enabled) noexcept |
| Decode a 6-byte data-register burst (also used by tests). | |
BMP581 client.
| BusT | Concrete type inheriting BusInterface<BusT>. |
|
inlineexplicitnoexcept |
|
inlinenoexcept |
Chip id read by the last successful Init() (0 before).
|
inlinenoexcept |
Standby → OSR/ODR → IIR → power mode, in the order the device requires.
|
inlinenoexcept |
Disable sources, clear status, then write mode/polarity/drive/enable.
|
inlinenoexcept |
Convenience: INT_STATUS.drdy_data_reg.
|
inlinestaticnoexcept |
Decode a 6-byte data-register burst (also used by tests).
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Verify chip id (0x50 / 0x51) and NVM readiness.
On SPI (and for an adapter that does not declare kInterface) the first access is the dummy read that switches the chip from I2C to SPI (datasheet section 5.1); its data is discarded.
|
inlinenoexcept |
|
inlinenoexcept |
INT_STATUS (read clears in pulsed mode).
|
inlinenoexcept |
Read one 16-bit NVM user word (0x20..0x22). Requires standby; previous mode is restored.
|
inlinenoexcept |
|
inlinenoexcept |
Burst-read 0x1D..0x22 → temperature (1/65536 °C) and pressure (1/64 Pa).
|
inlinenoexcept |
|
inlinenoexcept |
IIR registers are writable in standby only; previous mode is restored.
|
inlinenoexcept |
Write OSR_CONFIG / ODR_CONFIG preserving power-mode bits. ODR faster than 5 Hz is only valid with deep standby disabled; the driver forces the device to plain standby first in that case (Bosch API behaviour).
|
inlinenoexcept |
Set power mode. Always hops through standby (t_standby 2.5 ms) as the data sheet requires before entering Normal/Forced/Continuous.
|
inlinenoexcept |
Soft reset: CMD = 0xB6, wait t_soft_res (2 ms), reselect SPI, verify.
kInterface == Interface::Spi it is reported as Bus.InvalidChipId), STATUS nvm_rdy = 1 and nvm_err = 0 (NvmNotReady, NvmCommandError), INT_STATUS por = 1 (PorSoftReset). Every read after the reset command reports its own bus error as Bus.
|
inlinenoexcept |