Command

Enum Command 

Source
pub enum Command {
Show 22 variants StartContinuousMeasurement = 33, StopMeasurement = 260, GetDataReady = 514, ReadMeasurement = 768, ReadRawMeasurement = 1_029, ReadNumberConcentrationValues = 790, SetTemperatureOffsetParameters = 24_754, SetTemperatureAccelerationParameters = 24_832, GetProductName = 53_268, GetSerialNumber = 53_299, GetDeviceStatus = 53_766, ReadAndClearDeviceStatus = 53_776, ResetDevice = 54_020, StartFanCleaning = 22_023, ActivateShtHeater = 14_128, SetReadVocTuningParameters = 24_784, SetReadVocAlgorithmState = 24_961, SetReadNoxTuningParameters = 24_801, ForcedRecalibration = 26_375, SetReadCo2AutomaticSelfCalibration = 26_385, SetReadAmbientPreassure = 26_400, SetReadSensorAltitude = 26_422,
}
Expand description

I2C Commands for the SEN66 according to its interface description.

Variants§

§

StartContinuousMeasurement = 33

Starts a continuous measurement and moves chip to measuring state. After the sending the command it might take some time until the first measurement is ready. Exec. Time: 50ms

Only available in idle state
§

StopMeasurement = 260

Stops measurements and returns to idle state. Wait at least 1000ms until starting a new measurement. Exec. Time: 1000ms

Only available in measuring state
§

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. Exec. Time: 20ms

Only available in measuring state
§

ReadMeasurement = 768

If a measurement is available reads out the measurement. If no new data is available the previous measurement is returned. If no data is available all data is set to the maximum value (0xFFFF for u16, 0x7FFF for i16). The measurement contains the mass concentration for PM1.0, PM2.5, PM4.0 and PM10.0 in ug/m³, the relative humidity in %, the temperature in °C, the volatile organic compounds (VOC) index, the NOx index and CO2 concentration in ppm. Exec. Time: 20ms

Only available in measuring state
§

ReadRawMeasurement = 1_029

If a measurement is available reads out the measured raw values. If no new data is available the previous measurement is returned. If no data is available all data is set to the maximum value (0xFFFF for u16, 0x7FFF for i16). The measurement contains the raw relative humidity in %, the raw temperature in °C, the VOC ticks, the NOx ticks and the CO2 concentration in ppm. For the first 10-11s after power-on or device reset the CO2 value will be 0xFFFF. Exec. Time: 20ms

Only available in measuring state
§

ReadNumberConcentrationValues = 790

If a measurement is available reads out the measured number concentration values. If no new data is available the previous values will be returned. If no data is available at all, the data is set to the maximum value (0xFFFF for u16). The values contain the mass concentration for PM0.5, PM1.0, PM2.5, PM4.0 and PM10.0 in p/cm³ Exec. Time: 20ms

Only available in measuring state
§

SetTemperatureOffsetParameters = 24_754

Configures the temperature compensation via a slope and one of five offsets in °C. Exec. Time: 20ms

§

SetTemperatureAccelerationParameters = 24_832

Configures the temperature acceleration parameters for the RH/T engine. Thes parameters are volatile and reverted after a device reset. Exec. Time: 20ms

Only available in idle state
§

GetProductName = 53_268

Reads out the product name as a null-terminated ASCII string with up to 32 characters. Exec. Time: 20ms

§

GetSerialNumber = 53_299

Reads out the device’s serial number as a null-terminated ASCII string with up to 32 characters. Exec. Time: 20ms

§

GetDeviceStatus = 53_766

Read out the device’s status register as a 32-bit bitfield. Exec. Time: 20ms

§

ReadAndClearDeviceStatus = 53_776

Read the current device status as a 32-bit bitfield and clear all flags. Exec. Time: 20ms

§

ResetDevice = 54_020

Executes a device reset, the same as a power cycle. Exec. Time: 1200ms

§

StartFanCleaning = 22_023

Starts fan cleaning, where fan speed is set to a maximum for 10s. Wait at least 10s after this command until the next measurement. Exec. Time: 1ms

Only available in idle state
§

ActivateShtHeater = 14_128

Start the SHT’s inbuilt heater for 1s with 200mW. Wait at least 20s after this command until the next measurement. Exec. Time: 1300ms

Only available in idle state
§

SetReadVocTuningParameters = 24_784

Sets or reads the parameters that customize the VOC algorithm. Contains the index offset, the learning time offset hours, the learning time gain hours, the max duration minutes, the initial standard deviation and the gain factor (all i16). Exec. Time: 20ms

Only available in idle state
§

SetReadVocAlgorithmState = 24_961

Sets or reads the state of the VOC algorithm to skip the initial learning phase. The state is encoded in a byte array of length 8. Exec. Time: 20ms

Writing only available in idle state
§

SetReadNoxTuningParameters = 24_801

Sets or reads the parameters that customize the VOC algorithm. Contains the index offset, the learning time offset hours, the learning time gain hours, the max duration minutes, the initial standard deviation and the gain factor (all i16). Exec. Time: 20ms

Only available in idle state
§

ForcedRecalibration = 26_375

Executes a forced recalibration (FRC) of the CO2 signal. Send the target CO2 concentation (as u16) and receive the correction factor as FRC - 0x8000 (as u16). Wait at least 1000ms after power-on and 600ms after stopping measurement to send this command.

§Errors

If recalibration failes 0xFFFF is returned. Exec. Time: 500ms

Only available in idle state
§

SetReadCo2AutomaticSelfCalibration = 26_385

Enables/Disables or reads the status of the automatic self calibration (ASC) for the CO2 sensor via a bool value. Sending a 0x01 activates ASC, sending a 0x00 disables ASC. Receiving a 0x01 indicates that ASC is enabled, a 0x00 indicates that ASC is disabled. Exec. Time: 20ms

Only available in idle state
§

SetReadAmbientPreassure = 26_400

Sets or reads the ambient pressure value in hPA (as u16) which is used for the CO2 sensor’s pressure compensation. Exec. Time: 20ms

§

SetReadSensorAltitude = 26_422

Sets or reads the sensors current altitude in m (as u16) which is used for the CO2 sensor’s pressure compensation. Exec. Time: 20ms

Only available in idle state

Implementations§

Source§

impl Command

Source

pub const 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.