thermo18 2.0.0.0
thermo18.h File Reference

This file contains API for Thermo 18 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  thermo18_t
 Thermo 18 Click context object. More...
 
struct  thermo18_cfg_t
 Thermo 18 Click configuration object. More...
 

Macros

#define THERMO18_REG_DEVICE_ID   0x1
 Thermo 18 description register.
 
#define THERMO18_REG_T_H_LIMIT   0x2
 
#define THERMO18_REG_T_L_LIMIT   0x3
 
#define THERMO18_REG_CTRL   0x4
 
#define THERMO18_REG_STATUS   0x5
 
#define THERMO18_REG_DATA_T_L   0x6
 
#define THERMO18_REG_DATA_T_H   0x7
 
#define THERMO18_REG_SOFT_RESET   0xC
 
#define THERMO18_CONTROL_ONESHOT_ENABLED   0x01
 Thermo 18 control settings.
 
#define THERMO18_CONTROL_CONTINOUS_ENABLED   0x04
 
#define THERMO18_STATUS_DATA_READY   0x00
 Thermo 18 description status values.
 
#define THERMO18_STATUS_DATA_BUSY   0x01
 
#define THERMO18_STATUS_OVERTEMPERATURE   0x02
 
#define THERMO18_STATUS_UNDERTEMPERATURE   0x04
 
#define THERMO18_DEVICE_ID   0xA0
 Thermo 18 description setting.
 
#define THERMO18_SET_DEV_ADDR   0x3F
 Thermo 18 device address setting.
 
#define THERMO18_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  thermo18_return_value_t { THERMO18_OK = 0 , THERMO18_ERROR = -1 }
 Thermo 18 Click return value data. More...
 

Functions

void thermo18_cfg_setup (thermo18_cfg_t *cfg)
 Thermo 18 configuration object setup function.
 
err_t thermo18_init (thermo18_t *ctx, thermo18_cfg_t *cfg)
 Thermo 18 initialization function.
 
err_t thermo18_default_cfg (thermo18_t *ctx)
 Thermo 18 default configuration function.
 
err_t thermo18_generic_write (thermo18_t *ctx, uint8_t reg, uint8_t tx_data)
 Thermo 18 I2C writing function.
 
err_t thermo18_generic_read (thermo18_t *ctx, uint8_t reg, uint8_t *rx_data)
 Thermo 18 I2C reading function.
 
err_t thermo18_read_temperature (thermo18_t *ctx, float *temperature)
 Reads and calculates temperature value.
 
err_t thermo18_reset (thermo18_t *ctx)
 Resets device.
 
uint8_t thermo18_get_interrupt (thermo18_t *ctx)
 Get interrput status.
 
err_t thermo18_set_temperature_threshold (thermo18_t *ctx, uint8_t threshold_reg, float threshold_limit)
 Sets temperature threshold.
 

Detailed Description

This file contains API for Thermo 18 Click Driver.

Enumeration Type Documentation

◆ thermo18_return_value_t

Thermo 18 Click return value data.

Predefined enum values for driver return values.

Enumerator
THERMO18_OK 
THERMO18_ERROR