Firmware SDK
twr_module_co2

Driver for HARDWARIO CO2 Module. More...

Enumerations

enum  twr_module_co2_event_t {
  TWR_MODULE_CO2_EVENT_ERROR = TWR_LP8_EVENT_ERROR ,
  TWR_MODULE_CO2_EVENT_UPDATE = TWR_LP8_EVENT_UPDATE
}
 Callback events. More...
 

Functions

void twr_module_co2_init (void)
 Initialize HARDWARIO CO2 Module.
 
void twr_module_co2_set_event_handler (void(*event_handler)(twr_module_co2_event_t, void *), void *event_param)
 Set callback function. More...
 
void twr_module_co2_set_update_interval (twr_tick_t interval)
 Set measurement interval. More...
 
bool twr_module_co2_measure (void)
 Start measurement manually. More...
 
bool twr_module_co2_get_concentration_ppm (float *ppm)
 Get CO2 concentration in ppm (parts per million) More...
 
bool twr_module_co2_get_error (twr_lp8_error_t *error)
 Get last error code. More...
 
void twr_module_co2_calibration (twr_lp8_calibration_t calibration)
 Request sensor calibration. More...
 

Detailed Description

Driver for HARDWARIO CO2 Module.

Enumeration Type Documentation

◆ twr_module_co2_event_t

Callback events.

Enumerator
TWR_MODULE_CO2_EVENT_ERROR 

Error event.

TWR_MODULE_CO2_EVENT_UPDATE 

Update event.

Definition at line 13 of file twr_module_co2.h.

Function Documentation

◆ twr_module_co2_calibration()

void twr_module_co2_calibration ( twr_lp8_calibration_t  calibration)

Request sensor calibration.

Parameters
[in]calibrationCalibration type

Definition at line 88 of file twr_module_co2.c.

Here is the call graph for this function:

◆ twr_module_co2_get_concentration_ppm()

bool twr_module_co2_get_concentration_ppm ( float *  ppm)

Get CO2 concentration in ppm (parts per million)

Parameters
[out]ppmPointer to variable where result will be stored
Returns
true On success
false On failure

Definition at line 78 of file twr_module_co2.c.

Here is the call graph for this function:

◆ twr_module_co2_get_error()

bool twr_module_co2_get_error ( twr_lp8_error_t *  error)

Get last error code.

Parameters
[out]pointerto the variable where error code will be stored
Returns
true On success
false On failure

Definition at line 83 of file twr_module_co2.c.

Here is the call graph for this function:

◆ twr_module_co2_measure()

bool twr_module_co2_measure ( void  )

Start measurement manually.

Returns
true On success
False When other measurement is in progress

Definition at line 73 of file twr_module_co2.c.

Here is the call graph for this function:

◆ twr_module_co2_set_event_handler()

void twr_module_co2_set_event_handler ( void(*)(twr_module_co2_event_t, void *)  event_handler,
void *  event_param 
)

Set callback function.

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

Definition at line 63 of file twr_module_co2.c.

Here is the call graph for this function:

◆ twr_module_co2_set_update_interval()

void twr_module_co2_set_update_interval ( twr_tick_t  interval)

Set measurement interval.

Parameters
[in]intervalMeasurement interval

Definition at line 68 of file twr_module_co2.c.

Here is the call graph for this function: