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 TEMPHUM11_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
68 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
75#define TEMPHUM11_RETVAL uint8_t
77#define TEMPHUM11_OK 0x00
78#define TEMPHUM11_INIT_ERROR 0xFF
85#define TEMPHUM11_REG_TEMPERATURE 0x00
86#define TEMPHUM11_REG_HUMIDITY 0x01
87#define TEMPHUM11_REG_CONFIGURATION 0x02
88#define TEMPHUM11_REG_SERIAL_ID_0 0xFB
89#define TEMPHUM11_REG_SERIAL_ID_1 0xFC
90#define TEMPHUM11_REG_SERIAL_ID_2 0xFD
91#define TEMPHUM11_REG_MANUFACTURER_ID 0xFE
92#define TEMPHUM11_REG_DEVICE_ID 0xFF
99#define TEMPHUM11_NORMAL_OPERATION 0x0000
100#define TEMPHUM11_SOFTWARE_RESET 0x8000
101#define TEMPHUM11_HEATER_DISABLED 0x0000
102#define TEMPHUM11_HEATER_ENABLED 0x2000
103#define TEMPHUM11_TEMP_HUM_ACQUIRED 0x0000
104#define TEMPHUM11_TEMP_FIRST 0x1000
105#define TEMPHUM11_BAT_VOLT_BIGGER_THAN_2p8 0x0000
106#define TEMPHUM11_BAT_VOLT_SMALLER_THAN_2p8 0x0800
107#define TEMPHUM11_TEMP_RESOLUTION_14bit 0x0000
108#define TEMPHUM11_TEMP_RESOLUTION_11bit 0x0400
109#define TEMPHUM11_HUM_RESOLUTION_14bit 0x0000
110#define TEMPHUM11_HUM_RESOLUTION_11bit 0x0100
111#define TEMPHUM11_HUM_RESOLUTION_8bit 0x0200
118#define TEMPHUM11_DEVICE_SLAVE_ADDR 0x40
125#define TEMPHUM11_DEVICE_ID 0x1050
126#define TEMPHUM11_MANUFACTURER_ID 0x5449
133#define TEMPHUM11_TEMP_IN_CELSIUS 0x00
134#define TEMPHUM11_TEMP_IN_KELVIN 0x01
135#define TEMPHUM11_TEMP_IN_FAHRENHEIT 0x02
#define TEMPHUM11_RETVAL
Definition temphum11.h:75
float temphum11_get_humidity(temphum11_t *ctx)
Functions for reading Relative Huminidy data.
void temphum11_write_config(temphum11_t *ctx, uint16_t config)
Function for writing configuration device for measurement.
void temphum11_default_cfg(temphum11_t *ctx)
Click Default Configuration function.
uint16_t temphum11_read_data(temphum11_t *ctx, uint8_t reg)
Functions for reading data from registers.
TEMPHUM11_RETVAL temphum11_init(temphum11_t *ctx, temphum11_cfg_t *cfg)
Initialization function.
void temphum11_cfg_setup(temphum11_cfg_t *cfg)
Config Object Initialization function.
float temphum11_get_temperature(temphum11_t *ctx, uint8_t temp_in)
Functions for reading Temperature data.
Click configuration structure definition.
Definition temphum11.h:163
uint32_t i2c_speed
Definition temphum11.h:171
pin_name_t scl
Definition temphum11.h:166
pin_name_t sda
Definition temphum11.h:167
uint8_t i2c_address
Definition temphum11.h:172
Click ctx object definition.
Definition temphum11.h:148
i2c_master_t i2c
Definition temphum11.h:151
uint8_t slave_address
Definition temphum11.h:155