sht  2.0.0.0
Data Structures | Macros | Functions
sht.h File Reference

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

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

Go to the source code of this file.

Data Structures

struct  drv_variables_t
 
struct  sht_t
 Click ctx object definition. More...
 
struct  sht_cfg_t
 Click configuration structure definition. More...
 

Macros

#define SHT_MAP_MIKROBUS(cfg, mikrobus)
 
#define SHT_OK   0x00
 
#define SHT_ERROR   0xFF
 
#define SHT_I2C_ADDR0   0x44
 
#define SHT_I2C_ADDR1   0x45
 
#define SHT_MPS_05   0x20
 
#define SHT_MPS_1   0x21
 
#define SHT_MPS_2   0x22
 
#define SHT_MPS_4   0x23
 
#define SHT_MPS_10   0x27
 
#define SHT_RPT_HIGH   0
 
#define SHT_RPT_MEDIUM   1
 
#define SHT_RPT_LOW   2
 
#define SHT_STR_ENABLE   0x2C
 
#define SHT_STR_DISABLE   0x24
 
#define SHT_CRC_POLYNOMIAL   0x31
 
#define SHT_FETCH_DATA   0xE000
 
#define SHT_PERIODIC_ART   0x2B32
 
#define SHT_BREAK   0x3093
 
#define SHT_SOFT_RESET   0x30A2
 
#define SHT_HEATER   0x30
 
#define SHT_READ_STATUS   0xF32D
 
#define SHT_CLEAR_STATUS1   0x3041
 

Functions

void sht_cfg_setup (sht_cfg_t *cfg)
 Config Object Initialization function. More...
 
err_t sht_init (sht_t *ctx, sht_cfg_t *cfg)
 Initialization function. More...
 
void sht_generic_write (sht_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function. More...
 
void sht_generic_read (sht_t *ctx, uint8_t *reg, uint8_t *data_buf, uint8_t len)
 Generic read function. More...
 
void sht_reset (sht_t *ctx)
 Resets settings. More...
 
void sht_hw_reset (sht_t *ctx)
 Resets device. More...
 
uint8_t sht_int_get (sht_t *ctx)
 Int status. More...
 
void sht_rst_set (sht_t *ctx, uint8_t state)
 Int status. More...
 
void sht_set_clk_strecth (sht_t *ctx, uint8_t clk_stretching)
 Sets the clock stretching state. More...
 
void sht_set_repeats (sht_t *ctx, uint8_t repeatability)
 Sets the repeatability value. More...
 
void sht_set_mps (sht_t *ctx, uint8_t measure_per_second)
 Measurements per Second. More...
 
float sht_temp_ss (sht_t *ctx)
 Single Shot Temperature Measurement. More...
 
float sht_hum_ss (sht_t *ctx)
 Single Shot Humidity Measurement. More...
 
void sht_start_pm (sht_t *ctx)
 Start Periodic Measurement. More...
 
float sht_temp_pm (sht_t *ctx)
 Periodic Mode Temperature. More...
 
float sht_hum_pm (sht_t *ctx)
 Periodic Mode Humidity. More...
 
void sht_stop_pm (sht_t *ctx)
 Stop Periodic Measurement. More...
 
void sht_software_rst (sht_t *ctx)
 Software Reset. More...
 
void sht_heater_control (sht_t *ctx, uint8_t state)
 Heater State. More...
 
void sht_clear_status (sht_t *ctx)
 Clears Status Register. More...
 
uint8_t sht_alert_status (sht_t *ctx)
 Alert Status. More...
 
uint8_t sht_heater_status (sht_t *ctx)
 Heater State. More...
 
uint8_t sht_hum_status (sht_t *ctx)
 Humidity Alert. More...
 
uint8_t sht_temp_status (sht_t *ctx)
 Temperature Alert. More...
 
uint8_t sht_reset_status (sht_t *ctx)
 System Reset. More...
 
uint8_t sht_cmd_status (sht_t *ctx)
 Command Status. More...
 
uint8_t sht_wr_chksum_status (sht_t *ctx)
 Checksum Status. More...
 

Detailed Description

This file contains API for SHT Click driver.