Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_tag_voc_lp.c
1 #include <bc_tag_voc_lp.h>
2 
4 {
5  bc_sgpc3_init(self, i2c_channel, 0x58);
6 }
7 
8 void bc_tag_voc_lp_set_event_handler(bc_tag_voc_lp_t *self, void (*event_handler)(bc_tag_voc_lp_t *, bc_tag_voc_lp_event_t, void *), void *event_param)
9 {
10  bc_sgpc3_set_event_handler(self, (void (*)(bc_sgpc3_t *, bc_sgpc3_event_t, void *)) event_handler, event_param);
11 }
12 
14 {
15  bc_sgpc3_set_update_interval(self, interval);
16 }
17 
19 {
20  return bc_sgpc3_measure(self);
21 }
22 
23 bool bc_tag_voc_lp_get_tvoc_ppb(bc_tag_voc_lp_t *self, uint16_t *ppb)
24 {
25  return bc_sgpc3_get_tvoc_ppb(self, ppb);
26 }
27 
28 float bc_tag_voc_lp_set_compensation(bc_tag_voc_lp_t *self, float *t_celsius, float *rh_percentage)
29 {
30  return bc_sgpc3_set_compensation(self, t_celsius, rh_percentage);
31 }
bool bc_tag_voc_lp_measure(bc_tag_voc_lp_t *self)
Start measurement manually.
Definition: bc_tag_voc_lp.c:18
bc_sgpc3_event_t
Callback events.
Definition: bc_sgpc3.h:13
uint64_t bc_tick_t
Timestamp data type.
Definition: bc_tick.h:16
void bc_sgpc3_set_update_interval(bc_sgpc3_t *self, bc_tick_t interval)
Set measurement interval.
Definition: bc_sgpc3.c:39
void bc_sgpc3_init(bc_sgpc3_t *self, bc_i2c_channel_t i2c_channel, uint8_t i2c_address)
Initialize SGPC3.
Definition: bc_sgpc3.c:18
bc_sgpc3_t bc_tag_voc_lp_t
BigClown VOC-LP Tag instance.
Definition: bc_tag_voc_lp.h:24
void bc_tag_voc_lp_set_update_interval(bc_tag_voc_lp_t *self, bc_tick_t interval)
Set measurement interval.
Definition: bc_tag_voc_lp.c:13
void bc_tag_voc_lp_set_event_handler(bc_tag_voc_lp_t *self, void(*event_handler)(bc_tag_voc_lp_t *, bc_tag_voc_lp_event_t, void *), void *event_param)
Set callback function.
Definition: bc_tag_voc_lp.c:8
void bc_tag_voc_lp_init(bc_tag_voc_lp_t *self, bc_i2c_channel_t i2c_channel)
Initialize BigClown VOC-LP Tag.
Definition: bc_tag_voc_lp.c:3
bool bc_sgpc3_get_tvoc_ppb(bc_sgpc3_t *self, uint16_t *ppb)
Get measured TVOC in ppb (parts per billion)
Definition: bc_sgpc3.c:74
float bc_tag_voc_lp_set_compensation(bc_tag_voc_lp_t *self, float *t_celsius, float *rh_percentage)
Set sensor compensation (absolute humidity is calculated from temperature and relative humidity) ...
Definition: bc_tag_voc_lp.c:28
bc_i2c_channel_t
I2C channels.
Definition: bc_i2c.h:15
bool bc_sgpc3_measure(bc_sgpc3_t *self)
Start measurement manually.
Definition: bc_sgpc3.c:55
void bc_sgpc3_set_event_handler(bc_sgpc3_t *self, void(*event_handler)(bc_sgpc3_t *, bc_sgpc3_event_t, void *), void *event_param)
Set callback function.
Definition: bc_sgpc3.c:33
float bc_sgpc3_set_compensation(bc_sgpc3_t *self, float *t_celsius, float *rh_percentage)
Set sensor compensation (absolute humidity is calculated from temperature and relative humidity) ...
Definition: bc_sgpc3.c:86
bc_tag_voc_lp_event_t
Callback events.
Definition: bc_tag_voc_lp.h:12
struct bc_sgpc3_t bc_sgpc3_t
SGPC3 instance.
Definition: bc_sgpc3.h:25
bool bc_tag_voc_lp_get_tvoc_ppb(bc_tag_voc_lp_t *self, uint16_t *ppb)
Get measured TVOC in ppb (parts per billion)
Definition: bc_tag_voc_lp.c:23