Skip to main content

max_measurement_micros

Function max_measurement_micros 

Source
pub fn max_measurement_micros(
    temperature: Oversampling,
    pressure: Oversampling,
) -> u32
Expand description

The longest one measurement cycle can take, in microseconds.

1.25 ms, plus 2.3 ms per temperature sample, plus 2.3 ms per pressure sample and 0.575 ms, each term only for a measurement that is not skipped. Section 3.8.1 of the data sheet publishes these maxima as Table 13, one row per recommended setting, rather than as a formula; the terms are the BME280 data sheet’s formula without its humidity term, and they reproduce every row of the table, including the minimum-rate column, which is computed from the maxima before the time column rounds them (6.425 ms gives the row’s 155.6 Hz where 6.4 ms would give 156.3 Hz). A driver waits this long after forcing a measurement before it polls the status register, which is how section 3.9 asks forced-mode readout to be timed.

§Arguments

  • temperature - temperature oversampling.
  • pressure - pressure oversampling.

§Returns

The maximum measurement time in microseconds.

§Examples

use pamoja_sensors::bmp280::{max_measurement_micros, Oversampling};

// Table 13's standard resolution row: pressure x4, temperature x1, 13.3 ms.
let micros = max_measurement_micros(Oversampling::X1, Oversampling::X4);
assert_eq!(micros, 13_325);