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 TEMPHUM10_MAP_MIKROBUS( cfg, mikrobus ) \
66 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
67 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
68 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS )
76#define TEMPHUM10_RETVAL uint8_t
78#define TEMPHUM10_OK 0x00
79#define TEMPHUM10_INIT_ERROR 0xFF
86#define TEMPHUM10_REG_DEVICE_RESET 0x00
87#define TEMPHUM10_REG_AVERAGE_MODE 0x01
88#define TEMPHUM10_REG_ERROR_FLAG 0x03
89#define TEMPHUM10_REG_HUMIDITY_LSB 0x04
90#define TEMPHUM10_REG_HUMIDITY_MSB 0x05
91#define TEMPHUM10_REG_TEMPERATURE_LSB 0x06
92#define TEMPHUM10_REG_TEMPERATURE_MSB 0x07
93#define TEMPHUM10_REG_CAPACITY_LSB 0x0A
94#define TEMPHUM10_REG_CAPACITY_MSB 0x0B
95#define TEMPHUM10_REG_CAPACITY_CTRL 0x2C
102#define TEMPHUM10_MODE_SLEEP 0x00
103#define TEMPHUM10_MODE_STANDBY 0x01
110#define TEMPHUM10_RST_NORMAL_OPERATION 0x00
111#define TEMPHUM10_RST_ACTIVE_RESET 0x01
118#define TEMPHUM10_AM_NO_AVERAGING_PROCESS 0x00
119#define TEMPHUM10_AM_TIMES_AVERAGE_MODE_2 0x08
120#define TEMPHUM10_AM_TIMES_AVERAGE_MODE_4 0x10
121#define TEMPHUM10_AM_TIMES_AVERAGE_MODE_8 0x20
122#define TEMPHUM10_AM_TEMP_AVERAGE_MODE_TIMES_8 0x00
123#define TEMPHUM10_AM_TEMP_AVERAGE_MODE_TIMES_16 0x04
124#define TEMPHUM10_AM_MANUAL_MODE_DETECTION_OP_STOP 0x00
125#define TEMPHUM10_AM_MANUAL_MODE_DETECTION_OP_START 0x01
132#define TEMPHUM10_ERR_NO_ERROR 0x00
133#define TEMPHUM10_ERR_ERROR_FLAG_RESET 0x01
140#define TEMPHUM10_CAP_OUTSIDE_CAPACITY_CUTTING 0x00
141#define TEMPHUM10_CAP_OUTSIDE_CAPACITY_CONNECTION 0x10
#define TEMPHUM10_RETVAL
Definition temphum10.h:76
TEMPHUM10_RETVAL temphum10_init(temphum10_t *ctx, temphum10_cfg_t *cfg)
Initialization function.
void temphum10_cfg_setup(temphum10_cfg_t *cfg)
Config Object Initialization function.
void temphum10_set_device_mode(temphum10_t *ctx, uint8_t mode)
Functions for sets Device mode.
float temphum10_get_humidity(temphum10_t *ctx)
Functions for read Relative Huminidy data.
void temphum10_generic_read(temphum10_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
void temphum10_repeat_measurement(temphum10_t *ctx, uint8_t average)
Functions for repeat measurement.
void temphum10_generic_write(temphum10_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
float temphum10_get_temperature(temphum10_t *ctx)
Functions for read Temperature data.
Click configuration structure definition.
Definition temphum10.h:174
uint32_t i2c_speed
Definition temphum10.h:186
pin_name_t scl
Definition temphum10.h:177
pin_name_t sda
Definition temphum10.h:178
pin_name_t cs
Definition temphum10.h:182
uint8_t i2c_address
Definition temphum10.h:187
Click ctx object definition.
Definition temphum10.h:155
digital_out_t cs
Definition temphum10.h:158
i2c_master_t i2c
Definition temphum10.h:162
uint8_t slave_address
Definition temphum10.h:166