thermo28 2.1.0.0
thermo28.h File Reference

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

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

Go to the source code of this file.

Data Structures

struct  thermo28_t
 Thermo 28 Click context object. More...
 
struct  thermo28_cfg_t
 Thermo 28 Click configuration object. More...
 
struct  thermo28_config_t
 Thermo 28 Click configuration object. More...
 

Macros

#define THERMO28_REG_TVAL   0x00
 Thermo 28 description register.
 
#define THERMO28_REG_CONFIG   0x01
 
#define THERMO28_REG_TLOW   0x02
 
#define THERMO28_REG_THIGH   0x03
 
#define THERMO28_CFG_DEFAULT_CONFIG   0x40A0
 Thermo 28 description setting.
 
#define THERMO28_CFG_SINGLE_SHOT   0x8000
 
#define THERMO28_CONV_RATE_BIT_MASK   0x00C0
 
#define THERMO28_STATE_BIT_MASK   0x0100
 
#define THERMO28_CONSEC_FAULTS_BIT_MASK   0x3000
 
#define THERMO28_ALERT_BIT_MASK   0x0200
 
#define THERMO28_SINGLE_SHOT_BIT_MASK   0x8000
 
#define THERMO28_DEVICE_ADDRESS_VSS   0x48
 Thermo 28 device address setting.
 
#define THERMO28_DEVICE_ADDRESS_VDD   0x49
 
#define THERMO28_DEVICE_ADDRESS_SDA   0x4A
 
#define THERMO28_DEVICE_ADDRESS_SCL   0x4B
 
#define THERMO28_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  thermo28_return_value_t { THERMO28_OK = 0 , THERMO28_ERROR = -1 }
 Thermo 28 Click return value data. More...
 
enum  thermo28_conv_rate_t { THERMO28_CONV_RATE025 = 0x0000 , THERMO28_CONV_RATE1 = 0x0040 , THERMO28_CONV_RATE4 = 0x0080 , THERMO28_CONV_RATE8 = 0x00C0 }
 Thermo 28 Click conversion rate value data. More...
 
enum  thermo28_device_mode_t { THERMO28_STATE_SLEEP = 0x0100 , THERMO28_STATE_ACTIVE = 0x0000 }
 Thermo 28 Click sleep mode value data. More...
 
enum  thermo28_alert_mode_t { THERMO28_ALERT_INTERRUPT = 0x0200 , THERMO28_ALERT_COMPARATOR = 0x0000 }
 Thermo 28 Click interrupt mode value data. More...
 
enum  thermo28_alert_polarity_t { THERMO28_ALERT_ACTIVE_LOW = 0x0000 , THERMO28_ALERT_ACTIVE_HIGH = 0x0400 }
 Thermo 28 Click polarity of the alert output value data. More...
 
enum  thermo28_consec_faults_t { THERMO28_CONSEC_FAULTS1 = 0x0000 , THERMO28_CONSEC_FAULTS2 = 0x1000 , THERMO28_CONSEC_FAULTS3 = 0x2000 , THERMO28_CONSEC_FAULTS4 = 0x3000 }
 Thermo 28 Click consecutive faults value data. More...
 
enum  thermo28_single_shot_t { THERMO28_SINGLE_SHOT_NO_CONVERSION = 0x0000 , THERMO28_SINGLE_SHOT_START_CONVERSION = 0x8000 }
 Thermo 28 Click measurement mode value data. More...
 

Functions

void thermo28_cfg_setup (thermo28_cfg_t *cfg)
 Thermo 28 configuration object setup function.
 
err_t thermo28_init (thermo28_t *ctx, thermo28_cfg_t *cfg)
 Thermo 28 initialization function.
 
err_t thermo28_default_cfg (thermo28_t *ctx)
 Thermo 28 default configuration function.
 
err_t thermo28_generic_write (thermo28_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Thermo 28 I2C writing function.
 
err_t thermo28_generic_read (thermo28_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Thermo 28 I2C reading function.
 
err_t thermo28_get_temperature (thermo28_t *ctx, float *temperature)
 Thermo 28 get temperature function.
 
err_t thermo28_set_alert_limits (thermo28_t *ctx, float alert_min, float alert_max)
 Thermo 28 set alert limits function.
 
err_t thermo28_set_config (thermo28_t *ctx, thermo28_config_t config)
 Thermo 28 set configuration function.
 
err_t thermo28_set_continuous_conversion (thermo28_t *ctx)
 Thermo 28 set continuous conversion function.
 
err_t thermo28_set_sleep_mode (thermo28_t *ctx)
 Thermo 28 set device working mode function.
 
err_t thermo28_set_trigger_single_shot (thermo28_t *ctx)
 Thermo 28 set trigger single-shot function.
 
uint8_t thermo28_get_int_pin (thermo28_t *ctx)
 Thermo 28 set alert status function.
 

Detailed Description

This file contains API for Thermo 28 Click Driver.

Enumeration Type Documentation

◆ thermo28_alert_mode_t

Thermo 28 Click interrupt mode value data.

Predefined enum values for driver interrupt mode values.

Enumerator
THERMO28_ALERT_INTERRUPT 
THERMO28_ALERT_COMPARATOR 

◆ thermo28_alert_polarity_t

Thermo 28 Click polarity of the alert output value data.

Predefined enum values for driver polarity of the alert output values.

Enumerator
THERMO28_ALERT_ACTIVE_LOW 
THERMO28_ALERT_ACTIVE_HIGH 

◆ thermo28_consec_faults_t

Thermo 28 Click consecutive faults value data.

Predefined enum values for driver consecutive faults values.

Enumerator
THERMO28_CONSEC_FAULTS1 
THERMO28_CONSEC_FAULTS2 
THERMO28_CONSEC_FAULTS3 
THERMO28_CONSEC_FAULTS4 

◆ thermo28_conv_rate_t

Thermo 28 Click conversion rate value data.

Predefined enum values for driver conversion rate values.

Enumerator
THERMO28_CONV_RATE025 
THERMO28_CONV_RATE1 
THERMO28_CONV_RATE4 
THERMO28_CONV_RATE8 

◆ thermo28_device_mode_t

Thermo 28 Click sleep mode value data.

Predefined enum values for driver sleep mode values.

Enumerator
THERMO28_STATE_SLEEP 
THERMO28_STATE_ACTIVE 

◆ thermo28_return_value_t

Thermo 28 Click return value data.

Predefined enum values for driver return values.

Enumerator
THERMO28_OK 
THERMO28_ERROR 

◆ thermo28_single_shot_t

Thermo 28 Click measurement mode value data.

Predefined enum values for driver measurement mode values.

Enumerator
THERMO28_SINGLE_SHOT_NO_CONVERSION 
THERMO28_SINGLE_SHOT_START_CONVERSION