Expand description
The BMP390 is a digital sensor with pressure and temperature measurement based on proven sensing principles. The sensor is more accurate than its predecessor BMP380, covering a wider measurement range. It offers new interrupt functionality, lower power consumption, and a new FIFO functionality. The integrated 512 byte FIFO buffer supports low power applications and prevents data loss in non-real-time systems.
Bmp390 is a driver for the BMP390 sensor. It provides methods to read the temperature and pressure from the
sensor over I2C. It is built on top of the embedded_hal_async::i2c
traits to be compatible with a wide range of embedded platforms. Measurements utilize the uom crate to provide
automatic, type-safe, and zero-cost units of measurement for Measurement.
§Example
use bmp390::Bmp390;
let config = bmp390::Configuration::default();
let mut sensor = Bmp390::try_new(i2c, bmp390::Address::Up, delay, &config).await?;
let measurement = sensor.measure().await?;
defmt::info!("Measurement: {}", measurement);§Datasheet
The BMP390 Datasheet contains detailed information about the sensor’s features, electrical characteristics, and registers. This package implements the functionality described in the datasheet and references the relevant sections in the documentation.
§Synchronous API
The synchronous API is available behind the sync feature flag. It’s driver is sync::Bmp390 and functions
similarly to the asynchronous driver, but with synchronous methods.
By default, the synchronous API is disabled.
Modules§
- sync
sync - This module provides a synchronous verison of the
Bmp390driver, built on top ofembedded_hal::i2c.
Structs§
- Bmp390
- A driver for the BMP390 pressure sensor over any
I2cimplementation. - Cmd
Register::CMDissues commands to the BMP390.- Config
Register::CONFIGcontrols the IIR filter coefficients.- Configuration
- Configuration for the BMP390 barometer.
- ErrReg
Register::ERR_REGcontains sensor error conditions.- Event
Register::EVENTcontains status flags for certain events. These flags are cleared on read.- IntControl
Register::INT_CTRLconfigures the interrupt settings and affectsRegister::INT_STATUSand theINTpin.- IntStatus
Register::INT_STATUSshows interrupt statuses and is cleared on read.- Measurement
- A single measurement from the
Bmp390barometer. - Odr
Register::ODRsets the configuration of the output data rates by means of setting the subdivision/subsampling.- Osr
Register::OSRcontrols the oversampling settings for pressure and temperature measurements.- Power
Control Register::PWR_CTRLenables or disables pressure and temperature measurements and sets thePowerMode.- Status
Register::STATUScontains sensor status flags.
Enums§
- Address
- The BMP390 barometer’s I2C addresses, either
0x76or0x77. - Command
- Available commands that can be written to
Register::CMD. - Error
- Errors that can occur when communicating with the BMP390 barometer.
- IirFilter
- The IIR filter can suppress short-term pressure disturbances by filtering internally.
- IntLevel
- The interrupt level for the
INTpin. - IntOd
- The interrupt output type for the
INTpin. - OdrSel
- The output data rate (ODR) is the rate at which the sensor provides new data.
- Oversampling
- Oversampling settings for pressure and temperature measurements.
- Power
Mode - The BMP390 offers three power modes: sleep mode, forced mode and normal mode.
- Register
- The BMP390 has a number of registers to provide access to the sensor’s data and control various settings.