co2_sensor.h 856 Bytes
Newer Older
1
2
3
#ifndef CO2_SENSOR_H_
#define CO2_SENSOR_H_

Eric Duminil's avatar
Eric Duminil committed
4
#include <stdint.h> // For uint16_t
5
6

namespace config {
7
  extern uint16_t measurement_timestep; // [s] Value between 2 and 1800 (range for SCD30 sensor)
8
  extern bool auto_calibrate_sensor; // [true / false]
9
  extern uint16_t co2_calibration_level; // [ppm]
10
11
12
13
  extern const float temperature_offset; // [K] Sign isn't relevant.
}

namespace sensor {
14
  extern uint16_t co2;
15
16
  extern float temperature;
  extern float humidity;
Eric Duminil's avatar
Eric Duminil committed
17
  extern char timestamp[];
18
19

  void initialize();
Eric Duminil's avatar
Eric Duminil committed
20
  bool processData();
21
  void startCalibrationProcess();
22
23
24
25
26

  void setCO2forDebugging(int32_t fakeCo2);
  void setTimer(int32_t timestep);
  void calibrateSensorToSpecificPPM(int32_t calibrationLevel);
  void calibrateSensorRightNow(int32_t calibrationLevel);
27
  void setAutoCalibration(int32_t autoCalibration);
28
  void resetSCD();
29
30
}
#endif