[][src]Struct winsen_co2_sensor::WinsenSensor

pub struct WinsenSensor<S, C> { /* fields omitted */ }

Methods

impl<E, S: Read<u8, Error = E> + Write<u8, Error = E>, C: MonotonicCounter> WinsenSensor<S, C>[src]

pub fn new(serial: S, counter: C) -> Self[src]

pub fn free(self) -> (S, C)[src]

pub fn probe(&mut self) -> Result<bool, E>[src]

pub fn read_co2_concentration(&mut self) -> Result<u16, Error<E>>[src]

Read the CO2 gas concentration in ppm

pub fn set_automatic_baseline_correction(
    &mut self,
    enabled: bool
) -> Result<(), Error<E>>
[src]

Enable or disable Automatic Baseline Correction (ABC)

pub fn calibrate_zero_point(&mut self) -> Result<(), Error<E>>[src]

Perform zero point calibration

For MH-Z19B zero point is 400ppm, please make sure the sensor has been worked under 400ppm for over 20 minutes

pub fn calibrate_span_point(&mut self, span: u16) -> Result<(), Error<E>>[src]

Perform span point calibration

Quoting the datasheet: "Note: Pls do ZERO calibration before span calibration Please make sure the sensor worked under a certain level co2 for over 20 minutes.

Suggest using 2000ppm as span, at least 1000ppm"

pub fn set_detection_range(&mut self, range: u32) -> Result<(), Error<E>>[src]

Set the sensor detection range (MH-Z19B only).

Quoting the datasheet: "Detection range is 2000 or 5000ppm"

pub fn get_detection_range(&mut self) -> Result<u32, Error<E>>[src]

This is supported on feature="experimental" only.

Get the sensor detection range

pub fn reset(&mut self) -> Result<(), Error<E>>[src]

This is supported on feature="experimental" only.

Perform sensor reset

This command resets sensor MCU

pub fn get_analog_bounds(&mut self) -> Result<(u16, u16), Error<E>>[src]

This is supported on feature="experimental" only.

Get CO2 concentration bounds used for the analog output

pub fn get_firmware_version(&mut self) -> Result<[u8; 4], Error<E>>[src]

This is supported on feature="experimental" only.

Get firmware version string

Auto Trait Implementations

impl<S, C> RefUnwindSafe for WinsenSensor<S, C> where
    C: RefUnwindSafe,
    S: RefUnwindSafe

impl<S, C> Send for WinsenSensor<S, C> where
    C: Send,
    S: Send

impl<S, C> Sync for WinsenSensor<S, C> where
    C: Sync,
    S: Sync

impl<S, C> Unpin for WinsenSensor<S, C> where
    C: Unpin,
    S: Unpin

impl<S, C> UnwindSafe for WinsenSensor<S, C> where
    C: UnwindSafe,
    S: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.