temphum17 2.0.0.0
Temp&Hum 17 Click Driver

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

Topics

 Temp&Hum 17 Registers List
 List of registers of Temp&Hum 17 Click driver.
 
 Temp&Hum 17 Command List
 List of commands of Temp&Hum 17 Click driver.
 
 Temp&Hum 17 status bits
 List of status bits of Temp&Hum 17 Click driver.
 
 Temp&Hum 17 Registers Settings
 Settings for registers of Temp&Hum 17 Click driver.
 
 Temp&Hum 17 MikroBUS Map
 MikroBUS pin mapping of Temp&Hum 17 Click driver.
 

Functions

void temphum17_cfg_setup (temphum17_cfg_t *cfg)
 Temp&Hum 17 configuration object setup function.
 
err_t temphum17_init (temphum17_t *ctx, temphum17_cfg_t *cfg)
 Temp&Hum 17 initialization function.
 
err_t temphum17_default_cfg (temphum17_t *ctx)
 Temp&Hum 17 default configuration function.
 
err_t temphum17_generic_write (temphum17_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Temp&Hum 17 I2C writing function.
 
err_t temphum17_generic_read (temphum17_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Temp&Hum 17 I2C reading function.
 
err_t temphum17_wake_up (temphum17_t *ctx)
 Temp&Hum 17 wake up function.
 
err_t temphum17_get_raw_data (temphum17_t *ctx, uint8_t resolution, int16_t *temp, uint16_t *hum, uint8_t *status)
 Temp&Hum 17 get raw data function.
 
err_t temphum17_get_temp_hum (temphum17_t *ctx, uint8_t resolution, float *temperature, float *humidity)
 Temp&Hum 17 get temperature and humidity function.
 
err_t temphum17_enter_programming_mode (temphum17_t *ctx)
 Temp&Hum 17 enter programming mode function.
 
err_t temphum17_enter_measurements_mode (temphum17_t *ctx)
 Temp&Hum 17 enter measurements mode function.
 
err_t temphum17_set_relative_humidity_resolution (temphum17_t *ctx, uint8_t resolution)
 Temp&Hum 17 set relative humidity resolution function.
 
err_t temphum17_set_temperature_resolution (temphum17_t *ctx, uint8_t resolution)
 Temp&Hum 17 set temperature resolution function.
 

Detailed Description

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

◆ temphum17_cfg_setup()

void temphum17_cfg_setup ( temphum17_cfg_t * cfg)

Temp&Hum 17 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ temphum17_default_cfg()

err_t temphum17_default_cfg ( temphum17_t * ctx)

Temp&Hum 17 default configuration function.

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

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

◆ temphum17_enter_measurements_mode()

err_t temphum17_enter_measurements_mode ( temphum17_t * ctx)

Temp&Hum 17 enter measurements mode function.

This function enter measurements mode, exit programming mode of the HS3001 High Performance Relative Humidity and Temperature Sensor on the Temp&Hum 17 click board™.

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

◆ temphum17_enter_programming_mode()

err_t temphum17_enter_programming_mode ( temphum17_t * ctx)

Temp&Hum 17 enter programming mode function.

This function enter programming mode, accessing the non-volatile memory of the HS3001 High Performance Relative Humidity and Temperature Sensor on the Temp&Hum 17 click board™.

Parameters
[in]ctx: Click context object. See temphum17_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
To enter the programming mode, you must call the function within 10 ms after the sensor has been powered on.

◆ temphum17_generic_read()

err_t temphum17_generic_read ( temphum17_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

Temp&Hum 17 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 temphum17_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.

◆ temphum17_generic_write()

err_t temphum17_generic_write ( temphum17_t * ctx,
uint8_t reg,
uint8_t * tx_buf,
uint8_t tx_len )

Temp&Hum 17 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 temphum17_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.

◆ temphum17_get_raw_data()

err_t temphum17_get_raw_data ( temphum17_t * ctx,
uint8_t resolution,
int16_t * temp,
uint16_t * hum,
uint8_t * status )

Temp&Hum 17 get raw data function.

This function get raw data of the HS3001 High Performance Relative Humidity and Temperature Sensor on the Temp&Hum 17 click board™.

Parameters
[in]ctx: Click context object. See temphum17_t object definition for detailed explanation.
[in]resolution:
  • 0x00 ( TEMPHUM17_RESOLUTION_8_BITS ) - 8 bit resolution,
  • 0x01 ( TEMPHUM17_RESOLUTION_10_BITS ) - 10 bit resolution,
  • 0x02 ( TEMPHUM17_RESOLUTION_12_BITS ) - 12 bit resolution,
  • 0x03 ( TEMPHUM17_RESOLUTION_14_BITS ) - 14 bit resolution.
[out]temp: Output read Temperature ( RAW ) data.
[out]hum: Output read Humidity ( RAW ) data.
[out]status:
  • 0x00 ( TEMPHUM17_STATUS_VALID_DATA ) - Data that has not been fetched since the last measurement cycle,
  • 0x01 ( TEMPHUM17_STATUS_STALE_DATA ) - Data that has already been fetched since the last measurement cycle.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
Status : If a data fetch is performed before or during the first measurement after power-on reset, then the stale status will be returned, but this data is actually invalid since the first measurement has not been completed. The function performs a delay depending on the selected data resolution:
  • 14-bit resolution it is 33.90 milliseconds,
  • 12-bit resolution it is 9.10 milliseconds,
  • 10-bit resolution it is 2.72 milliseconds,
  • 8-bit resolution it is 1.20 milliseconds.

◆ temphum17_get_temp_hum()

err_t temphum17_get_temp_hum ( temphum17_t * ctx,
uint8_t resolution,
float * temperature,
float * humidity )

Temp&Hum 17 get temperature and humidity function.

This function get temperature ( degree Celsius ) and humidity ( % ) of the HS3001 High Performance Relative Humidity and Temperature Sensor on the Temp&Hum 17 click board™.

Parameters
[in]ctx: Click context object. See temphum17_t object definition for detailed explanation.
[in]resolution:
  • 0x00 ( TEMPHUM17_RESOLUTION_8_BITS ) - 8 bit resolution,
  • 0x01 ( TEMPHUM17_RESOLUTION_10_BITS ) - 10 bit resolution,
  • 0x02 ( TEMPHUM17_RESOLUTION_12_BITS ) - 12 bit resolution,
  • 0x03 ( TEMPHUM17_RESOLUTION_14_BITS ) - 14 bit resolution.
[out]temperature: Temperature data ( degree Celsius ).
[out]humidity: Humidity data ( % ).
Returns
  • 0x00 ( TEMPHUM17_STATUS_VALID_DATA ) - Data that has not been fetched since the last measurement cycle,
  • 0x01 ( TEMPHUM17_STATUS_STALE_DATA ) - Data that has already been fetched since the last measurement cycle.
  • -1 - Communication Error.
See #err_t definition for detailed explanation.
Note
If a data fetch is performed before or during the first measurement after power-on reset, then the stale status will be returned, but this data is actually invalid since the first measurement has not been completed. The function performs a delay depending on the selected data resolution:
  • 14-bit resolution it is 33.90 milliseconds,
  • 12-bit resolution it is 9.10 milliseconds,
  • 10-bit resolution it is 2.72 milliseconds,
  • 8-bit resolution it is 1.20 milliseconds.

◆ temphum17_init()

err_t temphum17_init ( temphum17_t * ctx,
temphum17_cfg_t * cfg )

Temp&Hum 17 initialization function.

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

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

◆ temphum17_set_relative_humidity_resolution()

err_t temphum17_set_relative_humidity_resolution ( temphum17_t * ctx,
uint8_t resolution )

Temp&Hum 17 set relative humidity resolution function.

This function sets desired relative humidity resolution of the HS3001 High Performance Relative Humidity and Temperature Sensor on the Temp&Hum 17 click board™.

Parameters
[in]ctx: Click context object. See temphum17_t object definition for detailed explanation.
[in]resolution:
  • 0x00 ( TEMPHUM17_RESOLUTION_8_BITS ) - 8 bit resolution,
  • 0x01 ( TEMPHUM17_RESOLUTION_10_BITS ) - 10 bit resolution,
  • 0x02 ( TEMPHUM17_RESOLUTION_12_BITS ) - 12 bit resolution,
  • 0x03 ( TEMPHUM17_RESOLUTION_14_BITS ) - 14 bit resolution.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
The function performs a delay of approximately 14 milliseconds.

◆ temphum17_set_temperature_resolution()

err_t temphum17_set_temperature_resolution ( temphum17_t * ctx,
uint8_t resolution )

Temp&Hum 17 set temperature resolution function.

This function sets desired temperature resolution of the HS3001 High Performance Relative Humidity and Temperature Sensor on the Temp&Hum 17 click board™.

Parameters
[in]ctx: Click context object. See temphum17_t object definition for detailed explanation.
[in]resolution:
  • 0x00 ( TEMPHUM17_RESOLUTION_8_BITS ) - 8 bit resolution,
  • 0x01 ( TEMPHUM17_RESOLUTION_10_BITS ) - 10 bit resolution,
  • 0x02 ( TEMPHUM17_RESOLUTION_12_BITS ) - 12 bit resolution,
  • 0x03 ( TEMPHUM17_RESOLUTION_14_BITS ) - 14 bit resolution.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
The function performs a delay of approximately 14 milliseconds.

◆ temphum17_wake_up()

err_t temphum17_wake_up ( temphum17_t * ctx)

Temp&Hum 17 wake up function.

This function wake up the HS3001 High Performance Relative Humidity and Temperature Sensor from its Sleep Mode.

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