thermostat5  2.1.0.0
Data Structures | Macros | Enumerations | Functions
thermostat5.h File Reference

This file contains API for Thermostat 5 Click Driver. More...

#include "mikrosdk_version.h"
#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_analog_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  thermostat5_t
 Thermostat 5 Click context object. More...
 
struct  thermostat5_cfg_t
 Thermostat 5 Click configuration object. More...
 

Macros

#define THERMOSTAT5_ROOM_TEMP_IN_K   293.15f
 Thermostat 5 temperature calculation data values. More...
 
#define THERMOSTAT5_THERMISOR_BETA   3435.0f
 
#define THERMOSTAT5_INVERTED_VALUE   1.0f
 
#define THERMOSTAT5_TEMP_K_TO_C   273.15f
 
#define THERMOSTAT5_RELAY_OFF   0
 Thermostat 5 relay states. More...
 
#define THERMOSTAT5_RELAY_ON   1
 
#define THERMOSTAT5_ADC_RESOLUTION   0x0FFFu
 Thermostat 5 ADC setting. More...
 
#define THERMOSTAT5_VREF_3V3   3.3
 
#define THERMOSTAT5_VREF_5V   5.0
 
#define THERMOSTAT5_SET_DEV_ADDR   0x4D
 Thermostat 5 device address setting. More...
 
#define THERMOSTAT5_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping. More...
 

Enumerations

enum  thermostat5_drv_t { THERMOSTAT5_DRV_SEL_ADC, THERMOSTAT5_DRV_SEL_I2C }
 Thermostat 5 Click driver selector. More...
 
enum  thermostat5_return_value_t { THERMOSTAT5_OK = 0, THERMOSTAT5_ERROR = -1 }
 Thermostat 5 Click return value data. More...
 

Functions

void thermostat5_cfg_setup (thermostat5_cfg_t *cfg)
 Thermostat 5 configuration object setup function. More...
 
void thermostat5_drv_interface_sel (thermostat5_cfg_t *cfg, thermostat5_drv_t drv_sel)
 Thermostat 5 driver interface setup function. More...
 
err_t thermostat5_init (thermostat5_t *ctx, thermostat5_cfg_t *cfg)
 Thermostat 5 initialization function. More...
 
err_t thermostat5_read_raw_adc (thermostat5_t *ctx, uint16_t *raw_adc)
 Thermostat 5 read raw ADC value function. More...
 
err_t thermostat5_read_voltage (thermostat5_t *ctx, float *voltage)
 Thermostat 5 read voltage level function. More...
 
err_t thermostat5_set_vref (thermostat5_t *ctx, float vref)
 Thermostat 5 set vref function. More...
 
err_t thermostat5_get_temperature (thermostat5_t *ctx, float *temperature)
 Thermostat 5 get temperature function. More...
 
void thermostat5_set_relay (thermostat5_t *ctx, uint8_t state)
 Thermostat 5 set relay function. More...
 

Detailed Description

This file contains API for Thermostat 5 Click Driver.

Enumeration Type Documentation

◆ thermostat5_drv_t

Thermostat 5 Click driver selector.

Selects target driver interface of Thermostat 5 Click driver.

Enumerator
THERMOSTAT5_DRV_SEL_ADC 

ADC driver descriptor.

THERMOSTAT5_DRV_SEL_I2C 

I2C driver descriptor.

◆ thermostat5_return_value_t

Thermostat 5 Click return value data.

Predefined enum values for driver return values.

Enumerator
THERMOSTAT5_OK 
THERMOSTAT5_ERROR