temphum24 2.1.0.0
temphum24.h File Reference

This file contains API for TempHum 24 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  temphum24_t
 TempHum 24 Click context object. More...
 
struct  temphum24_cfg_t
 TempHum 24 Click configuration object. More...
 

Macros

#define TEMPHUM24_CMD_TRG_OD_LP0   0x2400u
 TempHum 24 commands list.
 
#define TEMPHUM24_CMD_TRG_OD_LP1   0x240Bu
 
#define TEMPHUM24_CMD_TRG_OD_LP2   0x2416u
 
#define TEMPHUM24_CMD_TRG_OD_LP3   0x24FFu
 
#define TEMPHUM24_CMD_AUTO_MEAS_HALF_HZ_LP0   0x2032u
 
#define TEMPHUM24_CMD_AUTO_MEAS_HALF_HZ_LP1   0x2024u
 
#define TEMPHUM24_CMD_AUTO_MEAS_HALF_HZ_LP2   0x202Fu
 
#define TEMPHUM24_CMD_AUTO_MEAS_HALF_HZ_LP3   0x20FFu
 
#define TEMPHUM24_CMD_AUTO_MEAS_1_HZ_LP0   0x2130u
 
#define TEMPHUM24_CMD_AUTO_MEAS_1_HZ_LP1   0x2126u
 
#define TEMPHUM24_CMD_AUTO_MEAS_1_HZ_LP2   0x212Du
 
#define TEMPHUM24_CMD_AUTO_MEAS_1_HZ_LP3   0x21FFu
 
#define TEMPHUM24_CMD_AUTO_MEAS_2_HZ_LP0   0x2236u
 
#define TEMPHUM24_CMD_AUTO_MEAS_2_HZ_LP1   0x2220u
 
#define TEMPHUM24_CMD_AUTO_MEAS_2_HZ_LP2   0x222Bu
 
#define TEMPHUM24_CMD_AUTO_MEAS_2_HZ_LP3   0x22FFu
 
#define TEMPHUM24_CMD_AUTO_MEAS_4_HZ_LP0   0x2334u
 
#define TEMPHUM24_CMD_AUTO_MEAS_4_HZ_LP1   0x2322u
 
#define TEMPHUM24_CMD_AUTO_MEAS_4_HZ_LP2   0x2329u
 
#define TEMPHUM24_CMD_AUTO_MEAS_4_HZ_LP3   0x23FFu
 
#define TEMPHUM24_CMD_AUTO_MEAS_10_HZ_LP0   0x2737u
 
#define TEMPHUM24_CMD_AUTO_MEAS_10_HZ_LP1   0x2721u
 
#define TEMPHUM24_CMD_AUTO_MEAS_10_HZ_LP2   0x272Au
 
#define TEMPHUM24_CMD_AUTO_MEAS_10_HZ_LP3   0x27FFu
 
#define TEMPHUM24_CMD_AUTO_MEAS_EXIT   0x3093u
 
#define TEMPHUM24_CMD_AUTO_MEAS_ROUT_T_RH   0xE000u
 
#define TEMPHUM24_CMD_AUTO_MEAS_MIN_T   0xE002u
 
#define TEMPHUM24_CMD_AUTO_MEAS_MAX_T   0xE003u
 
#define TEMPHUM24_CMD_AUTO_MEAS_MIN_RH   0xE004u
 
#define TEMPHUM24_CMD_AUTO_MEAS_MAX_RH   0xE005u
 
#define TEMPHUM24_CMD_PROGRAM_SET_LOW_ALERT   0x6100u
 
#define TEMPHUM24_CMD_PROGRAM_SET_HIGH_ALERT   0x611Du
 
#define TEMPHUM24_CMD_PROGRAM_CLEAR_LOW_ALERT   0x610Bu
 
#define TEMPHUM24_CMD_PROGRAM_CLEAR_HIGH_ALERT   0x6116u
 
#define TEMPHUM24_CMD_TRANSFER_ALERT_THOLDS_TO_NVM   0x6155u
 
#define TEMPHUM24_CMD_READ_SET_LOW_ALERT   0xE102u
 
#define TEMPHUM24_CMD_READ_SET_HIGH_ALERT   0xE11Fu
 
#define TEMPHUM24_CMD_READ_CLEAR_LOW_ALERT   0xE109u
 
#define TEMPHUM24_CMD_READ_CLEAR_HIGH_ALERT   0xE114u
 
#define TEMPHUM24_CMD_INT_HEATER_ENABLE   0x306Du
 
#define TEMPHUM24_CMD_INT_HEATER_DISABLE   0x3066u
 
#define TEMPHUM24_CMD_INT_HEATER_CONFIGURE   0x306Eu
 
#define TEMPHUM24_CMD_STATUS_READ   0xF32Du
 
