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"
74#define TEMPHUM15_CMD_MEASURE_HIGH_PRECISION 0xFD
75#define TEMPHUM15_CMD_MEASURE_MEDIUM_PRECISION 0xF6
76#define TEMPHUM15_CMD_MEASURE_LOW_PRECISION 0xE0
77#define TEMPHUM15_CMD_READ_SERIAL 0x89
78#define TEMPHUM15_CMD_SOFT_RESET 0x94
79#define TEMPHUM15_CMD_HEATER_HIGHEST_POW_HIGH_DUR 0x39
80#define TEMPHUM15_CMD_HEATER_HIGHEST_POW_LOW_DUR 0x32
81#define TEMPHUM15_CMD_HEATER_MEDIUM_POW_HIGH_DUR 0x2F
82#define TEMPHUM15_CMD_HEATER_MEDIUM_POW_LOW_DUR 0x24
83#define TEMPHUM15_CMD_HEATER_LOWEST_POW_HIGH_DUR 0x1E
84#define TEMPHUM15_CMD_HEATER_LOWEST_POW_LOW_DUR 0x15
103#define TEMPHUM15_SET_DEV_ADDR 0x44
118#define TEMPHUM15_MODE_HIGH_PRECISION 0x00
119#define TEMPHUM15_MODE_MEDIUM_PRECISION 0x01
120#define TEMPHUM15_MODE_LOW_PRECISION 0x02
135#define TEMPHUM15_SUCCESS 0
136#define TEMPHUM15_ERROR -1
154#define TEMPHUM15_MAP_MIKROBUS( cfg, mikrobus ) \
155 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
156 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
err_t temphum15_get_temp_and_hum(temphum15_t *ctx, uint8_t precision_mode, float *temp_val, float *hum_val)
Temp&Hum 15 get temperature and humidity function.
err_t temphum15_generic_write(temphum15_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
Temp&Hum 15 I2C writing function.
err_t temphum15_generic_read(temphum15_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
Temp&Hum 15 I2C reading function.
err_t temphum15_soft_reset(temphum15_t *ctx)
Temp&Hum 15 soft reset function.
err_t temphum15_read_serial(temphum15_t *ctx, uint32_t *serial_number)
Temp&Hum 15 read serial number function.
void temphum15_cfg_setup(temphum15_cfg_t *cfg)
Temp&Hum 15 configuration object setup function.
err_t temphum15_init(temphum15_t *ctx, temphum15_cfg_t *cfg)
Temp&Hum 15 initialization function.
err_t temphum15_default_cfg(temphum15_t *ctx)
Temp&Hum 15 default configuration function.
Temp&Hum 15 Click configuration object.
Definition temphum15.h:182
uint32_t i2c_speed
Definition temphum15.h:186
pin_name_t scl
Definition temphum15.h:183
pin_name_t sda
Definition temphum15.h:184
uint8_t i2c_address
Definition temphum15.h:187
Temp&Hum 15 Click context object.
Definition temphum15.h:166
i2c_master_t i2c
Definition temphum15.h:169
uint8_t slave_address
Definition temphum15.h:173