temphum19 2.0.0.0
TempHum 19 Click Driver

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

Topics

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

Functions

void temphum19_cfg_setup (temphum19_cfg_t *cfg)
 TempHum 19 configuration object setup function.
 
err_t temphum19_init (temphum19_t *ctx, temphum19_cfg_t *cfg)
 TempHum 19 initialization function.
 
err_t temphum19_default_cfg (temphum19_t *ctx)
 TempHum 19 default configuration function.
 
err_t temphum19_generic_write (temphum19_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 TempHum 19 I2C writing function.
 
err_t temphum19_generic_read (temphum19_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 TempHum 19 I2C reading function.
 
void temphum19_enable_chip (temphum19_t *ctx)
 TempHum 19 enable chip function.
 
void temphum19_disable_chip (temphum19_t *ctx)
 TempHum 19 disable chip function.
 
void temphum19_restart_chip (temphum19_t *ctx)
 TempHum 19 restart chip function.
 
err_t temphum19_set_mode_reg (temphum19_t *ctx, uint8_t mode)
 TempHum 19 set mode function.
 
err_t temphum19_read_data (temphum19_t *ctx, float *temperature, float *humidity)
 TempHum 19 read data function.
 

Detailed Description

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

◆ temphum19_cfg_setup()

void temphum19_cfg_setup ( temphum19_cfg_t * cfg)

TempHum 19 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ temphum19_default_cfg()

err_t temphum19_default_cfg ( temphum19_t * ctx)

TempHum 19 default configuration function.

This function executes a default configuration of TempHum 19 click board.

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

◆ temphum19_disable_chip()

void temphum19_disable_chip ( temphum19_t * ctx)

TempHum 19 disable chip function.

This function disables the chip by setting the EN pin to low logic state.

Parameters
[in]ctx: Click context object. See temphum19_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ temphum19_enable_chip()

void temphum19_enable_chip ( temphum19_t * ctx)

TempHum 19 enable chip function.

This function enables the chip by setting the EN pin to high logic state.

Parameters
[in]ctx: Click context object. See temphum19_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ temphum19_generic_read()

err_t temphum19_generic_read ( temphum19_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

TempHum 19 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 temphum19_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.

◆ temphum19_generic_write()

err_t temphum19_generic_write ( temphum19_t * ctx,
uint8_t reg,
uint8_t * tx_buf,
uint8_t tx_len )

TempHum 19 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 temphum19_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.

◆ temphum19_init()

err_t temphum19_init ( temphum19_t * ctx,
temphum19_cfg_t * cfg )

TempHum 19 initialization function.

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

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

◆ temphum19_read_data()

err_t temphum19_read_data ( temphum19_t * ctx,
float * temperature,
float * humidity )

TempHum 19 read data function.

This function reads temperature and humidity raw data and converts them to Celsius and Percents respectfully.

Parameters
[in]ctx: Click context object. See temphum19_t object definition for detailed explanation.
[out]temperature: Temperature in Celsius.
[out]humidity: Humidity in Percents.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
In the case of any error, this function will restart the chip.

◆ temphum19_restart_chip()

void temphum19_restart_chip ( temphum19_t * ctx)

TempHum 19 restart chip function.

This function restarts the chip by toggling the EN pin state.

Parameters
[in]ctx: Click context object. See temphum19_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ temphum19_set_mode_reg()

err_t temphum19_set_mode_reg ( temphum19_t * ctx,
uint8_t mode )

TempHum 19 set mode function.

This function programs the mode register with a desired mode value, and stores it to the ctx->detection_mode variable.

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