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 TEMPHUM9_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
68 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
77#define TEMPHUM9_ERROR -1
84#define TEMPHUM9_DEVICE_ADDRESS 0x70
92#define TEMPHUM9_NORMAL_MODE 0x00
93#define TEMPHUM9_LOW_POWER_MODE 0x01
101#define TEMPHUM9_SINGLE_DATA 0x03
102#define TEMPHUM9_DUAL_DATA 0x06
109#define TEMPHUM9_SLEEP 0xB098
110#define TEMPHUM9_WAKEUP 0x3517
111#define TEMPHUM9_SOFT_RESET 0x805D
112#define TEMPHUM9_GENERAL_CALL_RESET 0x0006
113#define TEMPHUM9_READ_ID 0xEFC8
void temphum9_read_register(temphum9_t *ctx, uint16_t address, uint8_t num_data, uint16_t *data_out)
Readinig register content.
err_t temphum9_init(temphum9_t *ctx, temphum9_cfg_t *cfg)
Initialization function.
void temphum9_send_command(temphum9_t *ctx, uint16_t command)
Issuing a command.
void temphum9_cfg_setup(temphum9_cfg_t *cfg)
Config Object Initialization function.
void temhum9_get_data(temphum9_t *ctx, uint8_t data_mode, float *temp, float *hum)
Calculating temperature and relative humidity.
float temphum9_get_temperature(temphum9_t *ctx, uint8_t data_mode)
Calculating temperature.
float temphum9_get_humidity(temphum9_t *ctx, uint8_t data_mode)
Calculating relative humidity.
Click configuration structure definition.
Definition temphum9.h:140
uint32_t i2c_speed
Definition temphum9.h:146
pin_name_t scl
Definition temphum9.h:142
pin_name_t sda
Definition temphum9.h:143
uint8_t i2c_address
Definition temphum9.h:147
Click ctx object definition.
Definition temphum9.h:127
i2c_master_t i2c
Definition temphum9.h:129
uint8_t slave_address
Definition temphum9.h:132