Go to the documentation of this file.
38 #include "drv_digital_out.h"
39 #include "drv_digital_in.h"
40 #include "drv_i2c_master.h"
48 #define TEMPLOG_MAP_MIKROBUS( cfg, mikrobus ) \
49 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
50 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
51 cfg.alt = MIKROBUS( mikrobus, MIKROBUS_INT )
58 #define TEMPLOG_RETVAL uint8_t
60 #define TEMPLOG_OK 0x00
61 #define TEMPLOG_INIT_ERROR 0xFF
68 #define TEMP_LOG_TEMPERATURE 0x00
69 #define TEMP_LOG_CONFIGURATION 0x01
70 #define TEMP_LOG_TLOW_LIMIT 0x02
71 #define TEMP_LOG_THIGH_LIMIT 0x03
72 #define TEMP_LOG_CONFIGURATION_NONVOL 0x11
73 #define TEMP_LOG_TLOW_LIMIT_NONVOL 0x12
74 #define TEMP_LOG_THIGH_LIMIT_NONVOL 0x13
75 #define TEMP_LOG_SLAVE_ADDRESS 0x48
76 #define TEMP_LOG_8_BITS_DATA 0x01
77 #define TEMP_LOG_16_BITS_DATA 0x00
78 #define TEMP_LOG_RESOLUTION_9_BITS 0x0000
79 #define TEMP_LOG_RESOLUTION_10_BITS 0x2000
80 #define TEMP_LOG_RESOLUTION_11_BITS 0x4000
81 #define TEMP_LOG_RESOLUTION_12_BITS 0x6000
82 #define TEMP_LOG_0_CELSIUS 0x0000
83 #define TEMP_LOG_10_125_CELSIUS 0x0A20
84 #define TEMP_LOG_25_25_CELSIUS 0x1940
85 #define TEMP_LOG_50_5_CELSIUS 0x3200
86 #define TEMP_LOG_75_CELSIUS 0x4B00
87 #define TEMP_LOG_100_CELSIUS 0x6400
88 #define TEMP_LOG_125_CELSIUS 0x7D00
89 #define TEMP_LOG_NEGATIVE_10_125_CELSIUS 0xF5E0
90 #define TEMP_LOG_NEGATIVE_25_25_CELSIUS 0xE7C0
91 #define TEMP_LOG_NEGATIVE_50_5_CELSIUS 0xCE80
92 #define TEMP_LOG_NEGATIVE_55_CELSIUS 0xC900
248 #endif // _TEMPLOG_H_
uint8_t i2c_address
Definition: templog.h:139
float temp_log_convert_to_celsius(uint16_t temperature_data)
Convert function.
pin_name_t chip_select
Definition: templog.h:118
TEMPLOG_RETVAL templog_init(templog_t *ctx, templog_cfg_t *cfg)
Initialization function.
pin_name_t alt
Definition: templog.h:134
pin_name_t scl
Definition: templog.h:129
uint16_t templog_generic_read(templog_t *ctx, uint8_t reg)
Generic read function.
pin_name_t sda
Definition: templog.h:130
void templog_generic_write(templog_t *ctx, uint8_t reg, uint16_t transfer_data, uint8_t len)
Generic write function.
void templog_cfg_setup(templog_cfg_t *cfg)
Config Object Initialization function.
Click configuration structure definition.
Definition: templog.h:125
uint16_t temp_log_read_temp_dec(templog_t *ctx, uint16_t resolution)
Temp read function.
Click ctx object definition.
Definition: templog.h:105
digital_in_t alt
Definition: templog.h:109
i2c_master_t i2c
Definition: templog.h:113
void templog_default_cfg(templog_t *ctx)
Click Default Configuration function.
uint8_t temp_log_get_alert(templog_t *ctx)
Alert function.
uint32_t i2c_speed
Definition: templog.h:138
#define TEMPLOG_RETVAL
Definition: templog.h:58
uint8_t slave_address
Definition: templog.h:117