42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_i2c_master.h"
65#define TEMPHUM7_MAP_MIKROBUS( cfg, mikrobus ) \
66 cfg.scl = MIKROBUS ( mikrobus, MIKROBUS_SCL ); \
67 cfg.sda = MIKROBUS ( mikrobus, MIKROBUS_SDA )
74#define TEMPHUM7_RETVAL uint8_t
76#define TEMPHUM7_OK 0x00
77#define TEMPHUM7_INIT_ERROR 0xFF
84#define TEMPHUM7_DEVICE_ADDRESS 0x40
91#define TEMPHUM7_HOLD_MASTER_MODE 0x00
92#define TEMPHUM7_NOHOLD_MASTER_MODE 0x01
93#define TEMPHUM7_DATA_FROM_PREVIOUS_RH_MEASUREMENT 0x02
100#define TEMPHUM7_RESET 0xFE
101#define TEMPHUM7_WRITE_RHT_USER_REGISTER_1 0xE6
102#define TEMPHUM7_READ_RHT_USER_REGISTER_1 0xE7
103#define TEMPHUM7_WRITE_HEATER_CONTROL_REGISTER 0x51
104#define TEMPHUM7_READ_HEATER_CONTROL_REGISTER 0x11
111#define TEMPHUM7_RESOLUTION_12_BIT 0x00
112#define TEMPHUM7_RESOLUTION_8_BIT 0x01
113#define TEMPHUM7_RESOLUTION_10_BIT 0x80
114#define TEMPHUM7_RESOLUTION_11_BIT 0x81
115#define TEMPHUM7_HEATER_ENABLE 0x04
116#define TEMPHUM7_HEATER_DISABLE 0x00
123#define TEMPHUM7_HEATER_CURRENT_3p09 0x00
124#define TEMPHUM7_HEATER_CURRENT_9p17 0x01
125#define TEMPHUM7_HEATER_CURRENT_15p24 0x02
126#define TEMPHUM7_HEATER_CURRENT_21p31 0x03
127#define TEMPHUM7_HEATER_CURRENT_27p39 0x04
128#define TEMPHUM7_HEATER_CURRENT_33p46 0x05
129#define TEMPHUM7_HEATER_CURRENT_39p53 0x06
130#define TEMPHUM7_HEATER_CURRENT_45p61 0x07
131#define TEMPHUM7_HEATER_CURRENT_51p68 0x08
132#define TEMPHUM7_HEATER_CURRENT_57p76 0x09
133#define TEMPHUM7_HEATER_CURRENT_63p83 0x0A
134#define TEMPHUM7_HEATER_CURRENT_69p90 0x0B
135#define TEMPHUM7_HEATER_CURRENT_75p98 0x0C
136#define TEMPHUM7_HEATER_CURRENT_82p05 0x0D
137#define TEMPHUM7_HEATER_CURRENT_88p13 0x0E
138#define TEMPHUM7_HEATER_CURRENT_94p20 0x0F
#define TEMPHUM7_RETVAL
Definition temphum7.h:74
void temphum7_reset(temphum7_t *ctx)
Reset.
float temphum7_get_heater_current(temphum7_t *ctx)
Heater current.
void temphum7_get_electronic_serial_number(temphum7_t *ctx, uint8_t *esn_buffer)
Electronic serial number.
uint8_t temphum7_get_firmware_revision(temphum7_t *ctx)
Firmware revision.
void temphum7_default_cfg(temphum7_t *ctx)
Click Default Configuration function.
void temphum7_generic_write(temphum7_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
void temphum7_cfg_setup(temphum7_cfg_t *cfg)
Config Object Initialization function.
TEMPHUM7_RETVAL temphum7_init(temphum7_t *ctx, temphum7_cfg_t *cfg)
Initialization function.
float temphum7_get_temperature(temphum7_t *ctx, uint8_t mode_data)
Temerature.
void temphum7_generic_read(temphum7_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
float temphum7_get_relative_humidity(temphum7_t *ctx, uint8_t mode_data)
Relative humidity.
Click configuration structure definition.
Definition temphum7.h:167
uint32_t i2c_speed
Definition temphum7.h:175
pin_name_t scl
Definition temphum7.h:170
pin_name_t sda
Definition temphum7.h:171
uint8_t i2c_address
Definition temphum7.h:176
Click ctx object definition.
Definition temphum7.h:152
i2c_master_t i2c
Definition temphum7.h:155
uint8_t slave_address
Definition temphum7.h:159