42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_i2c_master.h"
62#define TEMPLOG_MAP_MIKROBUS( cfg, mikrobus ) \
63 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
64 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
65 cfg.alt = MIKROBUS( mikrobus, MIKROBUS_INT )
72#define TEMPLOG_RETVAL uint8_t
74#define TEMPLOG_OK 0x00
75#define TEMPLOG_INIT_ERROR 0xFF
82#define TEMP_LOG_TEMPERATURE 0x00
83#define TEMP_LOG_CONFIGURATION 0x01
84#define TEMP_LOG_TLOW_LIMIT 0x02
85#define TEMP_LOG_THIGH_LIMIT 0x03
86#define TEMP_LOG_CONFIGURATION_NONVOL 0x11
87#define TEMP_LOG_TLOW_LIMIT_NONVOL 0x12
88#define TEMP_LOG_THIGH_LIMIT_NONVOL 0x13
89#define TEMP_LOG_SLAVE_ADDRESS 0x48
90#define TEMP_LOG_8_BITS_DATA 0x01
91#define TEMP_LOG_16_BITS_DATA 0x00
92#define TEMP_LOG_RESOLUTION_9_BITS 0x0000
93#define TEMP_LOG_RESOLUTION_10_BITS 0x2000
94#define TEMP_LOG_RESOLUTION_11_BITS 0x4000
95#define TEMP_LOG_RESOLUTION_12_BITS 0x6000
96#define TEMP_LOG_0_CELSIUS 0x0000
97#define TEMP_LOG_10_125_CELSIUS 0x0A20
98#define TEMP_LOG_25_25_CELSIUS 0x1940
99#define TEMP_LOG_50_5_CELSIUS 0x3200
100#define TEMP_LOG_75_CELSIUS 0x4B00
101#define TEMP_LOG_100_CELSIUS 0x6400
102#define TEMP_LOG_125_CELSIUS 0x7D00
103#define TEMP_LOG_NEGATIVE_10_125_CELSIUS 0xF5E0
104#define TEMP_LOG_NEGATIVE_25_25_CELSIUS 0xE7C0
105#define TEMP_LOG_NEGATIVE_50_5_CELSIUS 0xCE80
106#define TEMP_LOG_NEGATIVE_55_CELSIUS 0xC900
#define TEMPLOG_RETVAL
Definition templog.h:72
void templog_default_cfg(templog_t *ctx)
Click Default Configuration function.
void templog_cfg_setup(templog_cfg_t *cfg)
Config Object Initialization function.
void templog_generic_write(templog_t *ctx, uint8_t reg, uint16_t transfer_data, uint8_t len)
Generic write function.
float temp_log_convert_to_celsius(uint16_t temperature_data)
Convert function.
uint16_t temp_log_read_temp_dec(templog_t *ctx, uint16_t resolution)
Temp read function.
uint8_t temp_log_get_alert(templog_t *ctx)
Alert function.
TEMPLOG_RETVAL templog_init(templog_t *ctx, templog_cfg_t *cfg)
Initialization function.
uint16_t templog_generic_read(templog_t *ctx, uint8_t reg)
Generic read function.
Click configuration structure definition.
Definition templog.h:140
pin_name_t alt
Definition templog.h:148
uint32_t i2c_speed
Definition templog.h:152
pin_name_t scl
Definition templog.h:143
pin_name_t sda
Definition templog.h:144
uint8_t i2c_address
Definition templog.h:153
Click ctx object definition.
Definition templog.h:120
digital_in_t alt
Definition templog.h:123
i2c_master_t i2c
Definition templog.h:127
uint8_t slave_address
Definition templog.h:131
pin_name_t chip_select
Definition templog.h:132