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.
 

Detailed Description

Function Documentation

◆ airquality3_app_function()

void airquality3_app_function ( airquality3_t * ctx,
uint8_t app_task )

function to start APP task

Parameters
ctxClick object.
app_task1 bytes data to be written in register
Note
Task options:
  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.

◆ airquality3_cfg_setup()

void airquality3_cfg_setup ( airquality3_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ airquality3_default_cfg()

void airquality3_default_cfg ( airquality3_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for AirQuality3 click.

Note
The default configuration is set:
   -  Set measurement mode : AIRQUALITY3_DRIVE_MODE_4 | AIRQUALITY3_INT_DATARDY_1

◆ airquality3_generic_read()

void airquality3_generic_read ( airquality3_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function reads data from the desired register.

◆ airquality3_generic_write()

void airquality3_generic_write ( airquality3_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register.

◆ airquality3_get_co2_and_tvoc()

uint8_t airquality3_get_co2_and_tvoc ( airquality3_t * ctx,
airquality3_air_data_t * air_data )

Get CO2 and TVOC data.

Parameters
ctxClick object.
air_dataStructure for air quality data storage
Note
   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.
Returns
Error ID value.

◆ airquality3_get_device_info()

void airquality3_get_device_info ( airquality3_t * ctx,
airguality3_info_t * info )

Get device info.

Parameters
ctxClick object.
infoStructure ( Device ID, HW ver, FW boot ver, FW app ver.. )

◆ airquality3_get_interrupt_state()

uint8_t airquality3_get_interrupt_state ( airquality3_t * ctx)

Get interrupt state.

Parameters
ctxClick object.
Returns
Interrupt state on the INT pin (DRDY)

◆ airquality3_get_ntc_data()

void airquality3_get_ntc_data ( airquality3_t * ctx,
uint8_t * data_buf )

Get NTC value.

Parameters
ctxClick object.
data_bufpointer to the buffer when data will be storaged
Note
    Four bytes read only a register that contains voltage across
    resistor (RREF) and voltage across the NTC resistor
    which determines the ambient temperature.

◆ airquality3_get_raw_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.

Parameters
ctxClick object.
raw_datapointer to the buffer when data will be storaged

◆ airquality3_get_starus()

uint8_t airquality3_get_starus ( airquality3_t * ctx)

Reads status.

Parameters
ctxClick object.
Returns
(8-bit) Status data

◆ airquality3_hardware_reset()

void airquality3_hardware_reset ( airquality3_t * ctx)

Hardware reset.

Parameters
ctxClick object.

◆ airquality3_init()

AIRQUALITY3_RETVAL airquality3_init ( airquality3_t * ctx,
airquality3_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ airquality3_set_baseline()

void airquality3_set_baseline ( airquality3_t * ctx,
uint16_t baseline )

Function for settings baseline value.

Parameters
ctxClick object.
baseline2 bytes data to be written into the baseline register
Note
   This function is used to correct the measurement,
   and set the baseline value that the algorithm uses to measure the CO2 and TVOC values.

◆ airquality3_set_environment_data()

void airquality3_set_environment_data ( airquality3_t * ctx,
uint32_t env_data )

Temperature and humidity data settings.

Parameters
ctxClick object.
_data4 bytes data for settings temperature and huminidy
Note
    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.

◆ airquality3_set_measurement_mode()

void airquality3_set_measurement_mode ( airquality3_t * ctx,
uint8_t mode )

Function for settings sensor drive mode and interrupts.

Parameters
ctxClick object.
modedata to be written into the meas register
Note
set mode options:
  - 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).
*

◆ airquality3_set_power()

void airquality3_set_power ( airquality3_t * ctx,
uint16_t pwr_state )

Function for power ON/OFF chip.

Parameters
ctxClick object.
prw_statePower state (ON or OFF state)

◆ airquality3_software_reset()

void airquality3_software_reset ( airquality3_t * ctx,
uint32_t reset )

Software reset.

Parameters
ctxClick object.
reset4 bytes for reset chip
Note
    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.