|
@@ -22,8 +22,6 @@
|
22
|
22
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
23
|
23
|
*/
|
24
|
24
|
|
25
|
|
-
|
26
|
|
-
|
27
|
25
|
#pragma once
|
28
|
26
|
|
29
|
27
|
#include <iostream>
|
|
@@ -31,33 +29,34 @@
|
31
|
29
|
#include "mraa.hpp"
|
32
|
30
|
#include "mraa/i2c.hpp"
|
33
|
31
|
|
34
|
|
-
|
35
|
|
-
|
36
|
32
|
namespace upm {
|
37
|
33
|
/**
|
38
|
|
- * @library gas
|
39
|
|
- * @sensor MICS-V89
|
40
|
|
- * @comname MICS-V89
|
41
|
|
- * @type Environmental. VOC and CO2
|
42
|
|
- * @man http://sgx.cdistore.com/datasheets/e2v/MiCS-VZ-86%20and%20VZ-89%20rev%204.pdf
|
43
|
|
- * @man http://www.sgxsensortech.com/content/uploads/2015/01/MICS-VZ-89-I2C-specs-rev-A.pdf
|
|
34
|
+ * @brief MICS-VZ89 environmental sensor library
|
|
35
|
+ * @defgroup micsv89 libupm-micsv89
|
|
36
|
+ * @ingroup generic i2c gaseous
|
|
37
|
+ */
|
|
38
|
+ /**
|
|
39
|
+ * @library micsv89
|
|
40
|
+ * @sensor micsv89
|
|
41
|
+ * @comname MICS-VZ89 Gas Sensor
|
|
42
|
+ * @type gaseous
|
|
43
|
+ * @man generic
|
44
|
44
|
* @con i2c
|
|
45
|
+ * @web http://sgx.cdistore.com/datasheets/e2v/MiCS-VZ-86%20and%20VZ-89%20rev%204.pdf
|
|
46
|
+ * @web http://www.sgxsensortech.com/content/uploads/2015/01/MICS-VZ-89-I2C-specs-rev-A.pdf
|
45
|
47
|
*
|
46
|
48
|
* @brief API for the MICS-VZ89 Gas Sensor
|
47
|
|
- * The MiCS-VZ-86/89 combines state-of-the-art MOS
|
48
|
|
- * sensor technology with intelligent detection algorithms
|
49
|
|
- * to monitor VOCs and CO2 equivalent variations in
|
50
|
|
- * confined spaces.
|
51
|
49
|
*
|
52
|
|
- * The MICSV89 comes in 4 variants, PWM and I2c
|
53
|
|
- * in 3.3 volts and 5 volts. This library only implements
|
54
|
|
- * the I2c version of the device.
|
|
50
|
+ * The MiCS-VZ-86/89 combines state-of-the-art MOS sensor technology with
|
|
51
|
+ * intelligent detection algorithms to monitor VOCs and CO2 equivalent
|
|
52
|
+ * variations in confined spaces.
|
55
|
53
|
*
|
56
|
|
- * Device output is not valid until a warm up of 15 minutes
|
57
|
|
- * of operation.
|
|
54
|
+ * The MICSV89 comes in 4 variants, PWM and I2C in 3.3 volts and 5 volts.
|
|
55
|
+ * This library only implements the I2c version of the device.
|
58
|
56
|
*
|
|
57
|
+ * Device output is not valid until a warm up of 15 minutes of operation.
|
59
|
58
|
*
|
60
|
|
- * @image html micsv89.jpg
|
|
59
|
+ * @image html micsv89.jpg
|
61
|
60
|
* @snippet micsv89.cxx Interesting
|
62
|
61
|
*/
|
63
|
62
|
class MICSV89 {
|
|
@@ -84,7 +83,7 @@ namespace upm {
|
84
|
83
|
}
|
85
|
84
|
|
86
|
85
|
/**
|
87
|
|
- * Returns the CO2 equivalent value.
|
|
86
|
+ * Returns the CO2 equivalent value.
|
88
|
87
|
*/
|
89
|
88
|
float co2equ();
|
90
|
89
|
|
|
@@ -106,7 +105,7 @@ namespace upm {
|
106
|
105
|
/**
|
107
|
106
|
* Performs a write/read cycle.
|
108
|
107
|
*/
|
109
|
|
- void start();
|
|
108
|
+ void update();
|
110
|
109
|
|
111
|
110
|
/**
|
112
|
111
|
* Returns true if a valid write/read cycle has been completed.
|
|
@@ -114,20 +113,15 @@ namespace upm {
|
114
|
113
|
*/
|
115
|
114
|
bool valid()
|
116
|
115
|
{
|
117
|
|
- return m_valid;
|
|
116
|
+ return m_valid;
|
118
|
117
|
}
|
119
|
118
|
|
120
|
|
-
|
121
|
|
-
|
122
|
|
-
|
123
|
119
|
private:
|
124
|
120
|
std::string m_name;
|
125
|
121
|
bool m_valid;
|
126
|
122
|
uint8_t m_address;
|
127
|
123
|
uint8_t rx_buf[6];
|
128
|
|
- uint8_t tx_buf[3];
|
129
|
|
- mraa::I2c* i2c;
|
130
|
|
-
|
131
|
|
-
|
|
124
|
+ uint8_t tx_buf[3];
|
|
125
|
+ mraa::I2c* i2c;
|
132
|
126
|
};
|
133
|
127
|
}
|