thermo20 2.0.0.0
Thermo 20 Click Driver

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

Topics

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

Functions

void thermo20_cfg_setup (thermo20_cfg_t *cfg)
 Thermo 20 configuration object setup function.
 
err_t thermo20_init (thermo20_t *ctx, thermo20_cfg_t *cfg)
 Thermo 20 initialization function.
 
err_t thermo20_default_cfg (thermo20_t *ctx)
 Thermo 20 default configuration function.
 
err_t thermo20_generic_write (thermo20_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Thermo 20 I2C writing function.
 
err_t thermo20_generic_read (thermo20_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Thermo 20 I2C reading function.
 
err_t thermo20_set_cmd (thermo20_t *ctx, uint8_t cmd)
 Send command function.
 
void thermo20_soft_reset (thermo20_t *ctx)
 Soft reset function.
 
void thermo20_start_conversion (thermo20_t *ctx)
 Start conversion function.
 
uint16_t thermo20_read_adc (thermo20_t *ctx)
 Read ADC data function.
 
float thermo20_get_temperature (thermo20_t *ctx)
 Get temperature data function.
 
uint32_t thermo20_get_serial_number (thermo20_t *ctx)
 Get serial number function.
 

Detailed Description

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

◆ thermo20_cfg_setup()

void thermo20_cfg_setup ( thermo20_cfg_t * cfg)

Thermo 20 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ thermo20_default_cfg()

err_t thermo20_default_cfg ( thermo20_t * ctx)

Thermo 20 default configuration function.

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

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

◆ thermo20_generic_read()

err_t thermo20_generic_read ( thermo20_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

Thermo 20 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 thermo20_t object definition for detailed explanation.
[in]reg: Start register address.
[out]rx_buf: Output read data.
[in]rx_len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ thermo20_generic_write()

err_t thermo20_generic_write ( thermo20_t * ctx,
uint8_t reg,
uint8_t * tx_buf,
uint8_t tx_len )

Thermo 20 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 thermo20_t object definition for detailed explanation.
[in]reg: Start register address.
[in]tx_buf: Data to be written.
[in]tx_len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ thermo20_get_serial_number()

uint32_t thermo20_get_serial_number ( thermo20_t * ctx)

Get serial number function.

The function get the serial number of the TSYS03 Digital Temperature Sensor on the Thermo 20 click board.

Parameters
[in]ctx: Click context object. See thermo20_t object definition for detailed explanation.
Returns
24-bit serial number.

◆ thermo20_get_temperature()

float thermo20_get_temperature ( thermo20_t * ctx)

Get temperature data function.

The function get temperature value in degree Celsius of the TSYS03 Digital Temperature Sensor on the Thermo 20 click board.

Parameters
[in]ctx: Click context object. See thermo20_t object definition for detailed explanation.
Returns
float temperature value in degree Celsius.

◆ thermo20_init()

err_t thermo20_init ( thermo20_t * ctx,
thermo20_cfg_t * cfg )

Thermo 20 initialization function.

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

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

◆ thermo20_read_adc()

uint16_t thermo20_read_adc ( thermo20_t * ctx)

Read ADC data function.

The function 16-bit temperature reprinting ADC result of the TSYS03 Digital Temperature Sensor on the Thermo 20 click board.

Parameters
[in]ctx: Click context object. See thermo20_t object definition for detailed explanation.
Returns
16-bit temperature reprinting ADC result.

◆ thermo20_set_cmd()

err_t thermo20_set_cmd ( thermo20_t * ctx,
uint8_t cmd )

Send command function.

The function send the desired command to the TSYS03 Digital Temperature Sensor on the Thermo 20 click board.

Parameters
[in]ctx: Click context object. See thermo20_t object definition for detailed explanation.
[in]cmdCommands byte. See #thermo20_reg defgroup for detailed explanation. *
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.

◆ thermo20_soft_reset()

void thermo20_soft_reset ( thermo20_t * ctx)

Soft reset function.

The function is performed by a software reset of the TSYS03 Digital Temperature Sensor on the Thermo 20 click board.

Parameters
[in]ctx: Click context object. See thermo20_t object definition for detailed explanation.
Returns
Nothing.

◆ thermo20_start_conversion()

void thermo20_start_conversion ( thermo20_t * ctx)

Start conversion function.

The function set conversion a single temperature conversion of the TSYS03 Digital Temperature Sensor on the Thermo 20 click board.

Parameters
[in]ctx: Click context object. See thermo20_t object definition for detailed explanation.
Returns
Nothing.
Note
A conversion must be started and conducted before the ADC result can be read. he typical conversion time is 12 milliseconds.