temphum 2.0.0.0
Public function

Functions

void temphum_cfg_setup (temphum_cfg_t *cfg)
 Config Object Initialization function.
 
TEMPHIM_RETVAL temphum_init (temphum_t *ctx, temphum_cfg_t *cfg)
 Initialization function.
 
void temphum_default_cfg (temphum_t *ctx)
 Click Default Configuration function.
 
void temphum_generic_write (temphum_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void temphum_generic_read (temphum_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint16_t temphum_get_hum_data (temphum_t *ctx)
 Gets humidity data function.
 
uint16_t temphum_get_temp_data (temphum_t *ctx)
 Gets temperature data function.
 
void temphum_get_temp_hum (temphum_t *ctx, float *temperature, float *humidity)
 Gets temperature and humidity function.
 
float temphum_get_temperature (temphum_t *ctx)
 Gets temperature in degrees Celsius function.
 
float temphum_get_humidity (temphum_t *ctx)
 Gets humidity in degrees Celsius function.
 

Detailed Description

Function Documentation

◆ temphum_cfg_setup()

void temphum_cfg_setup ( temphum_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.

◆ temphum_default_cfg()

void temphum_default_cfg ( temphum_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for TempHum click.

◆ temphum_generic_read()

void temphum_generic_read ( temphum_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.

◆ temphum_generic_write()

void temphum_generic_write ( temphum_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.

◆ temphum_get_hum_data()

uint16_t temphum_get_hum_data ( temphum_t * ctx)

Gets humidity data function.

Parameters
ctxClick object.
Returns
16-bit humidity data

@description Function get humidity data by reading from two target 8-bit register address of HTS221 sensor on Temp&Hum Click.

◆ temphum_get_humidity()

float temphum_get_humidity ( temphum_t * ctx)

Gets humidity in degrees Celsius function.

Parameters
ctxClick object.
Returns
float value of humidity in percentage

@description Function get humidity value in percentage [ % ] from HTS221 sensor on Temp&Hum Click.

◆ temphum_get_temp_data()

uint16_t temphum_get_temp_data ( temphum_t * ctx)

Gets temperature data function.

Parameters
ctxClick object.
Returns
16-bit temperature data

@description Function gets temperature data by reading from two target 8-bit register address of HTS221 sensor on Temp&Hum Click.

◆ temphum_get_temp_hum()

void temphum_get_temp_hum ( temphum_t * ctx,
float * temperature,
float * humidity )

Gets temperature and humidity function.

Parameters
temperaturepointer to float value of temperature [ �C ]
humiditypointer to float value of humidity [ % ]

@description Function gets temperature value in degrees Celsius [ �C ] and humidity value in percentage [ % ] by reading from the two target 8-bit register address of HTS221 sensor on Temp&Hum Click and converts it by performing linear interpolation on read data.

◆ temphum_get_temperature()

float temphum_get_temperature ( temphum_t * ctx)

Gets temperature in degrees Celsius function.

Parameters
ctxClick object.
Returns
float value of temperature in degrees Celsius

@description Function get temperature value in degrees Celsius [ �C ] from HTS221 sensor on Temp&Hum Click.

◆ temphum_init()

TEMPHIM_RETVAL temphum_init ( temphum_t * ctx,
temphum_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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