42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_i2c_master.h"
66#define HDC1000_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
68 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
69 cfg.rdy = MIKROBUS( mikrobus, MIKROBUS_INT )
76#define HDC1000_RETVAL uint8_t
78#define HDC1000_OK 0x00
79#define HDC1000_INIT_ERROR 0xFF
85#define HDC1000_SLAVE_ADDRESS 0x40
92#define HDC1000_REG_TEMP 0x00
93#define HDC1000_REG_HUMI 0x01
94#define HDC1000_REG_CONFIG 0x02
95#define HDC1000_REG_SERID_1 0xFB
96#define HDC1000_REG_SERID_2 0xFC
97#define HDC1000_REG_SERID_3 0xFD
98#define HDC1000_REG_MFID 0xFE
99#define HDC1000_REG_DEVID 0xFF
106#define HDC1000_RST 0x80
107#define HDC1000_HEAT_ON 0x20
108#define HDC1000_HEAT_OFF 0x00
109#define HDC1000_BOTH_TEMP_HUMI 0x10
110#define HDC1000_SINGLE_MEASUR 0x00
111#define HDC1000_TEMP_HUMI_14BIT 0x00
112#define HDC1000_TEMP_11BIT 0x04
113#define HDC1000_HUMI_11BIT 0x01
114#define HDC1000_HUMI_8BIT 0x02
#define HDC1000_RETVAL
Definition hdc1000.h:76
float hdc1000_get_temperature_data(hdc1000_t *ctx)
Get temperature value.
void hdc1000_generic_read(hdc1000_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
uint8_t hdc1000_get_interrupt(hdc1000_t *ctx)
Get interrupt state.
void hdc1000_cfg_setup(hdc1000_cfg_t *cfg)
Config Object Initialization function.
void hdc1000_default_cfg(hdc1000_t *ctx)
Click Default Configuration function.
HDC1000_RETVAL hdc1000_init(hdc1000_t *ctx, hdc1000_cfg_t *cfg)
Initialization function.
float hdc1000_get_humidity_data(hdc1000_t *ctx)
Get humidity value.
void hdc1000_generic_write(hdc1000_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
Click configuration structure definition.
Definition hdc1000.h:147
uint32_t i2c_speed
Definition hdc1000.h:159
pin_name_t scl
Definition hdc1000.h:150
pin_name_t rdy
Definition hdc1000.h:155
pin_name_t sda
Definition hdc1000.h:151
uint8_t i2c_address
Definition hdc1000.h:160
Click ctx object definition.
Definition hdc1000.h:128
i2c_master_t i2c
Definition hdc1000.h:135
uint8_t slave_address
Definition hdc1000.h:139
digital_in_t rdy
Definition hdc1000.h:131