temphum3 2.0.0.0
temphum3.h File Reference

This file contains API for TempHum 3 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  temphum3_t
 Click ctx object definition. More...
 
struct  temphum3_cfg_t
 Click configuration structure definition. More...
 

Macros

#define TEMPHUM3_MAP_MIKROBUS(cfg, mikrobus)
 
#define TEMPHUM3_OK   0
 
#define TEMPHUM3_ERROR   -1
 
#define TEMPHUM3_MODE_ACTIVE   0x01
 
#define TEMPHUM3_MODE_SLEEP   0x00
 
#define TEMPHUM3_REG_TEMPERATURE   0x00
 
#define TEMPHUM3_REG_HUMIDITY   0x02
 
#define TEMPHUM3_REG_INTERRUPT_DRDY   0x04
 
#define TEMPHUM3_REG_TEMPERATURE_MAX   0x05
 
#define TEMPHUM3_REG_HUMIDITY_MAX   0x06
 
#define TEMPHUM3_REG_INTERRUPT_MASK   0x07
 
#define TEMPHUM3_REG_TEMP_OFFSET_ADJUST   0x08
 
#define TEMPHUM3_REG_HUM_OFFSET_ADJUST   0x09
 
#define TEMPHUM3_REG_TEMP_THRESHOLD_HIGH   0x0A
 
#define TEMPHUM3_REG_HUM_THRESHOLD_HIGH   0x0C
 
#define TEMPHUM3_REG_TEMP_THRESHOLD_LOW   0x0B
 
#define TEMPHUM3_REG_HUM_THRESHOLD_LOW   0x0D
 
#define TEMPHUM3_REG_RST_DRDY_INT_CONF   0x0E
 
#define TEMPHUM3_REG_MEASUREMENT_CONF   0x0F
 
#define TEMPHUM3_REG_MANUFACTURER_ID   0xFC
 
#define TEMPHUM3_REG_DEVICE_ID   0xFE
 
#define TEMPHUM3_STATUS_DRDY   0x80
 
#define TEMPHUM3_STATUS_TEMP_HIGH   0x40
 
#define TEMPHUM3_STATUS_TEMP_LOW   0x20
 
#define TEMPHUM3_STATUS_HUM_HIGH   0x10
 
#define TEMPHUM3_STATUS_HUM_LOW   0x08
 
#define TEMPHUM3_MASK_DRDY   0x80
 
#define TEMPHUM3_MASK_TEMP_HIGH   0x40
 
#define TEMPHUM3_MASK_TEMP_LOW   0x20
 
#define TEMPHUM3_MASK_HUM_HIGH   0x10
 
#define TEMPHUM3_MASK_HUM_LOW   0x08
 
#define TEMPHUM3_CONF_NORMAL_MODE   0x00
 
#define TEMPHUM3_CONF_SOFT_RESET   0x80
 
#define TEMPHUM3_CONF_ODR_NO_REPEATED   0x00
 
#define TEMPHUM3_CONF_ODR_REPEATED_2MIN   0x10
 
#define TEMPHUM3_CONF_ODR_REPEATED_1MIN   0x20
 
#define TEMPHUM3_CONF_ODR_REPEATED_10SEC   0x30
 
#define TEMPHUM3_CONF_ODR_REPEATED_5SEC   0x40
 
#define TEMPHUM3_CONF_ODR_REPEATED_1SEC   0x50
 
#define TEMPHUM3_CONF_ODR_REPEATED_500MS   0x60
 
#define TEMPHUM3_CONF_ODR_REPEATED_200MS   0x70
 
#define TEMPHUM3_CONF_HEATER_OFF   0x00
 
#define TEMPHUM3_CONF_HEATER_ON   0x08
 
#define TEMPHUM3_CONF_INT_DRDY_HIGH_Z   0x00
 
#define TEMPHUM3_CONF_INT_DRDY_ENABLE   0x04
 
#define TEMPHUM3_CONF_INT_POL_LOW   0x00
 
#define TEMPHUM3_CONF_INT_POL_HIGH   0x02
 
#define TEMPHUM3_CONF_INT_MODE_SENSITIVE   0x00
 
#define TEMPHUM3_CONF_INT_MODE_COMPARATOR   0x01
 
#define TEMPHUM3_MCONF_TEMP_RES_14BIT   0x00
 
#define TEMPHUM3_MCONF_TEMP_RES_11BIT   0x40
 
#define TEMPHUM3_MCONF_TEMP_RES_9BIT   0x80
 
#define TEMPHUM3_MCONF_HUM_RES_14BIT   0x00
 
#define TEMPHUM3_MCONF_HUM_RES_11BIT   0x10
 
#define TEMPHUM3_MCONF_HUM_RES_9BIT   0x20
 
#define TEMPHUM3_MCONF_HUM_TEMP   0x00
 
#define TEMPHUM3_MCONF_TEMP_ONLY   0x02
 
#define TEMPHUM3_MCONF_HUM_ONLY   0x04
 
#define TEMPHUM3_MCONF_MEAS_START   0x01
 
#define TEMPHUM3_MCONF_MEAS_NO_ACTION   0x00
 

Functions

void temphum3_cfg_setup (temphum3_cfg_t *cfg)
 Config Object Initialization function.
 
err_t temphum3_init (temphum3_t *ctx, temphum3_cfg_t *cfg)
 Initialization function.
 
void temphum3_default_cfg (temphum3_t *ctx)
 Click Default Configuration function.
 
void temphum3_generic_write (temphum3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void temphum3_generic_read (temphum3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void temphum3_set_mode (temphum3_t *ctx, uint8_t value)
 Set measurement mode function.
 
void temphum3_set_configuration (temphum3_t *ctx, uint8_t value)
 Set configuration function.
 
void temphum3_set_measurement (temphum3_t *ctx, uint8_t value)
 Set measurement function.
 
float temphum3_get_temperature (temphum3_t *ctx)
 Get temperature function.
 
float temphum3_get_humidity (temphum3_t *ctx)
 Get humidity function.
 
uint16_t temphum3_get_id (temphum3_t *ctx)
 Get ID function.
 
uint16_t temphum3_get_manufacturer_id (temphum3_t *ctx)
 Get manufacturer's ID function.
 
uint8_t temphum3_get_status_interrupt (temphum3_t *ctx, uint8_t mask)
 Get interrupt status function.
 
uint8_t temphum3_get_interrupt_mask (temphum3_t *ctx, uint8_t mask)
 Get interrupt mask function.
 
void temphum3_set_offset (temphum3_t *ctx, uint8_t reg, uint8_t value)
 Set offset function.
 
void temphum3_set_high_temp (temphum3_t *ctx, uint8_t temp_data)
 Set high temperature function.
 
void temphum3_set_low_temp (temphum3_t *ctx, uint8_t temp_data)
 Set low temperature function.
 
void temphum3_set_high_hum (temphum3_t *ctx, uint8_t hum_data)
 Set high humidity function.
 
void temphum3_set_low_hum (temphum3_t *ctx, uint8_t hum_data)
 Set low humidity function.
 
float temphum3_get_max_hum (temphum3_t *ctx)
 Get maximum humidity function.
 
float temphum3_get_max_temp (temphum3_t *ctx)
 Get maximum temperature function.
 

Detailed Description

This file contains API for TempHum 3 Click driver.