temphum13 2.0.0.0
Public function

Functions

void temphum13_cfg_setup (temphum13_cfg_t *cfg)
 Config Object Initialization function.
 
TEMPHUM13_RETVAL temphum13_init (temphum13_t *ctx, temphum13_cfg_t *cfg)
 Initialization function.
 
void temphum13_default_cfg (temphum13_t *ctx)
 Click Default Configuration function.
 
void temphum13_generic_write (temphum13_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void temphum13_generic_read (temphum13_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
float temphum13_get_temperature (temphum13_t *ctx)
 Get temperature value.
 
float temphum13_get_humidity (temphum13_t *ctx)
 Get humidity value.
 
uint8_t temphum13_get_user_register (temphum13_t *ctx)
 Get user register value.
 
void temphum13_set_user_register (temphum13_t *ctx, uint8_t register_content)
 Set user register.
 
void temphum13_soft_reset (temphum13_t *ctx)
 Software reset.
 
uint8_t temphum13_enable_heater (temphum13_t *ctx, uint8_t enable_heater)
 Enable heater.
 
uint8_t temphum13_change_resolution (temphum13_t *ctx, uint8_t meas_res)
 Change measurement resolution.
 
uint8_t temphum13_disable_otp_reload (temphum13_t *ctx, uint8_t disable_otp_rel)
 Disable OTP.
 

Detailed Description

Function Documentation

◆ temphum13_cfg_setup()

void temphum13_cfg_setup ( temphum13_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.

◆ temphum13_change_resolution()

uint8_t temphum13_change_resolution ( temphum13_t * ctx,
uint8_t meas_res )

Change measurement resolution.

Parameters
ctxClick object.
meas_resResolution to be set.
Returns
0 - correct input value, 1 - incorrect input value

@description This function sets click measurement resolution.

Note
meas_res = 0x00 => resolution is 12-bit, 0x01 => resolution is 8-bit
           0x80 => resolution is 10-bit, 0x81 => resolution is 11-bit

◆ temphum13_default_cfg()

void temphum13_default_cfg ( temphum13_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration ( delay 0,5 secs - soft reset - delay 0,5 secs ) for TempHum13 click.

◆ temphum13_disable_otp_reload()

uint8_t temphum13_disable_otp_reload ( temphum13_t * ctx,
uint8_t disable_otp_rel )

Disable OTP.

Parameters
ctxClick object.
disable_otp_relOTP reload boolean.
Returns
0 - correct input value, 1 - incorrect input value

@description This function disables or enables OTP.

Note
If disable_otp_rel = 1 => OTP disabled, 0 => OTP enabled.

◆ temphum13_enable_heater()

uint8_t temphum13_enable_heater ( temphum13_t * ctx,
uint8_t enable_heater )

Enable heater.

Parameters
ctxClick object.
enable_heaterHeater enable/disable switch.
Returns
0 - correct input value, 1 - incorrect input value

@description This function enables or disables heater.

Note
enable_heater = 0 means disable heater; enable_heater = 1 means enable heater.

◆ temphum13_generic_read()

void temphum13_generic_read ( temphum13_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.

◆ temphum13_generic_write()

void temphum13_generic_write ( temphum13_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.

◆ temphum13_get_humidity()

float temphum13_get_humidity ( temphum13_t * ctx)

Get humidity value.

Parameters
ctxClick object.
Returns
65536 on error i.e CRC missmatch, humidity value otherwise

@description This function calculates humidity.

◆ temphum13_get_temperature()

float temphum13_get_temperature ( temphum13_t * ctx)

Get temperature value.

Parameters
ctxClick object.
Returns
65536 on error i.e CRC missmatch, Temperature value otherwise

@description This function calculates current temperature.

◆ temphum13_get_user_register()

uint8_t temphum13_get_user_register ( temphum13_t * ctx)

Get user register value.

Parameters
ctxClick object.
Returns
Value of user register

@description This function gets user register value

◆ temphum13_init()

TEMPHUM13_RETVAL temphum13_init ( temphum13_t * ctx,
temphum13_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ temphum13_set_user_register()

void temphum13_set_user_register ( temphum13_t * ctx,
uint8_t register_content )

Set user register.

Parameters
ctxClick object
register_contentDesired register content to be set

@description This function sets user register to desired value.

◆ temphum13_soft_reset()

void temphum13_soft_reset ( temphum13_t * ctx)

Software reset.

Parameters
ctxClick object.

@description This function performs click soft reset.