Firmware SDK
twr_tag_voc.h
1 #ifndef _TWR_TAG_VOC_H
2 #define _TWR_TAG_VOC_H
3 
4 #include <twr_sgp30.h>
5 
9 
11 
12 typedef enum
13 {
16 
19 
21 
23 
25 
29 
30 void twr_tag_voc_init(twr_tag_voc_t *self, twr_i2c_channel_t i2c_channel);
31 
36 
37 void twr_tag_voc_set_event_handler(twr_tag_voc_t *self, void (*event_handler)(twr_tag_voc_t *, twr_tag_voc_event_t, void *), void *event_param);
38 
42 
44 
49 
51 
57 
58 bool twr_tag_voc_get_co2eq_ppm(twr_tag_voc_t *self, uint16_t *ppm);
59 
65 
66 bool twr_tag_voc_get_tvoc_ppb(twr_tag_voc_t *self, uint16_t *ppb);
67 
73 
74 float twr_tag_voc_set_compensation(twr_tag_voc_t *self, float *t_celsius, float *rh_percentage);
75 
77 
78 #endif // _TWR_TAG_VOC_H
twr_i2c_channel_t
I2C channels.
Definition: twr_i2c.h:16
struct twr_sgp30_t twr_sgp30_t
SGP30 instance.
Definition: twr_sgp30.h:25
@ TWR_SGP30_EVENT_ERROR
Error event.
Definition: twr_sgp30.h:16
@ TWR_SGP30_EVENT_UPDATE
Update event.
Definition: twr_sgp30.h:19
void twr_tag_voc_set_update_interval(twr_tag_voc_t *self, twr_tick_t interval)
Set measurement interval.
Definition: twr_tag_voc.c:13
twr_sgp30_t twr_tag_voc_t
HARDWARIO VOC Module instance.
Definition: twr_tag_voc.h:24
twr_tag_voc_event_t
Callback events.
Definition: twr_tag_voc.h:13
bool twr_tag_voc_measure(twr_tag_voc_t *self)
Start measurement manually.
Definition: twr_tag_voc.c:18
void twr_tag_voc_set_event_handler(twr_tag_voc_t *self, void(*event_handler)(twr_tag_voc_t *, twr_tag_voc_event_t, void *), void *event_param)
Set callback function.
Definition: twr_tag_voc.c:8
bool twr_tag_voc_get_tvoc_ppb(twr_tag_voc_t *self, uint16_t *ppb)
Get measured TVOC in ppb (parts per billion)
Definition: twr_tag_voc.c:28
bool twr_tag_voc_get_co2eq_ppm(twr_tag_voc_t *self, uint16_t *ppm)
Get measured CO2eq in ppm (parts per million)
Definition: twr_tag_voc.c:23
float twr_tag_voc_set_compensation(twr_tag_voc_t *self, float *t_celsius, float *rh_percentage)
Set sensor compensation (absolute humidity is calculated from temperature and relative humidity)
Definition: twr_tag_voc.c:33
void twr_tag_voc_init(twr_tag_voc_t *self, twr_i2c_channel_t i2c_channel)
Initialize HARDWARIO VOC Module.
Definition: twr_tag_voc.c:3
@ TWR_TAG_VOC_EVENT_ERROR
Error event.
Definition: twr_tag_voc.h:15
@ TWR_TAG_VOC_EVENT_UPDATE
Update event.
Definition: twr_tag_voc.h:18
uint64_t twr_tick_t
Timestamp data type.
Definition: twr_tick.h:16