tempalarm 2.1.0.0
tempalarm.h File Reference

This file contains API for Temp Alarm 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  tempalarm_t
 Temp Alarm Click context object. More...
 
struct  tempalarm_cfg_t
 Temp Alarm Click configuration object. More...
 

Macros

#define TEMPALARM_REG_TEMP_LOCAL   0x00
 Temp Alarm description register.
 
#define TEMPALARM_REG_TEMP_REMOTE_MSB   0x01
 
#define TEMPALARM_REG_ALERT_STATUS   0x02
 
#define TEMPALARM_REG_CONFIGURATION   0x03
 
#define TEMPALARM_REG_CONV_PERIOD   0x04
 
#define TEMPALARM_REG_THIGH_LIMIT_LOCAL   0x05
 
#define TEMPALARM_REG_THIGH_LIMIT_REMOTE_MSB   0x07
 
#define TEMPALARM_REG_TLOW_LIMIT_REMOTE_MSB   0x08
 
#define TEMPALARM_REG_ONE_SHOT   0x0F
 
#define TEMPALARM_REG_TEMP_REMOTE_LSB   0x10
 
#define TEMPALARM_REG_REMOTE_OFFSET_MSB   0x11
 
#define TEMPALARM_REG_REMOTE_OFFSET_LSB   0x12
 
#define TEMPALARM_REG_THIGH_LIMIT_REMOTE_LSB   0x13
 
#define TEMPALARM_REG_TLOW_LIMIT_REMOTE_LSB   0x14
 
#define TEMPALARM_REG_ALERT_MASK   0x16
 
#define TEMPALARM_REG_THIGH_CRIT_REMOTE   0x19
 
#define TEMPALARM_REG_THIGH_CRIT_LOCAL   0x20
 
#define TEMPALARM_REG_CRIT_HYSTERESIS   0x21
 
#define TEMPALARM_REG_LOG1   0x2D
 
#define TEMPALARM_REG_LOG2   0x2E
 
#define TEMPALARM_REG_LOG3   0x2F
 
#define TEMPALARM_REG_FILTER_ALERT_MODE   0xBF
 
#define TEMPALARM_REG_CHIP_ID   0xFD
 
#define TEMPALARM_REG_VENDOR_ID   0xFE
 
#define TEMPALARM_REG_DEVICE_REV_ID   0xFF
 
#define TEMPALARM_THIGH_LA_ALERT_DIS_MASK   0x80
 Temp Alarm description setting.
 
#define TEMPALARM_THIGH_LA_ALERT_ENABLE_MASK   0x80
 
#define TEMPALARM_THIGH_RA_ALERT_DIS_MASK   0x10
 
#define TEMPALARM_THIGH_RA_ALERT_ENABLE_MASK   0x00
 
#define TEMPALARM_TLOW_RA_ALERT_DIS_MASK   0x08
 
#define TEMPALARM_TLOW_RA_ALERT_ENABLE_MASK   0x00
 
#define TEMPALARM_TCRIT_R_ALERT_DIS_MASK   0x02
 
#define TEMPALARM_TCRIT_R_ALERT_ENABLE_MASK   0x00
 
#define TEMPALARM_TCRIT_L_ALERT_DIS_MASK   0x01
 
#define TEMPALARM_TCRIT_L_ALERT_ENABLE_MASK   0x00
 
#define TEMPALARM_ADC_BUSY_MASK   0x80
 Temp Alarm flags setting.
 
#define TEMPALARM_THIGH_LA_MASK   0x40
 
#define TEMPALARM_THIGH_RA_MASK   0x10
 
#define TEMPALARM_TLOW_RA_MASK   0x08
 
#define TEMPALARM_REMOTE_DC_MASK   0x04
 
#define TEMPALARM_TCRIT_R_MASK   0x02
 
#define TEMPALARM_TCRIT_L_MASK   0x01
 
#define TEMPALARM_FILTER_LEVEL_0_MASK   0x00
 Temp Alarm filter level setting.
 
#define TEMPALARM_FILTER_LEVEL_4_MASK   0x02
 
#define TEMPALARM_FILTER_LEVEL_8_MASK   0x06
 
#define TEMPALARM_INTERRUPT_ALERT_MODE   0x00
 
#define TEMPALARM_COMPARATOR_MODE   0x01
 
#define TEMPALARM_ALERT_DISABLED   0x80
 Temp Alarm configuration setting.
 
#define TEMPALARM_SHUTDOWN_MODE   0x40
 
