Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_lp8

Driver for LP8 CO2 sensor. More...

Data Structures

struct  bc_lp8_driver_t
 LP8 driver. More...
 

Typedefs

typedef struct bc_lp8_t bc_lp8_t
 LP8 instance.
 

Enumerations

enum  bc_lp8_event_t {
  BC_LP8_EVENT_ERROR = 0,
  BC_LP8_EVENT_UPDATE = 1
}
 Callback events. More...
 
enum  bc_lp8_calibration_t {
  BC_LP8_CALIBRATION_BACKGROUND_UNFILTERED = 0x50,
  BC_LP8_CALIBRATION_BACKGROUND_FILTERED = 0x51,
  BC_LP8_CALIBRATION_BACKGROUND_UNFILTERED_RF = 0x52,
  BC_LP8_CALIBRATION_BACKGROUND_FILTERED_RF = 0x53,
  BC_LP8_CALIBRATION_ABC = 0x70,
  BC_LP8_CALIBRATION_ABC_RF = 0x72
}
 Calibration. More...
 

Functions

void bc_lp8_init (bc_lp8_t *self, const bc_lp8_driver_t *driver)
 Initialize LP8.
 
void bc_lp8_set_event_handler (bc_lp8_t *self, void(*event_handler)(bc_lp8_event_t, void *), void *event_param)
 Set callback function. More...
 
void bc_lp8_set_update_interval (bc_lp8_t *self, bc_tick_t interval)
 Set measurement interval. More...
 
bool bc_lp8_measure (bc_lp8_t *self)
 Start measurement manually. More...
 
bool bc_lp8_get_concentration_ppm (bc_lp8_t *self, float *ppm)
 Get CO2 concentration in ppm (parts per million) More...
 
bool bc_lp8_get_error (bc_lp8_t *self, bc_lp8_error_t *error)
 Get last error code. More...
 
void bc_lp8_calibration (bc_lp8_t *self, bc_lp8_calibration_t calibration)
 Request sensor calibration. More...
 

Detailed Description

Driver for LP8 CO2 sensor.

Enumeration Type Documentation

Calibration.

Enumerator
BC_LP8_CALIBRATION_BACKGROUND_UNFILTERED 

Background calibration using unfiltered data.

BC_LP8_CALIBRATION_BACKGROUND_FILTERED 

Background calibration using filtered data.

BC_LP8_CALIBRATION_BACKGROUND_UNFILTERED_RF 

Background calibration using unfiltered data + reset filters.

BC_LP8_CALIBRATION_BACKGROUND_FILTERED_RF 

Background calibration using filtered data + reset filters.

BC_LP8_CALIBRATION_ABC 

ABC (based on filtered data)

BC_LP8_CALIBRATION_ABC_RF 

ABC (based on filtered data) + reset filters.

Definition at line 25 of file bc_lp8.h.

Callback events.

Enumerator
BC_LP8_EVENT_ERROR 

Error event.

BC_LP8_EVENT_UPDATE 

Update event.

Definition at line 13 of file bc_lp8.h.

Function Documentation

void bc_lp8_calibration ( bc_lp8_t self,
bc_lp8_calibration_t  calibration 
)

Request sensor calibration.

Parameters
[in]selfInstance
[in]calibrationCalibration type

Definition at line 97 of file bc_lp8.c.

Referenced by bc_module_co2_calibration().

Here is the call graph for this function:

Here is the caller graph for this function:

bool bc_lp8_get_concentration_ppm ( bc_lp8_t self,
float *  ppm 
)

Get CO2 concentration in ppm (parts per million)

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

Definition at line 76 of file bc_lp8.c.

Referenced by bc_module_co2_get_concentration_ppm().

Here is the caller graph for this function:

bool bc_lp8_get_error ( bc_lp8_t self,
bc_lp8_error_t *  error 
)

Get last error code.

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

Definition at line 90 of file bc_lp8.c.

Referenced by bc_module_co2_get_error().

Here is the caller graph for this function:

bool bc_lp8_measure ( bc_lp8_t self)

Start measurement manually.

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

Definition at line 58 of file bc_lp8.c.

Referenced by bc_lp8_calibration(), bc_lp8_set_update_interval(), and bc_module_co2_measure().

Here is the call graph for this function:

Here is the caller graph for this function:

void bc_lp8_set_event_handler ( bc_lp8_t self,
void(*)(bc_lp8_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 36 of file bc_lp8.c.

Referenced by bc_module_co2_set_event_handler().

Here is the caller graph for this function:

void bc_lp8_set_update_interval ( bc_lp8_t self,
bc_tick_t  interval 
)

Set measurement interval.

Parameters
[in]selfInstance
[in]intervalMeasurement interval

Definition at line 42 of file bc_lp8.c.

Referenced by bc_module_co2_set_update_interval().

Here is the call graph for this function:

Here is the caller graph for this function: