LibDriver AHT20
Loading...
Searching...
No Matches
aht20 base driver function

aht20 base driver modules More...

Collaboration diagram for aht20 base driver function:

Data Structures

struct  aht20_handle_s
 aht20 handle structure definition More...
struct  aht20_info_s
 aht20 information structure definition More...

Typedefs

typedef struct aht20_handle_s aht20_handle_t
 aht20 handle structure definition
typedef struct aht20_info_s aht20_info_t
 aht20 information structure definition

Functions

uint8_t aht20_info (aht20_info_t *info)
 get chip's information
uint8_t aht20_init (aht20_handle_t *handle)
 initialize the chip
uint8_t aht20_deinit (aht20_handle_t *handle)
 close the chip
uint8_t aht20_read_temperature_humidity (aht20_handle_t *handle, uint32_t *temperature_raw, float *temperature_s, uint32_t *humidity_raw, uint8_t *humidity_s)
 read the temperature and humidity data
uint8_t aht20_read_temperature (aht20_handle_t *handle, uint32_t *temperature_raw, float *temperature_s)
 read the temperature
uint8_t aht20_read_humidity (aht20_handle_t *handle, uint32_t *humidity_raw, uint8_t *humidity_s)
 read the humidity data

Detailed Description

aht20 base driver modules

Typedef Documentation

◆ aht20_handle_t

aht20 handle structure definition

◆ aht20_info_t

typedef struct aht20_info_s aht20_info_t

aht20 information structure definition

Function Documentation

◆ aht20_deinit()

uint8_t aht20_deinit ( aht20_handle_t * handle)

close the chip

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

Definition at line 279 of file driver_aht20.c.

◆ aht20_info()

uint8_t aht20_info ( aht20_info_t * info)

get chip's information

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

Definition at line 614 of file driver_aht20.c.

◆ aht20_init()

uint8_t aht20_init ( aht20_handle_t * handle)

initialize the chip

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

Definition at line 182 of file driver_aht20.c.

◆ aht20_read_humidity()

uint8_t aht20_read_humidity ( aht20_handle_t * handle,
uint32_t * humidity_raw,
uint8_t * humidity_s )

read the humidity data

Parameters
[in]*handlepointer to an aht20 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
  • 4 data is not ready
  • 5 crc is error
Note
none

Definition at line 478 of file driver_aht20.c.

◆ aht20_read_temperature()

uint8_t aht20_read_temperature ( aht20_handle_t * handle,
uint32_t * temperature_raw,
float * temperature_s )

read the temperature

Parameters
[in]*handlepointer to an aht20 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
  • 4 data is not ready
  • 5 crc is error
Note
none

Definition at line 401 of file driver_aht20.c.

◆ aht20_read_temperature_humidity()

uint8_t aht20_read_temperature_humidity ( aht20_handle_t * handle,
uint32_t * temperature_raw,
float * temperature_s,
uint32_t * humidity_raw,
uint8_t * humidity_s )

read the temperature and humidity data

Parameters
[in]*handlepointer to an aht20 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
  • 4 data is not ready
  • 5 crc is error
Note
none

Definition at line 317 of file driver_aht20.c.