Firmware SDK
twr_tag_voc

Driver for HARDWARIO VOC Module. More...

Typedefs

typedef twr_sgp30_t twr_tag_voc_t
 HARDWARIO VOC Module instance.
 

Enumerations

enum  twr_tag_voc_event_t {
  TWR_TAG_VOC_EVENT_ERROR = TWR_SGP30_EVENT_ERROR ,
  TWR_TAG_VOC_EVENT_UPDATE = TWR_SGP30_EVENT_UPDATE
}
 Callback events. More...
 

Functions

void twr_tag_voc_init (twr_tag_voc_t *self, twr_i2c_channel_t i2c_channel)
 Initialize HARDWARIO VOC Module. More...
 
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. More...
 
void twr_tag_voc_set_update_interval (twr_tag_voc_t *self, twr_tick_t interval)
 Set measurement interval. More...
 
bool twr_tag_voc_measure (twr_tag_voc_t *self)
 Start measurement manually. More...
 
bool twr_tag_voc_get_co2eq_ppm (twr_tag_voc_t *self, uint16_t *ppm)
 Get measured CO2eq in ppm (parts per million) More...
 
bool twr_tag_voc_get_tvoc_ppb (twr_tag_voc_t *self, uint16_t *ppb)
 Get measured TVOC in ppb (parts per billion) More...
 
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) More...
 

Detailed Description

Driver for HARDWARIO VOC Module.

Enumeration Type Documentation

◆ twr_tag_voc_event_t

Callback events.

Enumerator
TWR_TAG_VOC_EVENT_ERROR 

Error event.

TWR_TAG_VOC_EVENT_UPDATE 

Update event.

Definition at line 12 of file twr_tag_voc.h.

Function Documentation

◆ twr_tag_voc_get_co2eq_ppm()

bool twr_tag_voc_get_co2eq_ppm ( twr_tag_voc_t self,
uint16_t *  ppm 
)

Get measured CO2eq in ppm (parts per million)

Parameters
[in]selfInstance
[out]ppmPointer to variable where result will be stored
Returns
true When value is valid
false When value is invalid

Definition at line 23 of file twr_tag_voc.c.

Here is the call graph for this function:

◆ twr_tag_voc_get_tvoc_ppb()

bool twr_tag_voc_get_tvoc_ppb ( twr_tag_voc_t self,
uint16_t *  ppb 
)

Get measured TVOC in ppb (parts per billion)

Parameters
[in]selfInstance
[out]ppbPointer to variable where result will be stored
Returns
true When value is valid
false When value is invalid

Definition at line 28 of file twr_tag_voc.c.

Here is the call graph for this function:

◆ twr_tag_voc_init()

void twr_tag_voc_init ( twr_tag_voc_t self,
twr_i2c_channel_t  i2c_channel 
)

Initialize HARDWARIO VOC Module.

Parameters
[in]selfInstance
[in]i2c_channelI2C channel

Definition at line 3 of file twr_tag_voc.c.

Here is the call graph for this function:

◆ twr_tag_voc_measure()

bool twr_tag_voc_measure ( twr_tag_voc_t self)

Start measurement manually.

Parameters
[in]selfInstance
Returns
true On success
false When other measurement is in progress

Definition at line 18 of file twr_tag_voc.c.

Here is the call graph for this function:

◆ twr_tag_voc_set_compensation()

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)

Parameters
[in]selfInstance
[in]t_celsiusPointer to variable holding temperature in degrees of celsius (must be NULL if not available)
[in]rh_percentagePointer to variable holding relative humidity in percentage (must be NULL if not available)
Returns
Absolute humidity in grams per cubic meter

Definition at line 33 of file twr_tag_voc.c.

Here is the call graph for this function:

◆ twr_tag_voc_set_event_handler()

void twr_tag_voc_set_event_handler ( twr_tag_voc_t self,
void(*)(twr_tag_voc_t *, twr_tag_voc_event_t, void *)  event_handler,
void *  event_param 
)

Set callback function.

Parameters
[in]selfInstance
[in]event_handlerFunction address
[in]event_paramOptional event parameter (can be NULL)

Definition at line 8 of file twr_tag_voc.c.

Here is the call graph for this function:

◆ twr_tag_voc_set_update_interval()

void twr_tag_voc_set_update_interval ( twr_tag_voc_t self,
twr_tick_t  interval 
)

Set measurement interval.

Parameters
[in]selfInstance
[in]intervalMeasurement interval

Definition at line 13 of file twr_tag_voc.c.

Here is the call graph for this function: