LibDriver AGS02MA
Loading...
Searching...
No Matches
ags02ma base driver function

ags02ma base driver modules More...

Collaboration diagram for ags02ma base driver function:

Data Structures

struct  ags02ma_handle_s
 ags02ma handle structure definition More...
struct  ags02ma_info_s
 ags02ma information structure definition More...

Typedefs

typedef struct ags02ma_handle_s ags02ma_handle_t
 ags02ma handle structure definition
typedef struct ags02ma_info_s ags02ma_info_t
 ags02ma information structure definition

Functions

uint8_t ags02ma_info (ags02ma_info_t *info)
 get chip's information
uint8_t ags02ma_init (ags02ma_handle_t *handle)
 initialize the chip
uint8_t ags02ma_deinit (ags02ma_handle_t *handle)
 close the chip
uint8_t ags02ma_read_tvoc (ags02ma_handle_t *handle, uint32_t *raw, uint32_t *ppb)
 read tvoc
uint8_t ags02ma_zero_point_calibration (ags02ma_handle_t *handle)
 zero point calibration
uint8_t ags02ma_get_resistance (ags02ma_handle_t *handle, uint32_t *raw, double *ohm)
 get resistance
uint8_t ags02ma_get_version (ags02ma_handle_t *handle, uint8_t *version)
 get version
uint8_t ags02ma_modify_slave_address (ags02ma_handle_t *handle, uint8_t addr_7bit)
 modify slave address
uint8_t ags02ma_set_slave_address (ags02ma_handle_t *handle, uint8_t addr)
 set slave address
uint8_t ags02ma_get_slave_address (ags02ma_handle_t *handle, uint8_t *addr)
 get slave address

Detailed Description

ags02ma base driver modules

Typedef Documentation

◆ ags02ma_handle_t

ags02ma handle structure definition

◆ ags02ma_info_t

ags02ma information structure definition

Function Documentation

◆ ags02ma_deinit()

uint8_t ags02ma_deinit ( ags02ma_handle_t * handle)

close the chip

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

Definition at line 223 of file driver_ags02ma.c.

◆ ags02ma_get_resistance()

uint8_t ags02ma_get_resistance ( ags02ma_handle_t * handle,
uint32_t * raw,
double * ohm )

get resistance

Parameters
[in]*handlepointer to an ags02ma handle structure
[out]*rawpointer to a raw data buffer
[out]*ohmpointer to a converted data buffer
Returns
status code
  • 0 success
  • 1 get resistance failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 crc is error
Note
none

Definition at line 406 of file driver_ags02ma.c.

◆ ags02ma_get_slave_address()

uint8_t ags02ma_get_slave_address ( ags02ma_handle_t * handle,
uint8_t * addr )

get slave address

Parameters
[in]*handlepointer to an ags02ma handle structure
[out]*addrpointer to a slave address buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 281 of file driver_ags02ma.c.

◆ ags02ma_get_version()

uint8_t ags02ma_get_version ( ags02ma_handle_t * handle,
uint8_t * version )

get version

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

Definition at line 454 of file driver_ags02ma.c.

◆ ags02ma_info()

uint8_t ags02ma_info ( ags02ma_info_t * info)

get chip's information

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

Definition at line 602 of file driver_ags02ma.c.

◆ ags02ma_init()

uint8_t ags02ma_init ( ags02ma_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to an ags02ma handle structure
Returns
status code
  • 0 success
  • 1 init failed
  • 2 handle is NULL
  • 3 linked functions is NULL
Note
none

Definition at line 154 of file driver_ags02ma.c.

◆ ags02ma_modify_slave_address()

uint8_t ags02ma_modify_slave_address ( ags02ma_handle_t * handle,
uint8_t addr_7bit )

modify slave address

Parameters
[in]*handlepointer to an ags02ma handle structure
[in]addr_7bitnew slave address
Returns
status code
  • 0 success
  • 1 modify slave address failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 498 of file driver_ags02ma.c.

◆ ags02ma_read_tvoc()

uint8_t ags02ma_read_tvoc ( ags02ma_handle_t * handle,
uint32_t * raw,
uint32_t * ppb )

read tvoc

Parameters
[in]*handlepointer to an ags02ma handle structure
[out]*rawpointer to a raw data buffer
[out]*ppbpointer to a converted data buffer
Returns
status code
  • 0 success
  • 1 read tvoc failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 crc is error
  • 5 chip is busy
Note
none

Definition at line 311 of file driver_ags02ma.c.

◆ ags02ma_set_slave_address()

uint8_t ags02ma_set_slave_address ( ags02ma_handle_t * handle,
uint8_t addr )

set slave address

Parameters
[in]*handlepointer to an ags02ma handle structure
[in]addrslave address
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 255 of file driver_ags02ma.c.

◆ ags02ma_zero_point_calibration()

uint8_t ags02ma_zero_point_calibration ( ags02ma_handle_t * handle)

zero point calibration

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

Definition at line 362 of file driver_ags02ma.c.