Zephyr Project API 3.7.0
A Scalable Open Source RTOS
|
Extended public API for CCS811 Indoor Air Quality Sensor. More...
Go to the source code of this file.
Data Structures | |
struct | ccs811_result_type |
Information collected from the sensor on each fetch. More... | |
struct | ccs811_configver_type |
Get information about static CCS811 state. More... | |
Macros | |
#define | CCS811_STATUS_ERROR BIT(0) |
#define | CCS811_STATUS_DATA_READY BIT(3) |
#define | CCS811_STATUS_APP_VALID BIT(4) |
#define | CCS811_STATUS_FW_MODE BIT(7) |
#define | CCS811_ERROR_WRITE_REG_INVALID BIT(0) |
#define | CCS811_ERROR_READ_REG_INVALID BIT(1) |
#define | CCS811_ERROR_MEASMODE_INVALID BIT(2) |
#define | CCS811_ERROR_MAX_RESISTANCE BIT(3) |
#define | CCS811_ERROR_HEATER_FAULT BIT(4) |
#define | CCS811_ERROR_HEATER_SUPPLY BIT(5) |
#define | CCS811_MODE_IDLE 0x00 |
#define | CCS811_MODE_IAQ_1SEC 0x10 |
#define | CCS811_MODE_IAQ_10SEC 0x20 |
#define | CCS811_MODE_IAQ_60SEC 0x30 |
#define | CCS811_MODE_IAQ_250MSEC 0x40 |
#define | CCS811_MODE_MSK 0x70 |
Functions | |
const struct ccs811_result_type * | ccs811_result (const struct device *dev) |
Access storage for the most recent data read from the sensor. | |
int | ccs811_configver_fetch (const struct device *dev, struct ccs811_configver_type *ptr) |
Fetch operating mode and version information. | |
int | ccs811_baseline_fetch (const struct device *dev) |
Fetch the current value of the BASELINE register. | |
int | ccs811_baseline_update (const struct device *dev, uint16_t baseline) |
Update the BASELINE register. | |
int | ccs811_envdata_update (const struct device *dev, const struct sensor_value *temperature, const struct sensor_value *humidity) |
Update the ENV_DATA register. | |
Extended public API for CCS811 Indoor Air Quality Sensor.
Some capabilities and operational requirements for this sensor cannot be expressed within the sensor driver abstraction.
#define CCS811_ERROR_HEATER_FAULT BIT(4) |
#define CCS811_ERROR_HEATER_SUPPLY BIT(5) |
#define CCS811_ERROR_MAX_RESISTANCE BIT(3) |
#define CCS811_ERROR_MEASMODE_INVALID BIT(2) |
#define CCS811_ERROR_READ_REG_INVALID BIT(1) |
#define CCS811_ERROR_WRITE_REG_INVALID BIT(0) |
#define CCS811_MODE_IAQ_10SEC 0x20 |
#define CCS811_MODE_IAQ_1SEC 0x10 |
#define CCS811_MODE_IAQ_250MSEC 0x40 |
#define CCS811_MODE_IAQ_60SEC 0x30 |
#define CCS811_MODE_IDLE 0x00 |
#define CCS811_MODE_MSK 0x70 |
#define CCS811_STATUS_APP_VALID BIT(4) |
#define CCS811_STATUS_DATA_READY BIT(3) |
#define CCS811_STATUS_ERROR BIT(0) |
#define CCS811_STATUS_FW_MODE BIT(7) |
int ccs811_baseline_fetch | ( | const struct device * | dev | ) |
Fetch the current value of the BASELINE register.
The BASELINE register encodes data used to correct sensor readings based on individual device configuration and variation over time.
For proper management of the BASELINE register see AN000370 "Baseline Save and Restore on CCS811".
dev | Pointer to the sensor device |
Update the BASELINE register.
For proper management of the BASELINE register see AN000370 "Baseline Save and Restore on CCS811".
dev | Pointer to the sensor device |
baseline | the value to be stored in the BASELINE register. |
int ccs811_configver_fetch | ( | const struct device * | dev, |
struct ccs811_configver_type * | ptr | ||
) |
Fetch operating mode and version information.
dev | Pointer to the sensor device |
ptr | Pointer to where the returned information should be stored |
int ccs811_envdata_update | ( | const struct device * | dev, |
const struct sensor_value * | temperature, | ||
const struct sensor_value * | humidity | ||
) |
Update the ENV_DATA register.
Accurate calculation of gas levels requires accurate environment data. Measurements are only accurate to 0.5 Cel and 0.5 RH.
dev | Pointer to the sensor device |
temperature | the current temperature at the sensor |
humidity | the current humidity at the sensor |
const struct ccs811_result_type * ccs811_result | ( | const struct device * | dev | ) |
Access storage for the most recent data read from the sensor.
This content of the object referenced is updated by sensor_fetch_sample(), except for ccs811_result_type::mode which is set on driver initialization.
dev | Pointer to the sensor device |