54 uint8_t temperature_symbol;
55 uint8_t humidity_symbol;
56 uint8_t temperature_symbol_check;
57 uint8_t humidity_symbol_check;
59 uint16_t threshold_check;
66 float temperature_deg;
67 float humidity_percentage;
68 float temperature_deg_check;
69 float humidity_percentage_check;
392 threshold = rand() % 0xFFFFU;
415 threshold = rand() % 0xFFFFU;
438 threshold = rand() % 0xFFFFU;
461 threshold = rand() % 0xFFFFU;
484 power = rand() % 0x3FFFU;
545 id[0],
id[1],
id[2],
id[3],
id[4],
id[5]);
578 temperature_deg = (float)(rand() % 10000) / 100.0f;
579 humidity_percentage = (float)(rand() % 10000) / 100.0f;
604 temperature_symbol = ((rand() % 2) != 0) ? 1 : 0;
605 humidity_symbol = ((rand() % 2) != 0) ? 1 : 0;
606 temperature_deg = (float)(rand() % 2000) / 100.0f;
607 humidity_percentage = (float)(rand() % 2000) / 100.0f;
609 humidity_symbol, humidity_percentage, ®);
622 &temperature_symbol_check, &temperature_deg_check,
623 &humidity_symbol_check, &humidity_percentage_check);
driver hdc302x register test header file
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_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
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_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_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_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
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_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
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_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_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_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_interface_iic_write_address16(uint8_t addr, uint16_t reg, uint8_t *buf, uint16_t len)
interface iic bus write address16
void hdc302x_interface_debug_print(const char *const fmt,...)
interface print format data
uint8_t hdc302x_interface_iic_init(void)
interface iic bus init
uint8_t hdc302x_interface_iic_read_address16(uint8_t addr, uint16_t reg, uint8_t *buf, uint16_t len)
interface iic bus read address16
void hdc302x_interface_receive_callback(uint16_t type)
interface receive callback
void hdc302x_interface_delay_ms(uint32_t ms)
interface delay ms
uint8_t hdc302x_interface_iic_deinit(void)
interface iic bus deinit
#define DRIVER_HDC302X_LINK_DEBUG_PRINT(HANDLE, FUC)
link debug_print function
#define DRIVER_HDC302X_LINK_RECEIVE_CALLBACK(HANDLE, FUC)
link receive_callback function
#define DRIVER_HDC302X_LINK_DELAY_MS(HANDLE, FUC)
link delay_ms function
#define DRIVER_HDC302X_LINK_IIC_DEINIT(HANDLE, FUC)
link iic_deinit function
#define DRIVER_HDC302X_LINK_IIC_READ_ADDRESS16(HANDLE, FUC)
link iic_read_address16 function
#define DRIVER_HDC302X_LINK_INIT(HANDLE, STRUCTURE)
initialize hdc302x_handle_t structure
#define DRIVER_HDC302X_LINK_IIC_WRITE_ADDRESS16(HANDLE, FUC)
link iic_write_address16 function
#define DRIVER_HDC302X_LINK_IIC_INIT(HANDLE, FUC)
link iic_init function
uint8_t hdc302x_register_test(hdc302x_address_t addr_pin)
register test
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v