surfacetemp2  2.0.0.0
Functions

Functions

void surfacetemp2_cfg_setup (surfacetemp2_cfg_t *cfg)
 Config Object Initialization function. More...
 
SURFACETEMP2_RETVAL surfacetemp2_init (surfacetemp2_t *ctx, surfacetemp2_cfg_t *cfg)
 Initialization function. More...
 
void surfacetemp2_generic_write (surfacetemp2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function. More...
 
void surfacetemp2_generic_read (surfacetemp2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function. More...
 
void surfacetemp2_soft_reset (surfacetemp2_t *ctx)
 Software Reset function. More...
 
uint8_t surfacetemp2_setup (surfacetemp2_t *ctx, uint8_t setup)
 Setup function. More...
 
void surfacetemp2_set_hys_val (surfacetemp2_t *ctx, uint8_t hys_val)
 Set Hysteresis function. More...
 
float surfacetemp2_get_temperature (surfacetemp2_t *ctx)
 Get Temperature function. More...
 
void surfacetemp2_set_high_trsh (surfacetemp2_t *ctx, float trsh)
 Set Over Temperature Threshold function. More...
 
void surfacetemp2_set_low_trsh (surfacetemp2_t *ctx, float trsh)
 Set Under Temperature Threshold function. More...
 
void surfacetemp2_set_crit_trsh (surfacetemp2_t *ctx, float trsh)
 Set Critical Temperature Threshold function. More...
 
uint8_t surfacetemp2_get_int_pin (surfacetemp2_t *ctx)
 Get INT pin state function. More...
 
uint8_t surfacetemp2_get_ct_pin (surfacetemp2_t *ctx)
 Get CT pin state function. More...
 

Detailed Description

Function Documentation

◆ surfacetemp2_cfg_setup()

void surfacetemp2_cfg_setup ( surfacetemp2_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.

◆ surfacetemp2_generic_read()

void surfacetemp2_generic_read ( surfacetemp2_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.

◆ surfacetemp2_generic_write()

void surfacetemp2_generic_write ( surfacetemp2_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.

◆ surfacetemp2_get_ct_pin()

uint8_t surfacetemp2_get_ct_pin ( surfacetemp2_t ctx)

Get CT pin state function.

Parameters
ctxClick object.
Returns
0 if INT pin is LOW
1 if INT pin is HIGH

Function is used to get the CT pin state.

Note
Use of the CT pin is defined in Configuration register.

◆ surfacetemp2_get_int_pin()

uint8_t surfacetemp2_get_int_pin ( surfacetemp2_t ctx)

Get INT pin state function.

Parameters
ctxClick object.
Returns
0 if INT pin is LOW
1 if INT pin is HIGH

Function is used to get the INT pin state.

Note
Use of the INT pin is defined in Configuration register.

◆ surfacetemp2_get_temperature()

float surfacetemp2_get_temperature ( surfacetemp2_t ctx)

Get Temperature function.

Parameters
ctxClick object.
Returns
Temperature value in degree Celsius.

Function is used to read and calculate temperatre value.

Note
Function checks the resolution by rading Configuration register.

◆ surfacetemp2_init()

SURFACETEMP2_RETVAL surfacetemp2_init ( surfacetemp2_t ctx,
surfacetemp2_cfg_t cfg 
)

Initialization function.

Parameters
surfacetemp2Click object.
cfgClick configuration structure.

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

◆ surfacetemp2_set_crit_trsh()

void surfacetemp2_set_crit_trsh ( surfacetemp2_t ctx,
float  trsh 
)

Set Critical Temperature Threshold function.

Parameters
ctxClick object.
trshcritical temperature threshold limit

Function is used to set critical temperature threshold limit.

◆ surfacetemp2_set_high_trsh()

void surfacetemp2_set_high_trsh ( surfacetemp2_t ctx,
float  trsh 
)

Set Over Temperature Threshold function.

Parameters
ctxClick object.
trshover temperature threshold limit

Function is used to set over temperature threshold limit.

◆ surfacetemp2_set_hys_val()

void surfacetemp2_set_hys_val ( surfacetemp2_t ctx,
uint8_t  hys_val 
)

Set Hysteresis function.

Parameters
ctxClick object.
hys_valuser defined value that represents hysteresis

Function is used to set hysteresis.

Note
Hysteresis value should range from 0 to 15;

◆ surfacetemp2_set_low_trsh()

void surfacetemp2_set_low_trsh ( surfacetemp2_t ctx,
float  trsh 
)

Set Under Temperature Threshold function.

Parameters
ctxClick object.
trshunder temperature threshold limit

Function is used to set under temperature threshold limit.

◆ surfacetemp2_setup()

uint8_t surfacetemp2_setup ( surfacetemp2_t ctx,
uint8_t  setup 
)

Setup function.

Parameters
ctxClick object.
setup8-bit input data that define device settings
Returns
0 If setup si successful
1 If an error has occured.

Function is used to apply the desired settings.

Note
Function holds "Software Reset" function and reads device ID.

◆ surfacetemp2_soft_reset()

void surfacetemp2_soft_reset ( surfacetemp2_t ctx)

Software Reset function.

Parameters
ctxClick object.

Function is used to issue soft reset command.

Note
Function holds small 100 ms delay.