LibDriver AHT30  1.0.0
AHT30 full-featured driver
aht30 base driver function

aht30 base driver modules More...

Data Structures

struct  aht30_handle_s
 aht30 handle structure definition More...
 
struct  aht30_info_s
 aht30 information structure definition More...
 

Typedefs

typedef struct aht30_handle_s aht30_handle_t
 aht30 handle structure definition More...
 
typedef struct aht30_info_s aht30_info_t
 aht30 information structure definition More...
 

Enumerations

enum  aht30_status_t {
  AHT30_STATUS_BUSY = (1 << 7) , AHT30_STATUS_NOR_MODE = (0 << 5) , AHT30_STATUS_CYC_MODE = (1 << 5) , AHT30_STATUS_CMD_MODE = (2 << 5) ,
  AHT30_STATUS_CRC_FLAG = (1 << 4) , AHT30_STATUS_CALIBRATION_ENABLE = (1 << 3) , AHT30_STATUS_CMP_INT = (1 << 2)
}
 aht30 status enumeration definition More...
 

Functions

uint8_t aht30_info (aht30_info_t *info)
 get chip's information More...
 
uint8_t aht30_init (aht30_handle_t *handle)
 initialize the chip More...
 
uint8_t aht30_deinit (aht30_handle_t *handle)
 close the chip More...
 
uint8_t aht30_read_temperature_humidity (aht30_handle_t *handle, uint32_t *temperature_raw, float *temperature_s, uint32_t *humidity_raw, uint8_t *humidity_s)
 read the temperature and humidity data More...
 
uint8_t aht30_read_temperature (aht30_handle_t *handle, uint32_t *temperature_raw, float *temperature_s)
 read the temperature More...
 
uint8_t aht30_read_humidity (aht30_handle_t *handle, uint32_t *humidity_raw, uint8_t *humidity_s)
 read the humidity data More...
 
uint8_t aht30_get_status (aht30_handle_t *handle, uint8_t *status)
 get status More...
 

Detailed Description

aht30 base driver modules

Typedef Documentation

◆ aht30_handle_t

aht30 handle structure definition

◆ aht30_info_t

typedef struct aht30_info_s aht30_info_t

aht30 information structure definition

Enumeration Type Documentation

◆ aht30_status_t

aht30 status enumeration definition

Enumerator
AHT30_STATUS_BUSY 

busy bit

AHT30_STATUS_NOR_MODE 

nor mode

AHT30_STATUS_CYC_MODE 

cyc mode

AHT30_STATUS_CMD_MODE 

cmd mode

AHT30_STATUS_CRC_FLAG 

crc flag

AHT30_STATUS_CALIBRATION_ENABLE 

calibration enable

AHT30_STATUS_CMP_INT 

comparation interrupt

Definition at line 62 of file driver_aht30.h.

Function Documentation

◆ aht30_deinit()

uint8_t aht30_deinit ( aht30_handle_t handle)

close the chip

Parameters
[in]*handlepointer to an aht30 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_aht30.c.

◆ aht30_get_status()

uint8_t aht30_get_status ( aht30_handle_t handle,
uint8_t *  status 
)

get status

Parameters
[in]*handlepointer to an aht30 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
Note
none

Definition at line 521 of file driver_aht30.c.

◆ aht30_info()

uint8_t aht30_info ( aht30_info_t info)

get chip's information

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

Definition at line 616 of file driver_aht30.c.

◆ aht30_init()

uint8_t aht30_init ( aht30_handle_t handle)

initialize the chip

Parameters
[in]*handlepointer to an aht30 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_aht30.c.

◆ aht30_read_humidity()

uint8_t aht30_read_humidity ( aht30_handle_t handle,
uint32_t *  humidity_raw,
uint8_t *  humidity_s 
)

read the humidity data

Parameters
[in]*handlepointer to an aht30 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 458 of file driver_aht30.c.

◆ aht30_read_temperature()

uint8_t aht30_read_temperature ( aht30_handle_t handle,
uint32_t *  temperature_raw,
float *  temperature_s 
)

read the temperature

Parameters
[in]*handlepointer to an aht30 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 391 of file driver_aht30.c.

◆ aht30_read_temperature_humidity()

uint8_t aht30_read_temperature_humidity ( aht30_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 aht30 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_aht30.c.