Enum Command

Source
pub enum Command {
    TriggerContinuousMeasurement = 16,
    StopContinuousMeasurement = 260,
    SetMeasurementInterval = 17_920,
    GetDataReady = 514,
    ReadMeasurement = 768,
    ActivateAutomaticSelfCalibration = 21_254,
    ForcedRecalibrationValue = 20_996,
    SetTemperatureOffset = 21_507,
    SetAltitudeCompensation = 20_738,
    ReadFirmwareVersion = 53_504,
    SoftReset = 54_020,
}
Expand description

I2C Commands for the SCD30 according to its interface description

Variants§

§

TriggerContinuousMeasurement = 16

Enable continuous measurements with an ambient pressure compensation. The ambient pressure compensation is sent as an argument after the command. Setting it to 0 uses the default value of 1013.25 mBar. Accepted value range: 0 or [700…1400] in mBar.

§

StopContinuousMeasurement = 260

Stop continuous measurements.

§

SetMeasurementInterval = 17_920

Sets the measurement interval in continuous mode. The interval is sent as an argument after the command. The initial value is 2 s. Accepted value range: [2…1800] in s. If no argument is given the value is read back.

§

GetDataReady = 514

Queries whether a measurement can be read from the sensor’s buffer. The answer is 1 if a measurement is available, 0 otherwise.

§

ReadMeasurement = 768

If a measurement is available reads out the measurement. The measurement contains the CO2 concentration in ppm, the temperature in °C and the relative humidity in %.

§

ActivateAutomaticSelfCalibration = 21_254

(De-)Activates continuous, automatic self calibration (ASC). The setting is sent as an argument after the command. Sending a 1 activates ASC, sending a 0 deactivates ASC. See the interface description for the self-calibration procedure.

§

ForcedRecalibrationValue = 20_996

Set or get the forced re-calibration value (FRC). After re-powering this returns the standard value of 400 ppm. Sending an argument after the command sets the FRC to the sent value. Accepted value range: [400…2000] ppm. If no argument is given the value is read back.

§

SetTemperatureOffset = 21_507

Set temperature offset caused by self-heating. The offset is sent as an argument after the command. Accepted value range: [0.1…UINT16::MAX * 0.1] in °C.

§

SetAltitudeCompensation = 20_738

Set operating height over sea level. The height is sent as an argument after the command. Accepted value range: [0..UINT16::MAX] in m above sea level. If no argument is given the value is read back.

§

ReadFirmwareVersion = 53_504

Queries the firmware version of the sensor. The responses is the major.minor version.

§

SoftReset = 54_020

Reset the device, similar to a power-off reset, by restarting the sensor controller.

Implementations§

Source§

impl Command

Source

pub fn to_be_bytes(&self) -> [u8; 2]

Returns a big endian byte representation of the command.

Trait Implementations§

Source§

impl Clone for Command

Source§

fn clone(&self) -> Command

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Command

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.