temphum2 2.0.0.0
temphum2.h File Reference

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

Macros

#define TEMPHUM2_MAP_MIKROBUS(cfg, mikrobus)
 
#define TEMPHUM2_RETVAL   uint8_t
 
#define TEMPHUM2_OK   0x00
 
#define TEMPHUM2_INIT_ERROR   0xFF
 
#define TEMPHUM2_REG_FIRMWARE_REVISION   0x84F1
 
#define TEMPHUM2_REG_ELECTRONIC_ID_1   0xFA0F
 
#define TEMPHUM2_REG_ELECTRONIC_ID_2   0xFCC9
 
#define TEMPHUM2_REG_SOFT_RESET   0xFE
 
#define TEMPHUM2_REG_TEMPHUM_HM_NORMAL_MODE   0x7CA2
 
#define TEMPHUM2_REG_TEMPHUM_NHM_NORMAL_MODE   0x7866
 
#define TEMPHUM2_REG_TEMPHUM_HM_FAST_MODE   0x6458
 
#define TEMPHUM2_REG_TEMPHUM_NHM_FAST_MODE   0x609C
 
#define TEMPHUM2_REG_QUERY_DEVICE_RESP   0xEFC8
 
#define TEMPHUM2_REG_QUERY_DEVICE_RESP1   0x805D
 
#define TEMPHUM2_REG_WRITE_HEATER_CONTROL   0xE6
 
#define TEMPHUM2_REG_READ_HEATER_CONTROL   0xE7
 
#define QUERY_DEVICE_ERROR   1
 
#define QUERY_DEVICE_OK   0
 
#define TEMPHUM2_HEATER_ENABLE   0x10
 
#define TEMPHUM2_HEATER_DISABLE   0x00
 
#define TEMPHUM2_HEATER_CURRENT_6_4mA   0x00
 
#define TEMPHUM2_HEATER_CURRENT_9_7mA   0x01
 
#define TEMPHUM2_HEATER_CURRENT_13_1mA   0x02
 
#define TEMPHUM2_HEATER_CURRENT_19_6mA   0x04
 
#define TEMPHUM2_HEATER_CURRENT_32_4mA   0x08
 
#define TEMPHUM2_HEATER_CURRENT_53_5mA   0x0F
 
#define TEMPHUM2_NO_HOLD_MODE   0x01
 
#define TEMPHUM2_HOLD_MODE   0x02
 
#define TEMPHUM2_NORMAL_MODE   0x01
 
#define TEMPHUM2_FAST_MODE   0x01
 

Functions

void temphum2_cfg_setup (temphum2_cfg_t *cfg)
 Config Object Initialization function.
 
TEMPHUM2_RETVAL temphum2_init (temphum2_t *ctx, temphum2_cfg_t *cfg)
 Initialization function.
 
void temphum2_default_cfg (temphum2_t *ctx)
 Click Default Configuration function.
 
void temphum2_generic_write (temphum2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void temphum2_generic_read (temphum2_t *ctx, uint8_t *tx_buf, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t temphum2_read_firmware_revision (temphum2_t *ctx)
 This function for reads Firmware Revision.
 
void temhum2_get_eletronic_id (temphum2_t *ctx, uint8_t *electronic_id)
 This function for reads Eletronic ID.
 
uint8_t temphum2_get_query_device (temphum2_t *ctx)
 This function for reads Query Device.
 
void temphum2_set_mode (uint8_t select_mode, uint8_t speed_mode)
 Functions for set measurement mode.
 
void temphum2_get_measurement (temphum2_t *ctx, float *data_buffer)
 Functions for mesurement.
 

Detailed Description

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