thermok 2.0.0.0
Public function

Functions

void thermok_cfg_setup (thermok_cfg_t *cfg)
 Config Object Initialization function.
 
THERMOK_RETVAL thermok_init (thermok_t *ctx, thermok_cfg_t *cfg)
 Initialization function.
 
void thermok_generic_write (thermok_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void thermok_generic_read (thermok_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint16_t thermok_get_device_info (thermok_t *ctx)
 Functions for read device info.
 
void thermok_get_status (thermok_t *ctx, thermok_alert_t *status)
 Get status.
 
float thermok_get_temperature (thermok_t *ctx, uint8_t reg, uint8_t temp_format)
 Temperature data.
 
void thermok_set_register_cfg (thermok_t *ctx, uint8_t reg_cfg, uint8_t cfg_data)
 Set register config.
 
uint8_t thermok_get_alert_state_1 (thermok_t *ctx)
 Alert 1 pin state.
 
uint8_t thermok_get_alert_state_2 (thermok_t *ctx)
 Alert 2 pin state.
 
uint8_t thermok_get_alert_state_3 (thermok_t *ctx)
 Alert 3 pin state.
 
uint8_t thermok_get_alert_state_4 (thermok_t *ctx)
 Alert 4 pin state.
 

Detailed Description

Function Documentation

◆ thermok_cfg_setup()

void thermok_cfg_setup ( thermok_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.

◆ thermok_generic_read()

void thermok_generic_read ( thermok_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.

◆ thermok_generic_write()

void thermok_generic_write ( thermok_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.

◆ thermok_get_alert_state_1()

uint8_t thermok_get_alert_state_1 ( thermok_t * ctx)

Alert 1 pin state.

Parameters
ctxClick object.
Returns
Alert pin state on the INT pin

◆ thermok_get_alert_state_2()

uint8_t thermok_get_alert_state_2 ( thermok_t * ctx)

Alert 2 pin state.

Parameters
ctxClick object.
Returns
Alert pin state on the PWM pin

◆ thermok_get_alert_state_3()

uint8_t thermok_get_alert_state_3 ( thermok_t * ctx)

Alert 3 pin state.

Parameters
ctxClick object.
Returns
Alert pin state on the RST pin

◆ thermok_get_alert_state_4()

uint8_t thermok_get_alert_state_4 ( thermok_t * ctx)

Alert 4 pin state.

Parameters
ctxClick object.
Returns
Alert pin state on the AN pin

◆ thermok_get_device_info()

uint16_t thermok_get_device_info ( thermok_t * ctx)

Functions for read device info.

Parameters
ctxClick object.
Returns
device info (MSB - device ID, LSB - device rev )

◆ thermok_get_status()

void thermok_get_status ( thermok_t * ctx,
thermok_alert_t * status )

Get status.

Parameters
ctxClick object.
statusStatus structure

◆ thermok_get_temperature()

float thermok_get_temperature ( thermok_t * ctx,
uint8_t reg,
uint8_t temp_format )

Temperature data.

Parameters
ctxClick object.
regTemperature Register
temp_formatTemperature in ... (FAHRENHEIT, KELVIN or CELSIUS)
Returns
Temperature data

◆ thermok_init()

THERMOK_RETVAL thermok_init ( thermok_t * ctx,
thermok_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ thermok_set_register_cfg()

void thermok_set_register_cfg ( thermok_t * ctx,
uint8_t reg_cfg,
uint8_t cfg_data )

Set register config.

Parameters
ctxClick object.
reg_cfgRegister type: Sensor config / Device config / Alert config
cfg_dataData which will be set in one of three configuration registers