airquality2 2.0.0.0
airquality2.h File Reference

This file contains API for Air quality 2 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  airquality2_t
 Click ctx object definition. More...
 
struct  airquality2_cfg_t
 Click configuration structure definition. More...
 

Macros

#define AIRQUALITY2_MAP_MIKROBUS(cfg, mikrobus)
 
#define AIRQUALITY2_RETVAL   uint8_t
 
#define AIRQUALITY2_OK   0x00
 
#define AIRQUALITY2_INIT_ERROR   0xFF
 
#define AIRQUALITY2_I2C_ADDRESS   0x5A
 
#define AIRQUALITY2_START_READING   0xB5
 
#define AIRQUALITY2_TYPE_C   0x00
 
#define AIRQUALITY2_TYPE_P   0x01
 
#define AIRQUALITY2_MEASUREMENT_INTERVAL_TYPE_C   1000
 
#define AIRQUALITY2_MEASUREMENT_INTERVAL_TYPE_P   11000
 
#define AIRQUALITY2_READ_CO2_AND_STATUS   3
 
#define AIRQUALITY2_READ_ALL   9
 
#define AIRQUALITY2_STATUS_OK   0x00
 
#define AIRQUALITY2_STATUS_RUNIN   0x10
 
#define AIRQUALITY2_STATUS_BUSY   0x01
 
#define AIRQUALITY2_STATUS_ERROR   0x80
 
#define AIRQUALITY2_STATUS_NOT_UPDATED_AT_ALL   0xf0
 
#define AIRQUALITY2_STATUS_UPDATING   0xf1
 
#define AIRQUALITY2_STATUS_I2C_REQ_FAILED   0xf2
 
#define AIRQUALITY2_CO2_PREDICTION_MSB_OFFSET   0x00
 
#define AIRQUALITY2_CO2_PREDICTION_LSB_OFFSET   0x01
 
#define AIRQUALITY2_STATUS_OFFSET   0x02
 
#define AIRQUALITY2_RESISTANCE_NULL_BYTE   0x03
 
#define AIRQUALITY2_RESISTANCE_MSB_OFFSET   0x04
 
#define AIRQUALITY2_RESISTANCE_MID_OFFSET   0x05
 
#define AIRQUALITY2_RESISTANCE_LSB_OFFSET   0x06
 
#define AIRQUALITY2_TVOC_PREDICTION_MSB_OFFSET   0x07
 
#define AIRQUALITY2_TVOC_PREDICTION_LSB_OFFSET   0x08
 

Functions

void airquality2_cfg_setup (airquality2_cfg_t *cfg)
 Config Object Initialization function.
 
AIRQUALITY2_RETVAL airquality2_init (airquality2_t *ctx, airquality2_cfg_t *cfg)
 Initialization function.
 
void airquality2_generic_read (airquality2_t *ctx, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t airquality2_get_all_data (airquality2_t *ctx, uint16_t *value_co2, uint16_t *value_tvoc, int32_t *resistance)
 Read all data info function.
 

Detailed Description

This file contains API for Air quality 2 Click driver.