irthermo2 2.0.0.0
IrThermo 2 Click Driver

API for configuring and manipulating IrThermo 2 Click driver. More...

Topics

 IrThermo 2 Registers List
 List of registers of IrThermo 2 Click driver.
 
 IrThermo 2 Registers Settings
 Settings for registers of IrThermo 2 Click driver.
 
 IrThermo 2 MikroBUS Map
 MikroBUS pin mapping of IrThermo 2 Click driver.
 

Functions

void irthermo2_cfg_setup (irthermo2_cfg_t *cfg)
 Config Object Initialization function.
 
err_t irthermo2_init (irthermo2_t *ctx, irthermo2_cfg_t *cfg)
 Initialization function.
 
void irthermo2_default_cfg (irthermo2_t *ctx)
 Click Default Configuration function.
 
void irthermo2_generic_write (irthermo2_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Generic write function.
 
void irthermo2_generic_read (irthermo2_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Generic read function.
 
void irthermo2_write_data (irthermo2_t *ctx, uint8_t address, uint16_t write_data)
 Generic write 16-bit data function.
 
uint16_t irthermo2_read_data (irthermo2_t *ctx, uint8_t address)
 Generic read 16-bit data from 8-bit address function.
 
err_t irthermo2_check_id (irthermo2_t *ctx)
 Check device ID function.
 
float irthermo2_get_object_temperature_c (irthermo2_t *ctx)
 Get object temperature in degrees Celsius function.
 
float irthermo2_get_object_temperature_f (irthermo2_t *ctx)
 Get object temperature in degrees Fahrenheit function.
 
float irthermo2_get_raw_temperature (irthermo2_t *ctx)
 Get raw temperature in degrees Celsius function.
 
uint8_t irhhermo2_get_alert (irthermo2_t *ctx)
 Get state of alert function.
 

Detailed Description

API for configuring and manipulating IrThermo 2 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

◆ irhhermo2_get_alert()

uint8_t irhhermo2_get_alert ( irthermo2_t * ctx)

Get state of alert function.

Function get state of alert - INT pin of TMP007 sesnor on IrThermo 2 Click.

Parameters
[in]ctx: Click context object. See irthermo2_t object definition for detailed explanation.
Returns
result (state of INT pin) : 0 - ACTIVE; 1 - NO ACTIVE

◆ irthermo2_cfg_setup()

void irthermo2_cfg_setup ( irthermo2_cfg_t * cfg)

Config Object Initialization function.

This function initializes click configuration structure to init state.

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

◆ irthermo2_check_id()

err_t irthermo2_check_id ( irthermo2_t * ctx)

Check device ID function.

Function check device ID and return ERROR or OK.

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

◆ irthermo2_default_cfg()

void irthermo2_default_cfg ( irthermo2_t * ctx)

Click Default Configuration function.

This function executes default configuration for IrThermo2 click.

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

◆ irthermo2_generic_read()

void irthermo2_generic_read ( irthermo2_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Generic read function.

This function reads data from the desired register.

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

◆ irthermo2_generic_write()

void irthermo2_generic_write ( irthermo2_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Generic write function.

This function writes data to the desired register.

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

◆ irthermo2_get_object_temperature_c()

float irthermo2_get_object_temperature_c ( irthermo2_t * ctx)

Get object temperature in degrees Celsius function.

Function read 16-bit data from object temperature register and calculate temperature in degrees Celsius.

Parameters
[in]ctx: Click context object. See irthermo2_t object definition for detailed explanation.
Returns
Float temperature data.
Note
Full scale allows a result of up to 256 C

◆ irthermo2_get_object_temperature_f()

float irthermo2_get_object_temperature_f ( irthermo2_t * ctx)

Get object temperature in degrees Fahrenheit function.

Function read 16-bit data from object temperature register and calculate temperature in degrees Fahrenheit.

Parameters
[in]ctx: Click context object. See irthermo2_t object definition for detailed explanation.
Returns
Float temperature data

◆ irthermo2_get_raw_temperature()

float irthermo2_get_raw_temperature ( irthermo2_t * ctx)

Get raw temperature in degrees Celsius function.

Function read 16-bit data from raw temperature register and calculate temperature in degrees Celsius.

Parameters
[in]ctx: Click context object. See irthermo2_t object definition for detailed explanation.
Returns
Float temperature data
Note
Full scale allows a result of up to � 256�C

◆ irthermo2_init()

err_t irthermo2_init ( irthermo2_t * ctx,
irthermo2_cfg_t * cfg )

Initialization function.

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

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

◆ irthermo2_read_data()

uint16_t irthermo2_read_data ( irthermo2_t * ctx,
uint8_t address )

Generic read 16-bit data from 8-bit address function.

Function read 16-bit data from given 8-bit register address.

Parameters
[in]ctx: Click context object. See irthermo2_t object definition for detailed explanation.
[in]address: 8-bit register address.
Returns
16-bit data from given address

◆ irthermo2_write_data()

void irthermo2_write_data ( irthermo2_t * ctx,
uint8_t address,
uint16_t write_data )

Generic write 16-bit data function.

Function write 16-bit data to given 8-bit register address.

Parameters
[in]ctx: Click context object. See irthermo2_t object definition for detailed explanation.
[in]address: 8-bit register address.
[in]write_command: 16-bit data to write to given address.
Returns
Nothing.