temphum 2.0.0.0
temphum.h File Reference

This file contains API for Temp Hum 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  temphum_t
 Click ctx object definition. More...
 
struct  temphum_cfg_t
 Click configuration structure definition. More...
 

Macros

#define TEMPHIM_MAP_MIKROBUS(cfg, mikrobus)
 
#define TEMPHIM_RETVAL   uint8_t
 
#define TEMPHIM_OK   0x00
 
#define TEMPHIM_INIT_ERROR   0xFF
 
#define TEMPANDHUM_I2C_ADDRESS   0x5F
 
#define TEMPANDHUM_WHO_AM_I   0x0F
 
#define TEMPANDHUM_AV_CONF   0x10
 
#define TEMPANDHUM_CTRL_REG1   0x20
 
#define TEMPANDHUM_CTRL_REG2   0x21
 
#define TEMPANDHUM_CTRL_REG3   0x22
 
#define TEMPANDHUM_STATUS_REG   0x27
 
#define TEMPANDHUM_HUMIDITY_OUT_L   0x28
 
#define TEMPANDHUM_HUMIDITY_OUT_H   0x29
 
#define TEMPANDHUM_TEMP_OUT_L   0x2A
 
#define TEMPANDHUM_TEMP_OUT_H   0x2B
 
#define TEMPANDHUM_H0_RH_X2   0x30
 
#define TEMPANDHUM_H1_RH_X2   0x31
 
#define TEMPANDHUM_T0_DEGC_X8   0x32
 
#define TEMPANDHUM_T1_DEGC_X8   0x33
 
#define TEMPANDHUM_T1_T0_MSB   0x35
 
#define TEMPANDHUM_H0_T0_OUT_L   0x36
 
#define TEMPANDHUM_H0_T0_OUT_H   0x37
 
#define TEMPANDHUM_H1_T0_OUT_L   0x3A
 
#define TEMPANDHUM_H1_T0_OUT_H   0x3B
 
#define TEMPANDHUM_T0_OUT_L   0x3C
 
#define TEMPANDHUM_T0_OUT_H   0x3D
 
#define TEMPANDHUM_T1_OUT_L   0x3E
 
#define TEMPANDHUM_T1_OUT_H   0x3F
 
#define TEMPANDHUM_AV_CONF_DEFAULT_VALUE   0x1B
 
#define TEMPANDHUM_CTRL_REG1_DEFAULT_VALUE   0x85
 
#define TEMPANDHUM_CTRL_REG2_DEFAULT_VALUE   0x00
 
#define TEMPANDHUM_CTRL_REG3_DEFAULT_VALUE   0x00
 

Functions

void temphum_cfg_setup (temphum_cfg_t *cfg)
 Config Object Initialization function.
 
TEMPHIM_RETVAL temphum_init (temphum_t *ctx, temphum_cfg_t *cfg)
 Initialization function.
 
void temphum_default_cfg (temphum_t *ctx)
 Click Default Configuration function.
 
void temphum_generic_write (temphum_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void temphum_generic_read (temphum_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint16_t temphum_get_hum_data (temphum_t *ctx)
 Gets humidity data function.
 
uint16_t temphum_get_temp_data (temphum_t *ctx)
 Gets temperature data function.
 
void temphum_get_temp_hum (temphum_t *ctx, float *temperature, float *humidity)
 Gets temperature and humidity function.
 
float temphum_get_temperature (temphum_t *ctx)
 Gets temperature in degrees Celsius function.
 
float temphum_get_humidity (temphum_t *ctx)
 Gets humidity in degrees Celsius function.
 

Detailed Description

This file contains API for Temp Hum Click driver.