temphum22 2.1.0.0
TempHum 22 Click Driver

API for configuring and manipulating TempHum 22 Click driver. More...

Topics

 TempHum 22 Registers List
 List of registers of TempHum 22 Click driver.
 
 TempHum 22 Registers Settings
 Settings for registers of TempHum 22 Click driver.
 
 TempHum 22 MikroBUS Map
 MikroBUS pin mapping of TempHum 22 Click driver.
 

Functions

void temphum22_cfg_setup (temphum22_cfg_t *cfg)
 TempHum 22 configuration object setup function.
 
err_t temphum22_init (temphum22_t *ctx, temphum22_cfg_t *cfg)
 TempHum 22 initialization function.
 
err_t temphum22_send_cmd (temphum22_t *ctx, uint8_t cmd)
 TempHum 22 send cmd function.
 
err_t temphum22_read_response (temphum22_t *ctx, uint8_t *data_out)
 TempHum 22 read response function.
 
err_t temphum22_soft_reset (temphum22_t *ctx)
 TempHum 22 soft reset function.
 
err_t temphum22_read_serial_num (temphum22_t *ctx, uint32_t *serial_num)
 TempHum 22 read serial num function.
 
err_t temphum22_read_measurement_high_precision (temphum22_t *ctx, float *temp, float *hum)
 TempHum 22 read measurement high precision function.
 

Detailed Description

API for configuring and manipulating TempHum 22 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ temphum22_cfg_setup()

void temphum22_cfg_setup ( temphum22_cfg_t * cfg)

TempHum 22 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See temphum22_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ temphum22_init()

err_t temphum22_init ( temphum22_t * ctx,
temphum22_cfg_t * cfg )

TempHum 22 initialization function.

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

Parameters
[out]ctx: Click context object. See temphum22_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See temphum22_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ temphum22_read_measurement_high_precision()

err_t temphum22_read_measurement_high_precision ( temphum22_t * ctx,
float * temp,
float * hum )

TempHum 22 read measurement high precision function.

This function reads the temperature and humidity measurements with high precision.

Parameters
[in]ctx: Click context object. See temphum22_t object definition for detailed explanation.
[out]temp: Temperature in degrees Celsius.
[out]hum: Relative humidity in percents.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ temphum22_read_response()

err_t temphum22_read_response ( temphum22_t * ctx,
uint8_t * data_out )

TempHum 22 read response function.

This function reads 6 response bytes to the previously sent command by using I2C serial interface.

Parameters
[in]ctx: Click context object. See temphum22_t object definition for detailed explanation.
[out]data_out: 6 response bytes.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ temphum22_read_serial_num()

err_t temphum22_read_serial_num ( temphum22_t * ctx,
uint32_t * serial_num )

TempHum 22 read serial num function.

This function reads the 4-bytes unique serial number by using I2C serial interface.

Parameters
[in]ctx: Click context object. See temphum22_t object definition for detailed explanation.
[out]serial_num: 4-bytes unique serial number.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ temphum22_send_cmd()

err_t temphum22_send_cmd ( temphum22_t * ctx,
uint8_t cmd )

TempHum 22 send cmd function.

This function sends the selected command byte by using I2C serial interface.

Parameters
[in]ctx: Click context object. See temphum22_t object definition for detailed explanation.
[in]cmd: Command byte to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ temphum22_soft_reset()

err_t temphum22_soft_reset ( temphum22_t * ctx)

TempHum 22 soft reset function.

This function performs the software reset by sending the soft reset command.

Parameters
[in]ctx: Click context object. See temphum22_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.