Go to the documentation of this file.
35 #include "drv_digital_out.h"
36 #include "drv_digital_in.h"
37 #include "drv_i2c_master.h"
59 #define TEMPHUM19_REG_RESET 0x00
60 #define TEMPHUM19_REG_MODE 0x01
61 #define TEMPHUM19_REG_ERROR 0x03
62 #define TEMPHUM19_REG_HUMIDITY_LSB 0x04
63 #define TEMPHUM19_REG_HUMIDITY_MSB 0x05
64 #define TEMPHUM19_REG_TEMPERATURE_LSB 0x06
65 #define TEMPHUM19_REG_TEMPERATURE_MSB 0x07
66 #define TEMPHUM19_REG_CAPACITY_LSB 0x0A
67 #define TEMPHUM19_REG_CAPACITY_MSB 0x0B
68 #define TEMPHUM19_REG_CAPACITY_CTRL 0x2C
86 #define TEMPHUM19_10BIT_RESOLUTION 0x400
87 #define TEMPHUM19_TEMP_DATA 0x7FF
88 #define TEMPHUM19_HUM_DATA 0x3FF
89 #define TEMPHUM19_TEMP_RESOLUTION 0.1
90 #define TEMPHUM19_HUM_RESOLUTION 100
91 #define TEMPHUM19_TEMP_NOMINAL 25
97 #define TEMPHUM19_NORMAL_OPERATION_MODE 0x00
98 #define TEMPHUM19_HUM_NO_AVG 0x00
99 #define TEMPHUM19_HUM_AVG_2 0x08
100 #define TEMPHUM19_HUM_AVG_4 0x10
101 #define TEMPHUM19_HUM_AVG_8 0x20
102 #define TEMPHUM19_TEMP_AVG_8 0x00
103 #define TEMPHUM19_TEMP_AVG_16 0x04
104 #define TEMPHUM19_START_DETECTION 0x01
105 #define TEMPHUM19_STOP_DETECTION 0x00
112 #define TEMPHUM19_SET_DEV_ADDR 0x7F
130 #define TEMPHUM19_MAP_MIKROBUS( cfg, mikrobus ) \
131 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
132 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
133 cfg.en = MIKROBUS( mikrobus, MIKROBUS_PWM );
332 #endif // TEMPHUM19_H
err_t temphum19_read_data(temphum19_t *ctx, float *temperature, float *humidity)
TempHum 19 read data function.
uint32_t i2c_speed
Definition: temphum19.h:170
uint8_t i2c_address
Definition: temphum19.h:171
err_t temphum19_default_cfg(temphum19_t *ctx)
TempHum 19 default configuration function.
TempHum 19 Click configuration object.
Definition: temphum19.h:164
pin_name_t scl
Definition: temphum19.h:149
err_t temphum19_generic_read(temphum19_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
TempHum 19 I2C reading function.
void temphum19_restart_chip(temphum19_t *ctx)
TempHum 19 restart chip function.
void temphum19_disable_chip(temphum19_t *ctx)
TempHum 19 disable chip function.
@ TEMPHUM19_ERROR
Definition: temphum19.h:182
digital_out_t en
Definition: temphum19.h:145
@ TEMPHUM19_OK
Definition: temphum19.h:181
void temphum19_enable_chip(temphum19_t *ctx)
TempHum 19 enable chip function.
err_t temphum19_set_mode_reg(temphum19_t *ctx, uint8_t mode)
TempHum 19 set mode function.
void temphum19_cfg_setup(temphum19_cfg_t *cfg)
TempHum 19 configuration object setup function.
pin_name_t sda
Definition: temphum19.h:166
temphum19_return_value_t
TempHum 19 Click return value data.
Definition: temphum19.h:180
err_t temphum19_init(temphum19_t *ctx, temphum19_cfg_t *cfg)
TempHum 19 initialization function.
pin_name_t scl
Definition: temphum19.h:165
i2c_master_t i2c
Definition: temphum19.h:148
uint8_t detection_mode
Definition: temphum19.h:155
TempHum 19 Click context object.
Definition: temphum19.h:143
err_t temphum19_generic_write(temphum19_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
TempHum 19 I2C writing function.
pin_name_t en
Definition: temphum19.h:168
pin_name_t sda
Definition: temphum19.h:150
uint8_t slave_address
Definition: temphum19.h:153