Go to the documentation of this file.
38 #include "drv_digital_in.h"
39 #include "drv_i2c_master.h"
51 #define TEMPLOG6_MAP_MIKROBUS( cfg, mikrobus ) \
52 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
53 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
54 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
61 #define TEMPLOG6_RETVAL uint8_t
63 #define TEMPLOG6_OK 0x00
64 #define TEMPLOG6_INIT_ERROR 0xFF
71 #define TEMPLOG6_REG_LOCAL_TEMPERATURE 0x00
72 #define TEMPLOG6_REG_REMOTE_TEMPERATURE 0x01
73 #define TEMPLOG6_REG_STATUS 0x02
74 #define TEMPLOG6_REG_RD_CONFIGURATION 0x03
75 #define TEMPLOG6_REG_RD_LOCAL_HIGH_LIMIT 0x05
76 #define TEMPLOG6_REG_RD_REMOTE_HIGH_LIMIT 0x07
77 #define TEMPLOG6_REG_WR_CONFIGURATION 0x09
78 #define TEMPLOG6_REG_WR_LOCAL_HIGH_LIMIT 0x0B
79 #define TEMPLOG6_REG_WR_REMOTE_HIGH_LIMIT 0x0D
80 #define TEMPLOG6_REG_SINGLE_SHOT 0x0F
81 #define TEMPLOG6_REG_REMOTE_EXTENDED_TEMP 0x10
82 #define TEMPLOG6_REG_INTERNAL_EXTENDED_TEMP 0x11
83 #define TEMPLOG6_REG_MANUFACTURER_ID 0xFE
90 #define TEMPLOG6_CFG_ALERT_OFF 0x80
91 #define TEMPLOG6_CFG_ALERT_ON 0x00
92 #define TEMPLOG6_CFG_STANDBY_MODE 0x40
93 #define TEMPLOG6_CFG_NORMAL_MODE 0x00
94 #define TEMPLOG6_CFG_LOCAL_MEASUREMENT_OFF 0x20
95 #define TEMPLOG6_CFG_LOCAL_MEASUREMENT_ON 0x00
96 #define TEMPLOG6_CFG_ALERT_1_FAULT 0x00
97 #define TEMPLOG6_CFG_ALERT_2_FAULT 0x10
99 #define TEMPLOG6_DEVICE_SLAVE_ADDRESS 0x4A
100 #define TEMPLOG6_MANUFACTURER_ID 0x4D
248 #endif // _TEMPLOG6_H_
pin_name_t sda
Definition: templog6.h:137
uint8_t templog6_read_byte(templog6_t *ctx, uint8_t reg)
Read one byte function.
TEMPLOG6_RETVAL templog6_init(templog6_t *ctx, templog6_cfg_t *cfg)
Initialization function.
digital_in_t int_pin
Definition: templog6.h:117
pin_name_t int_pin
Definition: templog6.h:141
uint8_t i2c_address
Definition: templog6.h:146
uint32_t i2c_speed
Definition: templog6.h:145
void templog6_generic_read(templog6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
void templog6_default_cfg(templog6_t *ctx)
Click Default Configuration function.
void templog6_write_byte(templog6_t *ctx, uint8_t reg, uint8_t data_buf)
Write one byte function.
void templog6_generic_write(templog6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
i2c_master_t i2c
Definition: templog6.h:121
Click ctx object definition.
Definition: templog6.h:114
Click configuration structure definition.
Definition: templog6.h:133
uint8_t slave_address
Definition: templog6.h:125
void templog6_cfg_setup(templog6_cfg_t *cfg)
Config Object Initialization function.
#define TEMPLOG6_RETVAL
Definition: templog6.h:61
pin_name_t scl
Definition: templog6.h:136
uint8_t templog6_get_interrupt(templog6_t *ctx)
Gets interrupt.