temphum  2.0.0.0
Functions
Public function

Functions

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

Detailed Description

Function Documentation

◆ temphum_cfg_setup()

void temphum_cfg_setup ( temphum_cfg_t cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

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.

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

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.

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

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

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

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 [ % ]

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

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.

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