LibDriver DHT11  2.0.0
DHT11 full-featured driver
dht11 base driver function

dht11 base driver modules More...

Data Structures

struct  dht11_handle_s
 dht11 handle structure definition More...
 
struct  dht11_info_s
 dht11 info structure definition More...
 

Typedefs

typedef struct dht11_handle_s dht11_handle_t
 dht11 handle structure definition More...
 
typedef struct dht11_info_s dht11_info_t
 dht11 info structure definition More...
 

Functions

uint8_t dht11_info (dht11_info_t *info)
 get chip's information More...
 
uint8_t dht11_init (dht11_handle_t *handle)
 initialize the chip More...
 
uint8_t dht11_deinit (dht11_handle_t *handle)
 close the chip More...
 
uint8_t dht11_read_temperature_humidity (dht11_handle_t *handle, uint16_t *temperature_raw, float *temperature_s, uint16_t *humidity_raw, uint8_t *humidity_s)
 read the temperature and humidity data More...
 
uint8_t dht11_read_humidity (dht11_handle_t *handle, uint16_t *raw, uint8_t *s)
 read the humidity data More...
 
uint8_t dht11_read_temperature (dht11_handle_t *handle, uint16_t *raw, float *s)
 read the temperature data More...
 

Detailed Description

dht11 base driver modules

Typedef Documentation

◆ dht11_handle_t

dht11 handle structure definition

◆ dht11_info_t

typedef struct dht11_info_s dht11_info_t

dht11 info structure definition

Function Documentation

◆ dht11_deinit()

uint8_t dht11_deinit ( dht11_handle_t handle)

close the chip

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

Definition at line 554 of file driver_dht11.c.

◆ dht11_info()

uint8_t dht11_info ( dht11_info_t info)

get chip's information

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

Definition at line 584 of file driver_dht11.c.

◆ dht11_init()

uint8_t dht11_init ( dht11_handle_t handle)

initialize the chip

Parameters
[in]*handlepointer to a dht11 handle structure
Returns
status code
  • 0 success
  • 1 bus initialization failed
  • 2 handle is NULL
  • 3 linked functions is NULL
  • 4 reset failed
Note
none

Definition at line 467 of file driver_dht11.c.

◆ dht11_read_humidity()

uint8_t dht11_read_humidity ( dht11_handle_t handle,
uint16_t *  raw,
uint8_t *  s 
)

read the humidity data

Parameters
[in]*handlepointer to a dht11 handle structure
[out]*rawpointer to a raw humidity buffer
[out]*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 260 of file driver_dht11.c.

◆ dht11_read_temperature()

uint8_t dht11_read_temperature ( dht11_handle_t handle,
uint16_t *  raw,
float *  s 
)

read the temperature data

Parameters
[in]*handlepointer to a dht11 handle structure
[out]*rawpointer to a raw temperature buffer
[out]*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 398 of file driver_dht11.c.

◆ dht11_read_temperature_humidity()

uint8_t dht11_read_temperature_humidity ( dht11_handle_t handle,
uint16_t *  temperature_raw,
float *  temperature_s,
uint16_t *  humidity_raw,
uint8_t *  humidity_s 
)

read the temperature and humidity data

Parameters
[in]*handlepointer to a dht11 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 324 of file driver_dht11.c.