55 lines
1.4 KiB
C++
55 lines
1.4 KiB
C++
#ifndef __SENSOR_MANAGER_HPP__
|
|
#define __SENSOR_MANAGER_HPP__
|
|
|
|
#include "bsec.h"
|
|
|
|
class SensorManager {
|
|
public:
|
|
// Public types
|
|
struct SensorData {
|
|
__typeof__(Bsec::iaq) iaq;
|
|
__typeof__(Bsec::iaqAccuracy) iaqAccuracy;
|
|
__typeof__(Bsec::staticIaq) staticIaq;
|
|
__typeof__(Bsec::co2Equivalent) co2Equivalent;
|
|
__typeof__(Bsec::breathVocEquivalent) breathVocEquivalent;
|
|
__typeof__(Bsec::rawTemperature) rawTemperature;
|
|
__typeof__(Bsec::pressure) pressure;
|
|
__typeof__(Bsec::rawHumidity) rawHumidity;
|
|
__typeof__(Bsec::gasResistance) gasResistance;
|
|
__typeof__(Bsec::stabStatus) stabStatus;
|
|
__typeof__(Bsec::runInStatus) runInStatus;
|
|
__typeof__(Bsec::temperature) temperature;
|
|
__typeof__(Bsec::humidity) humidity;
|
|
__typeof__(Bsec::gasPercentage) gasPercentage;
|
|
};
|
|
|
|
public:
|
|
// Constructor
|
|
SensorManager();
|
|
|
|
bool setup();
|
|
|
|
bool read();
|
|
|
|
public:
|
|
// Public members
|
|
SensorData data;
|
|
|
|
private:
|
|
bool checkIaqSensorStatus();
|
|
|
|
private:
|
|
// Private static members
|
|
constexpr static uint16_t m_NUM_LEDS_PROTO_V1 = 29U;
|
|
constexpr static int16_t m_DATA_PIN_PROTO_V1 = 14;
|
|
constexpr static uint8_t m_BME_CS = 5U;
|
|
constexpr static uint8_t m_BSEC_CONFIG_IAQ[] = {
|
|
#include "config/generic_33v_3s_4d/bsec_iaq.txt"
|
|
};
|
|
|
|
private:
|
|
// Private members
|
|
Bsec m_iaqSensor;
|
|
};
|
|
|
|
#endif // __SENSOR_MANAGER_HPP__
|