thermo21 2.0.0.0
Thermo 21 Click Driver

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

Topics

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

Functions

void thermo21_cfg_setup (thermo21_cfg_t *cfg)
 Thermo 21 configuration object setup function.
 
err_t thermo21_init (thermo21_t *ctx, thermo21_cfg_t *cfg)
 Thermo 21 initialization function.
 
err_t thermo21_generic_read (thermo21_t *ctx, uint8_t *data_out, uint8_t len)
 Data reading function.
 
err_t thermo21_temperature_read (thermo21_t *ctx, float *data_out)
 Temperature reading function.
 

Detailed Description

API for configuring and manipulating Thermo 21 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

◆ thermo21_cfg_setup()

void thermo21_cfg_setup ( thermo21_cfg_t * cfg)

Thermo 21 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ thermo21_generic_read()

err_t thermo21_generic_read ( thermo21_t * ctx,
uint8_t * data_out,
uint8_t len )

Data reading function.

This function reads a desired number of data bytes from the device by using SPI serial interface.

Parameters
[in]ctx: Click context object. See thermo21_t object definition for detailed explanation.
[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
None.

◆ thermo21_init()

err_t thermo21_init ( thermo21_t * ctx,
thermo21_cfg_t * cfg )

Thermo 21 initialization function.

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

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

◆ thermo21_temperature_read()

err_t thermo21_temperature_read ( thermo21_t * ctx,
float * data_out )

Temperature reading function.

This function reads a 2 bytes and calculates temperature from device.

Parameters
[in]ctx: Click context object. See thermo21_t object definition for detailed explanation.
[out]data_out: Output temperature data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
Output temperature in Celisus degrees .