surfacetemp 2.0.0.0

Functions

void surfacetemp_cfg_setup (surfacetemp_cfg_t *cfg)
 Config Object Initialization function.
 
SURFACETEMP_RETVAL surfacetemp_init (surfacetemp_t *ctx, surfacetemp_cfg_t *cfg)
 Initialization function.
 
void surfacetemp_default_cfg (surfacetemp_t *ctx)
 Click Default Configuration function.
 
void surfacetemp_generic_write (surfacetemp_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void surfacetemp_generic_read (surfacetemp_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t surfacetemp_get_pwm_pin (surfacetemp_t *ctx)
 Getting PWM pin state.
 
void surfacetemp_soft_reset (surfacetemp_t *ctx)
 Soft reset.
 
float surfacetemp_get_temperature (surfacetemp_t *ctx)
 Getting temperature value.
 
uint8_t surfacetemp_get_status (surfacetemp_t *ctx)
 Getting device status.
 
uint8_t surfacetemp_set_high_threshold (surfacetemp_t *ctx, float high_threshold)
 Setting high threshold limit.
 
uint8_t surfacetemp_set_low_threshold (surfacetemp_t *ctx, float high_threshold)
 Setting low threshold limit.
 
uint8_t surfacetemp_set_critical_threshold (surfacetemp_t *ctx, float high_threshold)
 Setting critical threshold limit.
 
uint8_t surfacetemp_set_hysteresis (surfacetemp_t *ctx, uint8_t hysteresis)
 Setting hysteresis value.
 
uint8_t surfacetemp_setup (surfacetemp_t *ctx)
 Device initialization.
 

Detailed Description

Function Documentation

◆ surfacetemp_cfg_setup()

void surfacetemp_cfg_setup ( surfacetemp_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.

◆ surfacetemp_default_cfg()

void surfacetemp_default_cfg ( surfacetemp_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for SurfaceTemp click.

◆ surfacetemp_generic_read()

void surfacetemp_generic_read ( surfacetemp_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.

◆ surfacetemp_generic_write()

void surfacetemp_generic_write ( surfacetemp_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.

◆ surfacetemp_get_pwm_pin()

uint8_t surfacetemp_get_pwm_pin ( surfacetemp_t * ctx)

Getting PWM pin state.

Parameters
ctxClick object.
Returns
0 if PWM pin is LOW
1 if PWM pin is HIGH
Note
This function returns PWM pin state

◆ surfacetemp_get_status()

uint8_t surfacetemp_get_status ( surfacetemp_t * ctx)

Getting device status.

Parameters
ctxClick object.
Returns
Status register value
Note
This function returns status register value

◆ surfacetemp_get_temperature()

float surfacetemp_get_temperature ( surfacetemp_t * ctx)

Getting temperature value.

Parameters
ctxClick object.
Returns
Temperature value
Note
This function reads temperature registers and calculates temperature value

◆ surfacetemp_init()

SURFACETEMP_RETVAL surfacetemp_init ( surfacetemp_t * ctx,
surfacetemp_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ surfacetemp_set_critical_threshold()

uint8_t surfacetemp_set_critical_threshold ( surfacetemp_t * ctx,
float high_threshold )

Setting critical threshold limit.

Parameters
ctxClick object.
critical_threshold- critical threshold value
Returns
0 for valid critical threshold value (i.e. if threshold value is between -40 and 150)
1 for invalid critical threshold value (i.e. if threshold value is not between -40 and 150)
Note
This function sets critical threshold value

◆ surfacetemp_set_high_threshold()

uint8_t surfacetemp_set_high_threshold ( surfacetemp_t * ctx,
float high_threshold )

Setting high threshold limit.

Parameters
ctxClick object.
high_threshold- high threshold value
Returns
0 for valid high threshold value (i.e. if threshold value is between -40 and 150)
1 for invalid high threshold value (i.e. if threshold value is not between -40 and 150)
Note
This function sets high threshold value

◆ surfacetemp_set_hysteresis()

uint8_t surfacetemp_set_hysteresis ( surfacetemp_t * ctx,
uint8_t hysteresis )

Setting hysteresis value.

Parameters
ctxClick object.
hysteresis- hysteresis value
Returns
0 for valid hysteresis value (i.e. if hysteresis value is between 0 and 15)
1 for invalid hysteresis value (i.e. if hysteresis value is not between 0 and 15)
Note
This function sets high threshold value

◆ surfacetemp_set_low_threshold()

uint8_t surfacetemp_set_low_threshold ( surfacetemp_t * ctx,
float high_threshold )

Setting low threshold limit.

Parameters
ctxClick object.
low_threshold- low threshold value
Returns
0 for valid low threshold value (i.e. if threshold value is between -40 and 150)
1 for invalid low threshold value (i.e. if threshold value is not between -40 and 150)
Note
This function sets low threshold value

◆ surfacetemp_setup()

uint8_t surfacetemp_setup ( surfacetemp_t * ctx)

Device initialization.

Parameters
ctxClick object.
Returns
0 for successful initialization (i.e. if device ID is correct)
1 for unsuccessful initialization (i.e. if device ID is incorrect)
Note
This function issues soft reset command
This function gets device ID
This function sets resolution to 16-bit
This function sets continious conversion mode
This function sets comprator mode
This function sets INT and CT(CS) pins to active low
This function sets fault queue to 4 faults

◆ surfacetemp_soft_reset()

void surfacetemp_soft_reset ( surfacetemp_t * ctx)

Soft reset.

Parameters
ctxClick object.
Note
This function issues soft reset command