39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_i2c_master.h"
73#define TEMPHUM24_CMD_TRG_OD_LP0 0x2400u
74#define TEMPHUM24_CMD_TRG_OD_LP1 0x240Bu
75#define TEMPHUM24_CMD_TRG_OD_LP2 0x2416u
76#define TEMPHUM24_CMD_TRG_OD_LP3 0x24FFu
77#define TEMPHUM24_CMD_AUTO_MEAS_HALF_HZ_LP0 0x2032u
78#define TEMPHUM24_CMD_AUTO_MEAS_HALF_HZ_LP1 0x2024u
79#define TEMPHUM24_CMD_AUTO_MEAS_HALF_HZ_LP2 0x202Fu
80#define TEMPHUM24_CMD_AUTO_MEAS_HALF_HZ_LP3 0x20FFu
81#define TEMPHUM24_CMD_AUTO_MEAS_1_HZ_LP0 0x2130u
82#define TEMPHUM24_CMD_AUTO_MEAS_1_HZ_LP1 0x2126u
83#define TEMPHUM24_CMD_AUTO_MEAS_1_HZ_LP2 0x212Du
84#define TEMPHUM24_CMD_AUTO_MEAS_1_HZ_LP3 0x21FFu
85#define TEMPHUM24_CMD_AUTO_MEAS_2_HZ_LP0 0x2236u
86#define TEMPHUM24_CMD_AUTO_MEAS_2_HZ_LP1 0x2220u
87#define TEMPHUM24_CMD_AUTO_MEAS_2_HZ_LP2 0x222Bu
88#define TEMPHUM24_CMD_AUTO_MEAS_2_HZ_LP3 0x22FFu
89#define TEMPHUM24_CMD_AUTO_MEAS_4_HZ_LP0 0x2334u
90#define TEMPHUM24_CMD_AUTO_MEAS_4_HZ_LP1 0x2322u
91#define TEMPHUM24_CMD_AUTO_MEAS_4_HZ_LP2 0x2329u
92#define TEMPHUM24_CMD_AUTO_MEAS_4_HZ_LP3 0x23FFu
93#define TEMPHUM24_CMD_AUTO_MEAS_10_HZ_LP0 0x2737u
94#define TEMPHUM24_CMD_AUTO_MEAS_10_HZ_LP1 0x2721u
95#define TEMPHUM24_CMD_AUTO_MEAS_10_HZ_LP2 0x272Au
96#define TEMPHUM24_CMD_AUTO_MEAS_10_HZ_LP3 0x27FFu
97#define TEMPHUM24_CMD_AUTO_MEAS_EXIT 0x3093u
98#define TEMPHUM24_CMD_AUTO_MEAS_ROUT_T_RH 0xE000u
99#define TEMPHUM24_CMD_AUTO_MEAS_MIN_T 0xE002u
100#define TEMPHUM24_CMD_AUTO_MEAS_MAX_T 0xE003u
101#define TEMPHUM24_CMD_AUTO_MEAS_MIN_RH 0xE004u
102#define TEMPHUM24_CMD_AUTO_MEAS_MAX_RH 0xE005u
103#define TEMPHUM24_CMD_PROGRAM_SET_LOW_ALERT 0x6100u
104#define TEMPHUM24_CMD_PROGRAM_SET_HIGH_ALERT 0x611Du
105#define TEMPHUM24_CMD_PROGRAM_CLEAR_LOW_ALERT 0x610Bu
106#define TEMPHUM24_CMD_PROGRAM_CLEAR_HIGH_ALERT 0x6116u
107#define TEMPHUM24_CMD_TRANSFER_ALERT_THOLDS_TO_NVM 0x6155u
108#define TEMPHUM24_CMD_READ_SET_LOW_ALERT 0xE102u
109#define TEMPHUM24_CMD_READ_SET_HIGH_ALERT 0xE11Fu
110#define TEMPHUM24_CMD_READ_CLEAR_LOW_ALERT 0xE109u
111#define TEMPHUM24_CMD_READ_CLEAR_HIGH_ALERT 0xE114u
112#define TEMPHUM24_CMD_INT_HEATER_ENABLE 0x306Du
113#define TEMPHUM24_CMD_INT_HEATER_DISABLE 0x3066u
114#define TEMPHUM24_CMD_INT_HEATER_CONFIGURE 0x306Eu
115#define TEMPHUM24_CMD_STATUS_READ 0xF32Du
116#define TEMPHUM24_CMD_STATUS_CLEAR 0x3041u
117#define TEMPHUM24_CMD_NVM_T_RH_OFFSET 0xA004u
118#define TEMPHUM24_CMD_SOFT_RESET 0x30A2u
119#define TEMPHUM24_CMD_READ_NIST_ID_BYTES_5_4 0x3683u
120#define TEMPHUM24_CMD_READ_NIST_ID_BYTES_3_2 0x3684u
121#define TEMPHUM24_CMD_READ_NIST_ID_BYTES_1_0 0x3685u
122#define TEMPHUM24_CMD_READ_MANUFACTURER_ID 0x3781u
123#define TEMPHUM24_CMD_OVERRIDE_DEFAULT 0x61BBu
141#define TEMPHUM24_MANUFACTURER_ID 0x3000u
147#define TEMPHUM24_TEMP_MIN ( -45.0f )
148#define TEMPHUM24_TEMP_MAX ( 130.0f )
149#define TEMPHUM24_HUM_MIN ( 0.0f )
150#define TEMPHUM24_HUM_MAX ( 100.0f )
151#define TEMPHUM24_DATA_RESOLUTION 0xFFFFu
158#define TEMPHUM24_DEVICE_ADDRESS_A1A0_00 0x44
159#define TEMPHUM24_DEVICE_ADDRESS_A1A0_01 0x45
160#define TEMPHUM24_DEVICE_ADDRESS_A1A0_10 0x46
161#define TEMPHUM24_DEVICE_ADDRESS_A1A0_11 0x47
179#define TEMPHUM24_MAP_MIKROBUS( cfg, mikrobus ) \
180 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
181 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
182 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
183 cfg.alert = MIKROBUS( mikrobus, MIKROBUS_INT )
void temphum24_disable_device(temphum24_t *ctx)
TempHum 24 disable device function.
err_t temphum24_get_serial_number(temphum24_t *ctx, uint16_t *serial_number)
TempHum 24 read serial number function.
void temphum24_reset_device(temphum24_t *ctx)
TempHum 24 reset device 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_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.
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.
void temphum24_enable_device(temphum24_t *ctx)
TempHum 24 enable device function.
err_t temphum24_write_cmd(temphum24_t *ctx, uint16_t cmd)
TempHum 24 write cmd function.
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_read_single(temphum24_t *ctx, uint16_t *data_out)
TempHum 24 read single 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_write_then_read_single(temphum24_t *ctx, uint16_t cmd, uint16_t *data_out)
TempHum 24 write then read single function.
err_t temphum24_default_cfg(temphum24_t *ctx)
TempHum 24 default configuration 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_read_temp_and_rh(temphum24_t *ctx, float *temp, float *hum)
TempHum 24 read temp and rh function.
err_t temphum24_read_rh_history(temphum24_t *ctx, float *hum_min, float *hum_max)
TempHum 24 read rh history 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.
TempHum 24 Click configuration object.
Definition temphum24.h:213
pin_name_t alert
Definition temphum24.h:218
uint32_t i2c_speed
Definition temphum24.h:220
pin_name_t scl
Definition temphum24.h:214
pin_name_t sda
Definition temphum24.h:215
pin_name_t rst
Definition temphum24.h:217
uint8_t i2c_address
Definition temphum24.h:221
TempHum 24 Click context object.
Definition temphum24.h:193
digital_in_t alert
Definition temphum24.h:198
i2c_master_t i2c
Definition temphum24.h:201
digital_out_t rst
Definition temphum24.h:195
uint8_t slave_address
Definition temphum24.h:204
temphum24_return_value_t
TempHum 24 Click return value data.
Definition temphum24.h:230
@ TEMPHUM24_OK
Definition temphum24.h:231
@ TEMPHUM24_ERROR
Definition temphum24.h:232