Zephyr Project API 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Sensirion SCD4X CO2 sensor. More...

Files

file  scd4x.h
 Header file for extended sensor API of SCD4X sensor.
 

Enumerations

enum  sensor_attribute_scd4x {
  SENSOR_ATTR_SCD4X_TEMPERATURE_OFFSET = SENSOR_ATTR_PRIV_START , SENSOR_ATTR_SCD4X_SENSOR_ALTITUDE , SENSOR_ATTR_SCD4X_AMBIENT_PRESSURE , SENSOR_ATTR_SCD4X_AUTOMATIC_CALIB_ENABLE ,
  SENSOR_ATTR_SCD4X_SELF_CALIB_INITIAL_PERIOD , SENSOR_ATTR_SCD4X_SELF_CALIB_STANDARD_PERIOD
}
 Custom sensor attributes for SCD4X. More...
 

Functions

int scd4x_forced_recalibration (const struct device *dev, uint16_t target_concentration, uint16_t *frc_correction)
 Performs a forced recalibration.
 
int scd4x_self_test (const struct device *dev)
 Performs a self test.
 
int scd4x_persist_settings (const struct device *dev)
 Performs a self test.
 
int scd4x_factory_reset (const struct device *dev)
 Performs a factory reset.
 

Detailed Description

Sensirion SCD4X CO2 sensor.

Enumeration Type Documentation

◆ sensor_attribute_scd4x

#include <include/zephyr/drivers/sensor/scd4x.h>

Custom sensor attributes for SCD4X.

Enumerator
SENSOR_ATTR_SCD4X_TEMPERATURE_OFFSET 

Temperature offset.

\[
T_{offset\_actual} = T_{scd4x} - T_{reference} + T_{offset\_previous}
\]

0 - 20°C

SENSOR_ATTR_SCD4X_SENSOR_ALTITUDE 

Altitude of the sensor.

0 - 3000m

SENSOR_ATTR_SCD4X_AMBIENT_PRESSURE 

Ambient pressure in hPa.

700 - 1200hPa

SENSOR_ATTR_SCD4X_AUTOMATIC_CALIB_ENABLE 

Automatic calibration enable (enabled: 1 / disabled: 0).

Default: enabled.

SENSOR_ATTR_SCD4X_SELF_CALIB_INITIAL_PERIOD 

Initial period for automatic self calibration correction (in hours).

Allowed values are integer multiples of 4 hours. Default: 44

SENSOR_ATTR_SCD4X_SELF_CALIB_STANDARD_PERIOD 

Standard period for automatic self calibration correction (in hours).

Allowed values are integer multiples of 4 hours. Default: 156

Function Documentation

◆ scd4x_factory_reset()

int scd4x_factory_reset ( const struct device dev)

#include <include/zephyr/drivers/sensor/scd4x.h>

Performs a factory reset.

The perform_factory_reset command resets all configuration settings stored in the EEPROM and erases the FRC and ASC algorithm history.

Parameters
devPointer to the sensor device
Returns
0 if successful, negative errno code if failure.

◆ scd4x_forced_recalibration()

int scd4x_forced_recalibration ( const struct device dev,
uint16_t  target_concentration,
uint16_t frc_correction 
)

#include <include/zephyr/drivers/sensor/scd4x.h>

Performs a forced recalibration.

Operate the SCD4x in the operation mode for at least 3 minutes in an environment with a homogeneous and constant CO2 concentration. Otherwise the recalibratioin will fail. The sensor must be operated at the voltage desired for the application when performing the FRC sequence.

Parameters
devPointer to the sensor device
target_concentrationReference CO2 concentration.
frc_correctionPrevious differences from the target concentration
Returns
0 if successful, negative errno code if failure.

◆ scd4x_persist_settings()

int scd4x_persist_settings ( const struct device dev)

#include <include/zephyr/drivers/sensor/scd4x.h>

Performs a self test.

The persist_settings command can be used to save the actual configuration. This command should only be sent when persistence is required and if actual changes to the configuration have been made. The EEPROM is guaranteed to withstand at least 2000 write cycles

Parameters
devPointer to the sensor device
Returns
0 if successful, negative errno code if failure.

◆ scd4x_self_test()

int scd4x_self_test ( const struct device dev)

#include <include/zephyr/drivers/sensor/scd4x.h>

Performs a self test.

The self_test command can be used as an end-of-line test to check the sensor functionality

Parameters
devPointer to the sensor device
Returns
0 if successful, negative errno code if failure.