templog4 2.0.0.0
templog4.h File Reference

This file contains API for Temp Log 4 Click driver. More...

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

Go to the source code of this file.

Data Structures

struct  templog4_t
 Click ctx object definition. More...
 
struct  templog4_cfg_t
 Click configuration structure definition. More...
 

Macros

#define TEMPLOG4_MAP_MIKROBUS(cfg, mikrobus)
 
#define TEMPLOG4_RETVAL   uint8_t
 
#define TEMPLOG4_OK   0x00
 
#define TEMPLOG4_INIT_ERROR   0xFF
 
#define TEMPLOG4_SLAVE_ADDR_A0_H   0x19
 
#define TEMPLOG4_SLAVE_ADDR_A0_L   0x18
 
#define TEMPLOG4_CAPABILITY_REG   0x00
 
#define TEMPLOG4_CONFIG_REG   0x01
 
#define TEMPLOG4_TEMP_UPPER_REG   0x02
 
#define TEMPLOG4_TEMP_LOWER_REG   0x03
 
#define TEMPLOG4_TEMP_CRITICAL_REG   0x04
 
#define TEMPLOG4_TEMP_AMBIENT_REG   0x05
 
#define TEMPLOG4_MANUFACT_ID_REG   0x06
 
#define TEMPLOG4_DEVICE_ID_REG   0x07
 
#define TEMPLOG4_SMBUS_REG   0x22
 
#define TEMPLOG4_EVENT_SHDN_STATUS_MASK   0x80
 
#define TEMPLOG4_BUS_TIMEOUT_STATUS_MASK   0x40
 
#define TEMPLOG4_HIGH_VOLT_INPUT_STATUS_MASK   0x20
 
#define TEMPLOG4_RESOLUTION_STATUS_MASK   0x18
 
#define TEMPLOG4_MEAS_RANGE_STATUS_MASK   0x04
 
#define TEMPLOG4_ACCURACY_STATUS_MASK   0x02
 
#define TEMPLOG4_ALARM_STATUS_MASK   0x01
 
#define TEMPLOG4_TLIMIT_HYST_0_DEG   0x0000
 
#define TEMPLOG4_TLIMIT_HYST_ONE_HALF_DEG   0x0200
 
#define TEMPLOG4_TLIMIT_HYST_3_DEG   0x0400
 
#define TEMPLOG4_TLIMIT_HYST_6_DEG   0x0600
 
#define TEMPLOG4_CONT_CONV_MODE   0x0000
 
#define TEMPLOG4_SHUTDOWN_MODE   0x0100
 
#define TEMPLOG4_TCRIT_LOCKED   0x0080
 
#define TEMPLOG4_TUPPER_TLOWER_LOCKED   0x0040
 
#define TEMPLOG4_INT_CLEAR   0x0020
 
#define TEMPLOG4_EVENT_OUTPUT_STATUS_MASK   0x0010
 
#define TEMPLOG4_EVENT_OUTPUT_EN   0x0008
 
#define TEMPLOG4_EVENT_ALL_TLIMIT   0x0000
 
#define TEMPLOG4_EVENT_TCRIT_ONLY   0x0004
 
#define TEMPLOG4_EVENT_POL_ACT_LOW   0x0000
 
#define TEMPLOG4_EVENT_POL_ACT_HIGH   0x0002
 
#define TEMPLOG4_EVENT_COMPARATOR_MODE   0x0000
 
#define TEMPLOG4_EVENT_INTERRUPT_MODE   0x0001
 
#define TEMPLOG4_TCRIT_DETECT   0x80
 
#define TEMPLOG4_TUPPER_DETECT   0x40
 
#define TEMPLOG4_TLOWER_DETECT   0x20
 
#define TEMPLOG4_NBYTES_ERROR   0x04
 
#define TEMPLOG4_TEMP_RANGE_ERROR   0x03
 
#define TEMPLOG4_ADDR_ERROR   0x02
 
#define TEMPLOG4_ALARMING   0x01
 
#define TEMPLOG4_OK   0x00
 
#define TEMPLOG4_SMBUS_TIMEOUT_DIS   0x80
 
#define TEMPLOG4_SMBUS_TIMEOUT_SHTDN_EN   0x20
 
#define TEMPLOG4_SMBUS_ARA_DIS   0x01
 
#define TEMPLOG4_EEPROM_WRITE   0x00
 
#define TEMPLOG4_SW_WRITE_PROTECT   0x01
 
#define TEMPLOG4_CLEAR_WRITE_PROTECT   0x02
 
#define _TEMPLOG4_EEPROM_SIZE   256
 
#define _TEMPLOG4_MANUFACT_ID   0x1131
 
#define _TEMPLOG4_DEVICE_ID   0xA203
 
#define TEMPLOG4_DUMMY_BYTE   0x00
 

Functions

void templog4_cfg_setup (templog4_cfg_t *cfg)
 Config Object Initialization function.
 
TEMPLOG4_RETVAL templog4_init (templog4_t *ctx, templog4_cfg_t *cfg)
 Initialization function.
 
void templog4_default_cfg (templog4_t *ctx)
 Click Default Configuration function.
 
void templog4_generic_write (templog4_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void templog4_generic_read (templog4_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t templog4_write_reg (templog4_t *ctx, uint8_t reg, uint16_t input_data)
 Generic Write function.
 
uint8_t templog4_read_reg (templog4_t *ctx, uint8_t reg, uint16_t *out_var)
 Generic Read function.
 
void templog4_set_addr_ptr (templog4_t *ctx, uint8_t addr)
 Set Address Pointer function.
 
void templog4_repeated_read (templog4_t *ctx, uint16_t *out_var)
 Repeated Read function.
 
uint8_t templog4_get_temp (templog4_t *ctx, uint8_t temp_sel, float *temp_out)
 Get Temperature function.
 
void templog4_set_temp (templog4_t *ctx, uint8_t temp_sel, float temp_in)
 Set Temperature function.
 

Detailed Description

This file contains API for Temp Log 4 Click driver.