Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Sensirion SCD30 CO2 sensor. More...

Files

file  scd30.h
 Header file for extended sensor API of SCD30 sensor.

Enumerations

enum  sensor_attribute_scd30 {
  SENSOR_ATTR_SCD30_TEMPERATURE_OFFSET = SENSOR_ATTR_PRIV_START , SENSOR_ATTR_SCD30_SENSOR_ALTITUDE , SENSOR_ATTR_SCD30_AMBIENT_PRESSURE , SENSOR_ATTR_SCD30_AUTOMATIC_CALIB_ENABLE ,
  SENSOR_ATTR_SCD30_MEASUREMENT_INTERVAL
}
 Custom sensor attributes for SCD30. More...

Functions

int scd30_forced_recalibration (const struct device *dev, uint16_t target_concentration)
 Perform a forced recalibration (FRC).
int scd30_soft_reset (const struct device *dev)
 Soft-reset the SCD30.

Detailed Description

Sensirion SCD30 CO2 sensor.

Enumeration Type Documentation

◆ sensor_attribute_scd30

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

Custom sensor attributes for SCD30.

Enumerator
SENSOR_ATTR_SCD30_TEMPERATURE_OFFSET 

Temperature offset for the onboard RH/T sensor.

Unit: deg C. The interface manual programs a uint16 in ticks of 0.01 deg C, so the accepted range is 0 to 655.35 deg C.

SENSOR_ATTR_SCD30_SENSOR_ALTITUDE 

Altitude compensation in metres above sea level.

Range: 0 to 65535. The interface manual stores this as a uint16. It is disregarded while ambient pressure compensation is active.

SENSOR_ATTR_SCD30_AMBIENT_PRESSURE 

Ambient pressure compensation in mBar.

Range: 0 (disabled) or 700-1400. Writing this restarts continuous measurement with the new pressure argument.

SENSOR_ATTR_SCD30_AUTOMATIC_CALIB_ENABLE 

Automatic self-calibration enable (1) or disable (0).

Default after power-up is disabled.

SENSOR_ATTR_SCD30_MEASUREMENT_INTERVAL 

Continuous measurement interval in seconds.

Range: 2-1800. Default: 2.

Function Documentation

◆ scd30_forced_recalibration()

int scd30_forced_recalibration ( const struct device * dev,
uint16_t target_concentration )

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

Perform a forced recalibration (FRC).

Interface manual: run continuous measurement at a 2 s interval for at least two minutes in a stable environment before calling this function. The command is sent while measurement is still running.

Parameters
devPointer to the sensor device
target_concentrationReference CO2 concentration in ppm (400-2000)
Returns
0 on success, -EINVAL if the concentration is outside 400..2000 ppm, -EAGAIN if continuous measurement is not running, or a negative errno from the bus.

◆ scd30_soft_reset()

int scd30_soft_reset ( const struct device * dev)

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

Soft-reset the SCD30.

Forces the same state as after power-up and blocks for the sensor boot time. The measurement interval and continuous-measurement state are reloaded from the sensor. Ambient pressure compensation is disabled.

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