Struct Scd30

Source
pub struct Scd30<Conn, Delay, Err> { /* private fields */ }
Expand description

Scd30 sensor object This is generic over an I2C connector and associated error type

Implementations§

Source§

impl<Conn, Delay, Err> Scd30<Conn, Delay, Err>
where Conn: Base<Err>, Delay: DelayNs, Err: Debug,

Source

pub fn new(conn: Conn, delay: Delay) -> Result<Self, Error<Err>>

Create a new Scd30 sensor instance

Source

pub fn start_continuous( &mut self, pressure_compensation: u16, ) -> Result<(), Error<Err>>

Start continuous sensing mode with optional pressure compensation pressure_compensation should either be the current pressure in millibar or 0 to disable compensation

Source

pub fn stop_continuous(&mut self) -> Result<(), Error<Err>>

Stop continuous sensing mode

Source

pub fn set_measurement_interval( &mut self, interval: u16, ) -> Result<(), Error<Err>>

Configure measurement interval in seconds

Source

pub fn set_afc(&mut self, enabled: bool) -> Result<(), Error<Err>>

Enable or disable Automatic Self-Calibration

Source

pub fn set_frc(&mut self, cal_ppm: u16) -> Result<(), Error<Err>>

Set Forced Recalibration Value This allows the sensor to be recalibrates using a reference CO2 source

Source

pub fn set_temp_offset(&mut self, temperature: f32) -> Result<(), Error<Err>>

Set Temperature Compensation Allows compensation for temperature variation during operation

Source

pub fn set_alt_offset(&mut self, altitude: u16) -> Result<(), Error<Err>>

Set Altitude Compensation Allows compensation for CO2 measurement using altitude over sea level

Source

pub fn soft_reset(&mut self) -> Result<(), Error<Err>>

Soft reset the underlying device

Source

pub fn firmware_version(&mut self) -> Result<u16, Error<Err>>

Fetch the device firmware version

Source

pub fn data_ready(&mut self) -> Result<bool, Error<Err>>

Check whether measurement data is available in the buffer

Source

pub fn read_data(&mut self) -> Result<Measurement, Error<Err>>

Read measurement data from the buffer

Auto Trait Implementations§

§

impl<Conn, Delay, Err> Freeze for Scd30<Conn, Delay, Err>
where Conn: Freeze, Delay: Freeze,

§

impl<Conn, Delay, Err> RefUnwindSafe for Scd30<Conn, Delay, Err>
where Conn: RefUnwindSafe, Delay: RefUnwindSafe, Err: RefUnwindSafe,

§

impl<Conn, Delay, Err> Send for Scd30<Conn, Delay, Err>
where Conn: Send, Delay: Send, Err: Send,

§

impl<Conn, Delay, Err> Sync for Scd30<Conn, Delay, Err>
where Conn: Sync, Delay: Sync, Err: Sync,

§

impl<Conn, Delay, Err> Unpin for Scd30<Conn, Delay, Err>
where Conn: Unpin, Delay: Unpin, Err: Unpin,

§

impl<Conn, Delay, Err> UnwindSafe for Scd30<Conn, Delay, Err>
where Conn: UnwindSafe, Delay: UnwindSafe, Err: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.