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>
impl<Conn, Delay, Err> Scd30<Conn, Delay, Err>
Sourcepub fn new(conn: Conn, delay: Delay) -> Result<Self, Error<Err>>
pub fn new(conn: Conn, delay: Delay) -> Result<Self, Error<Err>>
Create a new Scd30 sensor instance
Sourcepub fn start_continuous(
&mut self,
pressure_compensation: u16,
) -> Result<(), Error<Err>>
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
Sourcepub fn stop_continuous(&mut self) -> Result<(), Error<Err>>
pub fn stop_continuous(&mut self) -> Result<(), Error<Err>>
Stop continuous sensing mode
Sourcepub fn set_measurement_interval(
&mut self,
interval: u16,
) -> Result<(), Error<Err>>
pub fn set_measurement_interval( &mut self, interval: u16, ) -> Result<(), Error<Err>>
Configure measurement interval in seconds
Sourcepub fn set_afc(&mut self, enabled: bool) -> Result<(), Error<Err>>
pub fn set_afc(&mut self, enabled: bool) -> Result<(), Error<Err>>
Enable or disable Automatic Self-Calibration
Sourcepub fn set_frc(&mut self, cal_ppm: u16) -> Result<(), Error<Err>>
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
Sourcepub fn set_temp_offset(&mut self, temperature: f32) -> Result<(), Error<Err>>
pub fn set_temp_offset(&mut self, temperature: f32) -> Result<(), Error<Err>>
Set Temperature Compensation Allows compensation for temperature variation during operation
Sourcepub fn set_alt_offset(&mut self, altitude: u16) -> Result<(), Error<Err>>
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
Sourcepub fn soft_reset(&mut self) -> Result<(), Error<Err>>
pub fn soft_reset(&mut self) -> Result<(), Error<Err>>
Soft reset the underlying device
Sourcepub fn firmware_version(&mut self) -> Result<u16, Error<Err>>
pub fn firmware_version(&mut self) -> Result<u16, Error<Err>>
Fetch the device firmware version
Sourcepub fn data_ready(&mut self) -> Result<bool, Error<Err>>
pub fn data_ready(&mut self) -> Result<bool, Error<Err>>
Check whether measurement data is available in the buffer
Sourcepub fn read_data(&mut self) -> Result<Measurement, Error<Err>>
pub fn read_data(&mut self) -> Result<Measurement, Error<Err>>
Read measurement data from the buffer