39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_i2c_master.h"
62#define AIRQUALITY8_REG_PID 0x00
63#define AIRQUALITY8_REG_CONF 0x20
64#define AIRQUALITY8_REG_PROD_DATA 0x26
65#define AIRQUALITY8_REG_CMD 0x93
66#define AIRQUALITY8_REG_STATUS 0x94
67#define AIRQUALITY8_REG_TRACKING 0x3A
69#define AIRQUALITY8_REG_CFG_H 0x40
70#define AIRQUALITY8_REG_CFG_D 0x50
71#define AIRQUALITY8_REG_CFG_M 0x60
72#define AIRQUALITY8_REG_CFG_S 0x68
73#define AIRQUALITY8_REG_CFG_R 0x97
91#define AIRQUALITY8_PRODUCT_ID 0x6320
97#define AIRQUALITY8_GAS_DETECTION_STRATEGY_AUTO 0
98#define AIRQUALITY8_GAS_DETECTION_STRATEGY_FORCE_O3 1
99#define AIRQUALITY8_GAS_DETECTION_STRATEGY_FORCE_NO2 2
105#define AIRQUALITY8_RCDA_STRATEGY_FIX 0
106#define AIRQUALITY8_RCDA_STRATEGY_SET 1
107#define AIRQUALITY8_RCDA_STRATEGY_ADJ 2
113#define AIRQUALITY8_STATUS_SEQUENCER_RUNNING_MASK 0x80
114#define AIRQUALITY8_STATUS_SLEEP_TIMER_ENABLED_MASK 0x40
115#define AIRQUALITY8_STATUS_ALARM_MASK 0x20
116#define AIRQUALITY8_STATUS_LAST_SEQ_STEP_MASK 0x1F
117#define AIRQUALITY8_STATUS_POR_EVENT_MASK 0x80
118#define AIRQUALITY8_STATUS_ACCESS_CONFLICT_MASK 0x40
125#define AIRQUALITY8_SET_DEV_ADDR 0x33
143#define AIRQUALITY8_MAP_MIKROBUS( cfg, mikrobus ) \
144 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
145 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
146 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST )
airquality8_return_value_t
Air Quality 8 Click return value data.
Definition airquality8.h:193
@ AIRQUALITY8_ERROR_GAS_TIMEOUT
Definition airquality8.h:197
@ AIRQUALITY8_ERROR
Definition airquality8.h:195
@ AIRQUALITY8_ERROR_POR_EVENT
Definition airquality8.h:203
@ AIRQUALITY8_ERROR_SENSOR_UNSUPPORTED
Definition airquality8.h:199
@ AIRQUALITY8_ERROR_INIT_OUT_OF_RANGE
Definition airquality8.h:196
@ AIRQUALITY8_ERROR_CONFIG_MISSING
Definition airquality8.h:200
@ AIRQUALITY8_ERROR_ACCESS_CONFLICT
Definition airquality8.h:202
@ AIRQUALITY8_ERROR_I2C
Definition airquality8.h:198
@ AIRQUALITY8_OK
Definition airquality8.h:194
@ AIRQUALITY8_ERROR_SENSOR
Definition airquality8.h:201
float airquality8_calc_oaq(float *rmox, uint8_t rcda_strategy, uint8_t gas_detection_strategy)
Air Quality 8 calculates AQI 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.
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_start_measurement(airquality8_t *ctx)
Air Quality 8 start measurement 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_measurement(airquality8_t *ctx)
Air Quality 8 init measurement 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_init_sensor(airquality8_t *ctx, uint16_t *mox_lr, uint16_t *mox_er)
Air Quality 8 init sensor function.
void airquality8_cfg_setup(airquality8_cfg_t *cfg)
Air Quality 8 configuration object setup 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.
err_t airquality8_init(airquality8_t *ctx, airquality8_cfg_t *cfg)
Air Quality 8 initialization function.
uint8_t raq_check_interrupt(airquality8_t *ctx)
Air Quality 8 check interrupt function.
Air Quality 8 Click configuration object.
Definition airquality8.h:176
uint32_t i2c_speed
Definition airquality8.h:183
pin_name_t scl
Definition airquality8.h:177
pin_name_t int_pin
Definition airquality8.h:181
pin_name_t sda
Definition airquality8.h:178
pin_name_t rst
Definition airquality8.h:180
uint8_t i2c_address
Definition airquality8.h:184
Air Quality 8 Click context object.
Definition airquality8.h:156
digital_in_t int_pin
Definition airquality8.h:161
i2c_master_t i2c
Definition airquality8.h:164
digital_out_t rst
Definition airquality8.h:158
uint8_t slave_address
Definition airquality8.h:167