thermo26 2.1.0.0
Thermo 26 Click Driver

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

Topics

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

Functions

void thermo26_cfg_setup (thermo26_cfg_t *cfg)
 Thermo 26 configuration object setup function.
 
err_t thermo26_init (thermo26_t *ctx, thermo26_cfg_t *cfg)
 Thermo 26 initialization function.
 
err_t thermo26_write_command (thermo26_t *ctx, uint16_t cmd)
 Thermo 26 write command function.
 
err_t thermo26_read_command (thermo26_t *ctx, uint16_t cmd, uint16_t *data_out)
 Thermo 26 read command function.
 
void thermo26_reset_device (thermo26_t *ctx)
 Thermo 26 reset device function.
 
void thermo26_set_rst_pin (thermo26_t *ctx, uint8_t state)
 Thermo 26 set rst pin function.
 
uint8_t thermo26_get_alert_pin (thermo26_t *ctx)
 Thermo 26 get alert pin function.
 
err_t thermo26_read_temperature (thermo26_t *ctx, float *temperature)
 Thermo 26 read temperature function.
 
err_t thermo26_read_serial_num (thermo26_t *ctx, uint32_t *serial_num)
 Thermo 26 read serial num function.
 
err_t thermo26_start_measurement (thermo26_t *ctx, uint16_t cmd)
 Thermo 26 start measurement function.
 
err_t thermo26_stop_measurement (thermo26_t *ctx)
 Thermo 26 stop measurement function.
 

Detailed Description

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

◆ thermo26_cfg_setup()

void thermo26_cfg_setup ( thermo26_cfg_t * cfg)

Thermo 26 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ thermo26_get_alert_pin()

uint8_t thermo26_get_alert_pin ( thermo26_t * ctx)

Thermo 26 get alert pin function.

This function returns the alert pin logic state.

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

◆ thermo26_init()

err_t thermo26_init ( thermo26_t * ctx,
thermo26_cfg_t * cfg )

Thermo 26 initialization function.

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

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

◆ thermo26_read_command()

err_t thermo26_read_command ( thermo26_t * ctx,
uint16_t cmd,
uint16_t * data_out )

Thermo 26 read command function.

This function writes a desired command word and then reads its response word with CRC byte. If the read CRC byte matches internal CRC calculation the response word will be stored in data_out.

Parameters
[in]ctx: Click context object. See thermo26_t object definition for detailed explanation.
[in]cmd: Command word to be written.
[out]data_out: Read response word.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ thermo26_read_serial_num()

err_t thermo26_read_serial_num ( thermo26_t * ctx,
uint32_t * serial_num )

Thermo 26 read serial num function.

This function reads the 32-bit unique serial number.

Parameters
[in]ctx: Click context object. See thermo26_t object definition for detailed explanation.
[out]serial_num: 32-bit unique serial number.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ thermo26_read_temperature()

err_t thermo26_read_temperature ( thermo26_t * ctx,
float * temperature )

Thermo 26 read temperature function.

This function reads the temperature raw data measurements and converts it to degrees Celsius.

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

◆ thermo26_reset_device()

void thermo26_reset_device ( thermo26_t * ctx)

Thermo 26 reset device function.

This function resets the device by toggling the RST pin.

Parameters
[in]ctx: Click context object. See thermo26_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ thermo26_set_rst_pin()

void thermo26_set_rst_pin ( thermo26_t * ctx,
uint8_t state )

Thermo 26 set rst pin function.

This function sets the RST pin logic state.

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

◆ thermo26_start_measurement()

err_t thermo26_start_measurement ( thermo26_t * ctx,
uint16_t cmd )

Thermo 26 start measurement function.

This function starts the measurements by sending the specified command.

Parameters
[in]ctx: Click context object. See thermo26_t object definition for detailed explanation.
[in]cmd: Single-shot or periodic measurements command, refer to the commands list macros.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ thermo26_stop_measurement()

err_t thermo26_stop_measurement ( thermo26_t * ctx)

Thermo 26 stop measurement function.

This function stops the measurements by sending the break command.

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

◆ thermo26_write_command()

err_t thermo26_write_command ( thermo26_t * ctx,
uint16_t cmd )

Thermo 26 write command function.

This function writes a desired command by using I2C serial interface.

Parameters
[in]ctx: Click context object. See thermo26_t object definition for detailed explanation.
[in]cmd: Command word to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.