airquality3 2.0.0.0
|
Functions | |
void | airquality3_cfg_setup (airquality3_cfg_t *cfg) |
Config Object Initialization function. | |
AIRQUALITY3_RETVAL | airquality3_init (airquality3_t *ctx, airquality3_cfg_t *cfg) |
Initialization function. | |
void | airquality3_default_cfg (airquality3_t *ctx) |
Click Default Configuration function. | |
void | airquality3_generic_write (airquality3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | airquality3_generic_read (airquality3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
uint8_t | airquality3_get_starus (airquality3_t *ctx) |
Reads status. | |
void | airquality3_get_device_info (airquality3_t *ctx, airguality3_info_t *info) |
Get device info. | |
void | airquality3_software_reset (airquality3_t *ctx, uint32_t reset) |
Software reset. | |
uint8_t | airquality3_get_co2_and_tvoc (airquality3_t *ctx, airquality3_air_data_t *air_data) |
Get CO2 and TVOC data. | |
void | airquality3_get_raw_data (airquality3_t *ctx, uint16_t *raw_data) |
Function reads raw ADC data values for resistance and current source used. | |
void | airquality3_set_environment_data (airquality3_t *ctx, uint32_t env_data) |
Temperature and humidity data settings. | |
void | airquality3_get_ntc_data (airquality3_t *ctx, uint8_t *data_buf) |
Get NTC value. | |
void | airquality3_set_measurement_mode (airquality3_t *ctx, uint8_t mode) |
Function for settings sensor drive mode and interrupts. | |
void | airquality3_set_baseline (airquality3_t *ctx, uint16_t baseline) |
Function for settings baseline value. | |
void | airquality3_app_function (airquality3_t *ctx, uint8_t app_task) |
function to start APP task | |
void | airquality3_set_power (airquality3_t *ctx, uint16_t pwr_state) |
Function for power ON/OFF chip. | |
void | airquality3_hardware_reset (airquality3_t *ctx) |
Hardware reset. | |
uint8_t | airquality3_get_interrupt_state (airquality3_t *ctx) |
Get interrupt state. | |
void airquality3_app_function | ( | airquality3_t * | ctx, |
uint8_t | app_task ) |
function to start APP task
ctx | Click object. |
app_task | 1 bytes data to be written in register |
App start - Application start. This command must be executed at the start. App verify - Starts the process of the bootloader checking though the application to make sure a full image is valid.
void airquality3_cfg_setup | ( | airquality3_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void airquality3_default_cfg | ( | airquality3_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for AirQuality3 click.
- Set measurement mode : AIRQUALITY3_DRIVE_MODE_4 | AIRQUALITY3_INT_DATARDY_1
void airquality3_generic_read | ( | airquality3_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
@description This function reads data from the desired register.
void airquality3_generic_write | ( | airquality3_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
@description This function writes data to the desired register.
uint8_t airquality3_get_co2_and_tvoc | ( | airquality3_t * | ctx, |
airquality3_air_data_t * | air_data ) |
Get CO2 and TVOC data.
ctx | Click object. |
air_data | Structure for air quality data storage |
This function returns a lot of data. The first data is the CO2 value, following the TVOC value, and the status register for CO2 and TVOC and RAW_DATA value.
void airquality3_get_device_info | ( | airquality3_t * | ctx, |
airguality3_info_t * | info ) |
Get device info.
ctx | Click object. |
info | Structure ( Device ID, HW ver, FW boot ver, FW app ver.. ) |
uint8_t airquality3_get_interrupt_state | ( | airquality3_t * | ctx | ) |
Get interrupt state.
ctx | Click object. |
void airquality3_get_ntc_data | ( | airquality3_t * | ctx, |
uint8_t * | data_buf ) |
Get NTC value.
ctx | Click object. |
data_buf | pointer to the buffer when data will be storaged |
Four bytes read only a register that contains voltage across resistor (RREF) and voltage across the NTC resistor which determines the ambient temperature.
void airquality3_get_raw_data | ( | airquality3_t * | ctx, |
uint16_t * | raw_data ) |
Function reads raw ADC data values for resistance and current source used.
ctx | Click object. |
raw_data | pointer to the buffer when data will be storaged |
uint8_t airquality3_get_starus | ( | airquality3_t * | ctx | ) |
Reads status.
ctx | Click object. |
void airquality3_hardware_reset | ( | airquality3_t * | ctx | ) |
Hardware reset.
ctx | Click object. |
AIRQUALITY3_RETVAL airquality3_init | ( | airquality3_t * | ctx, |
airquality3_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void airquality3_set_baseline | ( | airquality3_t * | ctx, |
uint16_t | baseline ) |
Function for settings baseline value.
ctx | Click object. |
baseline | 2 bytes data to be written into the baseline register |
This function is used to correct the measurement, and set the baseline value that the algorithm uses to measure the CO2 and TVOC values.
void airquality3_set_environment_data | ( | airquality3_t * | ctx, |
uint32_t | env_data ) |
Temperature and humidity data settings.
ctx | Click object. |
_data | 4 bytes data for settings temperature and huminidy |
The internal algorithm uses these values (or default values if not set by the application) to compensate for changes in relative humidity and ambient temperature.
void airquality3_set_measurement_mode | ( | airquality3_t * | ctx, |
uint8_t | mode ) |
Function for settings sensor drive mode and interrupts.
ctx | Click object. |
mode | data to be written into the meas register |
- mode: Mode 0 - Idle ( Measurements are disabled in this mode ) Mode 1 - Constant power mode, IAQ measurement every second Mode 2 - Pulse heating mode IAQ measurement every 10 seconds Mode 3 - Low power pulse heating mode IAQ measurement every 60 seconds Mode 4 - Constant power mode, sensor measurement every 250ms - set interrupts: 0: Interrupt generation is disabled 1: The nINT signal is asserted (driven low) when a new sample is ready in multiData register. - set thresholds: 0: Interrupt mode (if enabled) operates normally 1: Interrupt mode (if enabled) only asserts the nINT signal (driven low) if the new ALG_RESULT_DATA crosses one of the thresholds set in the THRESHOLDS register by more than the hysteresis value (also in the THRESHOLDS register). *
void airquality3_set_power | ( | airquality3_t * | ctx, |
uint16_t | pwr_state ) |
Function for power ON/OFF chip.
ctx | Click object. |
prw_state | Power state (ON or OFF state) |
void airquality3_software_reset | ( | airquality3_t * | ctx, |
uint32_t | reset ) |
Software reset.
ctx | Click object. |
reset | 4 bytes for reset chip |
If the correct is 4 bytes (0x11 0xE5 0x72 0x8A) are written to this register in a single sequence the device will reset and return to BOOT mode.