temphum12 2.0.0.0
temphum12.h File Reference

This file contains API for Temp&Hum 12 Click driver. More...

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

Go to the source code of this file.

Data Structures

struct  temphum12_t
 Click ctx object definition. More...
 
struct  temphum12_cfg_t
 Click configuration structure definition. More...
 

Macros

#define TEMPHUM12_MAP_MIKROBUS(cfg, mikrobus)
 
#define TEMPHUM12_RETVAL   uint8_t
 
#define TEMPHUM12_OK   0x00
 
#define TEMPHUM12_INIT_ERROR   0xFF
 
#define TEMPHUM12_REG_TEMPERATURE_LSB   0x00
 
#define TEMPHUM12_REG_TEMPERATURE_MSB   0x01
 
#define TEMPHUM12_REG_HUMIDITY_LSB   0x02
 
#define TEMPHUM12_REG_HUMIDITY_MSB   0x03
 
#define TEMPHUM12_REG_DRDY_INTERRUPT   0x04
 
#define TEMPHUM12_REG_TEMP_MAX   0x05
 
#define TEMPHUM12_REG_HUM_MAX   0x06
 
#define TEMPHUM12_REG_INT_ENABLE   0x07
 
#define TEMPHUM12_REG_TEMP_OFFSET   0x08
 
#define TEMPHUM12_REG_HUM_OFFSET   0x09
 
#define TEMPHUM12_REG_TEMP_THR_LSB   0x0A
 
#define TEMPHUM12_REG_TEMP_THR_MSB   0x0B
 
#define TEMPHUM12_REG_HUM_THR_LSB   0x0C
 
#define TEMPHUM12_REG_HUM_THR_MSB   0x0D
 
#define TEMPHUM12_REG_DRDY_INT_CONFIG   0x0E
 
#define TEMPHUM12_REG_CONFIGURATION   0x0F
 
#define TEMPHUM12_REG_MANUFACTURER_ID_LSB   0xFC
 
#define TEMPHUM12_REG_MANUFACTURER_ID_MSB   0xFD
 
#define TEMPHUM12_REG_DEVICE_ID_LSB   0xFE
 
#define TEMPHUM12_REG_DEVICE_ID_MSB   0xFF
 
#define TEMPHUM12_REG_DATA_TEMPERATURE   0x00
 
#define TEMPHUM12_REG_DATA_HUMIDITY   0x02
 
#define TEMPHUM12_REG_DATA_TEMP_THR   0x0A
 
#define TEMPHUM12_REG_DATA_HUM_THR   0x0C
 
#define TEMPHUM12_REG_DATA_MANUFACTURER_ID   0xFC
 
#define TEMPHUM12_REG_DATA_DEVICE_ID   0xFE
 
#define TEMPHUM12_INT_STATUS_DRDY   0x80
 
#define TEMPHUM12_INT_STATUS_TEMP_THR_HIGH   0x40
 
#define TEMPHUM12_INT_STATUS_TEMP_THR_LOW   0x20
 
#define TEMPHUM12_INT_STATUS_HUM_THR_HIGH   0x10
 
#define TEMPHUM12_INT_STATUS_HUM_THR_LOW   0x08
 
#define TEMPHUM12_INTE_DRDY_ENABLE   0x80
 
#define TEMPHUM12_INTE_DRDY_DISABLE   0x00
 
#define TEMPHUM12_INTE_TEMP_TH_ENABLE   0x40
 
#define TEMPHUM12_INTE_TEMP_TH_DISABLE   0x00
 
#define TEMPHUM12_INTE_TEMP_TL_ENABLE   0x20
 
#define TEMPHUM12_INTE_TEMP_TL_DISABLE   0x00
 
#define TEMPHUM12_INTE_HUM_TH_ENABLE   0x10
 
#define TEMPHUM12_INTE_HUM_TH_DISABLE   0x00
 
#define TEMPHUM12_INTE_HUM_TL_ENABLE   0x08
 
#define TEMPHUM12_INTE_HUM_TL_DISABLE   0x00
 
#define TEMPHUM12_TO_PLUS_0_16C   0x01
 
#define TEMPHUM12_TO_PLUS_0_32C   0x02
 
#define TEMPHUM12_TO_PLUS_0_64C   0x04
 
#define TEMPHUM12_TO_PLUS_1_28C   0x08
 
#define TEMPHUM12_TO_PLUS_2_58C   0x10
 
