42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_in.h"
53#include "drv_i2c_master.h"
65#define TEMPLOG6_MAP_MIKROBUS( cfg, mikrobus ) \
66 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
67 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
68 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
75#define TEMPLOG6_RETVAL uint8_t
77#define TEMPLOG6_OK 0x00
78#define TEMPLOG6_INIT_ERROR 0xFF
85#define TEMPLOG6_REG_LOCAL_TEMPERATURE 0x00
86#define TEMPLOG6_REG_REMOTE_TEMPERATURE 0x01
87#define TEMPLOG6_REG_STATUS 0x02
88#define TEMPLOG6_REG_RD_CONFIGURATION 0x03
89#define TEMPLOG6_REG_RD_LOCAL_HIGH_LIMIT 0x05
90#define TEMPLOG6_REG_RD_REMOTE_HIGH_LIMIT 0x07
91#define TEMPLOG6_REG_WR_CONFIGURATION 0x09
92#define TEMPLOG6_REG_WR_LOCAL_HIGH_LIMIT 0x0B
93#define TEMPLOG6_REG_WR_REMOTE_HIGH_LIMIT 0x0D
94#define TEMPLOG6_REG_SINGLE_SHOT 0x0F
95#define TEMPLOG6_REG_REMOTE_EXTENDED_TEMP 0x10
96#define TEMPLOG6_REG_INTERNAL_EXTENDED_TEMP 0x11
97#define TEMPLOG6_REG_MANUFACTURER_ID 0xFE
104#define TEMPLOG6_CFG_ALERT_OFF 0x80
105#define TEMPLOG6_CFG_ALERT_ON 0x00
106#define TEMPLOG6_CFG_STANDBY_MODE 0x40
107#define TEMPLOG6_CFG_NORMAL_MODE 0x00
108#define TEMPLOG6_CFG_LOCAL_MEASUREMENT_OFF 0x20
109#define TEMPLOG6_CFG_LOCAL_MEASUREMENT_ON 0x00
110#define TEMPLOG6_CFG_ALERT_1_FAULT 0x00
111#define TEMPLOG6_CFG_ALERT_2_FAULT 0x10
113#define TEMPLOG6_DEVICE_SLAVE_ADDRESS 0x4A
114#define TEMPLOG6_MANUFACTURER_ID 0x4D
#define TEMPLOG6_RETVAL
Definition templog6.h:75
void templog6_default_cfg(templog6_t *ctx)
Click Default Configuration function.
uint8_t templog6_read_byte(templog6_t *ctx, uint8_t reg)
Read one byte function.
void templog6_generic_read(templog6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
void templog6_write_byte(templog6_t *ctx, uint8_t reg, uint8_t data_buf)
Write one byte function.
void templog6_cfg_setup(templog6_cfg_t *cfg)
Config Object Initialization function.
TEMPLOG6_RETVAL templog6_init(templog6_t *ctx, templog6_cfg_t *cfg)
Initialization function.
void templog6_generic_write(templog6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
uint8_t templog6_get_interrupt(templog6_t *ctx)
Gets interrupt.
Click configuration structure definition.
Definition templog6.h:147
uint32_t i2c_speed
Definition templog6.h:159
pin_name_t scl
Definition templog6.h:150
pin_name_t int_pin
Definition templog6.h:155
pin_name_t sda
Definition templog6.h:151
uint8_t i2c_address
Definition templog6.h:160
Click ctx object definition.
Definition templog6.h:128
digital_in_t int_pin
Definition templog6.h:131
i2c_master_t i2c
Definition templog6.h:135
uint8_t slave_address
Definition templog6.h:139