37#ifndef DRIVER_HDC302X_H
38#define DRIVER_HDC302X_H
163#define DRIVER_HDC302X_LINK_INIT(HANDLE, STRUCTURE) memset(HANDLE, 0, sizeof(STRUCTURE))
171#define DRIVER_HDC302X_LINK_IIC_INIT(HANDLE, FUC) (HANDLE)->iic_init = FUC
179#define DRIVER_HDC302X_LINK_IIC_DEINIT(HANDLE, FUC) (HANDLE)->iic_deinit = FUC
187#define DRIVER_HDC302X_LINK_IIC_READ_ADDRESS16(HANDLE, FUC) (HANDLE)->iic_read_address16 = FUC
195#define DRIVER_HDC302X_LINK_IIC_WRITE_ADDRESS16(HANDLE, FUC) (HANDLE)->iic_write_address16 = FUC
203#define DRIVER_HDC302X_LINK_DELAY_MS(HANDLE, FUC) (HANDLE)->delay_ms = FUC
211#define DRIVER_HDC302X_LINK_DEBUG_PRINT(HANDLE, FUC) (HANDLE)->debug_print = FUC
219#define DRIVER_HDC302X_LINK_RECEIVE_CALLBACK(HANDLE, FUC) (HANDLE)->receive_callback = FUC
384 uint16_t *humidity_raw,
float *humidity_s);
429 uint16_t *humidity_raw,
float *humidity_s);
808 float humidity_percentage, uint16_t *reg);
823 float *temperature_deg,
float *humidity_percentage);
840 uint8_t humidity_symbol,
float humidity_percentage, uint16_t *reg);
857 uint8_t *temperature_symbol,
float *temperature_deg,
858 uint8_t *humidity_symbol,
float *humidity_percentage);
uint8_t hdc302x_alert_threshold_convert_to_data(hdc302x_handle_t *handle, uint16_t reg, float *temperature_deg, float *humidity_percentage)
convert the alert threshold to the real data
uint8_t hdc302x_get_addr(hdc302x_handle_t *handle, hdc302x_address_t *addr)
get the iic address
uint8_t hdc302x_continuous_read(hdc302x_handle_t *handle, uint16_t *temperature_raw, float *temperature_s, uint16_t *humidity_raw, float *humidity_s)
continuous read
uint8_t hdc302x_read_clear_high_alert(hdc302x_handle_t *handle, uint16_t *threshold)
read clear high alert
uint8_t hdc302x_read_set_low_alert(hdc302x_handle_t *handle, uint16_t *threshold)
read set low alert
hdc302x_status_t
hdc302x status enumeration definition
uint8_t hdc302x_nvm_program_temperature_humidity_offset(hdc302x_handle_t *handle, uint16_t offset)
nvm program temperature humidity offset
uint8_t hdc302x_disable_heater(hdc302x_handle_t *handle)
disable heater
uint8_t hdc302x_set_heater_power(hdc302x_handle_t *handle, uint16_t power)
set heater power
uint8_t hdc302x_continuous_read_humidity(hdc302x_handle_t *handle, uint16_t *humidity_raw, float *humidity_s)
continuous read humidity
uint8_t hdc302x_nvm_read_temperature_humidity_offset(hdc302x_handle_t *handle, uint16_t *offset)
nvm read temperature humidity offset
uint8_t hdc302x_offset_convert_to_data(hdc302x_handle_t *handle, uint16_t reg, uint8_t *temperature_symbol, float *temperature_deg, uint8_t *humidity_symbol, float *humidity_percentage)
convert the offset to the real data
struct hdc302x_info_s hdc302x_info_t
hdc302x information structure definition
uint8_t hdc302x_enable_heater(hdc302x_handle_t *handle)
enable heater
uint8_t hdc302x_set_addr(hdc302x_handle_t *handle, hdc302x_address_t addr)
set the iic address
uint8_t hdc302x_deinit(hdc302x_handle_t *handle)
close the chip
hdc302x_address_t
hdc302x address enumeration definition
uint8_t hdc302x_irq_handler(hdc302x_handle_t *handle)
irq handler
uint8_t hdc302x_offset_convert_to_register(hdc302x_handle_t *handle, uint8_t temperature_symbol, float temperature_deg, uint8_t humidity_symbol, float humidity_percentage, uint16_t *reg)
convert the offset to the register raw data
uint8_t hdc302x_single_read(hdc302x_handle_t *handle, uint16_t *temperature_raw, float *temperature_s, uint16_t *humidity_raw, float *humidity_s)
single read
uint8_t hdc302x_set_low_power_mode(hdc302x_handle_t *handle, hdc302x_low_power_mode_t mode)
set low power mode
uint8_t hdc302x_get_nist_id(hdc302x_handle_t *handle, uint8_t id[6])
get nist id
uint8_t hdc302x_read_temperature_min(hdc302x_handle_t *handle, uint16_t *temperature_raw, float *temperature_s)
read temperature min
hdc302x_auto_mode_t
hdc302x auto mode enumeration definition
uint8_t hdc302x_set_auto_mode(hdc302x_handle_t *handle, hdc302x_auto_mode_t mode)
set auto mode
uint8_t hdc302x_alert_threshold_convert_to_register(hdc302x_handle_t *handle, float temperature_deg, float humidity_percentage, uint16_t *reg)
convert the alert threshold to the register raw data
uint8_t hdc302x_get_low_power_mode(hdc302x_handle_t *handle, hdc302x_low_power_mode_t *mode)
get low power mode
uint8_t hdc302x_read_humidity_min(hdc302x_handle_t *handle, uint16_t *humidity_raw, float *humidity_s)
read humidity min
uint8_t hdc302x_read_set_high_alert(hdc302x_handle_t *handle, uint16_t *threshold)
read set high alert
uint8_t hdc302x_nvm_read_config(hdc302x_handle_t *handle, uint16_t *config)
nvm read config
uint8_t hdc302x_init(hdc302x_handle_t *handle)
initialize the chip
uint8_t hdc302x_write_clear_low_alert(hdc302x_handle_t *handle, uint16_t threshold)
write clear low alert
uint8_t hdc302x_get_auto_mode(hdc302x_handle_t *handle, hdc302x_auto_mode_t *mode)
get auto mode
hdc302x_low_power_mode_t
hdc302x low power mode enumeration definition
uint8_t hdc302x_clear_status(hdc302x_handle_t *handle)
clear status
uint8_t hdc302x_write_set_low_alert(hdc302x_handle_t *handle, uint16_t threshold)
write set low alert
uint8_t hdc302x_read_temperature_max(hdc302x_handle_t *handle, uint16_t *temperature_raw, float *temperature_s)
read temperature max
uint8_t hdc302x_stop_continuous_read(hdc302x_handle_t *handle)
stop continuous read
struct hdc302x_handle_s hdc302x_handle_t
hdc302x handle structure definition
uint8_t hdc302x_read_clear_low_alert(hdc302x_handle_t *handle, uint16_t *threshold)
read clear low alert
uint8_t hdc302x_soft_reset(hdc302x_handle_t *handle)
soft reset
uint8_t hdc302x_nvm_program_alert_threshold(hdc302x_handle_t *handle)
nvm program alert threshold
uint8_t hdc302x_get_status(hdc302x_handle_t *handle, uint16_t *status)
get status
uint8_t hdc302x_read_humidity_max(hdc302x_handle_t *handle, uint16_t *humidity_raw, float *humidity_s)
read humidity max
uint8_t hdc302x_get_heater_power(hdc302x_handle_t *handle, uint16_t *power)
get heater power
uint8_t hdc302x_info(hdc302x_info_t *info)
get chip's information
uint8_t hdc302x_start_continuous_read(hdc302x_handle_t *handle)
start continuous read
uint8_t hdc302x_write_clear_high_alert(hdc302x_handle_t *handle, uint16_t threshold)
write clear high alert
uint8_t hdc302x_nvm_program_config(hdc302x_handle_t *handle, uint16_t config)
nvm program config
uint8_t hdc302x_write_set_high_alert(hdc302x_handle_t *handle, uint16_t threshold)
write set high alert
@ HDC302X_STATUS_OVERALL_ALERT
@ HDC302X_STATUS_T_HIGH_TRACKING_ALERT
@ HDC302X_STATUS_RH_LOW_TRACKING_ALERT
@ HDC302X_STATUS_T_LOW_TRACKING_ALERT
@ HDC302X_STATUS_CHECKSUM_VERY
@ HDC302X_STATUS_RH_HIGH_TRACKING_ALERT
@ HDC302X_STATUS_DEVICE_RESET_DETECTED
@ HDC302X_STATUS_T_TRACKING_ALERT
@ HDC302X_STATUS_RH_TRACKING_ALERT
@ HDC302X_AUTO_MODE_10_HZ
@ HDC302X_AUTO_MODE_0P5_HZ
@ HDC302X_LOW_POWER_MODE_3
@ HDC302X_LOW_POWER_MODE_2
@ HDC302X_LOW_POWER_MODE_0
@ HDC302X_LOW_POWER_MODE_1
uint8_t hdc302x_get_reg(hdc302x_handle_t *handle, uint16_t command, uint8_t *buf, uint16_t len)
get the chip register
uint8_t hdc302x_set_reg(hdc302x_handle_t *handle, uint16_t command, uint8_t *buf, uint16_t len)
set the chip register
hdc302x handle structure definition
void(* delay_ms)(uint32_t ms)
uint8_t(* iic_read_address16)(uint8_t addr, uint16_t reg, uint8_t *buf, uint16_t len)
void(* debug_print)(const char *const fmt,...)
void(* receive_callback)(uint16_t type)
uint8_t(* iic_init)(void)
uint8_t(* iic_write_address16)(uint8_t addr, uint16_t reg, uint8_t *buf, uint16_t len)
uint8_t(* iic_deinit)(void)
hdc302x information structure definition
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v