thermo6 2.0.0.0
Public function

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

Function Documentation

◆ thermo6_cfg_setup()

void thermo6_cfg_setup ( thermo6_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ thermo6_default_cfg()

void thermo6_default_cfg ( thermo6_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Thermo6 click.

Note
Default configuration of the chip contains the settings :
    ** Config register
           - THERMO6_CFG_CONVERSION_RATE_8
           - THERMO6_CFG_PEC_ENABLE
           - THERMO6_CFG_TIMEOUT_ENABLE
           - THERMO6_CFG_RESOLUTION_12
           - THERMO6_CFG_NORMAL_FORMAT
           - THERMO6_CFG_POWER_UP
           - THERMO6_CFG_COMPARATOR_MODE
           - THERMO6_CFG_FAULT_QUEUE_1

◆ thermo6_generic_read()

void thermo6_generic_read ( thermo6_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function reads data from the desired register.

◆ thermo6_generic_write()

void thermo6_generic_write ( thermo6_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register.

◆ thermo6_get_other_register()

float thermo6_get_other_register ( thermo6_t * ctx,
uint8_t reg )

Set other register.

Parameters
ctxClick object.
regSelect register (REG_TEMP_HYST or REG_TEMP_OS)
Returns
float result value representing current overtemperature shutdown threshold or hysteresis

@description Reads current overtemperature shutdown threshold or hysteresis.

◆ thermo6_get_over_temp_status()

uint8_t thermo6_get_over_temp_status ( thermo6_t * ctx)

Read over-temperature status function.

Parameters
ctxClick object.
Returns
result 8-bit value that represent configuration register's B15 state :
  • '0' : value in the TOS register has not been exceeded
  • '1' : value in the TOS register has been exceeded

@description Reads configuration register's B15, that indicates that the over-temperature value in the TOS register has been exceeded.

Note
Configuration register's B15 behavior is controlled by the Comparator/Interrupt bit.

◆ thermo6_get_temperature_data()

float thermo6_get_temperature_data ( thermo6_t * ctx,
uint8_t temp_format )

Temperature function.

Parameters
ctxClick object.
temp_formatTemperature format (FORMAT_CELSIUS, FORMAT_FAHRENHEIT or FORMAT_KELVIN).
Returns
Temperature data

@description Reads sensor and performs calculations in order to return result value representing current temperature.

◆ thermo6_init()

THERMO6_RETVAL thermo6_init ( thermo6_t * ctx,
thermo6_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ thermo6_set_other_register()

void thermo6_set_other_register ( thermo6_t * ctx,
uint8_t reg,
float tx_data )

Set other register.

Parameters
ctxClick object.
regSelect register (REG_TEMP_HYST or REG_TEMP_OS)
tx_dataData for write in the register

@description Sets new (shutdown threshold or hysteresis) value.

◆ thermo6_set_register_cfg()

void thermo6_set_register_cfg ( thermo6_t * ctx,
uint16_t cfg_data )

Write configuration function.

Parameters
ctxClick object.
cfg_data16-bit data that defines wanted configuration

@description writes 16-bit data into configuration register.

Note
Consult datasheet in order to discern what to write into register or use predefined values.