pub struct Scd30<I2C> { /* private fields */ }
Expand description
Interface for the SCD30 CO2 sensor by Sensirion.
Implementations§
Source§impl<I2C: I2c<Error = I2cErr>, I2cErr: Error> Scd30<I2C>
impl<I2C: I2c<Error = I2cErr>, I2cErr: Error> Scd30<I2C>
Sourcepub fn trigger_continuous_measurements(
&mut self,
pressure_compensation: Option<AmbientPressureCompensation>,
) -> Result<(), Scd30Error<I2cErr>>
pub fn trigger_continuous_measurements( &mut self, pressure_compensation: Option<AmbientPressureCompensation>, ) -> Result<(), Scd30Error<I2cErr>>
Start continuous measurements. This is stored in non-volatile memory. After power-cycling the device, it will continue measuring without being send a measurement command. Additionally an AmbientPressure value can be send, to compensate for ambient pressure. Default ambient pressure is 1013.25 mBar, can be configured in the range of 700 mBar to 1400 mBar.
Sourcepub fn stop_continuous_measurements(&mut self) -> Result<(), Scd30Error<I2cErr>>
pub fn stop_continuous_measurements(&mut self) -> Result<(), Scd30Error<I2cErr>>
Stop continuous measurements.
Sourcepub fn set_measurement_interval(
&mut self,
interval: MeasurementInterval,
) -> Result<(), Scd30Error<I2cErr>>
pub fn set_measurement_interval( &mut self, interval: MeasurementInterval, ) -> Result<(), Scd30Error<I2cErr>>
Configures the measurement interval in seconds, ranging from to 2s to 1800s.
Sourcepub fn get_measurement_interval(
&mut self,
) -> Result<MeasurementInterval, Scd30Error<I2cErr>>
pub fn get_measurement_interval( &mut self, ) -> Result<MeasurementInterval, Scd30Error<I2cErr>>
Reads out the configured continuous measurement interval
Sourcepub fn is_data_ready(&mut self) -> Result<DataStatus, Scd30Error<I2cErr>>
pub fn is_data_ready(&mut self) -> Result<DataStatus, Scd30Error<I2cErr>>
Checks whether a measurement is ready for readout.
Sourcepub fn read_measurement(&mut self) -> Result<Measurement, Scd30Error<I2cErr>>
pub fn read_measurement(&mut self) -> Result<Measurement, Scd30Error<I2cErr>>
Reads out a Measurement from the sensor.
Sourcepub fn set_automatic_self_calibration(
&mut self,
setting: AutomaticSelfCalibration,
) -> Result<(), Scd30Error<I2cErr>>
pub fn set_automatic_self_calibration( &mut self, setting: AutomaticSelfCalibration, ) -> Result<(), Scd30Error<I2cErr>>
Activates or deactivates automatic self-calibration.
Sourcepub fn get_automatic_self_calibration(
&mut self,
) -> Result<AutomaticSelfCalibration, Scd30Error<I2cErr>>
pub fn get_automatic_self_calibration( &mut self, ) -> Result<AutomaticSelfCalibration, Scd30Error<I2cErr>>
Reads out the current state of the automatic self-calibration.
Sourcepub fn set_forced_recalibration(
&mut self,
frc: ForcedRecalibrationValue,
) -> Result<(), Scd30Error<I2cErr>>
pub fn set_forced_recalibration( &mut self, frc: ForcedRecalibrationValue, ) -> Result<(), Scd30Error<I2cErr>>
Configures the forced re-calibration (FRC) value to compensate for sensor drift. The value can range from 400 ppm to 2000 ppm.
Sourcepub fn get_forced_recalibration(
&mut self,
) -> Result<ForcedRecalibrationValue, Scd30Error<I2cErr>>
pub fn get_forced_recalibration( &mut self, ) -> Result<ForcedRecalibrationValue, Scd30Error<I2cErr>>
Reads out the configured value of the forced re-calibration (FRC) value.
Sourcepub fn set_temperature_offset(
&mut self,
offset: TemperatureOffset,
) -> Result<(), Scd30Error<I2cErr>>
pub fn set_temperature_offset( &mut self, offset: TemperatureOffset, ) -> Result<(), Scd30Error<I2cErr>>
Configures the temperature offset to compensate for self-heating electric components. The value can range from 0.0 °C to 6553.5 °C.
Sourcepub fn get_temperature_offset(
&mut self,
) -> Result<TemperatureOffset, Scd30Error<I2cErr>>
pub fn get_temperature_offset( &mut self, ) -> Result<TemperatureOffset, Scd30Error<I2cErr>>
Reads out the configured temperature offset.
Sourcepub fn set_altitude_compensation(
&mut self,
altitude: AltitudeCompensation,
) -> Result<(), Scd30Error<I2cErr>>
pub fn set_altitude_compensation( &mut self, altitude: AltitudeCompensation, ) -> Result<(), Scd30Error<I2cErr>>
Configures the altitude compensation. The value can range from 0 m to 65535 m above sea level.
Sourcepub fn get_altitude_compensation(
&mut self,
) -> Result<AltitudeCompensation, Scd30Error<I2cErr>>
pub fn get_altitude_compensation( &mut self, ) -> Result<AltitudeCompensation, Scd30Error<I2cErr>>
Reads out the configured altitude compensation.
Sourcepub fn read_firmware_version(
&mut self,
) -> Result<FirmwareVersion, Scd30Error<I2cErr>>
pub fn read_firmware_version( &mut self, ) -> Result<FirmwareVersion, Scd30Error<I2cErr>>
Reads out the version of the firmware deployed on the sensor.
Sourcepub fn soft_reset(&mut self) -> Result<(), Scd30Error<I2cErr>>
pub fn soft_reset(&mut self) -> Result<(), Scd30Error<I2cErr>>
Executes a soft reset of the sensor.