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 SHT_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
68 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
69 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
70 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
81#define SHT_I2C_ADDR0 0x44
82#define SHT_I2C_ADDR1 0x45
88#define SHT_MPS_05 0x20
92#define SHT_MPS_10 0x27
100#define SHT_RPT_MEDIUM 1
102#define SHT_STR_ENABLE 0x2C
103#define SHT_STR_DISABLE 0x24
110#define SHT_CRC_POLYNOMIAL 0x31
111#define SHT_FETCH_DATA 0xE000
112#define SHT_PERIODIC_ART 0x2B32
113#define SHT_BREAK 0x3093
114#define SHT_SOFT_RESET 0x30A2
115#define SHT_HEATER 0x30
116#define SHT_READ_STATUS 0xF32D
117#define SHT_CLEAR_STATUS1 0x3041
void sht_hw_reset(sht_t *ctx)
Resets device.
void sht_rst_set(sht_t *ctx, uint8_t state)
Int status.
uint8_t sht_cmd_status(sht_t *ctx)
Command Status.
void sht_heater_control(sht_t *ctx, uint8_t state)
Heater State.
void sht_generic_write(sht_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
void sht_software_rst(sht_t *ctx)
Software Reset.
float sht_temp_ss(sht_t *ctx)
Single Shot Temperature Measurement.
uint8_t sht_reset_status(sht_t *ctx)
System Reset.
uint8_t sht_wr_chksum_status(sht_t *ctx)
Checksum Status.
void sht_stop_pm(sht_t *ctx)
Stop Periodic Measurement.
void sht_start_pm(sht_t *ctx)
Start Periodic Measurement.
uint8_t sht_int_get(sht_t *ctx)
Int status.
void sht_reset(sht_t *ctx)
Resets settings.
uint8_t sht_alert_status(sht_t *ctx)
Alert Status.
float sht_hum_pm(sht_t *ctx)
Periodic Mode Humidity.
uint8_t sht_heater_status(sht_t *ctx)
Heater State.
void sht_generic_read(sht_t *ctx, uint8_t *reg, uint8_t *data_buf, uint8_t len)
Generic read function.
float sht_hum_ss(sht_t *ctx)
Single Shot Humidity Measurement.
void sht_clear_status(sht_t *ctx)
Clears Status Register.
err_t sht_init(sht_t *ctx, sht_cfg_t *cfg)
Initialization function.
void sht_set_repeats(sht_t *ctx, uint8_t repeatability)
Sets the repeatability value.
void sht_set_clk_strecth(sht_t *ctx, uint8_t clk_stretching)
Sets the clock stretching state.
void sht_set_mps(sht_t *ctx, uint8_t measure_per_second)
Measurements per Second.
uint8_t sht_temp_status(sht_t *ctx)
Temperature Alert.
void sht_cfg_setup(sht_cfg_t *cfg)
Config Object Initialization function.
float sht_temp_pm(sht_t *ctx)
Periodic Mode Temperature.
uint8_t sht_hum_status(sht_t *ctx)
Humidity Alert.
uint8_t clk_stretching
Definition sht.h:129
uint8_t repeatability
Definition sht.h:130
uint8_t mps
Definition sht.h:131
Click configuration structure definition.
Definition sht.h:161
drv_variables_t vars_cfg
Definition sht.h:175
uint32_t i2c_speed
Definition sht.h:171
pin_name_t scl
Definition sht.h:163
pin_name_t int_pin
Definition sht.h:168
pin_name_t sda
Definition sht.h:164
pin_name_t rst
Definition sht.h:167
uint8_t i2c_address
Definition sht.h:172
Click ctx object definition.
Definition sht.h:139
digital_in_t int_pin
Definition sht.h:144
i2c_master_t i2c
Definition sht.h:147
drv_variables_t vars
Definition sht.h:153
digital_out_t rst
Definition sht.h:141
uint8_t slave_address
Definition sht.h:150