thermostat 2.0.0.0
thermostat.h File Reference

This file contains API for Thermostat Click driver. More...

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

Go to the source code of this file.

Data Structures

struct  thermostat_t
 Click ctx object definition. More...
 
struct  thermostat_cfg_t
 Click configuration structure definition. More...
 

Macros

#define THERMOSTAT_MAP_MIKROBUS(cfg, mikrobus)
 
#define THERMOSTAT_RETVAL   uint8_t
 
#define THERMOSTAT_OK   0x00
 
#define THERMOSTAT_INIT_ERROR   0xFF
 
#define THERMOSTAT_I2C_ADDRESS_0   0x48
 
#define THERMOSTAT_I2C_ADDRESS_1   0x49
 
#define THERMOSTAT_I2C_ADDRESS_2   0x4A
 
#define THERMOSTAT_I2C_ADDRESS_3   0x4B
 
#define THERMOSTAT_REG_TEMP_OUT   0x00
 
#define THERMOSTAT_REG_CONFIG   0x01
 
#define THERMOSTAT_REG_TEMP_HYST   0x02
 
#define THERMOSTAT_REG_TEMP_REF   0x03
 
#define THERMOSTAT_CHECK_SIGN   0x80
 
#define THERMOSTAT_DEFAULT_CONFIG   0x0000
 
#define THERMOSTAT_MSB_BITS   0xFF00
 
#define THERMOSTAT_LSB_BITS   0x00FF
 
#define THERMOSTAT_START_RESULT   0x0000
 
#define THERMOSTAT_UPPER_LIMITS_TEMP   126.00
 
#define THERMOSTAT_LOWER_LIMITS_TEMP   -55.00
 
#define THERMOSTAT_CALCULATE_COEF_MULT   1.8000
 
#define THERMOSTAT_CALCULATE_COEF_PLUS   32.000
 

Functions

void thermostat_cfg_setup (thermostat_cfg_t *cfg)
 Config Object Initialization function.
 
THERMOSTAT_RETVAL thermostat_init (thermostat_t *ctx, thermostat_cfg_t *cfg)
 Initialization function.
 
void thermostat_generic_write (thermostat_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void thermostat_generic_read (thermostat_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void thermostat_write_data (thermostat_t *ctx, uint8_t reg_address, uint16_t write_data)
 Generic write 16-bit data function.
 
uint16_t thermostat_read_data (thermostat_t *ctx, uint8_t reg_address)
 Generic read 16-bit data function.
 
float thermostat_get_temperature (thermostat_t *ctx)
 Get temperature in degrees Celsius.
 
float thermostat_convert_fahrenheit (thermostat_t *ctx, float temp_celsius)
 Convert temperature in degrees Celsius to Fahrenheit.
 
void thermostat_set_configuration (thermostat_t *ctx, uint16_t config_value)
 Set configuration function.
 
void thermostat_set_temp_hyst (thermostat_t *ctx, int8_t temp_hyst)
 Set temperature hysterezis function.
 
void thermostat_set_temp_ref (thermostat_t *ctx, int8_t temp_ref)
 Set referent temperature function.
 
void thermostat_soft_reset (thermostat_t *ctx)
 Soft reset function.
 
void thermostat_switch_on (thermostat_t *ctx)
 Set on thermal switch function.
 
void thermostat_switch_off (thermostat_t *ctx)
 Set off thermal switch function.
 
void thermostat_enable (thermostat_t *ctx)
 Thermostat enabled function.
 
void thermostat_disable (thermostat_t *ctx)
 Thermostat disabled function.
 

Detailed Description

This file contains API for Thermostat Click driver.