-
Notifications
You must be signed in to change notification settings - Fork 0
/
gas_sensor.h
40 lines (28 loc) · 1.07 KB
/
gas_sensor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef __GAS_SENSOR_H__
#define __GAS_SENSOR_H__
#include "common.h"
#include "sensor_properties.h"
class gas_sensor {
private:
gas_sensor() {}; // empty constructor which is not allowed
public:
gas_sensor(sensor_mq_e sensor_type);
//virtual ~gas_sensor();
rc_t gas_sensor_init();
float gas_sensor_value_get(measure_gas_type_e gas_type);
sensor_mq_e sensor_type_get();
private:
sensor_mq_e sensor_type;
sensor_properties_t params;
float RO;
float m[MEASURE_GAS_MAX_E + 1]; //per gas type // TODO - allocate correct memory based on value of supported gases + release in destructor
float b[MEASURE_GAS_MAX_E + 1];
rc_t gas_sensor_define_attr_value();
float gas_sensor_analog_value_get(int iterations = 200);
float analog2volt(float analog_value);
float sensor_rs_get(float volt);
float gas_sensor_define_ro_value();
rc_t gas_sensor_define_m_and_b_values(measure_gas_type_e gas_type);
int gas_sensor_type_index_get(measure_gas_type_e gas_type);
};
#endif /* .__GAS_SENSOR_H__ */