LibDriver HDC1080
Loading...
Searching...
No Matches
hdc1080 base driver function

hdc1080 base driver modules More...

Collaboration diagram for hdc1080 base driver function:

Data Structures

struct  hdc1080_handle_s
 hdc1080 handle structure definition More...
struct  hdc1080_info_s
 hdc1080 information structure definition More...

Typedefs

typedef struct hdc1080_handle_s hdc1080_handle_t
 hdc1080 handle structure definition
typedef struct hdc1080_info_s hdc1080_info_t
 hdc1080 information structure definition

Enumerations

enum  hdc1080_bool_t { HDC1080_BOOL_FALSE = 0x00 , HDC1080_BOOL_TRUE = 0x01 }
 hdc1080 bool enumeration definition More...
enum  hdc1080_mode_t { HDC1080_MODE_OR = 0x00 , HDC1080_MODE_SEQUENCE = 0x01 }
 hdc1080 mode enumeration definition More...
enum  hdc1080_temperature_resolution_t { HDC1080_TEMPERATURE_RESOLUTION_14_BIT = 0x00 , HDC1080_TEMPERATURE_RESOLUTION_11_BIT = 0x01 }
 hdc1080 temperature resolution enumeration definition More...
enum  hdc1080_humidity_resolution_t { HDC1080_HUMIDITY_RESOLUTION_14_BIT = 0x00 , HDC1080_HUMIDITY_RESOLUTION_11_BIT = 0x01 , HDC1080_HUMIDITY_RESOLUTION_8_BIT = 0x02 }
 hdc1080 humidity resolution enumeration definition More...
enum  hdc1080_battery_status_t { HDC1080_BATTERY_STATUS_OVER_2P8_V = 0x00 , HDC1080_BATTERY_STATUS_LESS_2P8_V = 0x01 }
 hdc1080 battery status enumeration definition More...

Functions

uint8_t hdc1080_info (hdc1080_info_t *info)
 get chip's information
uint8_t hdc1080_init (hdc1080_handle_t *handle)
 initialize the chip
uint8_t hdc1080_deinit (hdc1080_handle_t *handle)
 close the chip
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_read_temperature (hdc1080_handle_t *handle, uint16_t *temperature_raw, float *temperature_s)
 read the temperature
uint8_t hdc1080_read_humidity (hdc1080_handle_t *handle, uint16_t *humidity_raw, float *humidity_s)
 read the humidity data
uint8_t hdc1080_software_reset (hdc1080_handle_t *handle)
 software reset
uint8_t hdc1080_set_heater (hdc1080_handle_t *handle, hdc1080_bool_t enable)
 enable or disable heater
uint8_t hdc1080_get_heater (hdc1080_handle_t *handle, hdc1080_bool_t *enable)
 get the heater status
uint8_t hdc1080_set_mode (hdc1080_handle_t *handle, hdc1080_mode_t mode)
 set the chip mode
uint8_t hdc1080_get_mode (hdc1080_handle_t *handle, hdc1080_mode_t *mode)
 get the chip mode
uint8_t hdc1080_get_battery_status (hdc1080_handle_t *handle, hdc1080_battery_status_t *status)
 get battery status
uint8_t hdc1080_set_temperature_resolution (hdc1080_handle_t *handle, hdc1080_temperature_resolution_t resolution)
 set temperature resolution
uint8_t hdc1080_get_temperature_resolution (hdc1080_handle_t *handle, hdc1080_temperature_resolution_t *resolution)
 get temperature resolution
uint8_t hdc1080_set_humidity_resolution (hdc1080_handle_t *handle, hdc1080_humidity_resolution_t resolution)
 set humidity resolution
uint8_t hdc1080_get_humidity_resolution (hdc1080_handle_t *handle, hdc1080_humidity_resolution_t *resolution)
 get humidity resolution
uint8_t hdc1080_get_serial_id (hdc1080_handle_t *handle, uint8_t id[6])
 get serial id

Detailed Description

hdc1080 base driver modules

Typedef Documentation

◆ hdc1080_handle_t

hdc1080 handle structure definition

◆ hdc1080_info_t

hdc1080 information structure definition

Enumeration Type Documentation

◆ hdc1080_battery_status_t

hdc1080 battery status enumeration definition

Enumerator
HDC1080_BATTERY_STATUS_OVER_2P8_V 

battery voltage > 2.8v

HDC1080_BATTERY_STATUS_LESS_2P8_V 

battery voltage < 2.8v

Definition at line 99 of file driver_hdc1080.h.

◆ hdc1080_bool_t

hdc1080 bool enumeration definition

Enumerator
HDC1080_BOOL_FALSE 

disable

HDC1080_BOOL_TRUE 

enable

Definition at line 62 of file driver_hdc1080.h.

◆ hdc1080_humidity_resolution_t

hdc1080 humidity resolution enumeration definition

Enumerator
HDC1080_HUMIDITY_RESOLUTION_14_BIT 

14 bit

HDC1080_HUMIDITY_RESOLUTION_11_BIT 

11 bit

HDC1080_HUMIDITY_RESOLUTION_8_BIT 

8 bit

Definition at line 89 of file driver_hdc1080.h.

◆ hdc1080_mode_t

hdc1080 mode enumeration definition

Enumerator
HDC1080_MODE_OR 

temperature or humidity is acquired

HDC1080_MODE_SEQUENCE 

temperature and humidity are acquired in sequence, temperature first

Definition at line 71 of file driver_hdc1080.h.

◆ hdc1080_temperature_resolution_t

hdc1080 temperature resolution enumeration definition

Enumerator
HDC1080_TEMPERATURE_RESOLUTION_14_BIT 

