Go to the documentation of this file.
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 TEMPHUM25_CMD_MEAS_SSH_REP_HIGH_CS_EN 0x2C06
74 #define TEMPHUM25_CMD_MEAS_SSH_REP_MID_CS_EN 0x2C0D
75 #define TEMPHUM25_CMD_MEAS_SSH_REP_LOW_CS_EN 0x2C10
76 #define TEMPHUM25_CMD_MEAS_SSH_REP_HIGH_CS_DIS 0x2400
77 #define TEMPHUM25_CMD_MEAS_SSH_REP_MID_CS_DIS 0x240B
78 #define TEMPHUM25_CMD_MEAS_SSH_REP_LOW_CS_DIS 0x2416
79 #define TEMPHUM25_CMD_MEAS_CONT_REP_HIGH_MPS_0_5 0x2032
80 #define TEMPHUM25_CMD_MEAS_CONT_REP_MID_MPS_0_5 0x2024
81 #define TEMPHUM25_CMD_MEAS_CONT_REP_LOW_MPS_0_5 0x202F
82 #define TEMPHUM25_CMD_MEAS_CONT_REP_HIGH_MPS_1 0x2130
83 #define TEMPHUM25_CMD_MEAS_CONT_REP_MID_MPS_1 0x2126
84 #define TEMPHUM25_CMD_MEAS_CONT_REP_LOW_MPS_1 0x212D
85 #define TEMPHUM25_CMD_MEAS_CONT_REP_HIGH_MPS_2 0x2236
86 #define TEMPHUM25_CMD_MEAS_CONT_REP_MID_MPS_2 0x2220
87 #define TEMPHUM25_CMD_MEAS_CONT_REP_LOW_MPS_2 0x222B
88 #define TEMPHUM25_CMD_MEAS_CONT_REP_HIGH_MPS_4 0x2334
89 #define TEMPHUM25_CMD_MEAS_CONT_REP_MID_MPS_4 0x2322
90 #define TEMPHUM25_CMD_MEAS_CONT_REP_LOW_MPS_4 0x2329
91 #define TEMPHUM25_CMD_MEAS_CONT_REP_HIGH_MPS_10 0x2737
92 #define TEMPHUM25_CMD_MEAS_CONT_REP_MID_MPS_10 0x2721
93 #define TEMPHUM25_CMD_MEAS_CONT_REP_LOW_MPS_10 0x272A
94 #define TEMPHUM25_CMD_MEAS_CONT_ART 0x2B32
95 #define TEMPHUM25_CMD_CONT_MEAS_STOP 0x3093
96 #define TEMPHUM25_CMD_FETCH_DATA 0xE000
97 #define TEMPHUM25_CMD_SOFT_RESET 0x30A2
98 #define TEMPHUM25_CMD_HEATER_ENABLE 0x306D
99 #define TEMPHUM25_CMD_HEATER_DISABLE 0x3066
100 #define TEMPHUM25_CMD_GET_SERIAL_NUM_0 0x3780
101 #define TEMPHUM25_CMD_GET_SERIAL_NUM_1 0x3682
102 #define TEMPHUM25_CMD_READ_STATUS 0xF32D
103 #define TEMPHUM25_CMD_CLEAR_STATUS 0x3041
121 #define TEMPHUM25_MAX_RH 100.0f
122 #define TEMPHUM25_MIN_RH 0.0f
123 #define TEMPHUM25_DATA_RESOLUTION 65535.0f
124 #define TEMPHUM25_ABS_MIN_TEMP ( -45.0f )
125 #define TEMPHUM25_ABS_MAX_TEMP ( 130.0f )
132 #define TEMPHUM25_DEVICE_ADDRESS_0 0x44
133 #define TEMPHUM25_DEVICE_ADDRESS_1 0x45
151 #define TEMPHUM25_MAP_MIKROBUS( cfg, mikrobus ) \
152 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
153 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
154 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
155 cfg.alert = MIKROBUS( mikrobus, MIKROBUS_INT )
401 #endif // TEMPHUM25_H
pin_name_t alert
Definition: temphum25.h:190
pin_name_t rst
Definition: temphum25.h:189
uint8_t i2c_address
Definition: temphum25.h:193
uint8_t temphum25_get_alert_pin(temphum25_t *ctx)
TempHum 25 get alert pin function.
err_t temphum25_read_status(temphum25_t *ctx, uint16_t *status)
TempHum 25 read status function.
i2c_master_t i2c
Definition: temphum25.h:173
TempHum 25 Click configuration object.
Definition: temphum25.h:185
pin_name_t sda
Definition: temphum25.h:187
err_t temphum25_init(temphum25_t *ctx, temphum25_cfg_t *cfg)
TempHum 25 initialization function.
pin_name_t scl
Definition: temphum25.h:186
err_t temphum25_enable_heater(temphum25_t *ctx)
TempHum 25 enable heater function.
void temphum25_cfg_setup(temphum25_cfg_t *cfg)
TempHum 25 configuration object setup function.
err_t temphum25_stop_measurement(temphum25_t *ctx)
TempHum 25 stop measurement function.
void temphum25_reset_device(temphum25_t *ctx)
TempHum 25 reset device function.
digital_out_t rst
Definition: temphum25.h:167
err_t temphum25_start_measurement(temphum25_t *ctx, uint16_t meas_cmd)
TempHum 25 start measurement function.
err_t temphum25_disable_heater(temphum25_t *ctx)
TempHum 25 disable heater function.
uint8_t slave_address
Definition: temphum25.h:176
digital_in_t alert
Definition: temphum25.h:170
err_t temphum25_clear_status(temphum25_t *ctx)
TempHum 25 clear status function.
err_t temphum25_soft_reset(temphum25_t *ctx)
TempHum 25 soft reset function.
err_t temphum25_read_measurement(temphum25_t *ctx, float *temperature, float *humidity)
TempHum 25 read measurement function.
@ TEMPHUM25_ERROR
Definition: temphum25.h:204
temphum25_return_value_t
TempHum 25 Click return value data.
Definition: temphum25.h:202
void temphum25_set_rst_pin(temphum25_t *ctx, uint8_t state)
TempHum 25 set rst pin function.
err_t temphum25_read_serial_num(temphum25_t *ctx, uint32_t *serial_num)
TempHum 25 read serial num function.
TempHum 25 Click context object.
Definition: temphum25.h:165
@ TEMPHUM25_OK
Definition: temphum25.h:203
uint32_t i2c_speed
Definition: temphum25.h:192
err_t temphum25_send_command(temphum25_t *ctx, uint16_t cmd)
TempHum 25 send command function.