#define TEMPHUM24_CMD_STATUS_CLEAR   0x3041u
 
#define TEMPHUM24_CMD_NVM_T_RH_OFFSET   0xA004u
 
#define TEMPHUM24_CMD_SOFT_RESET   0x30A2u
 
#define TEMPHUM24_CMD_READ_NIST_ID_BYTES_5_4   0x3683u
 
#define TEMPHUM24_CMD_READ_NIST_ID_BYTES_3_2   0x3684u
 
#define TEMPHUM24_CMD_READ_NIST_ID_BYTES_1_0   0x3685u
 
#define TEMPHUM24_CMD_READ_MANUFACTURER_ID   0x3781u
 
#define TEMPHUM24_CMD_OVERRIDE_DEFAULT   0x61BBu
 
#define TEMPHUM24_MANUFACTURER_ID   0x3000u
 TempHum 24 manufacturer ID value.
 
#define TEMPHUM24_TEMP_MIN   ( -45.0f )
 TempHum 24 temperature and humidity calculation values.
 
#define TEMPHUM24_TEMP_MAX   ( 130.0f )
 
#define TEMPHUM24_HUM_MIN   ( 0.0f )
 
#define TEMPHUM24_HUM_MAX   ( 100.0f )
 
#define TEMPHUM24_DATA_RESOLUTION   0xFFFFu
 
#define TEMPHUM24_DEVICE_ADDRESS_A1A0_00   0x44
 TempHum 24 device address setting.
 
#define TEMPHUM24_DEVICE_ADDRESS_A1A0_01   0x45
 
#define TEMPHUM24_DEVICE_ADDRESS_A1A0_10   0x46
 
#define TEMPHUM24_DEVICE_ADDRESS_A1A0_11   0x47
 
#define TEMPHUM24_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  temphum24_return_value_t { TEMPHUM24_OK = 0 , TEMPHUM24_ERROR = -1 }
 TempHum 24 Click return value data. More...
 

Functions

void temphum24_cfg_setup (temphum24_cfg_t *cfg)
 TempHum 24 configuration object setup function.
 
err_t temphum24_init (temphum24_t *ctx, temphum24_cfg_t *cfg)
 TempHum 24 initialization function.
 
err_t temphum24_default_cfg (temphum24_t *ctx)
 TempHum 24 default configuration function.
 
err_t temphum24_write_cmd (temphum24_t *ctx, uint16_t cmd)
 TempHum 24 write cmd function.
 
err_t temphum24_write_cmd_config (temphum24_t *ctx, uint16_t cmd, uint16_t config)
 TempHum 24 write cmd config function.
 
err_t temphum24_read_single (temphum24_t *ctx, uint16_t *data_out)
 TempHum 24 read single function.
 
err_t temphum24_read_multi (temphum24_t *ctx, uint16_t *data1_out, uint16_t *data2_out)
 TempHum 24 read multi function.
 
err_t temphum24_write_then_read_single (temphum24_t *ctx, uint16_t cmd, uint16_t *data_out)
 TempHum 24 write then read single function.
 
err_t temphum24_write_then_read_multi (temphum24_t *ctx, uint16_t cmd, uint16_t *data1_out, uint16_t *data2_out)
 TempHum 24 write then read multi function.
 
void temphum24_enable_device (temphum24_t *ctx)
 TempHum 24 enable device function.
 
void temphum24_disable_device (temphum24_t *ctx)
 TempHum 24 disable device function.
 
void temphum24_reset_device (temphum24_t *ctx)
 TempHum 24 reset device function.
 
uint8_t temphum24_get_alert_pin (temphum24_t *ctx)
 TempHum 24 get alert pin function.
 
err_t temphum24_check_communication (temphum24_t *ctx)
 TempHum 24 check communication function.
 
err_t temphum24_read_temp_and_rh (temphum24_t *ctx, float *temp, float *hum)
 TempHum 24 read temp and rh function.
 
err_t temphum24_read_temp_history (temphum24_t *ctx, float *temp_min, float *temp_max)
 TempHum 24 read temp history function.
 
err_t temphum24_read_rh_history (temphum24_t *ctx, float *hum_min, float *hum_max)
 TempHum 24 read rh history function.
 
err_t temphum24_start_measurement (temphum24_t *ctx)
 TempHum 24 start measurement function.
 
err_t temphum24_stop_measurement (temphum24_t *ctx)
 TempHum 24 stop measurement function.
 
err_t temphum24_get_serial_number (temphum24_t *ctx, uint16_t *serial_number)
 TempHum 24 read serial number function.
 

Detailed Description

This file contains API for TempHum 24 Click Driver.

Enumeration Type Documentation

◆ temphum24_return_value_t

TempHum 24 Click return value data.

Predefined enum values for driver return values.

Enumerator
TEMPHUM24_OK 
TEMPHUM24_ERROR