LibDriver HDC302X
Loading...
Searching...
No Matches
hdc302x base driver function

hdc302x base driver modules More...

Collaboration diagram for hdc302x base driver function:

Data Structures

struct  hdc302x_handle_s
 hdc302x handle structure definition More...
struct  hdc302x_info_s
 hdc302x information structure definition More...

Typedefs

typedef struct hdc302x_handle_s hdc302x_handle_t
 hdc302x handle structure definition
typedef struct hdc302x_info_s hdc302x_info_t
 hdc302x information structure definition

Enumerations

enum  hdc302x_address_t { HDC302X_ADDRESS_00 = (0x44 << 1) , HDC302X_ADDRESS_01 = (0x46 << 1) , HDC302X_ADDRESS_10 = (0x45 << 1) , HDC302X_ADDRESS_11 = (0x47 << 1) }
 hdc302x address enumeration definition More...
enum  hdc302x_low_power_mode_t { HDC302X_LOW_POWER_MODE_0 = 0 , HDC302X_LOW_POWER_MODE_1 = 1 , HDC302X_LOW_POWER_MODE_2 = 2 , HDC302X_LOW_POWER_MODE_3 = 3 }
 hdc302x low power mode enumeration definition More...
enum  hdc302x_auto_mode_t {
  HDC302X_AUTO_MODE_0P5_HZ = 0 , HDC302X_AUTO_MODE_1_HZ = 1 , HDC302X_AUTO_MODE_2_HZ = 2 , HDC302X_AUTO_MODE_4_HZ = 3 ,
  HDC302X_AUTO_MODE_10_HZ = 4
}
 hdc302x auto mode enumeration definition More...
enum  hdc302x_status_t {
  HDC302X_STATUS_OVERALL_ALERT = (1 << 15) , HDC302X_STATUS_HEATER = (1 << 13) , HDC302X_STATUS_RH_TRACKING_ALERT = (1 << 11) , HDC302X_STATUS_T_TRACKING_ALERT = (1 << 10) ,
  HDC302X_STATUS_RH_HIGH_TRACKING_ALERT = (1 << 9) , HDC302X_STATUS_RH_LOW_TRACKING_ALERT = (1 << 8) , HDC302X_STATUS_T_HIGH_TRACKING_ALERT = (1 << 7) , HDC302X_STATUS_T_LOW_TRACKING_ALERT = (1 << 6) ,
  HDC302X_STATUS_DEVICE_RESET_DETECTED = (1 << 4) , HDC302X_STATUS_CHECKSUM_VERY = (1 << 0)
}
 hdc302x status enumeration definition More...

Functions

uint8_t hdc302x_info (hdc302x_info_t *info)
 get chip's information
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_init (hdc302x_handle_t *handle)
 initialize the chip
uint8_t hdc302x_deinit (hdc302x_handle_t *handle)
 close the chip
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_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_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_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_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_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_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

Detailed Description

hdc302x base driver modules

Typedef Documentation

◆ hdc302x_handle_t

hdc302x handle structure definition

◆ hdc302x_info_t

hdc302x information structure definition

Enumeration Type Documentation

◆ hdc302x_address_t

hdc302x address enumeration definition

Enumerator
HDC302X_ADDRESS_00 

addr - addr1 gnd - gnd

HDC302X_ADDRESS_01 

addr - addr1 gnd - vdd

HDC302X_ADDRESS_10 

addr - addr1 vdd - gnd

HDC302X_ADDRESS_11 

addr - addr1 vdd - vdd

Definition at line 62 of file driver_hdc302x.h.

◆ hdc302x_auto_mode_t

hdc302x auto mode enumeration definition

Enumerator
HDC302X_AUTO_MODE_0P5_HZ 

0.5hz

HDC302X_AUTO_MODE_1_HZ 

1hz

HDC302X_AUTO_MODE_2_HZ 

2hz

HDC302X_AUTO_MODE_4_HZ 

4hz

HDC302X_AUTO_MODE_10_HZ 

10hz

Definition at line 84 of file driver_hdc302x.h.

