templog3 2.0.0.0
templog3.h File Reference

This file contains API for Temp Log 3 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  templog3_t
 Click ctx object definition. More...
 
struct  templog3_cfg_t
 Click configuration structure definition. More...
 

Macros

#define TEMPLOG3_MAP_MIKROBUS(cfg, mikrobus)
 
#define TEMPLOG3_RETVAL   uint8_t
 
#define TEMPLOG3_OK   0x00
 
#define TEMPLOG3_INIT_ERROR   0xFF
 
#define TEMPLOG3_SLAVE_ADDR_A0_H   0x19
 
#define TEMPLOG3_SLAVE_ADDR_A0_L   0x18
 
#define TEMPLOG3_CAPABILITY_REG   0x00
 
#define TEMPLOG3_CONFIG_REG   0x01
 
#define TEMPLOG3_TEMP_UPPER_REG   0x02
 
#define TEMPLOG3_TEMP_LOWER_REG   0x03
 
#define TEMPLOG3_TEMP_CRITICAL_REG   0x04
 
#define TEMPLOG3_TEMP_AMBIENT_REG   0x05
 
#define TEMPLOG3_MANUFACT_ID_REG   0x06
 
#define TEMPLOG3_DEVICE_ID_REG   0x07
 
#define TEMPLOG3_RESOLUTION_REG   0x08
 
#define TEMPLOG3_EVENT_SHDN_STATUS_MASK   0x80
 
#define TEMPLOG3_I2C_TIMEOUT_STATUS_MASK   0x40
 
#define TEMPLOG3_HIGH_VOLT_INPUT_STATUS_MASK   0x20
 
#define TEMPLOG3_RESOLUTION_STATUS_MASK   0x18
 
#define TEMPLOG3_MEAS_RANGE_STATUS_MASK   0x04
 
#define TEMPLOG3_ACCURACY_STATUS_MASK   0x02
 
#define TEMPLOG3_ALARM_STATUS_MASK   0x01
 
#define TEMPLOG3_TLIMIT_HYST_0_DEG   0x0000
 
#define TEMPLOG3_TLIMIT_HYST_ONE_HALF_DEG   0x0200
 
#define TEMPLOG3_TLIMIT_HYST_3_DEG   0x0400
 
#define TEMPLOG3_TLIMIT_HYST_6_DEG   0x0600
 
#define TEMPLOG3_CONT_CONV_MODE   0x0000
 
#define TEMPLOG3_SHUTDOWN_MODE   0x0100
 
#define TEMPLOG3_TCRIT_LOCKED   0x0080
 
#define TEMPLOG3_TUPPER_TLOWER_LOCKED   0x0040
 
#define TEMPLOG3_INT_CLEAR   0x0020
 
#define TEMPLOG3_EVENT_OUTPUT_STATUS_MASK   0x0010
 
#define TEMPLOG3_EVENT_OUTPUT_EN   0x0008
 
#define TEMPLOG3_EVENT_ALL_TLIMIT   0x0000
 
#define TEMPLOG3_EVENT_TCRIT_ONLY   0x0004
 
#define TEMPLOG3_EVENT_POL_ACT_LOW   0x0000
 
#define TEMPLOG3_EVENT_POL_ACT_HIGH   0x0002
 
#define TEMPLOG3_EVENT_COMPARATOR_MODE   0x0000
 
#define TEMPLOG3_EVENT_INTERRUPT_MODE   0x0001
 
#define TEMPLOG3_TCRIT_DETECT   0x80
 
#define TEMPLOG3_TUPPER_DETECT   0x40
 
#define TEMPLOG3_TLOWER_DETECT   0x20
 
#define TEMPLOG3_NBYTES_ERROR   0x04
 
#define TEMPLOG3_TEMP_RANGE_ERROR   0x03
 
#define TEMPLOG3_ADDR_ERROR   0x02
 
#define TEMPLOG3_ALARMING   0x01
 
#define TEMPLOG3_OK   0x00
 
#define TEMPLOG3_12BIT_RESOLUTION   0x03
 
#define TEMPLOG3_11BIT_RESOLUTION   0x02
 
#define TEMPLOG3_10BIT_RESOLUTION   0x01
 
#define TEMPLOG3_9BIT_RESOLUTION   0x00
 
#define TEMPLOG3_EEPROM_WRITE   0x00
 
#define TEMPLOG3_SW_WRITE_PROTECT   0x01
 
#define TEMPLOG3_CLEAR_WRITE_PROTECT   0x02
 
#define TEMPLOG3_EEPROM_SIZE   256
 

Functions

void templog3_cfg_setup (templog3_cfg_t *cfg)
 Config Object Initialization function.
 
TEMPLOG3_RETVAL templog3_init (templog3_t *ctx, templog3_cfg_t *cfg)
 Initialization function.
 
void templog3_default_cfg (templog3_t *ctx)
 Click Default Configuration function.
 
uint8_t templog3_write_reg (templog3_t *ctx, uint8_t reg_addr, uint16_t data_in)
 Generic Write function.
 
uint8_t templog3_read_reg (templog3_t *ctx, uint8_t reg_addr, uint16_t *data_out)
 Generic Read function.
 
uint8_t templog3_set_addr_ptr (templog3_t *ctx, uint8_t reg_addr)
 Set Address Pointer function.
 
void templog3_repeated_read (templog3_t *ctx, uint16_t *data_out)
 Repeated Read function.
 
uint8_t templog3_get_temp (templog3_t *ctx, uint8_t temp_sel, float *temp_out)
 Get Temperature function.
 
uint8_t templog3_set_temp (templog3_t *ctx, uint8_t temp_sel, float temp_in)
 Set Temperature function.
 
uint8_t templog3_check_alarm (templog3_t *ctx)
 Alarm-Event Check function.
 
void templog3_wait_conv_done (templog3_t *ctx)
 Conversion Time function.
 
void templog3_eeprom_byte_write (templog3_t *ctx, uint8_t reg_addr, uint8_t data_in, uint8_t eeprom_mode)
 EEPROM Single Write function.
 
void templog3_eeprom_page_write (templog3_t *ctx, uint8_t reg_addr, uint8_t *data_in)
 EEPROM Page Write function.
 
void templog3_eeprom_curr_addr_read (templog3_t *ctx, uint8_t *current_address)
 EEPROM Current Address Read function.
 
void templog3_eeprom_byte_read (templog3_t *ctx, uint8_t reg_addr, uint8_t *data_out)
 EEPROM Single Read function.
 
uint8_t templog3_eeprom_sequential_read (templog3_t *ctx, uint8_t reg_addr, uint8_t *data_out, uint16_t num_bytes)
 EEPROM Sequential Read function.
 

Detailed Description

This file contains API for Temp Log 3 Click driver.