shtan 2.0.0.0
Public function

Functions

void shtan_cfg_setup (shtan_cfg_t *cfg)
 Config Object Initialization function.
 
err_t shtan_init (shtan_t *ctx, shtan_cfg_t *cfg)
 Initialization function.
 
err_t shtan_read_adc (shtan_t *ctx, uint16_t *data_out)
 ADC read function.
 
err_t shtan_read_an_voltage (shtan_t *ctx, float *data_out)
 AN voltage read function.
 
err_t shtan_meas_temperature (shtan_t *ctx, float *data_out, shtan_temp_mode_t sel)
 Temperature measure function.
 
err_t shtan_meas_humidity (shtan_t *ctx, float *data_out)
 Humidity measure function.
 
void shtan_set_mode (shtan_t *ctx, shtan_adc_mode_t sel)
 Set ADC mode function.
 
void shtan_reset (shtan_t *ctx)
 Hardware reset function.
 

Detailed Description

Function Documentation

◆ shtan_cfg_setup()

void shtan_cfg_setup ( shtan_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.

◆ shtan_init()

err_t shtan_init ( shtan_t * ctx,
shtan_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.
Returns
0 - Ok, (-1) - Error.

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

◆ shtan_meas_humidity()

err_t shtan_meas_humidity ( shtan_t * ctx,
float * data_out )

Humidity measure function.

Parameters
ctxClick object.
data_outOutput relative humidity value [%].
Returns
0 - Ok, (-1) - Error.

@description This function measures a relative humidity level.

◆ shtan_meas_temperature()

err_t shtan_meas_temperature ( shtan_t * ctx,
float * data_out,
shtan_temp_mode_t sel )

Temperature measure function.

Parameters
ctxClick object.
data_outOutput temperature value [deg C/F].
sel0 - deg C, 1 - deg F.
Returns
0 - Ok, (-1) - Error.

@description This function measures a temperature results converting them to the selected unit.

◆ shtan_read_adc()

err_t shtan_read_adc ( shtan_t * ctx,
uint16_t * data_out )

ADC read function.

Parameters
ctxClick object.
data_outOutput read data.
Returns
0 - Ok, (-1) - Error.

@description This function reads the ADC converted data.

◆ shtan_read_an_voltage()

err_t shtan_read_an_voltage ( shtan_t * ctx,
float * data_out )

AN voltage read function.

Parameters
ctxClick object.
data_outOutput read voltage value.
Returns
0 - Ok, (-1) - Error.

@description This function reads and calculates the voltage level of the AN pin.

◆ shtan_reset()

void shtan_reset ( shtan_t * ctx)

Hardware reset function.

Parameters
ctxClick object.

@description Function hardware reset the SHT3x-ARP Humidity and Temperature Sensor IC on SHT AN click by cleared to '0' state of the RST pin, wait the 100 ms, then sets to '1' state of the RST pin and wait for 1 second to establish the device.

◆ shtan_set_mode()

void shtan_set_mode ( shtan_t * ctx,
shtan_adc_mode_t sel )

Set ADC mode function.

Parameters
ctxClick object.
sel- 0 ( SHTAN_SET_ADC_MODE_TEMP ) - Set signal output, ADC mode temperature.
  • 1 ( SHTAN_SET_ADC_MODE_HUM ) - Set signal output, ADC mode humidity.

@description Function sets signal output ADC mode of the SHT3x-ARP Humidity and Temperature Sensor IC on SHT AN Click.