thermo27 2.1.0.0
Thermo 27 Click Driver

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

Topics

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

Functions

void thermo27_cfg_setup (thermo27_cfg_t *cfg)
 Thermo 27 configuration object setup function.
 
err_t thermo27_init (thermo27_t *ctx, thermo27_cfg_t *cfg)
 Thermo 27 initialization function.
 
err_t thermo27_default_cfg (thermo27_t *ctx)
 Thermo 27 default configuration function.
 
err_t thermo27_generic_write (thermo27_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Thermo 27 I2C writing function.
 
err_t thermo27_generic_read (thermo27_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Thermo 27 I2C reading function.
 
err_t thermo27_write_register (thermo27_t *ctx, uint8_t reg, uint16_t data_in)
 Thermo 27 register writing function.
 
err_t thermo27_read_register (thermo27_t *ctx, uint8_t reg, uint16_t *data_out)
 Thermo 27 register reading function.
 
err_t thermo27_get_device_id (thermo27_t *ctx, uint16_t *device_id)
 Thermo 27 get device id function.
 
err_t thermo27_sw_reset (thermo27_t *ctx)
 Thermo 27 software reset function.
 
err_t thermo27_read_temp (thermo27_t *ctx, float *temp_out)
 Thermo 27 get read temperature function.
 
err_t thermo27_enable_crc (thermo27_t *ctx)
 Thermo 27 enable CRC function.
 
err_t thermo27_set_low_temp_limit (thermo27_t *ctx, float low_temp_limit)
 Thermo 27 set low temperature limit function.
 
err_t thermo27_set_high_temp_limit (thermo27_t *ctx, float high_temp_limit)
 Thermo 27 set high temperature limit function.
 
err_t thermo27_set_hysteresis (thermo27_t *ctx, uint8_t thigh_hyst, uint8_t tlow_hyst)
 Thermo 27 set hysteresis function.
 
err_t thermo27_set_slew_limit (thermo27_t *ctx, float slew_limit)
 Thermo 27 set slew limit function.
 
err_t thermo27_get_alert_reg (thermo27_t *ctx, uint8_t *register_flags)
 Thermo 27 get alert register staus function.
 

Detailed Description

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

◆ thermo27_cfg_setup()

void thermo27_cfg_setup ( thermo27_cfg_t * cfg)

Thermo 27 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ thermo27_default_cfg()

err_t thermo27_default_cfg ( thermo27_t * ctx)

Thermo 27 default configuration function.

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

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

◆ thermo27_enable_crc()

err_t thermo27_enable_crc ( thermo27_t * ctx)

Thermo 27 enable CRC function.

This function sets device in CRC mode. CRC is generated and added as part of the read and write functions.

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

◆ thermo27_generic_read()

err_t thermo27_generic_read ( thermo27_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Thermo 27 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 thermo27_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
None.

◆ thermo27_generic_write()

err_t thermo27_generic_write ( thermo27_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Thermo 27 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 thermo27_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
None.

◆ thermo27_get_alert_reg()

err_t thermo27_get_alert_reg ( thermo27_t * ctx,
uint8_t * register_flags )

Thermo 27 get alert register staus function.

This function is used to read alert register data.

Parameters
[in]ctx: Click context object. See thermo27_t object definition for detailed explanation.
[out]register_flags: Read data from the alert register.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ thermo27_get_device_id()

err_t thermo27_get_device_id ( thermo27_t * ctx,
uint16_t * device_id )

Thermo 27 get device id function.

This function reads a device id from the register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See thermo27_t object definition for detailed explanation.
[out]device_id: Read device id.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ thermo27_init()

err_t thermo27_init ( thermo27_t * ctx,
thermo27_cfg_t * cfg )

Thermo 27 initialization function.

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

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

◆ thermo27_read_register()

err_t thermo27_read_register ( thermo27_t * ctx,
uint8_t reg,
uint16_t * data_out )

Thermo 27 register reading function.

This function reads a 16 bits of data from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See thermo27_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ thermo27_read_temp()

err_t thermo27_read_temp ( thermo27_t * ctx,
float * temp_out )

Thermo 27 get read temperature function.

This function reads a temperature from the register by using I2C serial interface. Temperature is converted and returned in degC.

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

◆ thermo27_set_high_temp_limit()

err_t thermo27_set_high_temp_limit ( thermo27_t * ctx,
float high_temp_limit )

Thermo 27 set high temperature limit function.

This function is used to set high temperature limit.

Parameters
[in]ctx: Click context object. See thermo27_t object definition for detailed explanation.
[in]high_temp_limit: High temperature limit in degC.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function ragde input is ±256 degC.

◆ thermo27_set_hysteresis()

err_t thermo27_set_hysteresis ( thermo27_t * ctx,
uint8_t thigh_hyst,
uint8_t tlow_hyst )

Thermo 27 set hysteresis function.

This function is used to set temperature high hysteresis and temperature low hysteresis.

Parameters
[in]ctx: Click context object. See thermo27_t object definition for detailed explanation.
[in]thigh_hyst: High temperature hysteresis.
[in]tlow_hyst: Low temperature hysteresis.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ thermo27_set_low_temp_limit()

err_t thermo27_set_low_temp_limit ( thermo27_t * ctx,
float low_temp_limit )

Thermo 27 set low temperature limit function.

This function is used to set low temperature limit.

Parameters
[in]ctx: Click context object. See thermo27_t object definition for detailed explanation.
[in]low_temp_limit: Low temperature limit in degC.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function ragde input is ±256 degC.

◆ thermo27_set_slew_limit()

err_t thermo27_set_slew_limit ( thermo27_t * ctx,
float slew_limit )

Thermo 27 set slew limit function.

This function is used to set temperature slew limit.

Parameters
[in]ctx: Click context object. See thermo27_t object definition for detailed explanation.
[in]slew_limit: Input temperature slew limit.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function ragde input is from 0 degC to 256 degC.

◆ thermo27_sw_reset()

err_t thermo27_sw_reset ( thermo27_t * ctx)

Thermo 27 software reset function.

This function is used to perform software reset.

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

◆ thermo27_write_register()

err_t thermo27_write_register ( thermo27_t * ctx,
uint8_t reg,
uint16_t data_in )

Thermo 27 register writing function.

This function writes a 16 bits of data from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See thermo27_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.