tempalarm 2.1.0.0
Data Structures | Macros | Enumerations | Functions
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_TEMP_LOCAL_REG   0x00
 Temp Alarm description register. More...
 
#define TEMPALARM_TEMP_REMOTE_MSB_REG   0x01
 
#define TEMPALARM_ALERT_STATUS_REG   0x02
 
#define TEMPALARM_CONFIGURATION_REG   0x03
 
#define TEMPALARM_CONV_PERIOD_REG   0x04
 
#define TEMPALARM_THIGH_LIMIT_LOCAL_REG   0x05
 
#define TEMPALARM_THIGH_LIMIT_REMOTE_MSB_REG   0x07
 
#define TEMPALARM_TLOW_LIMIT_REMOTE_MSB_REG   0x08
 
#define TEMPALARM_ONE_SHOT_REG   0x0F
 
#define TEMPALARM_TEMP_REMOTE_LSB_REG   0x10
 
#define TEMPALARM_REMOTE_OFFSET_MSB_REG   0x11
 
#define TEMPALARM_REMOTE_OFFSET_LSB_REG   0x12
 
#define TEMPALARM_THIGH_LIMIT_REMOTE_LSB_REG   0x13
 
#define TEMPALARM_TLOW_LIMIT_REMOTE_LSB_REG   0x14
 
#define TEMPALARM_ALERT_MASK_REG   0x16
 
#define TEMPALARM_THIGH_CRIT_REMOTE_REG   0x19
 
#define TEMPALARM_THIGH_CRIT_LOCAL_REG   0x20
 
#define TEMPALARM_CRIT_HYSTERESIS_REG   0x21
 
#define TEMPALARM_LOG1_REG   0x2D
 
#define TEMPALARM_LOG2_REG   0x2E
 
#define TEMPALARM_LOG3_REG   0x2F
 
#define TEMPALARM_FILTER_ALERT_MODE_REG   0xBF
 
#define TEMPALARM_CHIP_ID_REG   0xFD
 
#define TEMPALARM_VENDOR_ID_REG   0xFE
 
#define TEMPALARM_DEVICE_REV_ID_REG   0xFF
 
#define TEMPALARM_THIGH_LA_ALERT_DIS_MASK   0x80
 Temp Alarm description setting. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#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. More...
 
#define TEMPALARM_PIN_STATE_LOW   0x00
 
#define TEMPALARM_CHIP_ID   0x50
 
#define TEMPALARM_VENDOR_ID   0x60
 
#define TEMPALARM_TEMP_CLC   0.125f
 
#define TEMPALARM_DEVICE_ADDRESS   0x4C
 Temp Alarm device address setting. More...
 
#define TEMPALARM_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping. More...
 

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. More...
 
err_t tempalarm_init (tempalarm_t *ctx, tempalarm_cfg_t *cfg)
 Temp Alarm initialization function. More...
 
err_t tempalarm_default_cfg (tempalarm_t *ctx)
 Temp Alarm default configuration function. More...
 
err_t tempalarm_generic_write (tempalarm_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Temp Alarm I2C writing function. More...
 
err_t tempalarm_generic_read (tempalarm_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Temp Alarm I2C reading function. More...
 
uint8_t tempalarm_get_alr_pin (tempalarm_t *ctx)
 Temp Alarm get alarm pin state function. More...
 
uint8_t tempalarm_get_tcr_pin (tempalarm_t *ctx)
 Temp Alarm get critical temperature alert pin state function. More...
 
err_t tempalarm_write_reg (tempalarm_t *ctx, uint8_t reg, uint8_t data_in)
 Temp Alarm register writing function. More...
 
err_t tempalarm_read_reg (tempalarm_t *ctx, uint8_t reg, uint8_t *data_out)
 Temp Alarm register reading function. More...
 
err_t tempalarm_read_temperature (tempalarm_t *ctx, int8_t *temperature)
 Temp Alarm local sensor read temperature function. More...
 
err_t tempalarm_read_remote_temperature (tempalarm_t *ctx, float *temperature)
 Temp Alarm remote sensor read temperature function. More...
 
err_t tempalarm_set_crit_thigh (tempalarm_t *ctx, int8_t max_temperature)
 Temp Alarm local sensor set critical high temperature function. More...
 
err_t tempalarm_set_limit_thigh (tempalarm_t *ctx, int8_t max_temperature)
 Temp Alarm local sensor set limit high temperature function. More...
 
err_t tempalarm_set_alarm_low_limit (tempalarm_t *ctx, float min_temperature)
 Temp Alarm remote sensor set limit low temperature function. More...
 
err_t tempalarm_set_alarm_high_limit (tempalarm_t *ctx, float max_temperature)
 Temp Alarm remote sensor set limit high temperature function. More...
 
err_t tempalarm_get_alarms (tempalarm_t *ctx, uint8_t *alarms)
 Temp Alarm read alarms state function. More...
 

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