Device driver interface for the SCD30 sensor.
More...
#include "periph/i2c.h"
#include "saul.h"
#include "xtimer.h"
Go to the source code of this file.
|
#define | SCD30_VERSION 0xD100 |
| SCD30 Configuration parameter commands.
|
|
#define | SCD30_STATUS 0x0202 |
| Get data ready status from scd30 device.
|
|
#define | SCD30_DATA 0x0300 |
| Get data from scd30 device.
|
|
#define | SCD30_START 0x0010 |
| Start measuring data from scd30 device.
|
|
#define | SCD30_STOP 0x0104 |
| Stop measuring data from scd30 device.
|
|
#define | SCD30_SOFT_RESET 0xD304 |
| Soft reset scd30 device.
|
|
#define | SCD30_INTERVAL 0x4600 |
| Set measurement interval (2-1800 seconds)
|
|
#define | SCD30_ASC 0x5306 |
| De-Activate Automatic Self-Calibration.
|
|
#define | SCD30_FRC 0x5204 |
| Forced Recalibration.
|
|
#define | SCD30_T_OFFSET 0x5403 |
| Set temperature Offset in 0.01 Celsius.
|
|
#define | SCD30_A_OFFSET 0x5102 |
| Altitude Compensation in meters above sea level.
|
|
|
int8_t | scd30_init (scd30_t *dev, const scd30_params_t *params) |
| Initialize SCD30.
|
|
int8_t | scd30_set_param (const scd30_t *dev, uint16_t param, uint16_t val) |
| Set a configuration parameter of device.
|
|
int8_t | scd30_get_param (scd30_t *dev, uint16_t param, uint16_t *val) |
| Get value set for a configuration parameter on the device.
|
|
int8_t | scd30_read_triggered (scd30_t *dev, scd30_measurement_t *result) |
| read CO2 concentration, temperature and relative humidity once
|
|
uint8_t | scd30_read_periodic (scd30_t *dev, scd30_measurement_t *result) |
| read co2 concentration, temperature and relative humidity when continuous measurements are being taken
|
|
int | scd30_start_periodic_measurement (scd30_t *dev, uint16_t *interval, uint16_t *apc) |
| Initializes Continuous Measurements.
|
|
int8_t | scd30_stop_measurements (const scd30_t *dev) |
| Stop Continuous measurements.
|
|
int8_t | scd30_reset (scd30_t *dev) |
| Soft reset sensor.
|
|
◆ SCD30_A_OFFSET
#define SCD30_A_OFFSET 0x5102 |
Altitude Compensation in meters above sea level.
Definition at line 54 of file scd30.h.
◆ SCD30_ASC
De-Activate Automatic Self-Calibration.
Definition at line 50 of file scd30.h.
◆ SCD30_DATA
#define SCD30_DATA 0x0300 |
Get data from scd30 device.
Definition at line 42 of file scd30.h.
◆ SCD30_FRC
Forced Recalibration.
400-2000ppm
Definition at line 51 of file scd30.h.
◆ SCD30_INTERVAL
#define SCD30_INTERVAL 0x4600 |
Set measurement interval (2-1800 seconds)
Definition at line 49 of file scd30.h.
◆ SCD30_SOFT_RESET
#define SCD30_SOFT_RESET 0xD304 |
Soft reset scd30 device.
Definition at line 46 of file scd30.h.
◆ SCD30_START
#define SCD30_START 0x0010 |
Start measuring data from scd30 device.
Definition at line 44 of file scd30.h.
◆ SCD30_STATUS
#define SCD30_STATUS 0x0202 |
Get data ready status from scd30 device.
Definition at line 40 of file scd30.h.
◆ SCD30_STOP
#define SCD30_STOP 0x0104 |
Stop measuring data from scd30 device.
Definition at line 45 of file scd30.h.
◆ SCD30_T_OFFSET
#define SCD30_T_OFFSET 0x5403 |
Set temperature Offset in 0.01 Celsius.
Definition at line 52 of file scd30.h.
◆ SCD30_VERSION
#define SCD30_VERSION 0xD100 |
SCD30 Configuration parameter commands.
Get scd30 version
Definition at line 38 of file scd30.h.
◆ anonymous enum
Status and error codes for return values.
Enumerator |
---|
SCD30_COM_FAILED | Communication with device failed.
|
SCD30_INVALID_VALUE | Device doesn't exist.
|
SCD30_CRC_ERROR | Invalid value or length.
|
SCD30_NO_NEW_DATA | No new data.
|
Definition at line 59 of file scd30.h.
◆ scd30_get_param()
int8_t scd30_get_param |
( |
scd30_t * |
dev, |
|
|
uint16_t |
param, |
|
|
uint16_t * |
val |
|
) |
| |
Get value set for a configuration parameter on the device.
- Parameters
-
dev | scd30 device |
param | param to be set/operation to be performed param codes mentioned in scd30_internal |
val | Pointer to the value to be set for that parameter |
- Returns
- SCD30_OK on success
◆ scd30_init()
Initialize SCD30.
- Parameters
-
dev | scd30 device |
params | scd30 device params |
- Returns
- SCD30_OK if device started
◆ scd30_read_periodic()
read co2 concentration, temperature and relative humidity when continuous measurements are being taken
- Parameters
-
dev | scd30 device |
result | struct to store result |
- Returns
- SCD30_OK on success
◆ scd30_read_triggered()
read CO2 concentration, temperature and relative humidity once
- Parameters
-
dev | scd30 device |
result | Values are stored in this struct |
- Returns
- SCD30_OK on success
◆ scd30_reset()
int8_t scd30_reset |
( |
scd30_t * |
dev | ) |
|
Soft reset sensor.
- Parameters
-
- Returns
- SCD30_OK if soft reset successful
◆ scd30_set_param()
int8_t scd30_set_param |
( |
const scd30_t * |
dev, |
|
|
uint16_t |
param, |
|
|
uint16_t |
val |
|
) |
| |
Set a configuration parameter of device.
- Parameters
-
dev | scd30 device |
param | param to be set/operation to be performed param codes mentioned in scd30_internal |
val | value to be set for that parameter |
- Returns
- SCD30_OK on success
◆ scd30_start_periodic_measurement()
int scd30_start_periodic_measurement |
( |
scd30_t * |
dev, |
|
|
uint16_t * |
interval, |
|
|
uint16_t * |
apc |
|
) |
| |
Initializes Continuous Measurements.
- Parameters
-
dev | scd30 device |
interval | Interval at which new measurements have to be taken in seconds (between 2 and 1800 seconds, both inclusive) |
apc | Average Pressure Compensation 0 to disable pressure compensation 700-1400 mBar for valid pressure compensation |
- Returns
- SCD30_OK if device started
◆ scd30_stop_measurements()
int8_t scd30_stop_measurements |
( |
const scd30_t * |
dev | ) |
|
Stop Continuous measurements.
- Parameters
-
- Returns
- SCD30_OK if measurement stopped