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 TEMPHUM22_CMD_MEAS_TH_HIGH_PREC 0xFD
74#define TEMPHUM22_CMD_MEAS_TH_MED_PREC 0xF6
75#define TEMPHUM22_CMD_MEAS_TH_LOW_PREC 0xE0
76#define TEMPHUM22_CMD_READ_SERIAL_NUM 0x89
77#define TEMPHUM22_CMD_SOFT_RESET 0x94
78#define TEMPHUM22_CMD_ACT_HEATER_200mW_1S 0x39
79#define TEMPHUM22_CMD_ACT_HEATER_200mW_0p1S 0x32
80#define TEMPHUM22_CMD_ACT_HEATER_110mW_1S 0x2F
81#define TEMPHUM22_CMD_ACT_HEATER_110mW_0p1S 0x24
82#define TEMPHUM22_CMD_ACT_HEATER_20mW_1S 0x1E
83#define TEMPHUM22_CMD_ACT_HEATER_20mW_0p1S 0x15
101#define TEMPHUM22_MAX_RH 100.0
102#define TEMPHUM22_MIN_RH 0.0
103#define TEMPHUM22_DATA_RESOLUTION 65535.0
104#define TEMPHUM22_ABS_MIN_TEMP ( -45.0 )
105#define TEMPHUM22_ABS_MAX_TEMP ( 130.0 )
106#define TEMPHUM22_ABS_MIN_HUM ( -6.0 )
107#define TEMPHUM22_ABS_MAX_HUM ( 119.0 )
114#define TEMPHUM22_DEVICE_ADDRESS 0x44
132#define TEMPHUM22_MAP_MIKROBUS( cfg, mikrobus ) \
133 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
134 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA );
err_t temphum22_soft_reset(temphum22_t *ctx)
TempHum 22 soft reset function.
err_t temphum22_read_measurement_high_precision(temphum22_t *ctx, float *temp, float *hum)
TempHum 22 read measurement high precision function.
void temphum22_cfg_setup(temphum22_cfg_t *cfg)
TempHum 22 configuration object setup function.
err_t temphum22_send_cmd(temphum22_t *ctx, uint8_t cmd)
TempHum 22 send cmd function.
err_t temphum22_read_serial_num(temphum22_t *ctx, uint32_t *serial_num)
TempHum 22 read serial num function.
err_t temphum22_init(temphum22_t *ctx, temphum22_cfg_t *cfg)
TempHum 22 initialization function.
err_t temphum22_read_response(temphum22_t *ctx, uint8_t *data_out)
TempHum 22 read response function.
TempHum 22 Click configuration object.
Definition temphum22.h:158
uint32_t i2c_speed
Definition temphum22.h:162
pin_name_t scl
Definition temphum22.h:159
pin_name_t sda
Definition temphum22.h:160
uint8_t i2c_address
Definition temphum22.h:163
TempHum 22 Click context object.
Definition temphum22.h:144
i2c_master_t i2c
Definition temphum22.h:146
uint8_t slave_address
Definition temphum22.h:149
temphum22_return_value_t
TempHum 22 Click return value data.
Definition temphum22.h:172
@ TEMPHUM22_OK
Definition temphum22.h:173
@ TEMPHUM22_ERROR
Definition temphum22.h:174