Struct bme680::SettingsBuilder
source · pub struct SettingsBuilder { /* private fields */ }
Expand description
Builder to construct the desired settings
Example
use bme680::{IIRFilterSize, OversamplingSetting, SettingsBuilder};
use std::time::Duration;
let settings = SettingsBuilder::new()
.with_humidity_oversampling(OversamplingSetting::OS2x)
.with_pressure_oversampling(OversamplingSetting::OS4x)
.with_temperature_oversampling(OversamplingSetting::OS8x)
.with_temperature_filter(IIRFilterSize::Size3)
.with_gas_measurement(Duration::from_millis(1500), 320, 25)
.with_temperature_offset(-4.25)
.with_run_gas(true)
.build();
Implementations
sourceimpl SettingsBuilder
impl SettingsBuilder
pub fn new() -> SettingsBuilder
pub fn with_temperature_filter(self, filter: IIRFilterSize) -> SettingsBuilder
pub fn with_humidity_control(self, heatr_control: u8) -> SettingsBuilder
pub fn with_temperature_oversampling(
self,
os_temp: OversamplingSetting
) -> SettingsBuilder
pub fn with_pressure_oversampling(
self,
os_pres: OversamplingSetting
) -> SettingsBuilder
pub fn with_humidity_oversampling(
self,
os_hum: OversamplingSetting
) -> SettingsBuilder
pub fn with_gas_measurement(
self,
heatr_dur: Duration,
heatr_temp: u16,
ambient_temperature: i8
) -> SettingsBuilder
pub fn with_nb_conv(self, nb_conv: u8) -> SettingsBuilder
pub fn with_run_gas(self, run_gas: bool) -> SettingsBuilder
sourcepub fn with_temperature_offset(self, offset: f32) -> SettingsBuilder
pub fn with_temperature_offset(self, offset: f32) -> SettingsBuilder
Temperature offset in Celsius, e.g. 4, -8, 1.25
pub fn build(self) -> Settings
Auto Trait Implementations
impl RefUnwindSafe for SettingsBuilder
impl Send for SettingsBuilder
impl Sync for SettingsBuilder
impl Unpin for SettingsBuilder
impl UnwindSafe for SettingsBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more