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_analog_in.h"
52#include "drv_i2c_master.h"
75#define HUMIDITY_SET_DEV_ADDR 0x4D
81#define HUMIDITY_ADC_RESOLUTION 0x0FFF
82#define HUMIDITY_VREF_3V3 3.3
83#define HUMIDITY_VREF_5V 5.0
89#define HUMIDITY_DIVISOR 0.00636
90#define HUMIDITY_SUBTRAHEND 0.1515
108#define HUMIDITY_MAP_MIKROBUS( cfg, mikrobus ) \
109 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN ); \
110 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
111 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
void humidity_drv_interface_selection(humidity_cfg_t *cfg, humidity_drv_t drv_sel)
Humidity driver interface setup function.
err_t humidity_init(humidity_t *ctx, humidity_cfg_t *cfg)
Humidity initialization function.
void humidity_cfg_setup(humidity_cfg_t *cfg)
Humidity configuration object setup function.
float humidity_voltage_to_rh(humidity_t *ctx, float voltage)
Humidity voltage to relative humidity function.
err_t humidity_read_voltage(humidity_t *ctx, float *voltage)
Humidity read voltage level function.
err_t humidity_read_raw_adc(humidity_t *ctx, uint16_t *raw_adc)
Humidity read raw ADC value function.
err_t humidity_set_vref(humidity_t *ctx, float vref)
Humidity set vref function.
humidity_drv_t
Humidity Click driver selector.
Definition humidity.h:121
@ HUMIDITY_DRV_SEL_I2C
Definition humidity.h:123
@ HUMIDITY_DRV_SEL_ADC
Definition humidity.h:122
humidity_return_value_t
Humidity Click return value data.
Definition humidity.h:166
@ HUMIDITY_ERROR
Definition humidity.h:168
@ HUMIDITY_OK
Definition humidity.h:167
Humidity Click configuration object.
Definition humidity.h:147
humidity_drv_t drv_sel
Definition humidity.h:155
analog_in_resolution_t resolution
Definition humidity.h:156
float vref
Definition humidity.h:157
uint32_t i2c_speed
Definition humidity.h:152
pin_name_t scl
Definition humidity.h:149
pin_name_t sda
Definition humidity.h:150
pin_name_t an
Definition humidity.h:148
uint8_t i2c_address
Definition humidity.h:153
Humidity Click context object.
Definition humidity.h:132
humidity_drv_t drv_sel
Definition humidity.h:136
float vref
Definition humidity.h:138
i2c_master_t i2c
Definition humidity.h:134
uint8_t slave_address
Definition humidity.h:137
analog_in_t adc
Definition humidity.h:133