thermo30 2.1.0.0
Thermo 30 Click Driver

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

Topics

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

Functions

void thermo30_cfg_setup (thermo30_cfg_t *cfg)
 Thermo 30 configuration object setup function.
 
err_t thermo30_init (thermo30_t *ctx, thermo30_cfg_t *cfg)
 Thermo 30 initialization function.
 
err_t thermo30_default_cfg (thermo30_t *ctx)
 Thermo 30 default configuration function.
 
void thermo30_set_rst_pin (thermo30_t *ctx, uint8_t pin_state)
 Thermo 30 set rst pin function.
 
void thermo30_hw_reset (thermo30_t *ctx)
 Thermo 30 hw reset device function.
 
uint8_t thermo30_get_alert_pin (thermo30_t *ctx)
 Thermo 30 get alert pin function.
 
err_t thermo30_write_command (thermo30_t *ctx, uint16_t cmd)
 Thermo 30 write command function.
 
err_t thermo30_read_command (thermo30_t *ctx, uint16_t cmd, uint16_t *data_out)
 Thermo 30 read command function.
 
err_t thermo30_start_measurement (thermo30_t *ctx, uint16_t cmd)
 Thermo 30 start measurement function.
 
err_t thermo30_stop_measurement (thermo30_t *ctx)
 Thermo 30 stop measurement function.
 
err_t thermo30_read_status (thermo30_t *ctx, uint16_t *status_val)
 Thermo 30 read status function.
 
err_t thermo30_read_temperature (thermo30_t *ctx, float *temperature)
 Thermo 30 read temperature function.
 

Detailed Description

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

◆ thermo30_cfg_setup()

void thermo30_cfg_setup ( thermo30_cfg_t * cfg)

Thermo 30 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ thermo30_default_cfg()

err_t thermo30_default_cfg ( thermo30_t * ctx)

Thermo 30 default configuration function.

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

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

◆ thermo30_get_alert_pin()

uint8_t thermo30_get_alert_pin ( thermo30_t * ctx)

Thermo 30 get alert pin function.

This function returns the alert pin logic state.

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

◆ thermo30_hw_reset()

void thermo30_hw_reset ( thermo30_t * ctx)

Thermo 30 hw reset device function.

This function resets the device by toggling the RST pin.

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

◆ thermo30_init()

err_t thermo30_init ( thermo30_t * ctx,
thermo30_cfg_t * cfg )

Thermo 30 initialization function.

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

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

◆ thermo30_read_command()

err_t thermo30_read_command ( thermo30_t * ctx,
uint16_t cmd,
uint16_t * data_out )

Thermo 30 read command function.

This function writes a desired command word and then reads it's 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 thermo30_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.

◆ thermo30_read_status()

err_t thermo30_read_status ( thermo30_t * ctx,
uint16_t * status_val )

Thermo 30 read status function.

This function reads the status register.

Parameters
[in]ctx: Click context object. See thermo30_t object definition for detailed explanation.
[out]status_val: Status register data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ thermo30_read_temperature()

err_t thermo30_read_temperature ( thermo30_t * ctx,
float * temperature )

Thermo 30 read temperature function.

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

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

◆ thermo30_set_rst_pin()

void thermo30_set_rst_pin ( thermo30_t * ctx,
uint8_t pin_state )

Thermo 30 set rst pin function.

This function sets the RST pin logic state.

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

◆ thermo30_start_measurement()

err_t thermo30_start_measurement ( thermo30_t * ctx,
uint16_t cmd )

Thermo 30 start measurement function.

This function starts the measurements by sending the specified command.

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

◆ thermo30_stop_measurement()

err_t thermo30_stop_measurement ( thermo30_t * ctx)

Thermo 30 stop measurement function.

This function stops the measurements by sending the break command.

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

◆ thermo30_write_command()

err_t thermo30_write_command ( thermo30_t * ctx,
uint16_t cmd )

Thermo 30 write command function.

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

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