42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_i2c_master.h"
66#define AIRQUALITY7_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
68 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
69 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
76#define AIRQUALITY7_RETVAL uint8_t
77#define airquality7_err_t uint8_t
79#define AIRQUALITY7_OK 0x00
80#define AIRQUALITY7_INIT_ERROR 0xFF
87#define AIRQUALITY7_CMD_SET_PPMCO2 0x08
88#define AIRQUALITY7_CMD_GET_STATUS 0x0C
89#define AIRQUALITY7_CMD_GET_REVISION 0x0D
90#define AIRQUALITY7_CMD_GET_R0 0x10
97#define AIRQUALITY7_DEV_ADDR 0x70
104#define AIRQUALITY7_ERR_OK 0x00
105#define AIRQUALITY7_ERR_CRC 0x01
112#define AIRQUALITY7_NULL 0x00
113#define AIRQUALITY7_DUMMY 0x00
246 uint32_t *res_val_ohm,
268 uint8_t *ascii_code );
#define airquality7_err_t
Definition airquality7.h:77
#define AIRQUALITY7_RETVAL
Definition airquality7.h:76
void airquality7_generic_write(airquality7_t *ctx, uint8_t *data_buf)
Generic write function.
void airquality7_cfg_setup(airquality7_cfg_t *cfg)
Config Object Initialization function.
airquality7_err_t airquality7_get_revision(airquality7_t *ctx, uint8_t *year, uint8_t *month, uint8_t *day, uint8_t *ascii_code)
Get Revision function.
void airquality7_set_ppmco2(airquality7_t *ctx, uint8_t *ppmco2_value)
Set CO2 [ppm] function.
airquality7_err_t airquality7_get_status(airquality7_t *ctx, uint16_t *tvoc_ppb, uint16_t *co2_ppm, uint32_t *res_val_ohm, uint8_t *err_byte)
Get Status function.
airquality7_err_t airquality7_get_r0_calib(airquality7_t *ctx, uint16_t *r0_kohm)
Get R0 Calibration function.
void airquality7_generic_read(airquality7_t *ctx, uint8_t *data_buf)
Generic read function.
AIRQUALITY7_RETVAL airquality7_init(airquality7_t *ctx, airquality7_cfg_t *cfg)
Initialization function.
Click configuration structure definition.
Definition airquality7.h:147
uint32_t i2c_speed
Definition airquality7.h:159
pin_name_t scl
Definition airquality7.h:150
pin_name_t int_pin
Definition airquality7.h:155
pin_name_t sda
Definition airquality7.h:151
uint8_t i2c_address
Definition airquality7.h:160
Click ctx object definition.
Definition airquality7.h:128
digital_in_t int_pin
Definition airquality7.h:131
i2c_master_t i2c
Definition airquality7.h:135
uint8_t slave_address
Definition airquality7.h:139