Crate bmp390

Crate bmp390 

Source
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§

syncsync
This module provides a synchronous verison of the Bmp390 driver, built on top of embedded_hal::i2c.

Structs§

Bmp390
A driver for the BMP390 pressure sensor over any I2c implementation.
Cmd
Register::CMD issues commands to the BMP390.
Config
Register::CONFIG controls the IIR filter coefficients.
Configuration
Configuration for the BMP390 barometer.
ErrReg
Register::ERR_REG contains sensor error conditions.
Event
Register::EVENT contains status flags for certain events. These flags are cleared on read.
IntControl
Register::INT_CTRL configures the interrupt settings and affects Register::INT_STATUS and the INT pin.
IntStatus
Register::INT_STATUS shows interrupt statuses and is cleared on read.
Measurement
A single measurement from the Bmp390 barometer.
Odr
Register::ODR sets the configuration of the output data rates by means of setting the subdivision/subsampling.
Osr
Register::OSR controls the oversampling settings for pressure and temperature measurements.
PowerControl
Register::PWR_CTRL enables or disables pressure and temperature measurements and sets the PowerMode.
Status
Register::STATUS contains sensor status flags.

Enums§

Address
The BMP390 barometer’s I2C addresses, either 0x76 or 0x77.
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 INT pin.
IntOd
The interrupt output type for the INT pin.
OdrSel
The output data rate (ODR) is the rate at which the sensor provides new data.
Oversampling
Oversampling settings for pressure and temperature measurements.
PowerMode
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.