◆ hdc302x_low_power_mode_t

hdc302x low power mode enumeration definition

Enumerator
HDC302X_LOW_POWER_MODE_0 

12.5 ms

HDC302X_LOW_POWER_MODE_1 

7.5 ms

HDC302X_LOW_POWER_MODE_2 

5.0 ms

HDC302X_LOW_POWER_MODE_3 

3.7 ms

Definition at line 73 of file driver_hdc302x.h.

◆ hdc302x_status_t

hdc302x status enumeration definition

Enumerator
HDC302X_STATUS_OVERALL_ALERT 

0 = no active alerts, 1 = at least one

HDC302X_STATUS_HEATER 

0 = heater disabled, 1 = heater enabled

HDC302X_STATUS_RH_TRACKING_ALERT 

0 = no rh alert, 1 = rh alert

HDC302X_STATUS_T_TRACKING_ALERT 

0 = no t alert, 1 = t alert

HDC302X_STATUS_RH_HIGH_TRACKING_ALERT 

0 = no rh high alert, 1 = rh high alert

HDC302X_STATUS_RH_LOW_TRACKING_ALERT 

0 = no rh low alert, 1 = rh low alert

HDC302X_STATUS_T_HIGH_TRACKING_ALERT 

0 = no t high alert, 1 = t high alert

HDC302X_STATUS_T_LOW_TRACKING_ALERT 

0 = no t low alert, 1 = t low alert

HDC302X_STATUS_DEVICE_RESET_DETECTED 

0 = no reset detected since last clearing of status register 1 = device reset detected

HDC302X_STATUS_CHECKSUM_VERY 

0 = pass 1 = fail

Definition at line 96 of file driver_hdc302x.h.

Function Documentation

◆ hdc302x_alert_threshold_convert_to_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

Parameters
[in]*handlepointer to a hdc302x handle structure
[in]regregister raw data
[out]*temperature_degpointer to a temperature degree celsius buffer
[out]*humidity_percentagepointer to a humidity percentage buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2279 of file driver_hdc302x.c.

◆ hdc302x_alert_threshold_convert_to_register()

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

Parameters
[in]*handlepointer to a hdc302x handle structure
[in]temperature_degtemperature degree celsius
[in]humidity_percentagehumidity percentage
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2245 of file driver_hdc302x.c.

◆ hdc302x_clear_status()

uint8_t hdc302x_clear_status ( hdc302x_handle_t * handle)

clear status

Parameters
[in]*handlepointer to a hdc302x handle structure
Returns
status code
  • 0 success
  • 1 clear status failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1899 of file driver_hdc302x.c.

◆ hdc302x_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

Parameters
[in]*handlepointer to a hdc302x handle structure
[out]*temperature_rawpointer to a raw temperature buffer
[out]*temperature_spointer to a converted temperature buffer
[out]*humidity_rawpointer to a raw humidity buffer
[out]*humidity_spointer to a converted humidity buffer
Returns
status code
  • 0 success
  • 1 continuous read failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 current is not continuous mod
  • 5 crc check error
Note
none

Definition at line 658 of file driver_hdc302x.c.

◆ hdc302x_continuous_read_humidity()

uint8_t hdc302x_continuous_read_humidity ( hdc302x_handle_t * handle,
uint16_t * humidity_raw,
float * humidity_s )

continuous read humidity

Parameters
[in]*handlepointer to a hdc302x handle structure
[out]*humidity_rawpointer to a raw humidity buffer
[out]*humidity_spointer to a converted humidity buffer
Returns
status code
  • 0 success
  • 1 continuous read humidity failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 current is not continuous mod
  • 5 crc check error
Note
none

Definition at line 808 of file driver_hdc302x.c.

◆ hdc302x_deinit()

uint8_t hdc302x_deinit ( hdc302x_handle_t * handle)

close the chip

Parameters
[in]*handlepointer to a hdc302x handle structure
Returns
status code
  • 0 success
  • 1 iic deinit failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 soft reset failed
Note
none

