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.
|
int8_t | scd30_init (scd30_t *dev, const scd30_params_t *params) |
| Initialize SCD30. More...
|
|
int8_t | scd30_set_param (const scd30_t *dev, uint16_t param, uint16_t val) |
| Set a configuration parameter of device. More...
|
|
int8_t | scd30_get_param (scd30_t *dev, uint16_t param, uint16_t *val) |
| Get value set for a configuration parameter on the device. More...
|
|
int8_t | scd30_read_triggered (scd30_t *dev, scd30_measurement_t *result) |
| read CO2 concentration, temperature and relative humidity once More...
|
|
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 More...
|
|
int | scd30_start_periodic_measurement (scd30_t *dev, uint16_t *interval, uint16_t *apc) |
| Initializes Continuous Measurements. More...
|
|
int8_t | scd30_stop_measurements (const scd30_t *dev) |
| Stop Continuous measurements. More...
|
|
int8_t | scd30_reset (scd30_t *dev) |
| Soft reset sensor. More...
|
|
◆ SCD30_FRC
Forced Recalibration.
400-2000ppm
Definition at line 51 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