![]() |
LibDriver HDC302X
|
driver hdc302x source file More...
#include "driver_hdc302x.h"Go to the source code of this file.
Functions | |
| 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_low_power_mode (hdc302x_handle_t *handle, hdc302x_low_power_mode_t *mode) |
| get low power mode | |
| uint8_t | hdc302x_set_auto_mode (hdc302x_handle_t *handle, hdc302x_auto_mode_t mode) |
| set auto mode | |
| uint8_t | hdc302x_get_auto_mode (hdc302x_handle_t *handle, hdc302x_auto_mode_t *mode) |
| get auto mode | |
| uint8_t | hdc302x_soft_reset (hdc302x_handle_t *handle) |
| soft reset | |
| uint8_t | hdc302x_start_continuous_read (hdc302x_handle_t *handle) |
| start continuous read | |
| uint8_t | hdc302x_stop_continuous_read (hdc302x_handle_t *handle) |
| stop continuous read | |
| 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_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_continuous_read_humidity (hdc302x_handle_t *handle, uint16_t *humidity_raw, float *humidity_s) |
| continuous read humidity | |
| uint8_t | hdc302x_read_temperature_min (hdc302x_handle_t *handle, uint16_t *temperature_raw, float *temperature_s) |
| read temperature min | |
| uint8_t | hdc302x_read_temperature_max (hdc302x_handle_t *handle, uint16_t *temperature_raw, float *temperature_s) |
| read temperature max | |
| uint8_t | hdc302x_read_humidity_min (hdc302x_handle_t *handle, uint16_t *humidity_raw, float *humidity_s) |
| read humidity min | |
| uint8_t | hdc302x_read_humidity_max (hdc302x_handle_t *handle, uint16_t *humidity_raw, float *humidity_s) |
| read humidity max | |
| uint8_t | hdc302x_write_set_low_alert (hdc302x_handle_t *handle, uint16_t threshold) |
| write set low alert | |
| uint8_t | hdc302x_write_clear_low_alert (hdc302x_handle_t *handle, uint16_t threshold) |
| write clear low alert | |
| uint8_t | hdc302x_write_set_high_alert (hdc302x_handle_t *handle, uint16_t threshold) |
| write set high alert | |
| uint8_t | hdc302x_write_clear_high_alert (hdc302x_handle_t *handle, uint16_t threshold) |
| write clear high alert | |
| uint8_t | hdc302x_read_set_low_alert (hdc302x_handle_t *handle, uint16_t *threshold) |
| read set low alert | |
| uint8_t | hdc302x_read_set_high_alert (hdc302x_handle_t *handle, uint16_t *threshold) |
| read set high alert | |
| uint8_t | hdc302x_read_clear_low_alert (hdc302x_handle_t *handle, uint16_t *threshold) |
| read clear low alert | |
| uint8_t | hdc302x_read_clear_high_alert (hdc302x_handle_t *handle, uint16_t *threshold) |
| read clear high alert | |
| uint8_t | hdc302x_nvm_program_alert_threshold (hdc302x_handle_t *handle) |
| nvm program alert threshold | |
| uint8_t | hdc302x_nvm_program_temperature_humidity_offset (hdc302x_handle_t *handle, uint16_t offset) |
| nvm program temperature humidity offset | |
| uint8_t | hdc302x_nvm_read_temperature_humidity_offset (hdc302x_handle_t *handle, uint16_t *offset) |
| nvm read temperature humidity offset | |
| uint8_t | hdc302x_nvm_program_config (hdc302x_handle_t *handle, uint16_t config) |
| nvm program config | |
| uint8_t | hdc302x_nvm_read_config (hdc302x_handle_t *handle, uint16_t *config) |
| nvm read config | |
| uint8_t | hdc302x_enable_heater (hdc302x_handle_t *handle) |
| enable heater | |
| 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_get_heater_power (hdc302x_handle_t *handle, uint16_t *power) |
| get heater power | |
| uint8_t | hdc302x_get_nist_id (hdc302x_handle_t *handle, uint8_t id[6]) |
| get nist id | |
| uint8_t | hdc302x_get_status (hdc302x_handle_t *handle, uint16_t *status) |
| get status | |
| uint8_t | hdc302x_clear_status (hdc302x_handle_t *handle) |
| clear status | |
| uint8_t | hdc302x_init (hdc302x_handle_t *handle) |
| initialize the chip | |
| uint8_t | hdc302x_deinit (hdc302x_handle_t *handle) |
| close the chip | |
| uint8_t | hdc302x_set_addr (hdc302x_handle_t *handle, hdc302x_address_t addr) |
| set the iic address | |
| uint8_t | hdc302x_get_addr (hdc302x_handle_t *handle, hdc302x_address_t *addr) |
| get the iic address | |
| uint8_t | hdc302x_irq_handler (hdc302x_handle_t *handle) |
| irq handler | |
| 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_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_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_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 | |
| uint8_t | hdc302x_set_reg (hdc302x_handle_t *handle, uint16_t command, uint8_t *buf, uint16_t len) |
| set the chip register | |
| 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_info (hdc302x_info_t *info) |
| get chip's information | |
driver hdc302x source file
Copyright (c) 2015 - present LibDriver All rights reserved
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| Date | Version | Author | Description |
|---|---|---|---|
| 2025/12/25 | 1.0 | Shifeng Li | first upload |
Definition in file driver_hdc302x.c.
| #define CHIP_NAME "Texas Instruments HDC302X" |
| #define DRIVER_VERSION 1000 |
driver version
Definition at line 49 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_0P5_SECOND_LPM0 0x2032U |
auto measurement 0.5 second lpm0 command
Definition at line 58 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_0P5_SECOND_LPM1 0x2024U |
auto measurement 0.5 second lpm1 command
Definition at line 59 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_0P5_SECOND_LPM2 0x202FU |
auto measurement 0.5 second lpm2 command
Definition at line 60 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_0P5_SECOND_LPM3 0x20FFU |
auto measurement 0.5 second lpm3 command
Definition at line 61 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_10_SECOND_LPM0 0x2737U |
auto measurement 10 second lpm0 command
Definition at line 74 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_10_SECOND_LPM1 0x2721U |
auto measurement 10 second lpm1 command
Definition at line 75 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_10_SECOND_LPM2 0x272AU |
auto measurement 10 second lpm2 command
Definition at line 76 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_10_SECOND_LPM3 0x27FFU |
auto measurement 10 second lpm3 command
Definition at line 77 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_1_SECOND_LPM0 0x2130U |
auto measurement 1 second lpm0 command
Definition at line 62 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_1_SECOND_LPM1 0x2126U |
auto measurement 1 second lpm1 command
Definition at line 63 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_1_SECOND_LPM2 0x212DU |
auto measurement 1 second lpm2 command
Definition at line 64 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_1_SECOND_LPM3 0x21FFU |
auto measurement 1 second lpm3 command
Definition at line 65 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_2_SECOND_LPM0 0x2236U |
auto measurement 2 second lpm0 command
Definition at line 66 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_2_SECOND_LPM1 0x2220U |
auto measurement 2 second lpm1 command
Definition at line 67 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_2_SECOND_LPM2 0x222BU |
auto measurement 2 second lpm2 command
Definition at line 68 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_2_SECOND_LPM3 0x22FFU |
auto measurement 2 second lpm3 command
Definition at line 69 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_4_SECOND_LPM0 0x2334U |
auto measurement 4 second lpm0 command
Definition at line 70 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_4_SECOND_LPM1 0x2322U |
auto measurement 4 second lpm1 command
Definition at line 71 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_4_SECOND_LPM2 0x2329U |
auto measurement 4 second lpm2 command
Definition at line 72 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_4_SECOND_LPM3 0x23FFU |
auto measurement 4 second lpm3 command
Definition at line 73 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_READ_MAX_RH 0xE005U |
auto measurement read max RH command
Definition at line 84 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_READ_MAX_T 0xE003U |
auto measurement read max T command
Definition at line 82 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_READ_MIN_RH 0xE004U |
auto measurement read min RH command
Definition at line 83 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_READ_MIN_T 0xE002U |
auto measurement read min T command
Definition at line 81 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_READ_RH 0xE001U |
auto measurement read RH command
Definition at line 80 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_AUTO_MEASUREMENT_READ_T_RH 0xE000U |
auto measurement read T&&RH command
Definition at line 79 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_CLEAR_STATUS 0x3041U |
clear status command
Definition at line 97 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_EXIT 0x3093U |
exit command
Definition at line 78 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_HEATER_CONFIG 0x306EU |
heater config command
Definition at line 95 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_HEATER_DISABLE 0x3066U |
heater disable command
Definition at line 94 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_HEATER_ENABLE 0x306DU |
heater enable command
Definition at line 93 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_PROGRAM_ALERT_THRESHOLD 0x6155U |
program alert threshold command
Definition at line 103 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_PROGRAM_READ_EEPROM_CONFIG 0x61BBU |
program read eeprom config command
Definition at line 105 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_PROGRAM_READ_OFFSET 0xA004U |
program read offset command
Definition at line 104 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_READ_CLEAR_HIGH_ALERT 0xE114U |
read clear high alert command
Definition at line 92 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_READ_CLEAR_LOW_ALERT 0xE109U |
read clear low alert command
Definition at line 91 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_READ_ID 0x3781U |
read id command
Definition at line 102 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_READ_NIST_ID_BYTE1_BYTE0 0x3685U |
read nist id byte1 byte0 command
Definition at line 101 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_READ_NIST_ID_BYTE3_BYTE2 0x3684U |
read nist id byte3 byte2 command
Definition at line 100 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_READ_NIST_ID_BYTE5_BYTE4 0x3683U |
read nist id byte5 byte4 command
Definition at line 99 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_READ_SET_HIGH_ALERT 0xE11FU |
read set high alert command
Definition at line 90 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_READ_SET_LOW_ALERT 0xE102U |
read set low alert command
Definition at line 89 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_READ_STATUS 0xF32DU |
read status command
Definition at line 96 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_SINGLE_MEASUREMENT_LPM0 0x2400U |
chip command definition
single measurement lpm0 command
Definition at line 54 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_SINGLE_MEASUREMENT_LPM1 0x240BU |
single measurement lpm1 command
Definition at line 55 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_SINGLE_MEASUREMENT_LPM2 0x2416U |
single measurement lpm2 command
Definition at line 56 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_SINGLE_MEASUREMENT_LPM3 0x24FFU |
single measurement lpm3 command
Definition at line 57 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_SOFT_RESET 0x30A2U |
soft reset command
Definition at line 98 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_WRITE_CLEAR_HIGH_ALERT 0x6116U |
write clear high alert command
Definition at line 88 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_WRITE_CLEAR_LOW_ALERT 0x610BU |
write clear low alert command
Definition at line 87 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_WRITE_SET_HIGH_ALERT 0x611DU |
write set high alert command
Definition at line 86 of file driver_hdc302x.c.
| #define HDC302X_COMMAND_WRITE_SET_LOW_ALERT 0x6100U |
write set low alert command
Definition at line 85 of file driver_hdc302x.c.
| #define MANUFACTURER_NAME "Texas Instruments" |
manufacturer name
Definition at line 43 of file driver_hdc302x.c.
| #define MAX_CURRENT 0.17f |
chip max current
Definition at line 46 of file driver_hdc302x.c.
| #define SUPPLY_VOLTAGE_MAX 5.5f |
chip max supply voltage
Definition at line 45 of file driver_hdc302x.c.
| #define SUPPLY_VOLTAGE_MIN 1.62f |
chip min supply voltage
Definition at line 44 of file driver_hdc302x.c.
| #define TEMPERATURE_MAX 125.0f |
chip max operating temperature
Definition at line 48 of file driver_hdc302x.c.
| #define TEMPERATURE_MIN -40.0f |
chip min operating temperature
Definition at line 47 of file driver_hdc302x.c.