Go to the documentation of this file.
35 #include "mikrosdk_version.h"
38 #if mikroSDK_GET_VERSION < 20800ul
39 #include "rcu_delays.h"
45 #include "drv_digital_out.h"
46 #include "drv_digital_in.h"
47 #include "drv_analog_in.h"
48 #include "drv_i2c_master.h"
70 #define THERMOSTAT5_ROOM_TEMP_IN_K 293.15f
71 #define THERMOSTAT5_THERMISOR_BETA 3435.0f
72 #define THERMOSTAT5_INVERTED_VALUE 1.0f
73 #define THERMOSTAT5_TEMP_K_TO_C 273.15f
79 #define THERMOSTAT5_RELAY_OFF 0
80 #define THERMOSTAT5_RELAY_ON 1
86 #define THERMOSTAT5_ADC_RESOLUTION 0x0FFFu
87 #define THERMOSTAT5_VREF_3V3 3.3
88 #define THERMOSTAT5_VREF_5V 5.0
95 #define THERMOSTAT5_SET_DEV_ADDR 0x4D
113 #define THERMOSTAT5_MAP_MIKROBUS( cfg, mikrobus ) \
114 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN ); \
115 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
116 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
117 cfg.on = MIKROBUS( mikrobus, MIKROBUS_PWM )
298 #endif // THERMOSTAT5_H
pin_name_t an
Definition: thermostat5.h:156
@ THERMOSTAT5_ERROR
Definition: thermostat5.h:178
uint32_t i2c_speed
Definition: thermostat5.h:164
float vref
Definition: thermostat5.h:145
pin_name_t on
Definition: thermostat5.h:159
@ THERMOSTAT5_OK
Definition: thermostat5.h:177
digital_out_t on
Definition: thermostat5.h:139
void thermostat5_drv_interface_sel(thermostat5_cfg_t *cfg, thermostat5_drv_t drv_sel)
Thermostat 5 driver interface setup function.
pin_name_t scl
Definition: thermostat5.h:157
thermostat5_return_value_t
Thermostat 5 Click return value data.
Definition: thermostat5.h:176
pin_name_t sda
Definition: thermostat5.h:158
err_t thermostat5_read_voltage(thermostat5_t *ctx, float *voltage)
Thermostat 5 read voltage level function.
@ THERMOSTAT5_DRV_SEL_ADC
Definition: thermostat5.h:128
analog_in_resolution_t resolution
Definition: thermostat5.h:161
err_t thermostat5_init(thermostat5_t *ctx, thermostat5_cfg_t *cfg)
Thermostat 5 initialization function.
thermostat5_drv_t drv_sel
Definition: thermostat5.h:146
thermostat5_drv_t
Thermostat 5 Click driver selector.
Definition: thermostat5.h:127
uint8_t i2c_address
Definition: thermostat5.h:165
void thermostat5_set_relay(thermostat5_t *ctx, uint8_t state)
Thermostat 5 set relay function.
void thermostat5_cfg_setup(thermostat5_cfg_t *cfg)
Thermostat 5 configuration object setup function.
thermostat5_drv_t drv_sel
Definition: thermostat5.h:167
uint8_t slave_address
Definition: thermostat5.h:144
err_t thermostat5_read_raw_adc(thermostat5_t *ctx, uint16_t *raw_adc)
Thermostat 5 read raw ADC value function.
analog_in_t adc
Definition: thermostat5.h:141
err_t thermostat5_set_vref(thermostat5_t *ctx, float vref)
Thermostat 5 set vref function.
Thermostat 5 Click context object.
Definition: thermostat5.h:138
err_t thermostat5_get_temperature(thermostat5_t *ctx, float *temperature)
Thermostat 5 get temperature function.
@ THERMOSTAT5_DRV_SEL_I2C
Definition: thermostat5.h:129
i2c_master_t i2c
Definition: thermostat5.h:142
Thermostat 5 Click configuration object.
Definition: thermostat5.h:155
float vref
Definition: thermostat5.h:162