LibDriver AGS10
Loading...
Searching...
No Matches
ags10 base driver function

ags10 base driver modules More...

Collaboration diagram for ags10 base driver function:

Data Structures

struct  ags10_handle_s
 ags10 handle structure definition More...
struct  ags10_info_s
 ags10 information structure definition More...

Typedefs

typedef struct ags10_handle_s ags10_handle_t
 ags10 handle structure definition
typedef struct ags10_info_s ags10_info_t
 ags10 information structure definition

Functions

uint8_t ags10_info (ags10_info_t *info)
 get chip's information
uint8_t ags10_init (ags10_handle_t *handle)
 initialize the chip
uint8_t ags10_deinit (ags10_handle_t *handle)
 close the chip
uint8_t ags10_read_tvoc (ags10_handle_t *handle, uint32_t *raw, uint32_t *ppb)
 read tvoc
uint8_t ags10_zero_point_calibration (ags10_handle_t *handle, uint16_t raw)
 zero point calibration
uint8_t ags10_reset_zero_point_calibration (ags10_handle_t *handle)
 reset zero point calibration
uint8_t ags10_current_resistance_zero_point_calibration (ags10_handle_t *handle)
 zero point calibration using current resistance
uint8_t ags10_get_resistance (ags10_handle_t *handle, uint32_t *raw, double *ohm)
 get resistance
uint8_t ags10_get_version (ags10_handle_t *handle, uint8_t *version)
 get version
uint8_t ags10_modify_slave_address (ags10_handle_t *handle, uint8_t addr_7bit)
 modify slave address
uint8_t ags10_set_slave_address (ags10_handle_t *handle, uint8_t addr)
 set slave address
uint8_t ags10_get_slave_address (ags10_handle_t *handle, uint8_t *addr)
 get slave address

Detailed Description

ags10 base driver modules

Typedef Documentation

◆ ags10_handle_t

ags10 handle structure definition

◆ ags10_info_t

typedef struct ags10_info_s ags10_info_t

ags10 information structure definition

Function Documentation

◆ ags10_current_resistance_zero_point_calibration()

uint8_t ags10_current_resistance_zero_point_calibration ( ags10_handle_t * handle)

zero point calibration using current resistance

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

Definition at line 445 of file driver_ags10.c.

◆ ags10_deinit()

uint8_t ags10_deinit ( ags10_handle_t * handle)

close the chip

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

◆ ags10_get_resistance()

uint8_t ags10_get_resistance ( ags10_handle_t * handle,
uint32_t * raw,
double * ohm )

get resistance

Parameters
[in]*handlepointer to an ags10 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 489 of file driver_ags10.c.

◆ ags10_get_slave_address()

uint8_t ags10_get_slave_address ( ags10_handle_t * handle,
uint8_t * addr )

get slave address

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

◆ ags10_get_version()

uint8_t ags10_get_version ( ags10_handle_t * handle,
uint8_t * version )

get version

Parameters
[in]*handlepointer to an ags10 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 537 of file driver_ags10.c.

◆ ags10_info()

uint8_t ags10_info ( ags10_info_t * info)

get chip's information

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

Definition at line 685 of file driver_ags10.c.

◆ ags10_init()

uint8_t ags10_init ( ags10_handle_t * handle)

initialize the chip

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

◆ ags10_modify_slave_address()

uint8_t ags10_modify_slave_address ( ags10_handle_t * handle,
uint8_t addr_7bit )

modify slave address

Parameters
[in]*handlepointer to an ags10 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 581 of file driver_ags10.c.

◆ ags10_read_tvoc()

uint8_t ags10_read_tvoc ( ags10_handle_t * handle,
uint32_t * raw,
uint32_t * ppb )

read tvoc

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

◆ ags10_reset_zero_point_calibration()

uint8_t ags10_reset_zero_point_calibration ( ags10_handle_t * handle)

reset zero point calibration

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

Definition at line 404 of file driver_ags10.c.

◆ ags10_set_slave_address()

uint8_t ags10_set_slave_address ( ags10_handle_t * handle,
uint8_t addr )

set slave address

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

◆ ags10_zero_point_calibration()

uint8_t ags10_zero_point_calibration ( ags10_handle_t * handle,
uint16_t raw )

zero point calibration

Parameters
[in]*handlepointer to an ags10 handle structure
[in]rawraw data
Returns
status code
  • 0 success
  • 1 zero point calibration failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
raw data unit is 0.1kohm

Definition at line 363 of file driver_ags10.c.