thermo6 2.0.0.0
thermo6.h File Reference

This file contains API for Thermo 6 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  thermo6_t
 Click ctx object definition. More...
 
struct  thermo6_cfg_t
 Click configuration structure definition. More...
 

Macros

#define THERMO6_MAP_MIKROBUS(cfg, mikrobus)
 
#define THERMO6_RETVAL   uint8_t
 
#define THERMO6_OK   0x00
 
#define THERMO6_INIT_ERROR   0xFF
 
#define THERMO6_SLAVE_ADDRESS   0x48
 
#define THERMO6_REG_TEMPERATURE   0x00
 
#define THERMO6_REG_CONFIG   0x01
 
#define THERMO6_REG_TEMP_HYST   0x02
 
#define THERMO6_REG_TEMP_OS   0x03
 
#define THERMO6_CFG_ONE_SHOT   0x0001
 
#define THERMO6_CFG_CONVERSION_RATE_0_25   0x0000
 
#define THERMO6_CFG_CONVERSION_RATE_1   0x0002
 
#define THERMO6_CFG_CONVERSION_RATE_4   0x0004
 
#define THERMO6_CFG_CONVERSION_RATE_8   0x0006
 
#define THERMO6_CFG_PEC_ENABLE   0x0008
 
#define THERMO6_CFG_PEC_DISABLE   0x0000
 
#define THERMO6_CFG_TIMEOUT_ENABLE   0x0010
 
#define THERMO6_CFG_TIMEOUT_DISABLE   0x0000
 
#define THERMO6_CFG_RESOLUTION_8   0x0000
 
#define THERMO6_CFG_RESOLUTION_9   0x0020
 
#define THERMO6_CFG_RESOLUTION_10   0x0040
 
#define THERMO6_CFG_RESOLUTION_12   0x0060
 
#define THERMO6_CFG_NORMAL_FORMAT   0x0000
 
#define THERMO6_CFG_EXTENDED_FORMAT   0x0080
 
#define THERMO6_CFG_SHUT_DOWN   0x0100
 
#define THERMO6_CFG_POWER_UP   0x0000
 
#define THERMO6_CFG_COMPARATOR_MODE   0x0000
 
#define THERMO6_CFG_INTERRUPT_MODE   0x0200
 
#define THERMO6_CFG_FAULT_QUEUE_1   0x0000
 
#define THERMO6_CFG_FAULT_QUEUE_2   0x0800
 
#define THERMO6_CFG_FAULT_QUEUE_4   0x1000
 
#define THERMO6_CFG_FAULT_QUEUE_6   0x1800
 
#define THERMO6_TEMP_FORMAT_CELSIUS   0
 
#define THERMO6_TEMP_FORMAT_FAHRENHEIT   2
 
#define THERMO6_TEMP_FORMAT_KELVIN   1
 
#define THERMO6_TEMP_RESOLUTION_12bit   3
 
#define THERMO6_TEMP_RESOLUTION_10bit   2
 
#define THERMO6_TEMP_RESOLUTION_9bit   1
 
#define THERMO6_TEMP_RESOLUTION_8bit   0
 

Functions

void thermo6_cfg_setup (thermo6_cfg_t *cfg)
 Config Object Initialization function.
 
THERMO6_RETVAL thermo6_init (thermo6_t *ctx, thermo6_cfg_t *cfg)
 Initialization function.
 
void thermo6_default_cfg (thermo6_t *ctx)
 Click Default Configuration function.
 
void thermo6_generic_write (thermo6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void thermo6_generic_read (thermo6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
float thermo6_get_temperature_data (thermo6_t *ctx, uint8_t temp_format)
 Temperature function.
 
void thermo6_set_other_register (thermo6_t *ctx, uint8_t reg, float tx_data)
 Set other register.
 
float thermo6_get_other_register (thermo6_t *ctx, uint8_t reg)
 Set other register.
 
uint8_t thermo6_get_over_temp_status (thermo6_t *ctx)
 Read over-temperature status function.
 
void thermo6_set_register_cfg (thermo6_t *ctx, uint16_t cfg_data)
 Write configuration function.
 

Detailed Description

This file contains API for Thermo 6 Click driver.