airquality8 2.0.0.0
airquality8.h File Reference

This file contains API for Air Quality 8 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  airquality8_t
 Air Quality 8 Click context object. More...
 
struct  airquality8_cfg_t
 Air Quality 8 Click configuration object. More...
 

Macros

#define AIRQUALITY8_REG_PID   0x00
 Air Quality 8 description register.
 
#define AIRQUALITY8_REG_CONF   0x20
 
#define AIRQUALITY8_REG_PROD_DATA   0x26
 
#define AIRQUALITY8_REG_CMD   0x93
 
#define AIRQUALITY8_REG_STATUS   0x94
 
#define AIRQUALITY8_REG_TRACKING   0x3A
 
#define AIRQUALITY8_REG_CFG_H   0x40
 
#define AIRQUALITY8_REG_CFG_D   0x50
 
#define AIRQUALITY8_REG_CFG_M   0x60
 
#define AIRQUALITY8_REG_CFG_S   0x68
 
#define AIRQUALITY8_REG_CFG_R   0x97
 
#define AIRQUALITY8_PRODUCT_ID   0x6320
 Air Quality 8 product ID.
 
#define AIRQUALITY8_GAS_DETECTION_STRATEGY_AUTO   0
 Air Quality 8 gas detection strategy setting.
 
#define AIRQUALITY8_GAS_DETECTION_STRATEGY_FORCE_O3   1
 
#define AIRQUALITY8_GAS_DETECTION_STRATEGY_FORCE_NO2   2
 
#define AIRQUALITY8_RCDA_STRATEGY_FIX   0
 Air Quality 8 RCDA strategy setting.
 
#define AIRQUALITY8_RCDA_STRATEGY_SET   1
 
#define AIRQUALITY8_RCDA_STRATEGY_ADJ   2
 
#define AIRQUALITY8_STATUS_SEQUENCER_RUNNING_MASK   0x80
 Air Quality 8 status bit mask setting.
 
#define AIRQUALITY8_STATUS_SLEEP_TIMER_ENABLED_MASK   0x40
 
#define AIRQUALITY8_STATUS_ALARM_MASK   0x20
 
#define AIRQUALITY8_STATUS_LAST_SEQ_STEP_MASK   0x1F
 
#define AIRQUALITY8_STATUS_POR_EVENT_MASK   0x80
 
#define AIRQUALITY8_STATUS_ACCESS_CONFLICT_MASK   0x40
 
#define AIRQUALITY8_SET_DEV_ADDR   0x33
 Air Quality 8 device address setting.
 
#define AIRQUALITY8_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  airquality8_return_value_t {
  AIRQUALITY8_OK = 0 , AIRQUALITY8_ERROR = -1 , AIRQUALITY8_ERROR_INIT_OUT_OF_RANGE = 1 , AIRQUALITY8_ERROR_GAS_TIMEOUT = 2 ,
  AIRQUALITY8_ERROR_I2C = 3 , AIRQUALITY8_ERROR_SENSOR_UNSUPPORTED = 4 , AIRQUALITY8_ERROR_CONFIG_MISSING = 5 , AIRQUALITY8_ERROR_SENSOR = 6 ,
  AIRQUALITY8_ERROR_ACCESS_CONFLICT = 7 , AIRQUALITY8_ERROR_POR_EVENT = 8
}
 Air Quality 8 Click return value data. More...
 

Functions

void airquality8_cfg_setup (airquality8_cfg_t *cfg)
 Air Quality 8 configuration object setup function.
 
err_t airquality8_init (airquality8_t *ctx, airquality8_cfg_t *cfg)
 Air Quality 8 initialization function.
 
err_t airquality8_default_cfg (airquality8_t *ctx)
 Air Quality 8 default configuration function.
 
err_t airquality8_generic_write (airquality8_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Air Quality 8 I2C writing function.
 
err_t airquality8_generic_read (airquality8_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Air Quality 8 I2C reading function.
 
void airquality8_hw_reset (airquality8_t *ctx)
 Air Quality 8 reset function.
 
err_t airquality8_get_status (airquality8_t *ctx, uint8_t *status)
 Air Quality 8 get status function.
 
err_t airquality8_get_sensor_info (airquality8_t *ctx, uint8_t *cfg_data, uint8_t *prod_data, uint16_t *pid)
 Air Quality 8 get sensor info function.
 
err_t airquality8_init_sensor (airquality8_t *ctx, uint16_t *mox_lr, uint16_t *mox_er)
 Air Quality 8 init sensor function.
 
err_t airquality8_init_measurement (airquality8_t *ctx)
 Air Quality 8 init measurement function.
 
err_t airquality8_start_measurement (airquality8_t *ctx)
 Air Quality 8 start measurement function.
 
err_t airquality8_read_rmox (airquality8_t *ctx, float *rmox, uint16_t mox_lr, uint16_t mox_er)
 Air Quality 8 calculate rmox resistance function.
 
float airquality8_calc_oaq (float *rmox, uint8_t rcda_strategy, uint8_t gas_detection_strategy)
 Air Quality 8 calculates AQI function.
 
uint8_t raq_check_interrupt (airquality8_t *ctx)
 Air Quality 8 check interrupt function.
 

Detailed Description

This file contains API for Air Quality 8 Click Driver.

Enumeration Type Documentation

◆ airquality8_return_value_t

Air Quality 8 Click return value data.

Predefined enum values for driver return values.

Enumerator
AIRQUALITY8_OK 
AIRQUALITY8_ERROR 
AIRQUALITY8_ERROR_INIT_OUT_OF_RANGE 
AIRQUALITY8_ERROR_GAS_TIMEOUT 
AIRQUALITY8_ERROR_I2C 
AIRQUALITY8_ERROR_SENSOR_UNSUPPORTED 
AIRQUALITY8_ERROR_CONFIG_MISSING 
AIRQUALITY8_ERROR_SENSOR 
AIRQUALITY8_ERROR_ACCESS_CONFLICT 
AIRQUALITY8_ERROR_POR_EVENT