sht1x 2.0.0.0
sht1x.h File Reference

This file contains API for SHT1x Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"

Go to the source code of this file.

Data Structures

struct  sht1x_t
 Click ctx object definition. More...
 
struct  sht1x_cfg_t
 Click configuration structure definition. More...
 

Macros

#define SHT1X_MAP_MIKROBUS(cfg, mikrobus)
 
#define SHT1X_RETVAL   uint8_t
 
#define SHT1X_OK   0x00
 
#define SHT1X_INIT_ERROR   0xFF
 
#define SHT1X_MEAS_TEMP   0x03
 
#define SHT1X_MEAS_HUMI   0x05
 
#define SHT1X_STAT_REG_W   0x06
 
#define SHT1X_STAT_REG_R   0x07
 
#define SHT1X_SOFT_RESET   0x1E
 
#define SHT1X_SR_MASK   0x07
 
#define SHT1X_NACK   0
 
#define SHT1X_ACK   1
 
#define SHT1X_D1   -40.1
 
#define SHT1X_D2h   0.01
 
#define SHT1X_D2l   0.04
 
#define SHT1X_V3_C1   -4.0000
 
#define SHT1X_V3_C2h   0.0405
 
#define SHT1X_V3_C3h   -2.8000E-6
 
#define SHT1X_V3_C2l   0.6480
 
#define SHT1X_V3_C3l   -7.2000E-4
 
#define SHT1X_V4_C1   -2.0468
 
#define SHT1X_V4_C2h   0.0367
 
#define SHT1X_V4_C3h   -1.5955E-6
 
#define SHT1X_V4_C2l   0.5872
 
#define SHT1X_V4_C3l   -4.0845E-4
 
#define SHT1X_T1   0.01
 
#define SHT1X_T2h   0.00008
 
#define SHT1X_T2l   0.00128
 

Functions

void sht1x_cfg_setup (sht1x_cfg_t *cfg)
 Config Object Initialization function.
 
SHT1X_RETVAL sht1x_init (sht1x_t *ctx, sht1x_cfg_t *cfg)
 Initialization function.
 
void sht1x_output_sda (sht1x_t *ctx, sht1x_cfg_t *cfg)
 Set pin on output.
 
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.
 
void sht1x_sda_low (sht1x_t *ctx)
 Set SDA low function.
 
uint8_t sht1x_get_sda (sht1x_t *ctx)
 Check SDA state function.
 
void sht1x_scl_high (sht1x_t *ctx)
 Set SCL high function.
 
void sht1x_scl_low (sht1x_t *ctx)
 Set SCL low function.
 
float sht1x_calc_temp (sht1x_t *ctx, uint16_t t)
 Calculate temperature function.
 
float sht1x_calc_humi (sht1x_t *ctx, uint16_t h, uint16_t t)
 Calculate humidity function.
 

Detailed Description

This file contains API for SHT1x Click driver.