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"
52 #define SURFACETEMP_MAP_MIKROBUS( cfg, mikrobus ) \
53 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
54 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
55 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
56 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM )
63 #define SURFACETEMP_RETVAL uint8_t
65 #define SURFACETEMP_OK 0x00
66 #define SURFACETEMP_INIT_ERROR 0xFF
74 #define DEVICE_ERROR 1
81 #define SURFACETEMP_SLAVE_DEVICE_ADDR_0_0 0x48
82 #define SURFACETEMP_SLAVE_DEVICE_ADDR_0_1 0x49
83 #define SURFACETEMP_SLAVE_DEVICE_ADDR_1_0 0x4A
84 #define SURFACETEMP_SLAVE_DEVICE_ADDR_1_1 0x4B
91 #define SURFACETEMP_REG_TEMP_MSB 0x00
92 #define SURFACETEMP_REG_TEMP_LSB 0x01
93 #define SURFACETEMP_REG_STATUS 0x02
94 #define SURFACETEMP_REG_CONFIG 0x03
95 #define SURFACETEMP_REG_T_HIGH_SETP_MSB 0x04
96 #define SURFACETEMP_REG_T_HIGH_SETP_LSB 0x05
97 #define SURFACETEMP_REG_T_LOW_SETP_MSB 0x06
98 #define SURFACETEMP_REG_T_LOW_SETP_LSB 0x07
99 #define SURFACETEMP_REG_T_CRIT_SETP_MSB 0x08
100 #define SURFACETEMP_REG_T_CRIT_SETP_LSB 0x09
101 #define SURFACETEMP_REG_T_HYST_SETP 0x0A
102 #define SURFACETEMP_REG_ID 0x0B
103 #define SURFACETEMP_REG_SOFT_RESET 0x2F
110 #define SURFACETEMP_T_LOW_MASK 0x10
111 #define SURFACETEMP_T_HIGH_MASK 0x20
112 #define SURFACETEMP_T_CRIT_MASK 0x40
113 #define SURFACETEMP_RDY_MASK 0x80
347 #endif // _SURFACETEMP_H_
float surfacetemp_get_temperature(surfacetemp_t *ctx)
Getting temperature value.
digital_out_t pwm
Definition: surfacetemp.h:131
uint8_t slave_address
Definition: surfacetemp.h:139
Click ctx object definition.
Definition: surfacetemp.h:127
void surfacetemp_generic_read(surfacetemp_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
uint8_t surfacetemp_get_pwm_pin(surfacetemp_t *ctx)
Getting PWM pin state.
void surfacetemp_soft_reset(surfacetemp_t *ctx)
Soft reset.
pin_name_t scl
Definition: surfacetemp.h:150
uint8_t surfacetemp_set_hysteresis(surfacetemp_t *ctx, uint8_t hysteresis)
Setting hysteresis value.
void surfacetemp_generic_write(surfacetemp_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
Click configuration structure definition.
Definition: surfacetemp.h:147
uint8_t surfacetemp_set_critical_threshold(surfacetemp_t *ctx, float high_threshold)
Setting critical threshold limit.
SURFACETEMP_RETVAL surfacetemp_init(surfacetemp_t *ctx, surfacetemp_cfg_t *cfg)
Initialization function.
void surfacetemp_cfg_setup(surfacetemp_cfg_t *cfg)
Config Object Initialization function.
uint8_t surfacetemp_set_high_threshold(surfacetemp_t *ctx, float high_threshold)
Setting high threshold limit.
void surfacetemp_default_cfg(surfacetemp_t *ctx)
Click Default Configuration function.
uint8_t surfacetemp_setup(surfacetemp_t *ctx)
Device initialization.
pin_name_t sda
Definition: surfacetemp.h:151
pin_name_t pwm
Definition: surfacetemp.h:156
#define SURFACETEMP_RETVAL
Definition: surfacetemp.h:63
uint8_t surfacetemp_set_low_threshold(surfacetemp_t *ctx, float high_threshold)
Setting low threshold limit.
pin_name_t rst
Definition: surfacetemp.h:155
uint8_t surfacetemp_get_status(surfacetemp_t *ctx)
Getting device status.
uint8_t i2c_address
Definition: surfacetemp.h:161
uint32_t i2c_speed
Definition: surfacetemp.h:160
digital_out_t rst
Definition: surfacetemp.h:130
i2c_master_t i2c
Definition: surfacetemp.h:135