temphum21  2.0.0.0
Modules | Functions
TempHum 21 Click Driver

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

Modules

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

Functions

void temphum21_cfg_setup (temphum21_cfg_t *cfg)
 TempHum 21 configuration object setup function. More...
 
err_t temphum21_init (temphum21_t *ctx, temphum21_cfg_t *cfg)
 TempHum 21 initialization function. More...
 
err_t temphum21_request_measurement (temphum21_t *ctx)
 TempHum 21 request measurement function. More...
 
err_t temphum21_read_measurement (temphum21_t *ctx, float *temperature, float *humidity)
 TempHum 21 read measurement function. More...
 
uint8_t temphum21_get_all_pin (temphum21_t *ctx)
 TempHum 21 get all pin function. More...
 
uint8_t temphum21_get_alh_pin (temphum21_t *ctx)
 TempHum 21 get alh pin function. More...
 

Detailed Description

API for configuring and manipulating TempHum 21 Click driver.

Function Documentation

◆ temphum21_cfg_setup()

void temphum21_cfg_setup ( temphum21_cfg_t cfg)

TempHum 21 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ temphum21_get_alh_pin()

uint8_t temphum21_get_alh_pin ( temphum21_t ctx)

TempHum 21 get alh pin function.

This function returns the alarm high (ALH) pin logic state.

Parameters
[in]ctx: Click context object. See temphum21_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ temphum21_get_all_pin()

uint8_t temphum21_get_all_pin ( temphum21_t ctx)

TempHum 21 get all pin function.

This function returns the alarm low (ALL) pin logic state.

Parameters
[in]ctx: Click context object. See temphum21_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ temphum21_init()

err_t temphum21_init ( temphum21_t ctx,
temphum21_cfg_t cfg 
)

TempHum 21 initialization function.

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

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

◆ temphum21_read_measurement()

err_t temphum21_read_measurement ( temphum21_t ctx,
float *  temperature,
float *  humidity 
)

TempHum 21 read measurement function.

This function requests measurement and waits for a measurement to complete and after that reads temperature in Celsius and relative humidity in percents.

Parameters
[in]ctx: Click context object. See temphum21_t object definition for detailed explanation.
Returns
  • 2 - Device in Command Mode - Command Mode is used for programming the sensor.
  • 1 - Stale Data: Data that has already been fetched since the last measurement cycle, or data fetched before the first measurement has been completed.
  • 0 - Normal Operation, Valid Data that has not been fetched since the last measurement cycle.
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ temphum21_request_measurement()

err_t temphum21_request_measurement ( temphum21_t ctx)

TempHum 21 request measurement function.

This function sends a request mesurement command.

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