Definition at line 2033 of file driver_hdc302x.c.

◆ hdc302x_disable_heater()

uint8_t hdc302x_disable_heater ( hdc302x_handle_t * handle)

disable heater

Parameters
[in]*handlepointer to a hdc302x handle structure
Returns
status code
  • 0 success
  • 1 disable heater failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1638 of file driver_hdc302x.c.

◆ hdc302x_enable_heater()

uint8_t hdc302x_enable_heater ( hdc302x_handle_t * handle)

enable heater

Parameters
[in]*handlepointer to a hdc302x handle structure
Returns
status code
  • 0 success
  • 1 enable heater failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1604 of file driver_hdc302x.c.

◆ hdc302x_get_addr()

uint8_t hdc302x_get_addr ( hdc302x_handle_t * handle,
hdc302x_address_t * addr )

get the iic address

Parameters
[in]*handlepointer to a hdc302x handle structure
[out]*addrpointer to a chip iic address buffer
Returns
status code
  • 0 success
  • 1 get addr failed
  • 2 handle is NULL
Note
none

Definition at line 2096 of file driver_hdc302x.c.

◆ hdc302x_get_auto_mode()

uint8_t hdc302x_get_auto_mode ( hdc302x_handle_t * handle,
hdc302x_auto_mode_t * mode )

get auto mode

Parameters
[in]*handlepointer to a hdc302x handle structure
[out]*modepointer to an auto mode buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 263 of file driver_hdc302x.c.

◆ hdc302x_get_heater_power()

uint8_t hdc302x_get_heater_power ( hdc302x_handle_t * handle,
uint16_t * power )

get heater power

Parameters
[in]*handlepointer to a hdc302x handle structure
[out]*powerpointer to a power buffer
Returns
status code
  • 0 success
  • 1 get heater power failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 crc check error
Note
none

Definition at line 1738 of file driver_hdc302x.c.

◆ hdc302x_get_low_power_mode()

uint8_t hdc302x_get_low_power_mode ( hdc302x_handle_t * handle,
hdc302x_low_power_mode_t * mode )

get low power mode

Parameters
[in]*handlepointer to a hdc302x handle structure
[out]*modepointer to a low power mode buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 211 of file driver_hdc302x.c.

◆ hdc302x_get_nist_id()

uint8_t hdc302x_get_nist_id ( hdc302x_handle_t * handle,
uint8_t id[6] )

get nist id

Parameters
[in]*handlepointer to a hdc302x handle structure
[out]*idpointer to an id buffer
Returns
status code
  • 0 success
  • 1 get nist id failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 crc check error
Note
none

Definition at line 1782 of file driver_hdc302x.c.

◆ hdc302x_get_status()

uint8_t hdc302x_get_status ( hdc302x_handle_t * handle,
uint16_t * status )

get status

Parameters
[in]*handlepointer to a hdc302x handle structure
[out]*statuspointer to a status buffer
Returns
status code
  • 0 success
  • 1 get status failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 crc check error
Note
none

Definition at line 1857 of file driver_hdc302x.c.

◆ hdc302x_info()

uint8_t hdc302x_info ( hdc302x_info_t * info)

get chip's information

Parameters
[out]*infopointer to a hdc302x info structure
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 2484 of file driver_hdc302x.c.

◆ hdc302x_init()

