Go to the documentation of this file.
42 #ifdef PREINIT_SUPPORTED
46 #ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52 #include "drv_digital_out.h"
53 #include "drv_digital_in.h"
54 #include "drv_i2c_master.h"
66 #define TEMPHUM13_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
68 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
75 #define TEMPHUM13_RETVAL uint8_t
77 #define TEMPHUM13_OK 0x00
78 #define TEMPHUM13_INIT_ERROR 0xFF
85 #define TEMPHUM13_DEVICE_ADDRESS 0x40
92 #define TEMPHUM13_CMD_TRIG_TEMP_MEAS_HOLD 0xE3
93 #define TEMPHUM13_CMD_TRIG_HUMI_MEAS_HOLD 0xE5
94 #define TEMPHUM13_CMD_TRIG_TEMP_MEAS_NOHOLD 0xF3
95 #define TEMPHUM13_CMD_TRIG_HUMI_MEAS_NOHOLD 0xF5
96 #define TEMPHUM13_CMD_WRITE_USER_REG 0xE6
97 #define TEMPHUM13_CMD_READ_USER_REG 0xE7
98 #define TEMPHUM13_CMD_SOFT_RESET 0xFE
106 #define TEMPHUM13_HEATER_ENABLE 0x01
107 #define TEMPHUM13_HEATER_DISABLE 0x00
114 #define TEMPHUM13_RESOLUTION_8 0x01
115 #define TEMPHUM13_RESOLUTION_10 0x80
116 #define TEMPHUM13_RESOLUTION_11 0x81
117 #define TEMPHUM13_RESOLUTION_12 0x00
124 #define TEMPHUM13_OTP_DISABLE 0x01
125 #define TEMPHUM13_OTP_ENABLE 0x00
342 #endif // _TEMPHUM13_H_
void temphum13_generic_read(temphum13_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
uint8_t slave_address
Definition: temphum13.h:147
void temphum13_soft_reset(temphum13_t *ctx)
Software reset.
Click configuration structure definition.
Definition: temphum13.h:155
void temphum13_generic_write(temphum13_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
#define TEMPHUM13_RETVAL
Definition: temphum13.h:75
pin_name_t scl
Definition: temphum13.h:158
pin_name_t sda
Definition: temphum13.h:159
uint32_t i2c_speed
Definition: temphum13.h:163
uint8_t temphum13_enable_heater(temphum13_t *ctx, uint8_t enable_heater)
Enable heater.
uint8_t i2c_address
Definition: temphum13.h:164
float temphum13_get_humidity(temphum13_t *ctx)
Get humidity value.
float temphum13_get_temperature(temphum13_t *ctx)
Get temperature value.
uint8_t temphum13_disable_otp_reload(temphum13_t *ctx, uint8_t disable_otp_rel)
Disable OTP.
void temphum13_cfg_setup(temphum13_cfg_t *cfg)
Config Object Initialization function.
Click ctx object definition.
Definition: temphum13.h:140
TEMPHUM13_RETVAL temphum13_init(temphum13_t *ctx, temphum13_cfg_t *cfg)
Initialization function.
uint8_t temphum13_get_user_register(temphum13_t *ctx)
Get user register value.
i2c_master_t i2c
Definition: temphum13.h:143
void temphum13_default_cfg(temphum13_t *ctx)
Click Default Configuration function.
void temphum13_set_user_register(temphum13_t *ctx, uint8_t register_content)
Set user register.
uint8_t temphum13_change_resolution(temphum13_t *ctx, uint8_t meas_res)
Change measurement resolution.