Firmware SDK
|
Driver for LP8 CO2 sensor. More...
Data Structures | |
struct | twr_lp8_driver_t |
LP8 driver. More... | |
Typedefs | |
typedef struct twr_lp8_t | twr_lp8_t |
LP8 instance. | |
Enumerations | |
enum | twr_lp8_event_t { TWR_LP8_EVENT_ERROR = 0 , TWR_LP8_EVENT_UPDATE = 1 } |
Callback events. More... | |
enum | twr_lp8_calibration_t { TWR_LP8_CALIBRATION_BACKGROUND_UNFILTERED = 0x50 , TWR_LP8_CALIBRATION_BACKGROUND_FILTERED = 0x51 , TWR_LP8_CALIBRATION_BACKGROUND_UNFILTERED_RF = 0x52 , TWR_LP8_CALIBRATION_BACKGROUND_FILTERED_RF = 0x53 , TWR_LP8_CALIBRATION_ABC = 0x70 , TWR_LP8_CALIBRATION_ATWR_RF = 0x72 } |
Calibration. More... | |
Functions | |
void | twr_lp8_init (twr_lp8_t *self, const twr_lp8_driver_t *driver) |
Initialize LP8. | |
void | twr_lp8_set_event_handler (twr_lp8_t *self, void(*event_handler)(twr_lp8_event_t, void *), void *event_param) |
Set callback function. More... | |
void | twr_lp8_set_update_interval (twr_lp8_t *self, twr_tick_t interval) |
Set measurement interval. More... | |
bool | twr_lp8_measure (twr_lp8_t *self) |
Start measurement manually. More... | |
bool | twr_lp8_get_concentration_ppm (twr_lp8_t *self, float *ppm) |
Get CO2 concentration in ppm (parts per million) More... | |
bool | twr_lp8_get_error (twr_lp8_t *self, twr_lp8_error_t *error) |
Get last error code. More... | |
void | twr_lp8_calibration (twr_lp8_t *self, twr_lp8_calibration_t calibration) |
Request sensor calibration. More... | |
Driver for LP8 CO2 sensor.
Calibration.
enum twr_lp8_event_t |
void twr_lp8_calibration | ( | twr_lp8_t * | self, |
twr_lp8_calibration_t | calibration | ||
) |
Request sensor calibration.
[in] | self | Instance |
[in] | calibration | Calibration type |
Definition at line 97 of file twr_lp8.c.
Referenced by twr_module_co2_calibration().
bool twr_lp8_get_concentration_ppm | ( | twr_lp8_t * | self, |
float * | ppm | ||
) |
Get CO2 concentration in ppm (parts per million)
[in] | self | Instance |
[out] | ppm | Pointer to variable where result will be stored |
Definition at line 76 of file twr_lp8.c.
Referenced by twr_module_co2_get_concentration_ppm().
bool twr_lp8_get_error | ( | twr_lp8_t * | self, |
twr_lp8_error_t * | error | ||
) |
Get last error code.
[in] | self | Instance |
[out] | pointer | to the variable where error code will be stored |
Definition at line 90 of file twr_lp8.c.
Referenced by twr_module_co2_get_error().
bool twr_lp8_measure | ( | twr_lp8_t * | self | ) |
Start measurement manually.
[in] | self | Instance |
Definition at line 58 of file twr_lp8.c.
Referenced by twr_lp8_calibration(), twr_lp8_set_update_interval(), and twr_module_co2_measure().
void twr_lp8_set_event_handler | ( | twr_lp8_t * | self, |
void(*)(twr_lp8_event_t, void *) | event_handler, | ||
void * | event_param | ||
) |
Set callback function.
[in] | self | Instance |
[in] | event_handler | Function address |
[in] | event_param | Optional event parameter (can be NULL) |
Definition at line 36 of file twr_lp8.c.
Referenced by twr_module_co2_set_event_handler().
void twr_lp8_set_update_interval | ( | twr_lp8_t * | self, |
twr_tick_t | interval | ||
) |
Set measurement interval.
[in] | self | Instance |
[in] | interval | Measurement interval |
Definition at line 42 of file twr_lp8.c.
Referenced by twr_module_co2_set_update_interval().