uint8_t hdc302x_init ( hdc302x_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to a hdc302x handle structure
Returns
status code
  • 0 success
  • 1 iic initialization failed
  • 2 handle is NULL
  • 3 linked functions is NULL
  • 4 id is invalid
  • 5 soft reset failed
Note
none

Definition at line 1935 of file driver_hdc302x.c.

◆ hdc302x_irq_handler()

uint8_t hdc302x_irq_handler ( hdc302x_handle_t * handle)

irq handler

Parameters
[in]*handlepointer to a hdc302x handle structure
Returns
status code
  • 0 success
  • 1 run failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 crc check error
Note
none

Definition at line 2119 of file driver_hdc302x.c.

◆ hdc302x_nvm_program_alert_threshold()

uint8_t hdc302x_nvm_program_alert_threshold ( hdc302x_handle_t * handle)

nvm program alert threshold

Parameters
[in]*handlepointer to a hdc302x handle structure
Returns
status code
  • 0 success
  • 1 nvm program alert threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1401 of file driver_hdc302x.c.

◆ hdc302x_nvm_program_config()

uint8_t hdc302x_nvm_program_config ( hdc302x_handle_t * handle,
uint16_t config )

nvm program config

Parameters
[in]*handlepointer to a hdc302x handle structure
[in]confignvm config
Returns
status code
  • 0 success
  • 1 nvm program config failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1521 of file driver_hdc302x.c.

◆ hdc302x_nvm_program_temperature_humidity_offset()

uint8_t hdc302x_nvm_program_temperature_humidity_offset ( hdc302x_handle_t * handle,
uint16_t offset )

nvm program temperature humidity offset

Parameters
[in]*handlepointer to a hdc302x handle structure
[in]offsetset offset
Returns
status code
  • 0 success
  • 1 nvm program temperature humidity offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1437 of file driver_hdc302x.c.

◆ hdc302x_nvm_read_config()

uint8_t hdc302x_nvm_read_config ( hdc302x_handle_t * handle,
uint16_t * config )

nvm read config

Parameters
[in]*handlepointer to a hdc302x handle structure
[out]*configpointer to a config buffer
Returns
status code
  • 0 success
  • 1 nvm read config failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 crc check error
Note
none

Definition at line 1562 of file driver_hdc302x.c.

◆ hdc302x_nvm_read_temperature_humidity_offset()

uint8_t hdc302x_nvm_read_temperature_humidity_offset ( hdc302x_handle_t * handle,
uint16_t * offset )

nvm read temperature humidity offset

Parameters
[in]*handlepointer to a hdc302x handle structure
[out]*offsetpointer to an offset buffer
Returns
status code
  • 0 success
  • 1 nvm read temperature humidity offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 crc check error
Note
none

Definition at line 1478 of file driver_hdc302x.c.

◆ hdc302x_offset_convert_to_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

Parameters
[in]*handlepointer to a hdc302x handle structure
[in]regregister raw data
[out]*temperature_symbolpointer to a temperature symbol buffer
[out]*temperature_degpointer to a temperature degree celsius buffer
[out]*humidity_symbolpointer to a humidity symbol buffer
[out]*humidity_percentagepointer to a humidity percentage buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2365 of file driver_hdc302x.c.

◆ hdc302x_offset_convert_to_register()

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

Parameters
[in]*handlepointer to a hdc302x handle structure
[in]temperature_symboltemperature symbol, 1 is positive, 0 is negative
[in]temperature_degtemperature degree celsius
[in]humidity_symbolhumidity symbol, 1 is positive, 0 is negative
[in]humidity_percentagehumidity percentage
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2317 of file driver_hdc302x.c.

◆ hdc302x_read_clear_high_alert()

uint8_t hdc302x_read_clear_high_alert ( hdc302x_handle_t * handle,
uint16_t * threshold )

read clear high alert

Parameters
[in]*handlepointer to a hdc302x handle structure
[out]*thresholdpointer to an alert threshold buffer
Returns
status code
  • 0 success
  • 1 read clear high alert failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 crc check error
Note
none

Definition at line 1359 of file driver_hdc302x.c.

◆ hdc302x_read_clear_low_alert()

uint8_t hdc302x_read_clear_low_alert ( hdc302x_handle_t * handle,
uint16_t * threshold )

read clear low alert

Parameters
[in]*handlepointer to a hdc302x handle structure
[out]*thresholdpointer to an alert threshold buffer
Returns
status code
  • 0 success
  • 1 read clear low alert failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 crc check error
Note
none

Definition at line 1315 of file driver_hdc302x.c.

◆ hdc302x_read_humidity_max()

uint8_t hdc302x_read_humidity_max ( hdc302x_handle_t * handle,
uint16_t * humidity_raw,
float * humidity_s )

read humidity max

Parameters
[in]*handlepointer to a hdc302x handle structure
[out]*humidity_rawpointer to a raw humidity buffer
[out]*humidity_spointer to a converted humidity buffer
Returns
status code
  • 0 success
  • 1 read humidity max failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 current is not continuous mod
  • 5 crc check error
Note
none

Definition at line 1020 of file driver_hdc302x.c.

◆ hdc302x_read_humidity_min()

uint8_t hdc302x_read_humidity_min ( hdc302x_handle_t * handle,
uint16_t * humidity_raw,
float * humidity_s )

read humidity min

Parameters
[in]*handlepointer to a hdc302x handle structure
[out]*humidity_rawpointer to a raw humidity buffer
[out]*humidity_spointer to a converted humidity buffer
Returns
status code
  • 0 success
  • 1 read humidity min failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 current is not continuous mod
  • 5 crc check error
Note
none

Definition at line 967 of file driver_hdc302x.c.

◆ hdc302x_read_set_high_alert()

uint8_t hdc302x_read_set_high_alert ( hdc302x_handle_t * handle,
uint16_t * threshold )

read set high alert

Parameters
[in]*handlepointer to a hdc302x handle structure
[out]*thresholdpointer to an alert threshold buffer
Returns
status code
  • 0 success
  • 1 read set high alert failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 crc check error
Note
none

Definition at line 1271 of file driver_hdc302x.c.

◆ hdc302x_read_set_low_alert()

uint8_t hdc302x_read_set_low_alert ( hdc302x_handle_t * handle,
uint16_t * threshold )

read set low alert

Parameters
[in]*handlepointer to a hdc302x handle structure
[out]*thresholdpointer to an alert threshold buffer
Returns
status code
  • 0 success
  • 1 read set low alert failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 crc check error
Note
none

Definition at line 1227 of file driver_hdc302x.c.

◆ hdc302x_read_temperature_max()

uint8_t hdc302x_read_temperature_max ( hdc302x_handle_t * handle,
uint16_t * temperature_raw,
float * temperature_s )

read temperature max

Parameters
[in]*handlepointer to a hdc302x handle structure
[out]*temperature_rawpointer to a raw temperature buffer
[out]*temperature_spointer to a converted temperature buffer
Returns
status code
  • 0 success
  • 1 read temperature max failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 current is not continuous mod
  • 5 crc check error
Note
none

Definition at line 914 of file driver_hdc302x.c.

◆ hdc302x_read_temperature_min()

uint8_t hdc302x_read_temperature_min ( hdc302x_handle_t * handle,
uint16_t * temperature_raw,
float * temperature_s )

read temperature min

Parameters
[in]*handlepointer to a hdc302x handle structure
[out]*temperature_rawpointer to a raw temperature buffer
[out]*temperature_spointer to a converted temperature buffer
Returns
status code
  • 0 success
  • 1 read temperature min failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 current is not continuous mod
  • 5 crc check error
Note
none

Definition at line 861 of file driver_hdc302x.c.

◆ hdc302x_set_addr()

uint8_t hdc302x_set_addr ( hdc302x_handle_t * handle,
hdc302x_address_t addr )

set the iic address

Parameters
[in]*handlepointer to a hdc302x handle structure
[in]addrchip iic address
Returns
status code
  • 0 success
  • 1 set addr failed
  • 2 handle is NULL
Note
none

Definition at line 2074 of file driver_hdc302x.c.

◆ hdc302x_set_auto_mode()

uint8_t hdc302x_set_auto_mode ( hdc302x_handle_t * handle,
hdc302x_auto_mode_t mode )

set auto mode

Parameters
[in]*handlepointer to a hdc302x handle structure
[in]modeauto mode
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 237 of file driver_hdc302x.c.

◆ hdc302x_set_heater_power()

uint8_t hdc302x_set_heater_power ( hdc302x_handle_t * handle,
uint16_t power )

set heater power

Parameters
[in]*handlepointer to a hdc302x handle structure
[in]powerheater power
Returns
status code
  • 0 success
  • 1 set heater power failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 power > 0x3FFF
Note
power(hex) resistor(ohms) 1 1875.7 2 1379.3 4 1361.7 8 674.5 F 292.4 10 692.0 20 692.0 40 472.8 80 475.3 F0 145.2 100 478.0 200 477.6 400 281.6 800 281.6 F00 93.2 1000 283.7 3000 284.6 3FFF 40.3

Definition at line 1692 of file driver_hdc302x.c.

◆ hdc302x_set_low_power_mode()

uint8_t hdc302x_set_low_power_mode ( hdc302x_handle_t * handle,
hdc302x_low_power_mode_t mode )

set low power mode

Parameters
[in]*handlepointer to a hdc302x handle structure
[in]modelow power mode
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 185 of file driver_hdc302x.c.

◆ hdc302x_single_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

Parameters
[in]*handlepointer to a hdc302x handle structure
[out]*temperature_rawpointer to a raw temperature buffer
[out]*temperature_spointer to a converted temperature buffer
[out]*humidity_rawpointer to a raw humidity buffer
[out]*humidity_spointer to a converted humidity buffer
Returns
status code
  • 0 success
  • 1 single read failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 continuous mode can't use this function
  • 5 low power mode is invalid
  • 6 crc check error
Note
none

Definition at line 723 of file driver_hdc302x.c.

◆ hdc302x_soft_reset()

uint8_t hdc302x_soft_reset ( hdc302x_handle_t * handle)

soft reset

Parameters
[in]*handlepointer to a hdc302x handle structure
Returns
status code
  • 0 success
  • 1 soft reset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 289 of file driver_hdc302x.c.

◆ hdc302x_start_continuous_read()

uint8_t hdc302x_start_continuous_read ( hdc302x_handle_t * handle)

start continuous read

Parameters
[in]*handlepointer to a hdc302x handle structure
Returns
status code
  • 0 success
  • 1 start continuous read failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 low power mode is invalid
  • 5 auto mode is invalid
Note
none

Definition at line 326 of file driver_hdc302x.c.

◆ hdc302x_stop_continuous_read()

uint8_t hdc302x_stop_continuous_read ( hdc302x_handle_t * handle)

stop continuous read

Parameters
[in]*handlepointer to a hdc302x handle structure
Returns
status code
  • 0 success
  • 1 stop continuous read failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 617 of file driver_hdc302x.c.

◆ hdc302x_write_clear_high_alert()

uint8_t hdc302x_write_clear_high_alert ( hdc302x_handle_t * handle,
uint16_t threshold )

write clear high alert

Parameters
[in]*handlepointer to a hdc302x handle structure
[in]thresholdalert threshold
Returns
status code
  • 0 success
  • 1 write clear high alert failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1187 of file driver_hdc302x.c.

◆ hdc302x_write_clear_low_alert()

uint8_t hdc302x_write_clear_low_alert ( hdc302x_handle_t * handle,
uint16_t threshold )

write clear low alert

Parameters
[in]*handlepointer to a hdc302x handle structure
[in]thresholdalert threshold
Returns
status code
  • 0 success
  • 1 write clear low alert failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1109 of file driver_hdc302x.c.

◆ hdc302x_write_set_high_alert()

uint8_t hdc302x_write_set_high_alert ( hdc302x_handle_t * handle,
uint16_t threshold )

write set high alert

Parameters
[in]*handlepointer to a hdc302x handle structure
[in]thresholdalert threshold
Returns
status code
  • 0 success
  • 1 write set high alert failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1148 of file driver_hdc302x.c.

◆ hdc302x_write_set_low_alert()

uint8_t hdc302x_write_set_low_alert ( hdc302x_handle_t * handle,
uint16_t threshold )

write set low alert

Parameters
[in]*handlepointer to a hdc302x handle structure
[in]thresholdalert threshold
Returns
status code
  • 0 success
  • 1 write set low alert failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1070 of file driver_hdc302x.c.