thermo18 2.0.0.0
Thermo 18 Click Driver

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

Topics

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

Functions

void thermo18_cfg_setup (thermo18_cfg_t *cfg)
 Thermo 18 configuration object setup function.
 
err_t thermo18_init (thermo18_t *ctx, thermo18_cfg_t *cfg)
 Thermo 18 initialization function.
 
err_t thermo18_default_cfg (thermo18_t *ctx)
 Thermo 18 default configuration function.
 
err_t thermo18_generic_write (thermo18_t *ctx, uint8_t reg, uint8_t tx_data)
 Thermo 18 I2C writing function.
 
err_t thermo18_generic_read (thermo18_t *ctx, uint8_t reg, uint8_t *rx_data)
 Thermo 18 I2C reading function.
 
err_t thermo18_read_temperature (thermo18_t *ctx, float *temperature)
 Reads and calculates temperature value.
 
err_t thermo18_reset (thermo18_t *ctx)
 Resets device.
 
uint8_t thermo18_get_interrupt (thermo18_t *ctx)
 Get interrput status.
 
err_t thermo18_set_temperature_threshold (thermo18_t *ctx, uint8_t threshold_reg, float threshold_limit)
 Sets temperature threshold.
 

Detailed Description

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

◆ thermo18_cfg_setup()

void thermo18_cfg_setup ( thermo18_cfg_t * cfg)

Thermo 18 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ thermo18_default_cfg()

err_t thermo18_default_cfg ( thermo18_t * ctx)

Thermo 18 default configuration function.

This function executes a default configuration of Thermo 18 click board.

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

◆ thermo18_generic_read()

err_t thermo18_generic_read ( thermo18_t * ctx,
uint8_t reg,
uint8_t * rx_data )

Thermo 18 I2C reading function.

This function reads a data byte from the selected register.

Parameters
[in]ctx: Click context object. See thermo18_t object definition for detailed explanation.
[in]reg: Register address.
[out]rx_data: Output read data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ thermo18_generic_write()

err_t thermo18_generic_write ( thermo18_t * ctx,
uint8_t reg,
uint8_t tx_data )

Thermo 18 I2C writing function.

This function writes a data byte to the selected register.

Parameters
[in]ctx: Click context object. See thermo18_t object definition for detailed explanation.
[in]reg: Register address.
[in]tx_data: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ thermo18_get_interrupt()

uint8_t thermo18_get_interrupt ( thermo18_t * ctx)

Get interrput status.

Reads interrupt pin state.

Parameters
[in]ctx: Click context object. See thermo18_t object definition for detailed explanation.
Returns
Interrupt pin state

◆ thermo18_init()

err_t thermo18_init ( thermo18_t * ctx,
thermo18_cfg_t * cfg )

Thermo 18 initialization function.

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

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

◆ thermo18_read_temperature()

err_t thermo18_read_temperature ( thermo18_t * ctx,
float * temperature )

Reads and calculates temperature value.

Reads data registers and calculates temperature value in degrees Celsius.

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

◆ thermo18_reset()

err_t thermo18_reset ( thermo18_t * ctx)

Resets device.

Sends commands to reset device and clears it, when resets is done.

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

◆ thermo18_set_temperature_threshold()

err_t thermo18_set_temperature_threshold ( thermo18_t * ctx,
uint8_t threshold_reg,
float threshold_limit )

Sets temperature threshold.

Calculates and sets undertemperature thresholds or overtemperature threshold.

Parameters
[in]ctx: Click context object. See thermo18_t object definition for detailed explanation.
[in]threshold_reg: Can be THERMO18_REG_T_H_LIMIT or THERMO18_REG_T_L_LIMIT.
[in]threshold_limit: Temperature threshold to set.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.