#define TEMPHUM12_TO_PLUS_5_16C   0x20
 
#define TEMPHUM12_TO_PLUS_10_32C   0x40
 
#define TEMPHUM12_TO_MINUS_20_62C   0x80
 
#define TEMPHUM12_RHO_PLUS_0_2RH   0x01
 
#define TEMPHUM12_RHO_PLUS_0_4RH   0x02
 
#define TEMPHUM12_RHO_PLUS_0_8RH   0x04
 
#define TEMPHUM12_RHO_PLUS_1_6RH   0x08
 
#define TEMPHUM12_RHO_PLUS_3_1RH   0x10
 
#define TEMPHUM12_RHO_PLUS_6_3RH   0x20
 
#define TEMPHUM12_RHO_PLUS_12_5RH   0x40
 
#define TEMPHUM12_RHO_MINUS_25RH   0x80
 
#define TEMPHUM12_ICFG_NORAML_OPERATION   0x00
 
#define TEMPHUM12_ICFG_SOFTWARE_RESET   0x80
 
#define TEMPHUM12_ICFG_AMM_1_120Hz   0x10
 
#define TEMPHUM12_ICFG_AMM_1_60Hz   0x20
 
#define TEMPHUM12_ICFG_AMM_0p1Hz   0x30
 
#define TEMPHUM12_ICFG_AMM_0p2Hz   0x40
 
#define TEMPHUM12_ICFG_AMM_1Hz   0x50
 
#define TEMPHUM12_ICFG_AMM_2Hz   0x60
 
#define TEMPHUM12_ICFG_AMM_5Hz   0x70
 
#define TEMPHUM12_ICFG_HEATER_DISABLE   0x00
 
#define TEMPHUM12_ICFG_HEATER_ENABLE   0x08
 
#define TEMPHUM12_ICFG_DRDY_ENABLE   0x04
 
#define TEMPHUM12_ICFG_INT_ACTIVE_LOW   0x00
 
#define TEMPHUM12_ICFG_INT_ACTIVE_HIGH   0x02
 
#define TEMPHUM12_ICFG_LEVEL_SENSITIVE   0x00
 
#define TEMPHUM12_ICFG_COMPARATOR_MODE   0x01
 
#define TEMPHUM12_MCFG_TEMP_RES_14bit   0x00
 
#define TEMPHUM12_MCFG_TEMP_RES_11bit   0x40
 
#define TEMPHUM12_MCFG_TEMP_RES_8bit   0x80
 
#define TEMPHUM12_MCFG_HUM_RES_14bit   0x00
 
#define TEMPHUM12_MCFG_HUM_RES_11bit   0x10
 
#define TEMPHUM12_MCFG_HUM_RES_8bit   0x20
 
#define TEMPHUM12_MCFG_TEMP_HUM_READ   0x00
 
#define TEMPHUM12_MCFG_TEMP_ONLY   0x02
 
#define TEMPHUM12_MCFG_HUM_ONLY   0x04
 
#define TEMPHUM12_MCFG_TRIG_NO_ACTION   0x00
 
#define TEMPHUM12_MCFG_TRIG_START_MEASUREMENT   0x01
 
#define TEMPHUM12_MANUFACTURER_ID   0x4954
 
#define TEMPHUM12_DEVICE_ID   0x07D0
 
#define TEMPHUM12_DEVICE_SLAVE_ADDRESS   0x40
 
#define TEMPHUM12_TEMP_IN_CELSIUS   0x00
 
#define TEMPHUM12_TEMP_IN_KELVIN   0x01
 
#define TEMPHUM12_TEMP_IN_FAHRENHEIT   0x02
 

Functions

void temphum12_cfg_setup (temphum12_cfg_t *cfg)
 Config Object Initialization function.
 
TEMPHUM12_RETVAL temphum12_init (temphum12_t *ctx, temphum12_cfg_t *cfg)
 Initialization function.
 
void temphum12_default_cfg (temphum12_t *ctx)
 Click Default Configuration function.
 
void temphum12_generic_write (temphum12_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void temphum12_generic_read (temphum12_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
float temphum12_get_temperature (temphum12_t *ctx, uint8_t temp_in)
 Temperature data.
 
float temphum12_get_humidity (temphum12_t *ctx)
 Relative Huminidy data.
 
uint8_t temphum12_get_intrrupt_state (temphum12_t *ctx)
 Interrupt state.
 

Detailed Description

This file contains API for Temp&Hum 12 Click driver.