#i2c #pressure #sensors #info #bmp5-address

bmp5

An embedded_hal_async driver for the BMP5x series of pressure sensors from Bosch Sensortec

3 unstable releases

Uses new Rust 2024

new 0.2.0 Mar 28, 2025
0.1.1 Mar 28, 2025
0.1.0 Mar 28, 2025

#1525 in Embedded development

40 downloads per month

MPL-2.0 license

20KB
388 lines

Rust Driver For BMP5 Pressure Sensors

An embedded_hal_async driver for the BMP5x series of pressure sensors from Bosch Sensortec.

Usage

use defmt::info;
use bmp5::{Config as Bmp5Config, i2c::{Bmp5, BMP5_ADDRESS}};

async {
  // Replace i2c with an implementation of embedded_hal_async::i2c::I2c
  let mut sensor = Bmp5::new(i2c, Delay, BMP5_ADDRESS, Bmp5Config::default());

  // Initialize the sensor.
  sensor.init().await.unwrap();

  // Take a measurement.
  let measuement = sensor.measure().await.unwrap();
  info!("Temperature: {}°C, Pressure: {}Pa", measuement.temperature, measuement.pressure);
}

Dependencies

~170–350KB