#define TEMPALARM_CONTINUOUS_MODE   0x00
 
#define TEMPALARM_REMOTE_EN   0x04
 
#define TEMPALARM_REMOTE_DIS   0x00
 
#define TEMPALARM_WTC_EN   0x02
 
#define TEMPALARM_WTC_DIS   0x00
 
#define TEMPALARM_FAULT_QUE_EN   0x01
 
#define TEMPALARM_FAULT_QUE_DIS   0x00
 
#define TEMPALARM_CONVERSION_PERIOD_16S   0x00
 Temp Alarm configuration setting.
 
#define TEMPALARM_CONVERSION_PERIOD_8S   0x01
 
#define TEMPALARM_CONVERSION_PERIOD_4S   0x02
 
#define TEMPALARM_CONVERSION_PERIOD_2S   0x03
 
#define TEMPALARM_CONVERSION_PERIOD_1S   0x04
 
#define TEMPALARM_CONVERSION_PERIOD_500MS   0x05
 
#define TEMPALARM_CONVERSION_PERIOD_250MS   0x06
 
#define TEMPALARM_CONVERSION_PERIOD_125MS   0x07
 
#define TEMPALARM_CONVERSION_PERIOD_62MS5   0x08
 
#define TEMPALARM_PIN_STATE_HIGH   0x01
 Temp Alarm pin state setting.
 
#define TEMPALARM_PIN_STATE_LOW   0x00
 
#define TEMPALARM_CHIP_ID   0x50
 Temp Alarm chip id setting.
 
#define TEMPALARM_VENDOR_ID   0x60
 
#define TEMPALARM_TEMP_CLC   0.125f
 Temp Alarm temperature calculation setting.
 
#define TEMPALARM_DEVICE_ADDRESS   0x4C
 Temp Alarm device address setting.
 
#define TEMPALARM_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  tempalarm_return_value_t { TEMPALARM_OK = 0 , TEMPALARM_ERROR = -1 }
 Temp Alarm Click return value data. More...
 

Functions

void tempalarm_cfg_setup (tempalarm_cfg_t *cfg)
 Temp Alarm configuration object setup function.
 
err_t tempalarm_init (tempalarm_t *ctx, tempalarm_cfg_t *cfg)
 Temp Alarm initialization function.
 
err_t tempalarm_default_cfg (tempalarm_t *ctx)
 Temp Alarm default configuration function.
 
err_t tempalarm_generic_write (tempalarm_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Temp Alarm I2C writing function.
 
err_t tempalarm_generic_read (tempalarm_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Temp Alarm I2C reading function.
 
uint8_t tempalarm_get_alr_pin (tempalarm_t *ctx)
 Temp Alarm get alarm pin state function.
 
uint8_t tempalarm_get_tcr_pin (tempalarm_t *ctx)
 Temp Alarm get critical temperature alert pin state function.
 
err_t tempalarm_write_reg (tempalarm_t *ctx, uint8_t reg, uint8_t data_in)
 Temp Alarm register writing function.
 
err_t tempalarm_read_reg (tempalarm_t *ctx, uint8_t reg, uint8_t *data_out)
 Temp Alarm register reading function.
 
err_t tempalarm_read_temperature (tempalarm_t *ctx, int8_t *temperature)
 Temp Alarm local sensor read temperature function.
 
err_t tempalarm_read_remote_temp (tempalarm_t *ctx, float *temperature)
 Temp Alarm remote sensor read temperature function.
 
err_t tempalarm_set_crit_thigh (tempalarm_t *ctx, int8_t max_temperature)
 Temp Alarm local sensor set critical high temperature function.
 
err_t tempalarm_set_limit_thigh (tempalarm_t *ctx, int8_t max_temperature)
 Temp Alarm local sensor set limit high temperature function.
 
err_t tempalarm_set_alarm_low_limit (tempalarm_t *ctx, float min_temperature)
 Temp Alarm remote sensor set limit low temperature function.
 
err_t tempalarm_set_alarm_high_limit (tempalarm_t *ctx, float max_temperature)
 Temp Alarm remote sensor set limit high temperature function.
 
err_t tempalarm_get_alarms (tempalarm_t *ctx, uint8_t *alarms)
 Temp Alarm read alarms state function.
 

Detailed Description

This file contains API for Temp Alarm Click Driver.

Enumeration Type Documentation

◆ tempalarm_return_value_t

Temp Alarm Click return value data.

Predefined enum values for driver return values.

Enumerator
TEMPALARM_OK 
TEMPALARM_ERROR