Struct scd30pi::i2c::SCD30[][src]

pub struct SCD30 { /* fields omitted */ }

Structo encapsulating all the data required for the scd30 sensor

Implementations

impl SCD30[src]

pub fn new() -> Result<SCD30, Error>[src]

creates a new sensor with the default I2C address 0x61

pub fn from_slave_address(slave_address: u16) -> Result<SCD30, Error>[src]

Generates the sensor from an arbitrary slave address the default address is 0x61

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

Reads the I2C bus speed

pub fn set_measure_interval(
    &mut self,
    interval_seconds: u16
) -> Result<(), Error>
[src]

Sets the measure interval in seconds. The sensor default interval is 2s.

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

Reads the sensor firmware version.

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

Reads the currently set measurement interval in seconds

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

Reads the measurement values temperature, humidity and CO2 concentration from the sensor

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

Gets the temperature in degree Celsius. If the value is older than measure interval, it reads the value from the sensor.

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

Gets the humidity in percent. If the value is older than measure interval, it reads the value from the sensor.

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

Gets the CO2 concentration in ppm. If the value is older than measure interval, it reads the value from the sensor.

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

Enables the sensor self calibration mechanism. See also sensor documentation

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

Disables the sensor self calibration. See also sensor documentation.

pub fn set_altitude_compensation(
    &mut self,
    altitude_mum: u16
) -> Result<(), Error>
[src]

Sets the altitude compensation in meters above sea level.

pub fn set_forced_recalibration(
    &mut self,
    real_co2_ppm: u16
) -> Result<(), Error>
[src]

Force sensor recalibration based on the given CO2 concentration.

pub fn set_temperature_offset(&mut self, temp: f32) -> Result<(), Error>[src]

Sets a temperature offset to compensate heat from a nearby device.

pub fn start_with_alt_comp(&mut self, pressure_mbar: u16) -> Result<(), Error>[src]

Starts the measurement in the sensor based on the given altitude compensation in millibar.

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

Starts the measurement in the sensor.

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

Stops the sensor

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

Soft reset the sensor

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

True if there is new measurement data to read from the sensor.

Auto Trait Implementations

impl RefUnwindSafe for SCD30

impl Send for SCD30

impl !Sync for SCD30

impl Unpin for SCD30

impl UnwindSafe for SCD30

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.