thermo19 2.0.0.0
Thermo 19 Click Driver

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

Topics

 Thermo 19 Commands List
 List of commands of Thermo 19 Click driver.
 
 Thermo 19 Settings
 Settings of Thermo 19 Click driver.
 
 Thermo 19 MikroBUS Map
 MikroBUS pin mapping of Thermo 19 Click driver.
 

Functions

void thermo19_cfg_setup (thermo19_cfg_t *cfg)
 Thermo 19 configuration object setup function.
 
void thermo19_gpio_selection (thermo19_cfg_t *cfg, thermo19_gpio_sel_t gpio_sel)
 Thermo 19 driver interface setup function.
 
err_t thermo19_init (thermo19_t *ctx, thermo19_cfg_t *cfg)
 Thermo 19 initialization function.
 
err_t thermo19_default_cfg (thermo19_t *ctx)
 Thermo 19 default configuration function.
 
err_t thermo19_check_communication (thermo19_t *ctx)
 Thermo 19 check communication function.
 
err_t thermo19_select_device (thermo19_t *ctx)
 Thermo 19 select device function.
 
err_t thermo19_start_measurement (thermo19_t *ctx)
 Thermo 19 start measurement function.
 
err_t thermo19_read_scratchpad (thermo19_t *ctx, uint8_t *scratchpad)
 Thermo 19 read scratchpad function.
 
err_t thermo19_write_scratchpad (thermo19_t *ctx, uint16_t temp_high, uint16_t temp_low, uint8_t config)
 Thermo 19 write scratchpad function.
 
err_t thermo19_read_temperature (thermo19_t *ctx, float *temperature)
 Thermo 19 read temperature function.
 
uint8_t thermo19_get_alert_pin (thermo19_t *ctx)
 Thermo 19 get alert pin function.
 

Detailed Description

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

◆ thermo19_cfg_setup()

void thermo19_cfg_setup ( thermo19_cfg_t * cfg)

Thermo 19 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ thermo19_check_communication()

err_t thermo19_check_communication ( thermo19_t * ctx)

Thermo 19 check communication function.

This function checks the communication by reading the ROM address twice and comparing the two results, as well as verifying the family code byte.

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

◆ thermo19_default_cfg()

err_t thermo19_default_cfg ( thermo19_t * ctx)

Thermo 19 default configuration function.

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

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

◆ thermo19_get_alert_pin()

uint8_t thermo19_get_alert_pin ( thermo19_t * ctx)

Thermo 19 get alert pin function.

Reads the current input value of the ALT pin.

Parameters
[in]ctx: Click context object. See thermo19_t object definition for detailed explanation.
Returns
Function returns pin logical state (1 or 0).
Note
None.

◆ thermo19_gpio_selection()

void thermo19_gpio_selection ( thermo19_cfg_t * cfg,
thermo19_gpio_sel_t gpio_sel )

Thermo 19 driver interface setup function.

This function sets a communication GPIO pin which will be used further in the click driver.

Parameters
[out]cfg: Click configuration structure. See thermo19_cfg_t object definition for detailed explanation.
[in]gpio_sel: GPIO pin selection. See thermo19_gpio_sel_t object definition for detailed explanation.
Returns
Nothing.
Note
This gpio selection should be call before init function to configure the driver to work with the serial interface which is consistent with the real state of the hardware. If this function is not called, the default driver interface will be set.

◆ thermo19_init()

err_t thermo19_init ( thermo19_t * ctx,
thermo19_cfg_t * cfg )

Thermo 19 initialization function.

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

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

◆ thermo19_read_scratchpad()

err_t thermo19_read_scratchpad ( thermo19_t * ctx,
uint8_t * scratchpad )

Thermo 19 read scratchpad function.

This function reads the scratchpad bytes.

Parameters
[in]ctx: Click context object. See thermo19_t object definition for detailed explanation.
[out]scratchpad: Scratchpad [5-bytes] of device with the address set in ctx->config.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ thermo19_read_temperature()

err_t thermo19_read_temperature ( thermo19_t * ctx,
float * temperature )

Thermo 19 read temperature function.

This function reads the temperature value in Celsius.

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

◆ thermo19_select_device()

err_t thermo19_select_device ( thermo19_t * ctx)

Thermo 19 select device function.

This function selects the device by performing a skip or match ROM commands depending on the address value set in the configuration byte.

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

◆ thermo19_start_measurement()

err_t thermo19_start_measurement ( thermo19_t * ctx)

Thermo 19 start measurement function.

This function starts the measurement by sending an appropriate command for that.

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

◆ thermo19_write_scratchpad()

err_t thermo19_write_scratchpad ( thermo19_t * ctx,
uint16_t temp_high,
uint16_t temp_low,
uint8_t config )

Thermo 19 write scratchpad function.

This function writes the temperature thresholds and configuration byte to the scratchpad.

Parameters
[in]ctx: Click context object. See thermo19_t object definition for detailed explanation.
[in]temp_high: Temperature high limit.
[in]temp_low: Temperature low limit.
[in]config: Configuration byte.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.