14 bit

HDC1080_TEMPERATURE_RESOLUTION_11_BIT 

11 bit

Definition at line 80 of file driver_hdc1080.h.

Function Documentation

◆ hdc1080_deinit()

uint8_t hdc1080_deinit ( hdc1080_handle_t * handle)

close the chip

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

Definition at line 281 of file driver_hdc1080.c.

◆ hdc1080_get_battery_status()

uint8_t hdc1080_get_battery_status ( hdc1080_handle_t * handle,
hdc1080_battery_status_t * status )

get battery status

Parameters
[in]*handlepointer to an hdc1080 handle structure
[out]*statuspointer to a battery status buffer
Returns
status code
  • 0 success
  • 1 get battery status failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 646 of file driver_hdc1080.c.

◆ hdc1080_get_heater()

uint8_t hdc1080_get_heater ( hdc1080_handle_t * handle,
hdc1080_bool_t * enable )

get the heater status

Parameters
[in]*handlepointer to an hdc1080 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get heater failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 527 of file driver_hdc1080.c.

◆ hdc1080_get_humidity_resolution()

uint8_t hdc1080_get_humidity_resolution ( hdc1080_handle_t * handle,
hdc1080_humidity_resolution_t * resolution )

get humidity resolution

Parameters
[in]*handlepointer to an hdc1080 handle structure
[out]*resolutionpointer to a humidity resolution buffer
Returns
status code
  • 0 success
  • 1 get humidity resolution failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 810 of file driver_hdc1080.c.

◆ hdc1080_get_mode()

uint8_t hdc1080_get_mode ( hdc1080_handle_t * handle,
hdc1080_mode_t * mode )

get the chip mode

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

Definition at line 609 of file driver_hdc1080.c.

◆ hdc1080_get_serial_id()

uint8_t hdc1080_get_serial_id ( hdc1080_handle_t * handle,
uint8_t id[6] )

get serial id

Parameters
[in]*handlepointer to an hdc1080 handle structure
[out]*idpointer to an id buffer
Returns
status code
  • 0 success
  • 1 get serial id failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 847 of file driver_hdc1080.c.

◆ hdc1080_get_temperature_resolution()

uint8_t hdc1080_get_temperature_resolution ( hdc1080_handle_t * handle,
hdc1080_temperature_resolution_t * resolution )

get temperature resolution

Parameters
[in]*handlepointer to an hdc1080 handle structure
[out]*resolutionpointer to a temperature resolution buffer
Returns
status code
  • 0 success
  • 1 get temperature resolution failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 728 of file driver_hdc1080.c.

◆ hdc1080_info()

uint8_t hdc1080_info ( hdc1080_info_t * info)

get chip's information

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

Definition at line 966 of file driver_hdc1080.c.

◆ hdc1080_init()

uint8_t hdc1080_init ( hdc1080_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to an hdc1080 handle structure
Returns
status code
  • 0 success
  • 1 iic init failed
  • 2 handle is NULL
  • 3 linked functions is NULL
  • 4 read id failed
  • 5 id is invalid
  • 6 reset failed
Note
none

Definition at line 159 of file driver_hdc1080.c.

◆ hdc1080_read_humidity()

uint8_t hdc1080_read_humidity ( hdc1080_handle_t * handle,
uint16_t * humidity_raw,
float * humidity_s )

read the humidity data

Parameters
[in]*handlepointer to an hdc1080 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 failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 401 of file driver_hdc1080.c.

◆ hdc1080_read_temperature()

uint8_t hdc1080_read_temperature ( hdc1080_handle_t * handle,
uint16_t * temperature_raw,
float * temperature_s )

read the temperature

Parameters
[in]*handlepointer to an hdc1080 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 failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 364 of file driver_hdc1080.c.

◆ hdc1080_read_temperature_humidity()

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

Parameters
[in]*handlepointer to an hdc1080 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 read temperature humidity failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 317 of file driver_hdc1080.c.

◆ hdc1080_set_heater()

uint8_t hdc1080_set_heater ( hdc1080_handle_t * handle,
hdc1080_bool_t enable )

enable or disable heater

Parameters
[in]*handlepointer to an hdc1080 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set heater failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 482 of file driver_hdc1080.c.

◆ hdc1080_set_humidity_resolution()

uint8_t hdc1080_set_humidity_resolution ( hdc1080_handle_t * handle,
hdc1080_humidity_resolution_t resolution )

set humidity resolution

Parameters
[in]*handlepointer to an hdc1080 handle structure
[in]resolutionhumidity resolution
Returns
status code
  • 0 success
  • 1 set humidity resolution failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 765 of file driver_hdc1080.c.

◆ hdc1080_set_mode()

uint8_t hdc1080_set_mode ( hdc1080_handle_t * handle,
hdc1080_mode_t mode )

set the chip mode

Parameters
[in]*handlepointer to an hdc1080 handle structure
[in]modechip mode
Returns
status code
  • 0 success
  • 1 set mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 564 of file driver_hdc1080.c.

◆ hdc1080_set_temperature_resolution()

uint8_t hdc1080_set_temperature_resolution ( hdc1080_handle_t * handle,
hdc1080_temperature_resolution_t resolution )

set temperature resolution

Parameters
[in]*handlepointer to an hdc1080 handle structure
[in]resolutiontemperature resolution
Returns
status code
  • 0 success
  • 1 set temperature resolution failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 683 of file driver_hdc1080.c.

◆ hdc1080_software_reset()

uint8_t hdc1080_software_reset ( hdc1080_handle_t * handle)

software reset

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

Definition at line 436 of file driver_hdc1080.c.