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"
74#define THERMOSTAT5_ROOM_TEMP_IN_K 293.15f
75#define THERMOSTAT5_THERMISOR_BETA 3435.0f
76#define THERMOSTAT5_INVERTED_VALUE 1.0f
77#define THERMOSTAT5_TEMP_K_TO_C 273.15f
83#define THERMOSTAT5_RELAY_OFF 0
84#define THERMOSTAT5_RELAY_ON 1
90#define THERMOSTAT5_ADC_RESOLUTION 0x0FFFu
91#define THERMOSTAT5_VREF_3V3 3.3
92#define THERMOSTAT5_VREF_5V 5.0
99#define THERMOSTAT5_SET_DEV_ADDR 0x4D
117#define THERMOSTAT5_MAP_MIKROBUS( cfg, mikrobus ) \
118 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN ); \
119 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
120 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
121 cfg.on = MIKROBUS( mikrobus, MIKROBUS_PWM )
err_t thermostat5_set_vref(thermostat5_t *ctx, float vref)
Thermostat 5 set vref function.
void thermostat5_set_relay(thermostat5_t *ctx, uint8_t state)
Thermostat 5 set relay function.
void thermostat5_drv_interface_sel(thermostat5_cfg_t *cfg, thermostat5_drv_t drv_sel)
Thermostat 5 driver interface setup function.
err_t thermostat5_read_raw_adc(thermostat5_t *ctx, uint16_t *raw_adc)
Thermostat 5 read raw ADC value function.
err_t thermostat5_init(thermostat5_t *ctx, thermostat5_cfg_t *cfg)
Thermostat 5 initialization function.
err_t thermostat5_get_temperature(thermostat5_t *ctx, float *temperature)
Thermostat 5 get temperature function.
err_t thermostat5_read_voltage(thermostat5_t *ctx, float *voltage)
Thermostat 5 read voltage level function.
void thermostat5_cfg_setup(thermostat5_cfg_t *cfg)
Thermostat 5 configuration object setup function.
Thermostat 5 Click configuration object.
Definition thermostat5.h:159
analog_in_resolution_t resolution
Definition thermostat5.h:165
float vref
Definition thermostat5.h:166
uint32_t i2c_speed
Definition thermostat5.h:168
thermostat5_drv_t drv_sel
Definition thermostat5.h:171
pin_name_t on
Definition thermostat5.h:163
pin_name_t scl
Definition thermostat5.h:161
pin_name_t sda
Definition thermostat5.h:162
pin_name_t an
Definition thermostat5.h:160
uint8_t i2c_address
Definition thermostat5.h:169
Thermostat 5 Click context object.
Definition thermostat5.h:142
float vref
Definition thermostat5.h:149
thermostat5_drv_t drv_sel
Definition thermostat5.h:150
digital_out_t on
Definition thermostat5.h:143
i2c_master_t i2c
Definition thermostat5.h:146
uint8_t slave_address
Definition thermostat5.h:148
analog_in_t adc
Definition thermostat5.h:145
thermostat5_drv_t
Thermostat 5 Click driver selector.
Definition thermostat5.h:131
@ THERMOSTAT5_DRV_SEL_I2C
Definition thermostat5.h:133
@ THERMOSTAT5_DRV_SEL_ADC
Definition thermostat5.h:132
thermostat5_return_value_t
Thermostat 5 Click return value data.
Definition thermostat5.h:180
@ THERMOSTAT5_OK
Definition thermostat5.h:181
@ THERMOSTAT5_ERROR
Definition thermostat5.h:182