Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_tag_voc.c
1 #include <bc_tag_voc.h>
2 
4 {
5  bc_sgp30_init(self, i2c_channel, 0x58);
6 }
7 
8 void bc_tag_voc_set_event_handler(bc_tag_voc_t *self, void (*event_handler)(bc_tag_voc_t *, bc_tag_voc_event_t, void *), void *event_param)
9 {
10  bc_sgp30_set_event_handler(self, (void (*)(bc_sgp30_t *, bc_sgp30_event_t, void *)) event_handler, event_param);
11 }
12 
14 {
15  bc_sgp30_set_update_interval(self, interval);
16 }
17 
19 {
20  return bc_sgp30_measure(self);
21 }
22 
23 bool bc_tag_voc_get_co2eq_ppm(bc_tag_voc_t *self, uint16_t *ppm)
24 {
25  return bc_sgp30_get_co2eq_ppm(self, ppm);
26 }
27 
28 bool bc_tag_voc_get_tvoc_ppb(bc_tag_voc_t *self, uint16_t *ppb)
29 {
30  return bc_sgp30_get_tvoc_ppb(self, ppb);
31 }
32 
33 float bc_tag_voc_set_compensation(bc_tag_voc_t *self, float *t_celsius, float *rh_percentage)
34 {
35  return bc_sgp30_set_compensation(self, t_celsius, rh_percentage);
36 }
void bc_sgp30_set_update_interval(bc_sgp30_t *self, bc_tick_t interval)
Set measurement interval.
Definition: bc_sgp30.c:38
uint64_t bc_tick_t
Timestamp data type.
Definition: bc_tick.h:16
bool bc_sgp30_get_co2eq_ppm(bc_sgp30_t *self, uint16_t *ppm)
Get measured CO2eq in ppm (parts per million)
Definition: bc_sgp30.c:73
void bc_tag_voc_init(bc_tag_voc_t *self, bc_i2c_channel_t i2c_channel)
Initialize BigClown VOC Tag.
Definition: bc_tag_voc.c:3
void bc_sgp30_set_event_handler(bc_sgp30_t *self, void(*event_handler)(bc_sgp30_t *, bc_sgp30_event_t, void *), void *event_param)
Set callback function.
Definition: bc_sgp30.c:32
struct bc_sgp30_t bc_sgp30_t
SGP30 instance.
Definition: bc_sgp30.h:25
bc_sgp30_event_t
Callback events.
Definition: bc_sgp30.h:13
bool bc_sgp30_measure(bc_sgp30_t *self)
Start measurement manually.
Definition: bc_sgp30.c:54
void bc_tag_voc_set_update_interval(bc_tag_voc_t *self, bc_tick_t interval)
Set measurement interval.
Definition: bc_tag_voc.c:13
bool bc_tag_voc_measure(bc_tag_voc_t *self)
Start measurement manually.
Definition: bc_tag_voc.c:18
float bc_sgp30_set_compensation(bc_sgp30_t *self, float *t_celsius, float *rh_percentage)
Set sensor compensation (absolute humidity is calculated from temperature and relative humidity) ...
Definition: bc_sgp30.c:97
void bc_tag_voc_set_event_handler(bc_tag_voc_t *self, void(*event_handler)(bc_tag_voc_t *, bc_tag_voc_event_t, void *), void *event_param)
Set callback function.
Definition: bc_tag_voc.c:8
void bc_sgp30_init(bc_sgp30_t *self, bc_i2c_channel_t i2c_channel, uint8_t i2c_address)
Initialize SGP30.
Definition: bc_sgp30.c:17
float bc_tag_voc_set_compensation(bc_tag_voc_t *self, float *t_celsius, float *rh_percentage)
Set sensor compensation (absolute humidity is calculated from temperature and relative humidity) ...
Definition: bc_tag_voc.c:33
bc_i2c_channel_t
I2C channels.
Definition: bc_i2c.h:15
bool bc_tag_voc_get_tvoc_ppb(bc_tag_voc_t *self, uint16_t *ppb)
Get measured TVOC in ppb (parts per billion)
Definition: bc_tag_voc.c:28
bool bc_sgp30_get_tvoc_ppb(bc_sgp30_t *self, uint16_t *ppb)
Get measured TVOC in ppb (parts per billion)
Definition: bc_sgp30.c:85
bc_tag_voc_event_t
Callback events.
Definition: bc_tag_voc.h:12
bc_sgp30_t bc_tag_voc_t
BigClown VOC Tag instance.
Definition: bc_tag_voc.h:24
bool bc_tag_voc_get_co2eq_ppm(bc_tag_voc_t *self, uint16_t *ppm)
Get measured CO2eq in ppm (parts per million)
Definition: bc_tag_voc.c:23