31 lines
949 B
C
31 lines
949 B
C
#ifndef CO2_LEVEL_H
|
|
#define CO2_LEVEL_H
|
|
|
|
#include <zephyr/drivers/sensor.h>
|
|
#include <zephyr/drivers/sensor/ccs811.h>
|
|
|
|
#include "error_code.h"
|
|
#include "hygrometer.h"
|
|
#include "thermometer.h"
|
|
|
|
extern const int CO2_LEVEL_EMPTY_ROOM; // [ppm]
|
|
|
|
/**
|
|
* @brief init the co2 level measurement module
|
|
* @return init_failed upon any error during init
|
|
* @return success otherwise
|
|
*/
|
|
enum error_code co2_lvl_init();
|
|
|
|
/**
|
|
* @brief Retrieve the CO2 level measurement and stores it in the given parameter
|
|
* @param[out] holder : pointer where the measurement will be stored
|
|
* @return read_failed upon any error occuring during measurement
|
|
* @return success otherwise
|
|
* @note the content of holder should not be trusted upon returning something else than success
|
|
* @note the value is not read for the first few measurements after a reboot
|
|
*/
|
|
enum error_code co2_lvl_get_value(int* holder);
|
|
|
|
#endif //CO2_LEVEL_H
|