drivers: sensor: ccs811: support update of environmental conditions
Accurate estimate of gas presence requires temperature and humidity data. Add API to update these values. Signed-off-by: Peter A. Bigot <pab@pabigot.com>
This commit is contained in:
parent
316c6e3aeb
commit
c90a738d8c
3 changed files with 89 additions and 0 deletions
|
@ -20,6 +20,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#include <device.h>
|
||||
#include <drivers/sensor.h>
|
||||
|
||||
/**
|
||||
* @brief Fetch the current value of the BASELINE register.
|
||||
|
@ -51,6 +52,24 @@ int ccs811_baseline_fetch(struct device *dev);
|
|||
*/
|
||||
int ccs811_baseline_update(struct device *dev, u16_t baseline);
|
||||
|
||||
/**
|
||||
* @brief 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.
|
||||
*
|
||||
* @param dev Pointer to the sensor device
|
||||
*
|
||||
* @param temperature the current temperature at the sensor
|
||||
*
|
||||
* @param humidity the current humidity at the sensor
|
||||
*
|
||||
* @return 0 if successful, negative errno code if failure.
|
||||
*/
|
||||
int ccs811_envdata_update(struct device *dev,
|
||||
const struct sensor_value *temperature,
|
||||
const struct sensor_value *humidity);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue