Go to the documentation of this file.
35 #include "mikrosdk_version.h"
38 #if mikroSDK_GET_VERSION < 20800ul
39 #include "rcu_delays.h"
45 #include "drv_digital_out.h"
46 #include "drv_digital_in.h"
47 #include "drv_i2c_master.h"
69 #define TEMPHUM17_REG_HUMIDITY_SENSOR_RESOLUTION_READ 0x06
70 #define TEMPHUM17_REG_HUMIDITY_SENSOR_RESOLUTION_WRITE 0x46
71 #define TEMPHUM17_REG_TEMPERATURE_SENSOR_RESOLUTION_READ 0x11
72 #define TEMPHUM17_REG_TEMPERATURE_SENSOR_RESOLUTION_WRITE 0x51
73 #define TEMPHUM17_REG_SENSOR_ID_UPPER_READ 0x1E
74 #define TEMPHUM17_REG_SENSOR_ID_LOWER_READ 0x1F
92 #define TEMPHUM17_CMD_ENTER_PROGRAMMING_MODE 0xA0
93 #define TEMPHUM17_CMD_DUMMY 0x00
94 #define TEMPHUM17_CMD_ENTER_MEASUREMENTS_MODE 0x80
111 #define TEMPHUM17_STATUS_VALID_DATA 0x00
112 #define TEMPHUM17_STATUS_STALE_DATA 0x01
129 #define TEMPHUM17_RESOLUTION_8_BITS 0x00
130 #define TEMPHUM17_RESOLUTION_10_BITS 0x01
131 #define TEMPHUM17_RESOLUTION_12_BITS 0x02
132 #define TEMPHUM17_RESOLUTION_14_BITS 0x03
139 #define TEMPHUM17_SET_DEV_ADDR 0x44
157 #define TEMPHUM17_MAP_MIKROBUS( cfg, mikrobus ) \
158 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
159 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
460 #endif // TEMPHUM17_H
err_t temphum17_enter_measurements_mode(temphum17_t *ctx)
Temp&Hum 17 enter measurements mode function.
err_t temphum17_wake_up(temphum17_t *ctx)
Temp&Hum 17 wake up function.
Temp&Hum 17 Click configuration object.
Definition: temphum17.h:185
err_t temphum17_init(temphum17_t *ctx, temphum17_cfg_t *cfg)
Temp&Hum 17 initialization function.
err_t temphum17_get_raw_data(temphum17_t *ctx, uint8_t resolution, int16_t *temp, uint16_t *hum, uint8_t *status)
Temp&Hum 17 get raw data function.
err_t temphum17_set_relative_humidity_resolution(temphum17_t *ctx, uint8_t resolution)
Temp&Hum 17 set relative humidity resolution function.
uint8_t slave_address
Definition: temphum17.h:176
uint32_t i2c_speed
Definition: temphum17.h:190
pin_name_t scl
Definition: temphum17.h:186
pin_name_t sda
Definition: temphum17.h:187
void temphum17_cfg_setup(temphum17_cfg_t *cfg)
Temp&Hum 17 configuration object setup function.
err_t temphum17_enter_programming_mode(temphum17_t *ctx)
Temp&Hum 17 enter programming mode function.
Temp&Hum 17 Click context object.
Definition: temphum17.h:169
err_t temphum17_generic_write(temphum17_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
Temp&Hum 17 I2C writing function.
err_t temphum17_default_cfg(temphum17_t *ctx)
Temp&Hum 17 default configuration function.
i2c_master_t i2c
Definition: temphum17.h:172
err_t temphum17_set_temperature_resolution(temphum17_t *ctx, uint8_t resolution)
Temp&Hum 17 set temperature resolution function.
uint8_t i2c_address
Definition: temphum17.h:191
err_t temphum17_get_temp_hum(temphum17_t *ctx, uint8_t resolution, float *temperature, float *humidity)
Temp&Hum 17 get temperature and humidity function.
@ TEMPHUM17_OK
Definition: temphum17.h:201
@ TEMPHUM17_ERROR
Definition: temphum17.h:202
temphum17_return_value_t
Temp&Hum 17 Click return value data.
Definition: temphum17.h:200
err_t temphum17_generic_read(temphum17_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
Temp&Hum 17 I2C reading function.