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"
74#define OZONE3_REG_STATUS 0x00
75#define OZONE3_REG_LOCK 0x01
76#define OZONE3_REG_TIACN 0x10
77#define OZONE3_REG_REFCN 0x11
78#define OZONE3_REG_MODECN 0x12
101#define OZONE3_WRITE_MODE 0x00
102#define OZONE3_READ_ONLY_MODE 0x01
108#define OZONE3_RES_TIA_EXT 0x00
109#define OZONE3_RES_TIA_2750_Ohm 0x04
110#define OZONE3_RES_TIA_3500_Ohm 0x08
111#define OZONE3_RES_TIA_7K_Ohm 0x0C
112#define OZONE3_RES_TIA_14K_Ohm 0x10
113#define OZONE3_RES_TIA_35K_Ohm 0x14
114#define OZONE3_RES_TIA_120K_Ohm 0x18
115#define OZONE3_RES_TIA_350K_Ohm 0x1C
116#define OZONE3_RES_LOAD_10_Ohm 0x00
117#define OZONE3_RES_LOAD_33_Ohm 0x01
118#define OZONE3_RES_LOAD_50_Ohm 0x02
119#define OZONE3_RES_LOAD_100_Ohm 0x03
125#define OZONE3_VREF_INT 0x00
126#define OZONE3_VREF_EXT 0x80
127#define OZONE3_PERCENTS_INT_ZERO_20 0x00
128#define OZONE3_PERCENTS_INT_ZERO_50 0x20
129#define OZONE3_PERCENTS_INT_ZERO_67 0x40
130#define OZONE3_INT_ZERO_BYPASSED 0x60
131#define OZONE3_BIAS_POL_NEGATIVE 0x00
132#define OZONE3_BIAS_POL_POSITIVE 0x10
133#define OZONE3_PERCENTS_BIAS_0 0x00
134#define OZONE3_PERCENTS_BIAS_1 0x01
135#define OZONE3_PERCENTS_BIAS_2 0x02
136#define OZONE3_PERCENTS_BIAS_4 0x03
137#define OZONE3_PERCENTS_BIAS_6 0x04
138#define OZONE3_PERCENTS_BIAS_8 0x05
139#define OZONE3_PERCENTS_BIAS_10 0x06
140#define OZONE3_PERCENTS_BIAS_12 0x07
141#define OZONE3_PERCENTS_BIAS_14 0x08
142#define OZONE3_PERCENTS_BIAS_16 0x09
143#define OZONE3_PERCENTS_BIAS_18 0x0A
144#define OZONE3_PERCENTS_BIAS_20 0x0B
145#define OZONE3_PERCENTS_BIAS_22 0x0C
146#define OZONE3_PERCENTS_BIAS_24 0x0D
147#define OZONE3_FET_DIS 0x00
148#define OZONE3_FET_EN 0x80
149#define OZONE3_DEEP_SLEEP_MODE 0x00
150#define OZONE3_LEAD_MODE_2 0x01
151#define OZONE3_STANDBY_MODE 0x02
152#define OZONE3_LEAD_MODE_3 0x03
153#define OZONE3_TEMP_MODE_TIA_OFF 0x06
154#define OZONE3_TEMP_MODE_TIA_ON 0x07
155#define OZONE3_DEVICE_ENABLE 0x00
156#define OZONE3_DEVICE_DISABLE 0x01
163#define OZONE3_SET_DEV_ADDR 0x48
164#define OZONE3_ADC_DEVICE_ADDR 0x4D
182#define OZONE3_MAP_MIKROBUS( cfg, mikrobus ) \
183 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
184 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
185 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN ); \
186 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST )
err_t ozone3_default_cfg(ozone3_t *ctx)
Ozone 3 default configuration function.
err_t ozone3_generic_write(ozone3_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
Ozone 3 I2C writing function.
err_t ozone3_enable(ozone3_t *ctx, uint8_t state)
Ozone 3 enable function.
err_t ozone3_init(ozone3_t *ctx, ozone3_cfg_t *cfg)
Ozone 3 initialization function.
uint16_t ozone3_read_adc(ozone3_t *ctx)
Ozone 3 read ADC function.
err_t ozone3_write_byte(ozone3_t *ctx, uint8_t reg, uint8_t dev_data)
Ozone 3 write byte function.
float ozone3_get_o3_ppm(ozone3_t *ctx)
Ozone 3 get O3 ppm function.
uint8_t ozone3_read_byte(ozone3_t *ctx, uint8_t reg)
Ozone 3 read byte function.
void ozone3_wait_ready(ozone3_t *ctx)
Ozone 3 wait ready function.
void ozone3_cfg_setup(ozone3_cfg_t *cfg)
Ozone 3 configuration object setup function.
err_t ozone3_generic_read(ozone3_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
Ozone 3 I2C reading function.
ozone3_return_value_t
Ozone 3 Click return value data.
Definition ozone3.h:237
@ OZONE3_OK
Definition ozone3.h:238
@ OZONE3_ERROR
Definition ozone3.h:239
Ozone 3 Click configuration object.
Definition ozone3.h:220
uint32_t i2c_speed
Definition ozone3.h:227
pin_name_t scl
Definition ozone3.h:221
pin_name_t sda
Definition ozone3.h:222
pin_name_t rst
Definition ozone3.h:225
pin_name_t an
Definition ozone3.h:224
uint8_t i2c_address
Definition ozone3.h:228
Ozone 3 Click context object.
Definition ozone3.h:196
i2c_master_t i2c
Definition ozone3.h:207
digital_in_t an
Definition ozone3.h:203
digital_out_t rst
Definition ozone3.h:199
uint8_t slave_address
Definition ozone3.h:211