airquality3 2.0.0.0
airquality3.h File Reference

This file contains API for Air quality 3 Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  airquality3_t
 Click ctx object definition. More...
 
struct  airquality3_cfg_t
 Click configuration structure definition. More...
 
struct  airguality3_info_t
 Info structure definition. More...
 
struct  airquality3_air_data_t
 Air data structure definition. More...
 

Macros

#define AIRQUALITY3_MAP_MIKROBUS(cfg, mikrobus)
 
#define AIRQUALITY3_RETVAL   uint8_t
 
#define AIRQUALITY3_OK   0x00
 
#define AIRQUALITY3_INIT_ERROR   0xFF
 
#define AIRQUALITY3_REG_ID   0x20
 
#define AIRQUALITY3_REG_ERROR_ID   0xE0
 
#define AIRQUALITY3_REG_STATUS   0x00
 
#define AIRQUALITY3_REG_HW_VERSION   0x21
 
#define AIRQUALITY3_REG_FW_BOOT_VERSION   0x23
 
#define AIRQUALITY3_REG_FW_APP_VERSION   0x24
 
#define AIRQUALITY3_REG_SW_RESET   0xFF
 
#define AIRQUALITY3_REG_ALG_DATA   0x02
 
#define AIRQUALITY3_REG_RAW_DATA   0x03
 
#define AIRQUALITY3_REG_ENV_DATA   0x05
 
#define AIRQUALITY3_REG_NTC   0x06
 
#define AIRQUALITY3_REG_MEAS_MODE   0x01
 
#define AIRQUALITY3_REG_BASELINE   0x11
 
#define AIRQUALITY3_DRIVE_MODE_0   ( 0x00 << 4 )
 
#define AIRQUALITY3_DRIVE_MODE_1   ( 0x01 << 4 )
 
#define AIRQUALITY3_DRIVE_MODE_2   ( 0x02 << 4 )
 
#define AIRQUALITY3_DRIVE_MODE_3   ( 0x03 << 4 )
 
#define AIRQUALITY3_DRIVE_MODE_4   ( 0x04 << 4 )
 
#define AIRQUALITY3_INT_DATARDY_0   ( 0x00 << 3 )
 
#define AIRQUALITY3_INT_DATARDY_1   ( 0x01 << 3 )
 
#define AIRQUALITY3_INT_THRESH_0   ( 0x00 << 2 )
 
#define AIRQUALITY3_INT_THRESH_1   ( 0x01 << 2 )
 
#define AIRQUALITY3_APP_START   0xF4
 
#define AIRQUALITY3_APP_VERIFY   0xF3
 
#define AIRQUALITY3_APP_DATA   0xF2
 
#define AIRQUALITY3_APP_ERASE   0xF1
 
#define AIRQUALITY3_DEVICE_SLAVE_ADDRESS   0x5A
 
#define AIRQUALITY3_POWER_STATE_ON   0
 
#define AIRQUALITY3_POWER_STATE_OFF   1
 

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

This file contains API for Air quality 3 Click driver.