Skip to main content

Module bmp280

Module bmp280 

Source
Expand description

Bosch BMP280 digital pressure sensor.

The BMP280 is the BME280’s sibling without the humidity element: a barometric pressure and temperature sensor that ships 20-bit raw ADC codes plus a block of per-chip trimming coefficients, and leaves the compensation to the host. The integer arithmetic here is a line for line port of the bmp280_compensate_T_int32 and bmp280_compensate_P_int64 reference code in section 3.11.3 of the data sheet (BST-BMP280-DS001), and the tests cross-check it against the data sheet’s floating-point form in appendix 8.1.

A caller reads the 24 calibration bytes once with Calibration::parse, then burst-reads the six data registers each cycle into a Measurement and calls Calibration::compensate for a Reading. CtrlMeas and Config build and decode the two control registers, and every decode has a matching builder so a node can be exercised with nothing wired.

Modules§

register
The BMP280 register addresses.

Structs§

Calibration
The per-chip trimming coefficients read from 0x88..=0x9F.
Config
The configuration register (0xF5, config).
CtrlMeas
The measurement control register (0xF4, ctrl_meas).
Measurement
The raw, uncompensated 20-bit codes from the BMP280 data registers.
Reading
A compensated BMP280 reading.

Enums§

Mode
The power mode selected by the mode[1:0] field.
Oversampling
An oversampling setting for the pressure or temperature measurement.
Standby
The inactive period between measurements in normal mode, the t_sb[2:0] field.

Constants§

CALIBRATION_LEN
The number of calibration bytes at register::CALIBRATION.
CHIP_ID
The value the chip-id register (0xD0) returns for a BMP280.
DATA_LEN
The number of data bytes at register::DATA.
I2C_ADDRESS_PRIMARY
The I2C address with the SDO pin tied to ground.
I2C_ADDRESS_SECONDARY
The I2C address with the SDO pin tied to VDDIO.
RESET_WORD
The word written to the reset register (0xE0) to run a full power-on reset.
SKIPPED_OUTPUT
The raw code a data register holds when its measurement is skipped.

Functions§

image_updating
Returns whether the status register reports the NVM image being copied.
measuring
Returns whether the status register reports a conversion in progress.