thermo27 2.1.0.0
thermo27.h File Reference

This file contains API for Thermo 27 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  thermo27_t
 Thermo 27 Click context object. More...
 
struct  thermo27_cfg_t
 Thermo 27 Click configuration object. More...
 

Macros

#define THERMO27_TEMP_RESULT_REG   0x00
 Thermo 27 description register.
 
#define THERMO27_SLEW_RESULT_REG   0x01
 
#define THERMO27_ALERT_STATUS_REG   0x02
 
#define THERMO27_CONFIGURATION_REG   0x03
 
#define THERMO27_TLOW_LIMIT_REG   0x04
 
#define THERMO27_THIGH_LIMIT_REG   0x05
 
#define THERMO27_HYSTERESIS_REG   0x06
 
#define THERMO27_SLEW_LIMIT_REG   0x07
 
#define THERMO27_UNIQUE_ID1_REG   0x08
 
#define THERMO27_UNIQUE_ID2_REG   0x09
 
#define THERMO27_UNIQUE_ID3_REG   0x0A
 
#define THERMO27_DEVICE_ID_REG   0x0B
 
#define THERMO27_CRC_MODE_ENABLED   0x01
 Thermo 27 description setting.
 
#define THERMO27_CRC_MODE_DISABLED   0x00
 
#define THERMO27_POLYNOMIAL   0x07
 
#define THERMO27_DEVICE_ID   0x1114
 
#define THERMO27_TEMP_COEF   0.0078125
 
#define THERMO27_LSB_VAL   0.03125
 
#define THERMO27_LOW_TEMP_LIMIT_VAL   -25
 
#define THERMO27_HIGH_TEMP_LIMIT_VAL   80
 
#define THERMO27_SW_RESET   0x06
 
#define THERMO27_ADC_TIME_6mS_MODE_CMD   0x0000
 Thermo 27 configuration setting.
 
#define THERMO27_ADC_TIME_4mS_MODE_CMD   0x0200
 
#define THERMO27_ADC_TIME_2mS_MODE_CMD   0x0400
 
#define THERMO27_ADC_TIME_1mS_MODE_CMD   0x0600
 
#define THERMO27_SW_RESET_CMD   0x0100
 
#define THERMO27_ENABLE_AVG_CMD   0x0080
 
#define THERMO27_ENABLE_CRC_CMD   0x0040
 
#define THERMO27_ONE_SHOT_CMD   0x0010
 
#define THERMO27_CONTINUOUS_MODE_CMD   0x0000
 
#define THERMO27_SHOUTDOWN_MODE_CMD   0x0008
 
#define THERMO27_CONVERSION_TIME_7mS_MODE_CMD   0x0000
 
#define THERMO27_CONVERSION_TIME_32mS_MODE_CMD   0x0001
 
#define THERMO27_CONVERSION_TIME_63mS_MODE_CMD   0x0002
 
#define THERMO27_CONVERSION_TIME_125mS_MODE_CMD   0x0003
 
#define THERMO27_CONVERSION_TIME_250mS_MODE_CMD   0x0004
 
#define THERMO27_CONVERSION_TIME_500mS_MODE_CMD   0x0005
 
#define THERMO27_CONVERSION_TIME_1S_MODE_CMD   0x0006
 
#define THERMO27_CONVERSION_TIME_2S_MODE_CMD   0x0007
 
#define THERMO27_CRC_FLAG   0x80
 Thermo 27 alert status register flags.
 
#define THERMO27_SLEW_STATUS   0x40
 
#define THERMO27_SLEW_FLAG   0x20
 
#define THERMO27_THIGH_STATUS   0x10
 
#define THERMO27_TLOW_STATUS   0x08
 
#define THERMO27_THIGH_FLAG   0x04
 
#define THERMO27_TLOW_FLAG   0x02
 
#define THERMO27_DATA_READY_FLAG   0x01
 
#define THERMO27_DEVICE_ADDRESS   0x4D
 Thermo 27 device address setting.
 
#define THERMO27_RESET_DEVICE_ADDRESS   0x00
 
#define THERMO27_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  thermo27_return_value_t { THERMO27_OK = 0 , THERMO27_ERROR = -1 }
 Thermo 27 Click return value data. More...
 

Functions

void thermo27_cfg_setup (thermo27_cfg_t *cfg)
 Thermo 27 configuration object setup function.
 
err_t thermo27_init (thermo27_t *ctx, thermo27_cfg_t *cfg)
 Thermo 27 initialization function.
 
err_t thermo27_default_cfg (thermo27_t *ctx)
 Thermo 27 default configuration function.
 
err_t thermo27_generic_write (thermo27_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Thermo 27 I2C writing function.
 
err_t thermo27_generic_read (thermo27_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Thermo 27 I2C reading function.
 
err_t thermo27_write_register (thermo27_t *ctx, uint8_t reg, uint16_t data_in)
 Thermo 27 register writing function.
 
err_t thermo27_read_register (thermo27_t *ctx, uint8_t reg, uint16_t *data_out)
 Thermo 27 register reading function.
 
err_t thermo27_get_device_id (thermo27_t *ctx, uint16_t *device_id)
 Thermo 27 get device id function.
 
err_t thermo27_sw_reset (thermo27_t *ctx)
 Thermo 27 software reset function.
 
err_t thermo27_read_temp (thermo27_t *ctx, float *temp_out)
 Thermo 27 get read temperature function.
 
err_t thermo27_enable_crc (thermo27_t *ctx)
 Thermo 27 enable CRC function.
 
err_t thermo27_set_low_temp_limit (thermo27_t *ctx, float low_temp_limit)
 Thermo 27 set low temperature limit function.
 
err_t thermo27_set_high_temp_limit (thermo27_t *ctx, float high_temp_limit)
 Thermo 27 set high temperature limit function.
 
err_t thermo27_set_hysteresis (thermo27_t *ctx, uint8_t thigh_hyst, uint8_t tlow_hyst)
 Thermo 27 set hysteresis function.
 
err_t thermo27_set_slew_limit (thermo27_t *ctx, float slew_limit)
 Thermo 27 set slew limit function.
 
err_t thermo27_get_alert_reg (thermo27_t *ctx, uint8_t *register_flags)
 Thermo 27 get alert register staus function.
 

Detailed Description

This file contains API for Thermo 27 Click Driver.

Enumeration Type Documentation

◆ thermo27_return_value_t

Thermo 27 Click return value data.

Predefined enum values for driver return values.

Enumerator
THERMO27_OK 
THERMO27_ERROR