temphum14 2.0.0.0
Temp Hum 14 Click Driver

API for configuring and manipulating Temp Hum 14 Click driver. More...

Topics

 Temp Hum 14 Registers List
 List of registers of Temp Hum 14 Click driver.
 
 Temp Hum 14 MikroBUS Map
 MikroBUS pin mapping of Temp Hum 14 Click driver.
 

Functions

void temphum14_cfg_setup (temphum14_cfg_t *cfg)
 Temp Hum 14 configuration object setup function.
 
err_t temphum14_init (temphum14_t *ctx, temphum14_cfg_t *cfg)
 Temp Hum 14 initialization function.
 
err_t temphum14_generic_write (temphum14_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Temp Hum 14 I2C writing function.
 
err_t temphum14_generic_read (temphum14_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Temp Hum 14 I2C reading function.
 
void temphum14_hw_reset (temphum14_t *ctx)
 HW reset function.
 
void temphum14_set_cmd (temphum14_t *ctx, uint8_t cmd)
 Send command function.
 
void temphum14_set_conversion (temphum14_t *ctx, uint8_t hum_osr, uint8_t temp_osr)
 Set conversion function.
 
void temphum14_read_t_and_rh (temphum14_t *ctx, uint8_t *p_rx_data)
 Read temperature and humidity data function.
 
void temphum14_get_temp_and_hum (temphum14_t *ctx, float *temp, float *hum)
 Get temperature and humidity data function.
 
void temphum14_read_rh (temphum14_t *ctx, uint8_t *p_rx_data)
 Read humidity data function.
 
float temphum14_get_hum (temphum14_t *ctx)
 Get humidity data function.
 
void temphum14_soft_reset (temphum14_t *ctx)
 Soft reset function.
 
void temphum14_set_heater (temphum14_t *ctx, uint8_t en_heater)
 Enable heater function.
 
void temphum14_get_diagnostic (temphum14_t *ctx, temphum14_diagn_t *diag_data)
 Get diagnostic status function.
 
uint32_t temphum14_get_serial_number (temphum14_t *ctx)
 Get serial number function.
 

Detailed Description

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

◆ temphum14_cfg_setup()

void temphum14_cfg_setup ( temphum14_cfg_t * cfg)

Temp Hum 14 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ temphum14_generic_read()

err_t temphum14_generic_read ( temphum14_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

Temp Hum 14 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 temphum14_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.

◆ temphum14_generic_write()

err_t temphum14_generic_write ( temphum14_t * ctx,
uint8_t reg,
uint8_t * tx_buf,
uint8_t tx_len )

Temp Hum 14 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 temphum14_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.

◆ temphum14_get_diagnostic()

void temphum14_get_diagnostic ( temphum14_t * ctx,
temphum14_diagn_t * diag_data )

Get diagnostic status function.

The function get diagnostic status of the HTU31D RH/T SENSOR IC Digital Relative Humidity sensor with Temperature output on the Temp-Hum 14 click board.

Parameters
[in]ctx: Click context object. See temphum14_t object definition for detailed explanation.
[out]diag_data: pointer to the memory location where structure where data be stored.
Returns
Nothing.

◆ temphum14_get_hum()

float temphum14_get_hum ( temphum14_t * ctx)

Get humidity data function.

The function get humidity value of the HTU31D RH/T SENSOR IC Digital Relative Humidity sensor with Temperature output on the Temp-Hum 14 click board.

Parameters
[in]ctx: Click context object. See temphum14_t object definition for detailed explanation.
Returns
Humidity value (percentage).

◆ temphum14_get_serial_number()

uint32_t temphum14_get_serial_number ( temphum14_t * ctx)

Get serial number function.

The function get the serial number of the HTU31D RH/T SENSOR IC Digital Relative Humidity sensor with Temperature output on the Temp-Hum 14 click board.

Parameters
[in]ctx: Click context object. See temphum14_t object definition for detailed explanation.
Returns
24-bit serial number.

◆ temphum14_get_temp_and_hum()

void temphum14_get_temp_and_hum ( temphum14_t * ctx,
float * temp,
float * hum )

Get temperature and humidity data function.

The function get temperature and humidity value of the HTU31D RH/T SENSOR IC Digital Relative Humidity sensor with Temperature output on the Temp-Hum 14 click board.

Parameters
[in]ctx: Click context object. See temphum14_t object definition for detailed explanation.
[out]temp: Pointer to the memory location where temperature (degree Celsius) be stored.
[out]hum: Pointer to the memory location where humidity (percentage) be stored.
Returns
Nothing.

◆ temphum14_hw_reset()

void temphum14_hw_reset ( temphum14_t * ctx)

HW reset function.

The function is performed by a hardware reset of the HTU31D RH/T SENSOR IC Digital Relative Humidity sensor with Temperature output on the Temp-Hum 14 click board.

Parameters
[in]ctx: Click context object. See temphum14_t object definition for detailed explanation.
Returns
Nothing.

◆ temphum14_init()

err_t temphum14_init ( temphum14_t * ctx,
temphum14_cfg_t * cfg )

Temp Hum 14 initialization function.

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

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

◆ temphum14_read_rh()

void temphum14_read_rh ( temphum14_t * ctx,
uint8_t * p_rx_data )

Read humidity data function.

The function read humidity data of the HTU31D RH/T SENSOR IC Digital Relative Humidity sensor with Temperature output on the Temp-Hum 14 click board.

Parameters
[in]ctx: Click context object. See temphum14_t object definition for detailed explanation.
[out]p_rx_data: Pointer to the memory location where data be stored.
Returns
Nothing.

◆ temphum14_read_t_and_rh()

void temphum14_read_t_and_rh ( temphum14_t * ctx,
uint8_t * p_rx_data )

Read temperature and humidity data function.

The function read temperature and humidity data of the HTU31D RH/T SENSOR IC Digital Relative Humidity sensor with Temperature output on the Temp-Hum 14 click board.

Parameters
[in]ctx: Click context object. See temphum14_t object definition for detailed explanation.
[out]p_rx_data: Pointer to the memory location where data be stored.
Returns
Nothing.

◆ temphum14_set_cmd()

void temphum14_set_cmd ( temphum14_t * ctx,
uint8_t cmd )

Send command function.

The function send the desired command to the HTU31D RH/T SENSOR IC Digital Relative Humidity sensor with Temperature output on the Temp-Hum 14 click board.

Parameters
[in]ctx: Click context object. See temphum14_t object definition for detailed explanation.
[in]cmd: 8-bit command.
Returns
Nothing.

◆ temphum14_set_conversion()

void temphum14_set_conversion ( temphum14_t * ctx,
uint8_t hum_osr,
uint8_t temp_osr )

Set conversion function.

The function set conversion a single temperature and humidity conversion and select data resolution to the HTU31D RH/T SENSOR IC Digital Relative Humidity sensor with Temperature output on the Temp-Hum 14 click board.

Parameters
[in]ctx: Click context object. See temphum14_t object definition for detailed explanation.
[in]hum_osr: Humidity OSR See #temphum14_reg object definition for detailed explanation.
[in]temp_osr: Temperature OSR See #temphum14_reg object definition for detailed explanation.
Returns
Nothing.

◆ temphum14_set_heater()

void temphum14_set_heater ( temphum14_t * ctx,
uint8_t en_heater )

Enable heater function.

The function set heater status ( disable or enable ) of the HTU31D RH/T SENSOR IC Digital Relative Humidity sensor with Temperature output on the Temp-Hum 14 click board.

Parameters
[in]en_heater: Heater enable and disable.
[in]ctx: Click context object. See temphum14_t object definition for detailed explanation.
Returns
Nothing.

◆ temphum14_soft_reset()

void temphum14_soft_reset ( temphum14_t * ctx)

Soft reset function.

The function is performed by a software reset of the HTU31D RH/T SENSOR IC Digital Relative Humidity sensor with Temperature output on the Temp-Hum 14 click board.

Parameters
[in]ctx: Click context object. See temphum14_t object definition for detailed explanation.
Returns
Nothing.