42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
65#define SHT1X_MAP_MIKROBUS( cfg, mikrobus ) \
66 cfg.scl= MIKROBUS( mikrobus, MIKROBUS_SCL ); \
67 cfg.sda= MIKROBUS( mikrobus, MIKROBUS_SDA )
75#define SHT1X_RETVAL uint8_t
78#define SHT1X_INIT_ERROR 0xFF
85#define SHT1X_MEAS_TEMP 0x03
86#define SHT1X_MEAS_HUMI 0x05
87#define SHT1X_STAT_REG_W 0x06
88#define SHT1X_STAT_REG_R 0x07
89#define SHT1X_SOFT_RESET 0x1E
96#define SHT1X_SR_MASK 0x07
111#define SHT1X_D1 -40.1
112#define SHT1X_D2h 0.01
113#define SHT1X_D2l 0.04
114#define SHT1X_V3_C1 -4.0000
115#define SHT1X_V3_C2h 0.0405
116#define SHT1X_V3_C3h -2.8000E-6
117#define SHT1X_V3_C2l 0.6480
118#define SHT1X_V3_C3l -7.2000E-4
119#define SHT1X_V4_C1 -2.0468
120#define SHT1X_V4_C2h 0.0367
121#define SHT1X_V4_C3h -1.5955E-6
122#define SHT1X_V4_C2l 0.5872
123#define SHT1X_V4_C3l -4.0845E-4
125#define SHT1X_T2h 0.00008
126#define SHT1X_T2l 0.00128
#define SHT1X_RETVAL
Definition sht1x.h:75
void sht1x_scl_low(sht1x_t *ctx)
Set SCL low function.
float sht1x_calc_temp(sht1x_t *ctx, uint16_t t)
Calculate temperature function.
void sht1x_sda_low(sht1x_t *ctx)
Set SDA low function.
void sht1x_cfg_setup(sht1x_cfg_t *cfg)
Config Object Initialization function.
void sht1x_input_sda(sht1x_t *ctx, sht1x_cfg_t *cfg)
Set pin on input.
void sht1x_sda_high(sht1x_t *ctx)
Set SDA high function.
uint8_t sht1x_get_sda(sht1x_t *ctx)
Check SDA state function.
void sht1x_scl_high(sht1x_t *ctx)
Set SCL high function.
SHT1X_RETVAL sht1x_init(sht1x_t *ctx, sht1x_cfg_t *cfg)
Initialization function.
float sht1x_calc_humi(sht1x_t *ctx, uint16_t h, uint16_t t)
Calculate humidity function.
void sht1x_output_sda(sht1x_t *ctx, sht1x_cfg_t *cfg)
Set pin on output.
Click configuration structure definition.
Definition sht1x.h:154
pin_name_t scl
Definition sht1x.h:157
pin_name_t sda
Definition sht1x.h:158
Click ctx object definition.
Definition sht1x.h:142
digital_out_t sda
Definition sht1x.h:146
digital_out_t scl
Definition sht1x.h:145