Struct bme280_multibus::CtrlMeas[][src]

pub struct CtrlMeas(_);
Expand description

Measurement control register.

This configures the pressure and temperature data acquisition options of the device.

Implementations

Get the reset value of the ctrl_meas register.

Example
use bme280_multibus::CtrlMeas;

assert_eq!(CtrlMeas::reset(), CtrlMeas::default());

Set the oversampling for temperature data.

See Oversampling for settings, and chapter 3.4.3 in the datasheet for details.

Example
use bme280_multibus::{CtrlMeas, Oversampling};

let mut ctrl_meas: CtrlMeas = CtrlMeas::default();
assert_eq!(ctrl_meas.osrs_t(), Oversampling::default());
ctrl_meas = ctrl_meas.set_osrs_t(Oversampling::Skip);
assert_eq!(ctrl_meas.osrs_t(), Oversampling::Skip);
ctrl_meas = ctrl_meas.set_osrs_t(Oversampling::X1);
assert_eq!(ctrl_meas.osrs_t(), Oversampling::X1);
ctrl_meas = ctrl_meas.set_osrs_t(Oversampling::X2);
assert_eq!(ctrl_meas.osrs_t(), Oversampling::X2);
ctrl_meas = ctrl_meas.set_osrs_t(Oversampling::X4);
assert_eq!(ctrl_meas.osrs_t(), Oversampling::X4);
ctrl_meas = ctrl_meas.set_osrs_t(Oversampling::X8);
assert_eq!(ctrl_meas.osrs_t(), Oversampling::X8);
ctrl_meas = ctrl_meas.set_osrs_t(Oversampling::X16);
assert_eq!(ctrl_meas.osrs_t(), Oversampling::X16);

Get the temperature data oversampling.

Set the oversampling for pressure data.

See Oversampling for settings, and chapter 3.4.2 in the datasheet for details.

Example
use bme280_multibus::{CtrlMeas, Oversampling};

let mut ctrl_meas: CtrlMeas = CtrlMeas::default();
assert_eq!(ctrl_meas.osrs_p(), Oversampling::default());
ctrl_meas = ctrl_meas.set_osrs_p(Oversampling::Skip);
assert_eq!(ctrl_meas.osrs_p(), Oversampling::Skip);
ctrl_meas = ctrl_meas.set_osrs_p(Oversampling::X1);
assert_eq!(ctrl_meas.osrs_p(), Oversampling::X1);
ctrl_meas = ctrl_meas.set_osrs_p(Oversampling::X2);
assert_eq!(ctrl_meas.osrs_p(), Oversampling::X2);
ctrl_meas = ctrl_meas.set_osrs_p(Oversampling::X4);
assert_eq!(ctrl_meas.osrs_p(), Oversampling::X4);
ctrl_meas = ctrl_meas.set_osrs_p(Oversampling::X8);
assert_eq!(ctrl_meas.osrs_p(), Oversampling::X8);
ctrl_meas = ctrl_meas.set_osrs_p(Oversampling::X16);
assert_eq!(ctrl_meas.osrs_p(), Oversampling::X16);

Get the pressure data oversampling.

Set the sensor mode for the device.

See Mode for setting, and chapter 3.3 in the datasheet for details.

Example
use bme280_multibus::{CtrlMeas, Mode};

let mut ctrl_meas: CtrlMeas = CtrlMeas::default();
assert_eq!(ctrl_meas.mode(), Mode::default());
ctrl_meas = ctrl_meas.set_mode(Mode::Sleep);
assert_eq!(ctrl_meas.mode(), Mode::Sleep);
ctrl_meas = ctrl_meas.set_mode(Mode::Forced);
assert_eq!(ctrl_meas.mode(), Mode::Forced);
ctrl_meas = ctrl_meas.set_mode(Mode::Normal);
assert_eq!(ctrl_meas.mode(), Mode::Normal);

Get the mode.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.