Struct sgp40::Sgp40[][src]

pub struct Sgp40<I2C, D> { /* fields omitted */ }

Sgp40 driver instance

Create the driver instance with valid I²C address (0x59) and then it is just rock’n’roll. This driver doesn’t require special starting but once can start to make measurements right away. However, the initial values after start-up will unstable so you will want to throw away some of them.

Implementations

impl<I2C, D, E> Sgp40<I2C, D> where
    I2C: Read<Error = E> + Write<Error = E> + WriteRead<Error = E>,
    D: DelayMs<u32>, 
[src]

pub fn new(i2c: I2C, address: u8, delay: D) -> Self[src]

Creates Sgp40 driver

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

Sensor self-test.

Performs sensor self-test. This is intended for production line and testing and verification only and shouldn’t be needed for normal use.

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

Turn sensor heater off and places it in idle-mode.

Stops running the measurements, places heater into idle by turning the heaters off.

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

Resets the sensor.

Executes a reset on the device. The caller must wait 100ms before starting to use the device again.

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

Reads the voc index from the sensor.

Reads VOC index. Driver is using Sensirion proprietary algortihm and it takes minimum 45 reads to start working. These reads should be made with 1Hz interval to keep the algoritm working.

pub fn measure_voc_index_with_rht(
    &mut self,
    humidity: u16,
    temperature: i16
) -> Result<u16, Error<E>>
[src]

Reads the voc index from the sensor with humidity and temperature compensation.

Reads VOC index with humidity and temperature compensation. Both values us milli-notation where 25°C is equivalent of 25000 and 50% humidity equals 50000.

Driver is using Sensirion proprietary algortihm and it takes minimum 45 reads to start working. These reads should be made with 1Hz interval to keep the algoritm working.

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

Reads the raw signal from the sensor.

Raw signal without temperature and humidity compensation. This is not VOC index but needs to be processed through different algorithm for that.

pub fn measure_raw_with_rht(
    &mut self,
    humidity: u16,
    temperature: i16
) -> Result<u16, Error<E>>
[src]

Reads the raw signal from the sensor.

Raw signal with temperature and humidity compensation. This is not VOC index but needs to be processed through different algorithm for that.

pub fn set_temperature_offset(
    &mut self,
    offset: i16
) -> Result<&mut Self, Error<E>>
[src]

Sets the temperature offset.

This command sets the temperature offset used for the compensation of subsequent RHT measurements.RawSignals The parameter provides the temperature offset (in °C) with a scaling factor of 200, e.g., an output of +400 corresponds to +2.00 °C.

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

Gets the temperature offset

Gets the temperature compensation offset issues to the device.

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

Acquires the sensor serial number.

Sensor serial number is only 48-bits long so the remaining 16-bits are zeros.

Auto Trait Implementations

impl<I2C, D> RefUnwindSafe for Sgp40<I2C, D> where
    D: RefUnwindSafe,
    I2C: RefUnwindSafe

impl<I2C, D> Send for Sgp40<I2C, D> where
    D: Send,
    I2C: Send

impl<I2C, D> Sync for Sgp40<I2C, D> where
    D: Sync,
    I2C: Sync

impl<I2C, D> Unpin for Sgp40<I2C, D> where
    D: Unpin,
    I2C: Unpin

impl<I2C, D> UnwindSafe for Sgp40<I2C, D> where
    D: UnwindSafe,
    I2C: 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<Src, Dst> LosslessTryInto<Dst> for Src where
    Dst: LosslessTryFrom<Src>, 
[src]

impl<Src, Dst> LossyInto<Dst> for Src where
    Dst: LossyFrom<Src>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

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.