37#ifndef DRIVER_HDC1080_H
38#define DRIVER_HDC1080_H
112 uint8_t (*
iic_read)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len);
113 uint8_t (*
iic_write)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len);
115 uint8_t *buf, uint16_t len);
154#define DRIVER_HDC1080_LINK_INIT(HANDLE, STRUCTURE) memset(HANDLE, 0, sizeof(STRUCTURE))
162#define DRIVER_HDC1080_LINK_IIC_INIT(HANDLE, FUC) (HANDLE)->iic_init = FUC
170#define DRIVER_HDC1080_LINK_IIC_DEINIT(HANDLE, FUC) (HANDLE)->iic_deinit = FUC
178#define DRIVER_HDC1080_LINK_IIC_READ(HANDLE, FUC) (HANDLE)->iic_read = FUC
186#define DRIVER_HDC1080_LINK_IIC_READ_WITH_WAIT(HANDLE, FUC) (HANDLE)->iic_read_with_wait = FUC
194#define DRIVER_HDC1080_LINK_IIC_WRITE(HANDLE, FUC) (HANDLE)->iic_write = FUC
202#define DRIVER_HDC1080_LINK_DELAY_MS(HANDLE, FUC) (HANDLE)->delay_ms = FUC
210#define DRIVER_HDC1080_LINK_DEBUG_PRINT(HANDLE, FUC) (HANDLE)->debug_print = FUC
275 uint16_t *humidity_raw,
float *humidity_s);
uint8_t hdc1080_get_serial_id(hdc1080_handle_t *handle, uint8_t id[6])
get serial id
uint8_t hdc1080_info(hdc1080_info_t *info)
get chip's information
struct hdc1080_info_s hdc1080_info_t
hdc1080 information structure definition
uint8_t hdc1080_get_temperature_resolution(hdc1080_handle_t *handle, hdc1080_temperature_resolution_t *resolution)
get temperature resolution
uint8_t hdc1080_read_humidity(hdc1080_handle_t *handle, uint16_t *humidity_raw, float *humidity_s)
read the humidity data
uint8_t hdc1080_get_battery_status(hdc1080_handle_t *handle, hdc1080_battery_status_t *status)
get battery status
struct hdc1080_handle_s hdc1080_handle_t
hdc1080 handle structure definition
hdc1080_humidity_resolution_t
hdc1080 humidity resolution enumeration definition
hdc1080_mode_t
hdc1080 mode enumeration definition
hdc1080_temperature_resolution_t
hdc1080 temperature resolution enumeration definition
uint8_t hdc1080_read_temperature_humidity(hdc1080_handle_t *handle, uint16_t *temperature_raw, float *temperature_s, uint16_t *humidity_raw, float *humidity_s)
read the temperature and humidity data
uint8_t hdc1080_deinit(hdc1080_handle_t *handle)
close the chip
uint8_t hdc1080_set_heater(hdc1080_handle_t *handle, hdc1080_bool_t enable)
enable or disable heater
uint8_t hdc1080_set_mode(hdc1080_handle_t *handle, hdc1080_mode_t mode)
set the chip mode
uint8_t hdc1080_get_humidity_resolution(hdc1080_handle_t *handle, hdc1080_humidity_resolution_t *resolution)
get humidity resolution
uint8_t hdc1080_set_humidity_resolution(hdc1080_handle_t *handle, hdc1080_humidity_resolution_t resolution)
set humidity resolution
uint8_t hdc1080_init(hdc1080_handle_t *handle)
initialize the chip
hdc1080_battery_status_t
hdc1080 battery status enumeration definition
uint8_t hdc1080_get_heater(hdc1080_handle_t *handle, hdc1080_bool_t *enable)
get the heater status
uint8_t hdc1080_software_reset(hdc1080_handle_t *handle)
software reset
uint8_t hdc1080_read_temperature(hdc1080_handle_t *handle, uint16_t *temperature_raw, float *temperature_s)
read the temperature
uint8_t hdc1080_get_mode(hdc1080_handle_t *handle, hdc1080_mode_t *mode)
get the chip mode
uint8_t hdc1080_set_temperature_resolution(hdc1080_handle_t *handle, hdc1080_temperature_resolution_t resolution)
set temperature resolution
hdc1080_bool_t
hdc1080 bool enumeration definition
@ HDC1080_HUMIDITY_RESOLUTION_8_BIT
@ HDC1080_HUMIDITY_RESOLUTION_11_BIT
@ HDC1080_HUMIDITY_RESOLUTION_14_BIT
@ HDC1080_TEMPERATURE_RESOLUTION_14_BIT
@ HDC1080_TEMPERATURE_RESOLUTION_11_BIT
@ HDC1080_BATTERY_STATUS_OVER_2P8_V
@ HDC1080_BATTERY_STATUS_LESS_2P8_V
uint8_t hdc1080_get_reg(hdc1080_handle_t *handle, uint8_t reg, uint16_t *data)
get chip register
uint8_t hdc1080_set_reg(hdc1080_handle_t *handle, uint8_t reg, uint16_t data)
set chip register
hdc1080 handle structure definition
void(* delay_ms)(uint32_t ms)
void(* debug_print)(const char *const fmt,...)
uint8_t(* iic_init)(void)
uint8_t(* iic_read_with_wait)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
uint8_t(* iic_write)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
uint8_t(* iic_read)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
uint8_t(* iic_deinit)(void)
hdc1080 information structure definition
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v