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"
73#define ENVIRONMENT4_SGP_CMD_EXE_CONDITIONING 0x2612u
74#define ENVIRONMENT4_SGP_CMD_MEAS_RAW_SIGNALS 0x2619u
75#define ENVIRONMENT4_SGP_CMD_EXE_SELF_TEST 0x280Eu
76#define ENVIRONMENT4_SGP_TURN_HEATER_OFF 0x3615u
77#define ENVIRONMENT4_SGP_GET_SERIAL_NUMBER 0x3682u
83#define ENVIRONMENT4_SHT_CMD_MEAS_TH_HIGH_PREC 0xFD
84#define ENVIRONMENT4_SHT_CMD_MEAS_TH_MED_PREC 0xF6
85#define ENVIRONMENT4_SHT_CMD_MEAS_TH_LOW_PREC 0xE0
86#define ENVIRONMENT4_SHT_CMD_READ_SERIAL_NUM 0x89
87#define ENVIRONMENT4_SHT_CMD_SOFT_RESET 0x94
88#define ENVIRONMENT4_SHT_CMD_ACT_HEATER_200mW_1S 0x39
89#define ENVIRONMENT4_SHT_CMD_ACT_HEATER_200mW_0p1S 0x32
90#define ENVIRONMENT4_SHT_CMD_ACT_HEATER_110mW_1S 0x2F
91#define ENVIRONMENT4_SHT_CMD_ACT_HEATER_110mW_0p1S 0x24
92#define ENVIRONMENT4_SHT_CMD_ACT_HEATER_20mW_1S 0x1E
93#define ENVIRONMENT4_SHT_CMD_ACT_HEATER_20mW_0p1S 0x15
111#define ENVIRONMENT4_SGP_SELF_TEST_OK 0x00
112#define ENVIRONMENT4_SGP_SELF_TEST_VOC_PIXEL 0x01
113#define ENVIRONMENT4_SGP_SELF_TEST_NOX_PIXEL 0x02
114#define ENVIRONMENT4_SGP_SELF_TEST_MASK 0x03
120#define ENVIRONMENT4_SHT_MAX_RH 100.0
121#define ENVIRONMENT4_SHT_MIN_RH 0.0
122#define ENVIRONMENT4_SHT_DATA_RESOLUTION 65535.0
123#define ENVIRONMENT4_SHT_ABS_MIN_TEMP ( -45.0 )
124#define ENVIRONMENT4_SHT_ABS_MAX_TEMP ( 130.0 )
125#define ENVIRONMENT4_SHT_ABS_MIN_HUM ( -6.0 )
126#define ENVIRONMENT4_SHT_ABS_MAX_HUM ( 119.0 )
133#define ENVIRONMENT4_SHT_DEVICE_ADDRESS 0x44
134#define ENVIRONMENT4_SGP_DEVICE_ADDRESS 0x59
152#define ENVIRONMENT4_MAP_MIKROBUS( cfg, mikrobus ) \
153 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
154 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA );
251 uint16_t *sraw_voc );
273 uint16_t *sraw_voc, uint16_t *sraw_nox );
environment4_return_value_t
Environment 4 Click return value data.
Definition environment4.h:192
@ ENVIRONMENT4_OK
Definition environment4.h:193
@ ENVIRONMENT4_ERROR
Definition environment4.h:194
err_t environment4_sht_read_meas_hp(environment4_t *ctx, float *temp, float *hum)
Environment 4 sht read meas hp function.
err_t environment4_sgp_turn_heater_off(environment4_t *ctx)
Environment 4 sgp turn heater off function.
err_t environment4_sgp_get_serial_num(environment4_t *ctx, uint16_t *serial_num)
Environment 4 sgp get serial num function.
void environment4_cfg_setup(environment4_cfg_t *cfg)
Environment 4 configuration object setup function.
err_t environment4_sgp_exe_self_test(environment4_t *ctx, uint8_t *test_result)
Environment 4 sgp exe self test function.
err_t environment4_sht_read_response(environment4_t *ctx, uint8_t *data_out)
Environment 4 sht read response function.
err_t environment4_sgp_exe_conditioning(environment4_t *ctx, uint16_t comp_rh, uint16_t comp_t, uint16_t *sraw_voc)
Environment 4 sgp exe conditioning function.
err_t environment4_init(environment4_t *ctx, environment4_cfg_t *cfg)
Environment 4 initialization function.
err_t environment4_sgp_meas_raw_signals(environment4_t *ctx, uint16_t comp_rh, uint16_t comp_t, uint16_t *sraw_voc, uint16_t *sraw_nox)
Environment 4 sgp meas raw signals function.
err_t environment4_sht_send_cmd(environment4_t *ctx, uint8_t cmd)
Environment 4 sht send cmd function.
err_t environment4_sht_read_serial_num(environment4_t *ctx, uint32_t *serial_num)
Environment 4 sht read serial num function.
err_t environment4_sht_soft_reset(environment4_t *ctx)
Environment 4 sht soft reset function.
Environment 4 Click configuration object.
Definition environment4.h:178
uint32_t i2c_speed
Definition environment4.h:182
pin_name_t scl
Definition environment4.h:179
pin_name_t sda
Definition environment4.h:180
uint8_t i2c_address
Definition environment4.h:183
Environment 4 Click context object.
Definition environment4.h:164
i2c_master_t i2c
Definition environment4.h:166
uint8_t slave_address
Definition environment4.h:169