temphum16 2.0.0.0
Temp&Hum 16 Click Driver

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

Topics

 Temp&Hum 16 Registers List
 List of registers of Temp&Hum 16 Click driver.
 
 Temp&Hum 16 Registers Settings
 Settings for registers of Temp&Hum 16 Click driver.
 
 Temp&Hum 16 MikroBUS Map
 MikroBUS pin mapping of Temp&Hum 16 Click driver.
 

Functions

void temphum16_cfg_setup (temphum16_cfg_t *cfg)
 Temp&Hum 16 configuration object setup function.
 
void temphum16_drv_interface_selection (temphum16_cfg_t *cfg, temphum16_drv_t drv_sel)
 Temp&Hum 16 driver interface setup function.
 
err_t temphum16_init (temphum16_t *ctx, temphum16_cfg_t *cfg)
 Temp&Hum 16 initialization function.
 
err_t temphum16_default_cfg (temphum16_t *ctx)
 Temp&Hum 16 default configuration function.
 
err_t temphum16_generic_write (temphum16_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Temp&Hum 16 data writing function.
 
err_t temphum16_generic_read (temphum16_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Temp&Hum 16 data reading function.
 
err_t temphum16_get_device_id (temphum16_t *ctx, uint8_t *device_id)
 Temp&Hum 16 get device ID function.
 
err_t temphum16_power_mode (temphum16_t *ctx, uint8_t pwr_mode)
 Temp&Hum 16 set power mode function.
 
err_t temphum16_bdu_mode (temphum16_t *ctx, uint8_t bdu_mode)
 Temp&Hum 16 set block data update mode function.
 
err_t temphum16_set_odr (temphum16_t *ctx, uint8_t odr)
 Temp&Hum 16 set output data rate function.
 
err_t temphum16_heater (temphum16_t *ctx, uint8_t heater_mode)
 Temp&Hum 16 heater function.
 
err_t temphum16_enable_data_ready_interrupt (temphum16_t *ctx)
 Temp&Hum 16 enable data ready interrupt function.
 
err_t temphum16_get_status (temphum16_t *ctx, uint8_t *status)
 Temp&Hum 16 get status function.
 
uint8_t temphum16_check_ready (temphum16_t *ctx)
 Temp&Hum 16 check ready function.
 
err_t temphum16_get_humidity (temphum16_t *ctx, float *humidity)
 Temp&Hum 16 get humidity function.
 
err_t temphum16_get_temperature (temphum16_t *ctx, float *temperature)
 Temp&Hum 16 get temperature function.
 

Detailed Description

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

◆ temphum16_bdu_mode()

err_t temphum16_bdu_mode ( temphum16_t * ctx,
uint8_t bdu_mode )

Temp&Hum 16 set block data update mode function.

This function set block data update mode of the Humidity sensor with integrated Temperature sensor WSEN-HIDS on the Temp&Hum 16 Click board™.

Parameters
[in]ctx: Click context object. See temphum16_t object definition for detailed explanation.
[in]bdu_mode:
  • 0x00 ( TEMPHUM16_BDU_CONTINUOUS_UPDATE ) - Continuous update.
  • 0x01 ( TEMPHUM16_BDU_NOT_UPDAT_UNTIL_READ ) - Output registers are not updated until MSB and LSB is read.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ temphum16_cfg_setup()

void temphum16_cfg_setup ( temphum16_cfg_t * cfg)

Temp&Hum 16 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ temphum16_check_ready()

uint8_t temphum16_check_ready ( temphum16_t * ctx)

Temp&Hum 16 check ready function.

This function check output data ready of the Humidity sensor with integrated Temperature sensor WSEN-HIDS on the Temp&Hum 16 Click board™.

Parameters
[in]ctx: Click context object. See temphum16_t object definition for detailed explanation.
Returns
  • 0x00 - Data not ready.
  • 0x01 - Data is ready.
See #err_t definition for detailed explanation.
Note
None.

◆ temphum16_default_cfg()

err_t temphum16_default_cfg ( temphum16_t * ctx)

Temp&Hum 16 default configuration function.

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

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

◆ temphum16_drv_interface_selection()

void temphum16_drv_interface_selection ( temphum16_cfg_t * cfg,
temphum16_drv_t drv_sel )

Temp&Hum 16 driver interface setup function.

This function sets a serial driver interface which will be used further in the click driver.

Parameters
[out]cfg: Click configuration structure. See temphum16_cfg_t object definition for detailed explanation.
[in]drv_sel: Driver interface selection. See temphum16_drv_t object definition for detailed explanation.
Returns
Nothing.
Note
This driver selection should be call before init function to configure the driver to work with the serial interface which is consistent with the real state of the hardware. If this function is not called, the default driver interface will be set.

◆ temphum16_enable_data_ready_interrupt()

err_t temphum16_enable_data_ready_interrupt ( temphum16_t * ctx)

Temp&Hum 16 enable data ready interrupt function.

This function performs enable or disable heater of the Humidity sensor with integrated Temperature sensor WSEN-HIDS on the Temp&Hum 16 Click board™.

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

◆ temphum16_generic_read()

err_t temphum16_generic_read ( temphum16_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Temp&Hum 16 data reading function.

This function reads a desired number of data bytes starting from the selected register.

Parameters
[in]ctx: Click context object. See temphum16_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
Read multiple bytes available only by using I2C serial interface.

◆ temphum16_generic_write()

err_t temphum16_generic_write ( temphum16_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Temp&Hum 16 data writing function.

This function writes a desired number of data bytes starting from the selected register.

Parameters
[in]ctx: Click context object. See temphum16_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
Write multiple bytes available only by using I2C serial interface.

◆ temphum16_get_device_id()

err_t temphum16_get_device_id ( temphum16_t * ctx,
uint8_t * device_id )

Temp&Hum 16 get device ID function.

This function reads a device ID value of the Humidity sensor with integrated Temperature sensor WSEN-HIDS on the Temp&Hum 16 Click board™.

Parameters
[in]ctx: Click context object. See temphum16_t object definition for detailed explanation.
[out]device_id: Output read data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ temphum16_get_humidity()

err_t temphum16_get_humidity ( temphum16_t * ctx,
float * humidity )

Temp&Hum 16 get humidity function.

This function read the Humidity data of the Humidity sensor with integrated Temperature sensor WSEN-HIDS on the Temp&Hum 16 Click board™.

Parameters
[in]ctx: Click context object. See temphum16_t object definition for detailed explanation.
[out]humidity: Humidity [ % ].
  • 0x00 ( TEMPHUM16_HEATER_DISABLE ) - Disable.
  • 0x01 ( TEMPHUM16_HEATER_ENABLE ) - Enable.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ temphum16_get_status()

err_t temphum16_get_status ( temphum16_t * ctx,
uint8_t * status )

Temp&Hum 16 get status function.

This function get status output data of the Humidity sensor with integrated Temperature sensor WSEN-HIDS on the Temp&Hum 16 Click board™.

Parameters
[in]ctx: Click context object. See temphum16_t object definition for detailed explanation.
[out]status: Status output data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ temphum16_get_temperature()

err_t temphum16_get_temperature ( temphum16_t * ctx,
float * temperature )

Temp&Hum 16 get temperature function.

This function read the Temperature data of the Humidity sensor with integrated Temperature sensor WSEN-HIDS on the Temp&Hum 16 Click board™.

Parameters
[in]ctx: Click context object. See temphum16_t object definition for detailed explanation.
[out]humidity: Temperature [ degree Celsius ].
  • 0x00 ( TEMPHUM16_HEATER_DISABLE ) - Disable.
  • 0x01 ( TEMPHUM16_HEATER_ENABLE ) - Enable.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ temphum16_heater()

err_t temphum16_heater ( temphum16_t * ctx,
uint8_t heater_mode )

Temp&Hum 16 heater function.

This function performs enable or disable heater of the Humidity sensor with integrated Temperature sensor WSEN-HIDS on the Temp&Hum 16 Click board™.

Parameters
[in]ctx: Click context object. See temphum16_t object definition for detailed explanation.
[in]pwr_mode:
  • 0x00 ( TEMPHUM16_HEATER_DISABLE ) - Disable.
  • 0x01 ( TEMPHUM16_HEATER_ENABLE ) - Enable.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ temphum16_init()

err_t temphum16_init ( temphum16_t * ctx,
temphum16_cfg_t * cfg )

Temp&Hum 16 initialization function.

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

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

◆ temphum16_power_mode()

err_t temphum16_power_mode ( temphum16_t * ctx,
uint8_t pwr_mode )

Temp&Hum 16 set power mode function.

This function performs power mode of the Humidity sensor with integrated Temperature sensor WSEN-HIDS on the Temp&Hum 16 Click board™.

Parameters
[in]ctx: Click context object. See temphum16_t object definition for detailed explanation.
[in]pwr_mode:
  • 0x00 ( TEMPHUM16_PWR_MODE_POWER_DOWN ) - Power down mode.
  • 0x01 ( TEMPHUM16_PWR_MODE_CONTINUOUS ) - Continuous mode for active measurement.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ temphum16_set_odr()

err_t temphum16_set_odr ( temphum16_t * ctx,
uint8_t odr )

Temp&Hum 16 set output data rate function.

This function set output data rate of the humidity and temperature of the Humidity sensor with integrated Temperature sensor WSEN-HIDS on the Temp&Hum 16 Click board™.

Parameters
[in]ctx: Click context object. See temphum16_t object definition for detailed explanation.
[out]

odr :

  • 0x00 ( TEMPHUM16_ODR_ONE_SHOT_MODE ) - One shot mode.
  • 0x01 ( TEMPHUM16_ODR_1_Hz ) - Output data rate 1 Hz.
  • 0x02 ( TEMPHUM16_ODR_7_Hz ) - Output data rate 7 Hz.
  • 0x03 ( TEMPHUM16_ODR_12_5_Hz ) - Output data rate 12.5 Hz.
    Returns
  • 0 - Success,
  • -1 - Error.

See #err_t definition for detailed explanation.

Note
None.