temphum23 2.1.0.0
TempHum 23 Click Driver

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

Topics

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

Functions

void temphum23_cfg_setup (temphum23_cfg_t *cfg)
 TempHum 23 configuration object setup function.
 
err_t temphum23_init (temphum23_t *ctx, temphum23_cfg_t *cfg)
 TempHum 23 initialization function.
 
err_t temphum23_send_cmd (temphum23_t *ctx, uint8_t cmd)
 TempHum 23 send cmd function.
 
err_t temphum23_read_response (temphum23_t *ctx, uint8_t *data_out)
 TempHum 23 read response function.
 
err_t temphum23_soft_reset (temphum23_t *ctx)
 TempHum 23 soft reset function.
 
err_t temphum23_read_serial_num (temphum23_t *ctx, uint32_t *serial_num)
 TempHum 23 read serial num function.
 
err_t temphum23_read_measurement_high_precision (temphum23_t *ctx, float *temp, float *hum)
 TempHum 23 read measurement high precision function.
 

Detailed Description

API for configuring and manipulating TempHum 23 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

◆ temphum23_cfg_setup()

void temphum23_cfg_setup ( temphum23_cfg_t * cfg)

TempHum 23 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ temphum23_init()

err_t temphum23_init ( temphum23_t * ctx,
temphum23_cfg_t * cfg )

TempHum 23 initialization function.

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

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

◆ temphum23_read_measurement_high_precision()

err_t temphum23_read_measurement_high_precision ( temphum23_t * ctx,
float * temp,
float * hum )

TempHum 23 read measurement high precision function.

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

Parameters
[in]ctx: Click context object. See temphum23_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.

◆ temphum23_read_response()

err_t temphum23_read_response ( temphum23_t * ctx,
uint8_t * data_out )

TempHum 23 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 temphum23_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.

◆ temphum23_read_serial_num()

err_t temphum23_read_serial_num ( temphum23_t * ctx,
uint32_t * serial_num )

TempHum 23 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 temphum23_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.

◆ temphum23_send_cmd()

err_t temphum23_send_cmd ( temphum23_t * ctx,
uint8_t cmd )

TempHum 23 send cmd function.

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

Parameters
[in]ctx: Click context object. See temphum23_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.

◆ temphum23_soft_reset()

err_t temphum23_soft_reset ( temphum23_t * ctx)

TempHum 23 soft reset function.

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

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