temphum15 2.0.0.0
Temp&Hum 15 Click Driver

API for configuring and manipulating Temp&Hum 15 Click driver. More...

Topics

 Temp&Hum 15 Registers List
 List of commands of Temp&Hum 15 Click driver.
 
 Temp&Hum 15 Registers Settings
 Settings for registers of Temp&Hum 15 Click driver.
 
 Temp&Hum 15 MikroBUS Map
 MikroBUS pin mapping of Temp&Hum 15 Click driver.
 
 Precision_mode
 
 Status
 

Functions

void temphum15_cfg_setup (temphum15_cfg_t *cfg)
 Temp&Hum 15 configuration object setup function.
 
err_t temphum15_init (temphum15_t *ctx, temphum15_cfg_t *cfg)
 Temp&Hum 15 initialization function.
 
err_t temphum15_default_cfg (temphum15_t *ctx)
 Temp&Hum 15 default configuration function.
 
err_t temphum15_generic_write (temphum15_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Temp&Hum 15 I2C writing function.
 
err_t temphum15_generic_read (temphum15_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Temp&Hum 15 I2C reading function.
 
err_t temphum15_get_temp_and_hum (temphum15_t *ctx, uint8_t precision_mode, float *temp_val, float *hum_val)
 Temp&Hum 15 get temperature and humidity function.
 
err_t temphum15_soft_reset (temphum15_t *ctx)
 Temp&Hum 15 soft reset function.
 
err_t temphum15_read_serial (temphum15_t *ctx, uint32_t *serial_number)
 Temp&Hum 15 read serial number function.
 

Detailed Description

API for configuring and manipulating Temp&Hum 15 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

◆ temphum15_cfg_setup()

void temphum15_cfg_setup ( temphum15_cfg_t * cfg)

Temp&Hum 15 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ temphum15_default_cfg()

err_t temphum15_default_cfg ( temphum15_t * ctx)

Temp&Hum 15 default configuration function.

This function executes a default configuration of Temp&Hum 15 click board.

Parameters
[in]ctx: Click context object. See temphum15_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ temphum15_generic_read()

err_t temphum15_generic_read ( temphum15_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

Temp&Hum 15 I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See temphum15_t object definition for detailed explanation.
[in]reg: Start register address.
[out]rx_buf: Output read data.
[in]rx_len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ temphum15_generic_write()

err_t temphum15_generic_write ( temphum15_t * ctx,
uint8_t reg,
uint8_t * tx_buf,
uint8_t tx_len )

Temp&Hum 15 I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See temphum15_t object definition for detailed explanation.
[in]reg: Start register address.
[in]tx_buf: Data to be written.
[in]tx_len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ temphum15_get_temp_and_hum()

err_t temphum15_get_temp_and_hum ( temphum15_t * ctx,
uint8_t precision_mode,
float * temp_val,
float * hum_val )

Temp&Hum 15 get temperature and humidity function.

This function reads temperature and humidity with the power consumption based on the precision mode selected.

Parameters
[in]ctx: Click context object. See temphum15_t object definition for detailed explanation.
[in]precision_mode: Precision mode setting.
[out]temp_val: Output temperature value.
[out]hum_val: Output humidity value.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ temphum15_init()

err_t temphum15_init ( temphum15_t * ctx,
temphum15_cfg_t * cfg )

Temp&Hum 15 initialization function.

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

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

◆ temphum15_read_serial()

err_t temphum15_read_serial ( temphum15_t * ctx,
uint32_t * serial_number )

Temp&Hum 15 read serial number function.

This function reads unique serial number of the sensor.

Parameters
[in]ctx: Click context object. See temphum15_t object definition for detailed explanation.
[out]serial_number: Output serial number.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ temphum15_soft_reset()

err_t temphum15_soft_reset ( temphum15_t * ctx)

Temp&Hum 15 soft reset function.

This function sends soft reset command to the sensor.

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