M5Unit-ENV 1.2.0 git rev:d576302
Loading...
Searching...
No Matches
m5::unit::UnitSCD41 Class Reference

SCD41 unit component. More...

#include <unit_SCD41.hpp>

Inheritance diagram for m5::unit::UnitSCD41:
m5::unit::UnitSCD40

Public Member Functions

 UnitSCD41 (const uint8_t addr=DEFAULT_ADDRESS)
 
Low power single shot (SCD41)
bool measureSingleshot (scd4x::Data &d)
 Request a single measurement.
 
bool measureSingleshotRHT (scd4x::Data &d)
 Request a single measurement temperature and humidity.
 
- Public Member Functions inherited from m5::unit::UnitSCD40
 UnitSCD40 (const uint8_t addr=DEFAULT_ADDRESS)
 
virtual bool begin () override
 
virtual void update (const bool force=false) override
 
config_t config () const
 Gets the configration.
 
void config (const config_t &cfg)
 Set the configration.
 
uint16_t co2 () const
 Oldest measured CO2 concentration (ppm)
 
float temperature () const
 Oldest measured temperature (Celsius)
 
float celsius () const
 Oldest measured temperature (Celsius)
 
float fahrenheit () const
 Oldest measured temperature (Fahrenheit)
 
float humidity () const
 Oldest measured humidity (RH)
 
bool startPeriodicMeasurement (const scd4x::Mode mode=scd4x::Mode::Normal)
 Start periodic measurement.
 
bool startLowPowerPeriodicMeasurement ()
 Start low power periodic measurement.
 
bool stopPeriodicMeasurement (const uint32_t duration=scd4x::STOP_PERIODIC_MEASUREMENT_DURATION)
 Stop periodic measurement.
 
bool writeTemperatureOffset (const float offset, const uint32_t duration=scd4x::SET_TEMPERATURE_OFFSET_DURATION)
 Write the temperature offset.
 
bool readTemperatureOffset (float &offset)
 Read the temperature offset.
 
bool writeSensorAltitude (const uint16_t altitude, const uint32_t duration=scd4x::SET_SENSOR_ALTITUDE_DURATION)
 Write the sensor altitude.
 
bool readSensorAltitude (uint16_t &altitude)
 Read the sensor altitude.
 
bool writeAmbientPressure (const float pressure, const uint32_t duration=scd4x::SET_AMBIENT_PRESSURE_DURATION)
 Write the ambient pressure.
 
bool performForcedRecalibration (const uint16_t concentration, int16_t &correction)
 Perform forced recalibration.
 
bool writeAutomaticSelfCalibrationEnabled (const bool enabled=true, const uint32_t duration=scd4x::SET_AUTOMATIC_SELF_CALIBRATION_ENABLED_DURATION)
 Enable/disable automatic self calibration.
 
bool readAutomaticSelfCalibrationEnabled (bool &enabled)
 Check if automatic self calibration is enabled.
 
bool writePersistSettings (const uint32_t duration=scd4x::PERSIST_SETTINGS_DURATION)
 Write sensor settings from RAM to EEPROM.
 
bool readSerialNumber (char *serialNumber)
 Read the serial number string.
 
bool readSerialNumber (uint64_t &serialNumber)
 Read the serial number value.
 
bool performSelfTest (bool &malfunction)
 Perform self test.
 
bool performFactoryReset (const uint32_t duration=scd4x::PERFORM_FACTORY_RESET_DURATION)
 Peform factory reset.
 
bool reInit (const uint32_t duration=scd4x::REINIT_DURATION)
 Re-initialize the sensor, load settings from EEPROM.
 

Additional Inherited Members

- Protected Member Functions inherited from m5::unit::UnitSCD40
bool start_periodic_measurement (const scd4x::Mode mode=scd4x::Mode::Normal)
 
bool stop_periodic_measurement (const uint32_t duration=scd4x::STOP_PERIODIC_MEASUREMENT_DURATION)
 
bool read_data_ready_status ()
 
bool read_measurement (scd4x::Data &d, const bool all=true)
 
 M5_UNIT_COMPONENT_PERIODIC_MEASUREMENT_ADAPTER_HPP_BUILDER (UnitSCD40, scd4x::Data)
 
- Protected Attributes inherited from m5::unit::UnitSCD40
std::unique_ptr< m5::container::CircularBuffer< scd4x::Data > > _data {}
 
config_t _cfg {}
 

Detailed Description

SCD41 unit component.

Member Function Documentation

◆ measureSingleshot()

bool m5::unit::UnitSCD41::measureSingleshot ( scd4x::Data & d)

Request a single measurement.

Returns
True if successful
Note
Values are updated at 5000 ms interval
Warning
During periodic detection runs, an error is returned

◆ measureSingleshotRHT()

bool m5::unit::UnitSCD41::measureSingleshotRHT ( scd4x::Data & d)

Request a single measurement temperature and humidity.

Returns
True if successful
Note
Values are updated at 50 ms interval
Warning
Information on CO2 is invalid.
During periodic detection runs, an error is returned