sgp30 base driver modules
More...
|
| uint8_t | sgp30_info (sgp30_info_t *info) |
| | get chip information
|
| uint8_t | sgp30_init (sgp30_handle_t *handle) |
| | initialize the chip
|
| uint8_t | sgp30_deinit (sgp30_handle_t *handle) |
| | close the chip
|
| uint8_t | sgp30_iaq_init (sgp30_handle_t *handle) |
| | initialize the chip iaq
|
| uint8_t | sgp30_read (sgp30_handle_t *handle, uint16_t *co2_eq_ppm, uint16_t *tvoc_ppb) |
| | read the iaq measure result
|
| uint8_t | sgp30_measure_iaq (sgp30_handle_t *handle, uint16_t *co2_eq_ppm, uint16_t *tvoc_ppb) |
| | get the iaq measure result
|
| uint8_t | sgp30_get_measure_raw (sgp30_handle_t *handle, uint16_t *tvoc, uint16_t *co2_eq) |
| | get the iaq measure raw result
|
| uint8_t | sgp30_set_tvoc_baseline (sgp30_handle_t *handle, uint16_t tvoc_baseline) |
| | set the chip tvoc baseline
|
| uint8_t | sgp30_get_tvoc_inceptive_baseline (sgp30_handle_t *handle, uint16_t *tvoc_baseline) |
| | get the chip tvoc inceptive baseline
|
| uint8_t | sgp30_soft_reset (sgp30_handle_t *handle) |
| | soft reset the chip
|
| uint8_t | sgp30_get_serial_id (sgp30_handle_t *handle, uint16_t id[3]) |
| | get the chip serial id
|
| uint8_t | sgp30_set_iaq_baseline (sgp30_handle_t *handle, uint16_t tvoc, uint16_t co2_eq) |
| | set the chip iaq baseline
|
| uint8_t | sgp30_get_iaq_baseline (sgp30_handle_t *handle, uint16_t *tvoc, uint16_t *co2_eq) |
| | get the chip iaq baseline
|
| uint8_t | sgp30_set_absolute_humidity (sgp30_handle_t *handle, uint16_t humidity) |
| | set the chip absolute_humidity
|
| uint8_t | sgp30_absolute_humidity_convert_to_register (sgp30_handle_t *handle, float temp, float rh, uint16_t *reg) |
| | convert the absolute humidity to the register data
|
| uint8_t | sgp30_measure_test (sgp30_handle_t *handle, uint16_t *result) |
| | run the chip measure test
|
| uint8_t | sgp30_get_feature_set (sgp30_handle_t *handle, uint8_t *product_type, uint8_t *product_version) |
| | get the chip feature
|
sgp30 base driver modules
◆ sgp30_handle_t
sgp30 handle structure definition
◆ sgp30_info_t
sgp30 information structure definition
◆ sgp30_absolute_humidity_convert_to_register()
| uint8_t sgp30_absolute_humidity_convert_to_register |
( |
sgp30_handle_t * | handle, |
|
|
float | temp, |
|
|
float | rh, |
|
|
uint16_t * | reg ) |
convert the absolute humidity to the register data
- Parameters
-
| [in] | *handle | pointer to an sgp30 handle structure |
| [in] | temp | current temperature |
| [in] | rh | current relative humidity |
| [out] | *reg | pointer to a converted register data |
- Returns
- status code
- 0 success
- 1 absolute humidity convert to register failed
- 2 handle is NULL
- 3 handle is not initialized
- Note
- none
Definition at line 602 of file driver_sgp30.c.
◆ sgp30_deinit()
close the chip
- Parameters
-
| [in] | *handle | pointer to an sgp30 handle structure |
- Returns
- status code
- 0 success
- 1 iic deinit failed
- 2 handle is NULL
- 3 handle is not initialized
- 4 soft reset failed
- Note
- none
Definition at line 838 of file driver_sgp30.c.
◆ sgp30_get_feature_set()
| uint8_t sgp30_get_feature_set |
( |
sgp30_handle_t * | handle, |
|
|
uint8_t * | product_type, |
|
|
uint8_t * | product_version ) |
get the chip feature
- Parameters
-
| [in] | *handle | pointer to an sgp30 handle structure |
| [out] | *product_type | pointer to a product type buffer |
| [out] | *product_version | pointer to a product version buffer |
- Returns
- status code
- 0 success
- 1 get feature set failed
- 2 handle is NULL
- 3 handle is not initialized
- Note
- none
Definition at line 679 of file driver_sgp30.c.
◆ sgp30_get_iaq_baseline()
| uint8_t sgp30_get_iaq_baseline |
( |
sgp30_handle_t * | handle, |
|
|
uint16_t * | tvoc, |
|
|
uint16_t * | co2_eq ) |
get the chip iaq baseline
- Parameters
-
| [in] | *handle | pointer to an sgp30 handle structure |
| [out] | *tvoc | pointer to a tvoc buffer |
| [out] | *co2_eq | pointer to a co2 buffer |
- Returns
- status code
- 0 success
- 1 get iaq baseline failed
- 2 handle is NULL
- 3 handle is not initialized
- Note
- none
Definition at line 463 of file driver_sgp30.c.
◆ sgp30_get_measure_raw()
| uint8_t sgp30_get_measure_raw |
( |
sgp30_handle_t * | handle, |
|
|
uint16_t * | tvoc, |
|
|
uint16_t * | co2_eq ) |
get the iaq measure raw result
- Parameters
-
| [in] | *handle | pointer to an sgp30 handle structure |
| [out] | *tvoc | pointer to a tvoc buffer |
| [out] | *co2_eq | pointer to a co2 buffer |
- Returns
- status code
- 0 success
- 1 get measure raw failed
- 2 handle is NULL
- 3 handle is not initialized
- Note
- none
Definition at line 725 of file driver_sgp30.c.
◆ sgp30_get_serial_id()
| uint8_t sgp30_get_serial_id |
( |
sgp30_handle_t * | handle, |
|
|
uint16_t | id[3] ) |
get the chip serial id
- Parameters
-
| [in] | *handle | pointer to an sgp30 handle structure |
| [out] | *id | pointer to an id buffer |
- Returns
- status code
- 0 success
- 1 get serial id failed
- 2 handle is NULL
- 3 handle is not initialized
- Note
- none
Definition at line 352 of file driver_sgp30.c.
◆ sgp30_get_tvoc_inceptive_baseline()
| uint8_t sgp30_get_tvoc_inceptive_baseline |
( |
sgp30_handle_t * | handle, |
|
|
uint16_t * | tvoc_baseline ) |
get the chip tvoc inceptive baseline
- Parameters
-
| [in] | *handle | pointer to an sgp30 handle structure |
| [out] | *tvoc_baseline | pointer to a current tvoc baseline buffer |
- Returns
- status code
- 0 success
- 1 get tvoc inceptive baseline failed
- 2 handle is NULL
- 3 handle is not initialized
- Note
- none
Definition at line 237 of file driver_sgp30.c.
◆ sgp30_iaq_init()
initialize the chip iaq
- Parameters
-
| [in] | *handle | pointer to an sgp30 handle structure |
- Returns
- status code
- 0 success
- 1 iaq init failed
- 2 handle is NULL
- 3 handle is not initialized
- Note
- none
Definition at line 280 of file driver_sgp30.c.
◆ sgp30_info()
get chip information
- Parameters
-
| [out] | *info | pointer to an sgp30 info structure |
- Returns
- status code
- 0 success
- 2 handle is NULL
- Note
- none
Definition at line 980 of file driver_sgp30.c.
◆ sgp30_init()
initialize the chip
- Parameters
-
| [in] | *handle | pointer to an sgp30 handle structure |
- Returns
- status code
- 0 success
- 1 iic initialization failed
- 2 handle is NULL
- 3 linked functions is NULL
- Note
- none
Definition at line 775 of file driver_sgp30.c.
◆ sgp30_measure_iaq()
| uint8_t sgp30_measure_iaq |
( |
sgp30_handle_t * | handle, |
|
|
uint16_t * | co2_eq_ppm, |
|
|
uint16_t * | tvoc_ppb ) |
get the iaq measure result
- Parameters
-
| [in] | *handle | pointer to an sgp30 handle structure |
| [out] | *co2_eq_ppm | pointer to a co2 buffer |
| [out] | *tvoc_ppb | pointer to a tvoc buffer |
- Returns
- status code
- 0 success
- 1 measure iaq failed
- 2 handle is NULL
- 3 handle is not initialized
- Note
- none
Definition at line 411 of file driver_sgp30.c.
◆ sgp30_measure_test()
| uint8_t sgp30_measure_test |
( |
sgp30_handle_t * | handle, |
|
|
uint16_t * | result ) |
run the chip measure test
- Parameters
-
| [in] | *handle | pointer to an sgp30 handle structure |
| [out] | *result | pointer to a test result buffer |
- Returns
- status code
- 0 success
- 1 measure test failed
- 2 handle is NULL
- 3 handle is not initialized
- Note
- none
Definition at line 634 of file driver_sgp30.c.
◆ sgp30_read()
| uint8_t sgp30_read |
( |
sgp30_handle_t * | handle, |
|
|
uint16_t * | co2_eq_ppm, |
|
|
uint16_t * | tvoc_ppb ) |
read the iaq measure result
- Parameters
-
| [in] | *handle | pointer to an sgp30 handle structure |
| [out] | *co2_eq_ppm | pointer to a co2 buffer |
| [out] | *tvoc_ppb | pointer to a tvoc buffer |
- Returns
- status code
- 0 success
- 1 read failed
- 2 handle is NULL
- 3 handle is not initialized
- Note
- none
Definition at line 878 of file driver_sgp30.c.
◆ sgp30_set_absolute_humidity()
| uint8_t sgp30_set_absolute_humidity |
( |
sgp30_handle_t * | handle, |
|
|
uint16_t | humidity ) |
set the chip absolute_humidity
- Parameters
-
| [in] | *handle | pointer to an sgp30 handle structure |
| [in] | humidity | current absolute_humidity |
- Returns
- status code
- 0 success
- 1 set absolute_humidity failed
- 2 handle is NULL
- 3 handle is not initialized
- Note
- none
Definition at line 559 of file driver_sgp30.c.
◆ sgp30_set_iaq_baseline()
| uint8_t sgp30_set_iaq_baseline |
( |
sgp30_handle_t * | handle, |
|
|
uint16_t | tvoc, |
|
|
uint16_t | co2_eq ) |
set the chip iaq baseline
- Parameters
-
| [in] | *handle | pointer to an sgp30 handle structure |
| [in] | tvoc | current tvoc |
| [in] | co2_eq | current co2 eq |
- Returns
- status code
- 0 success
- 1 set iaq baseline failed
- 2 handle is NULL
- 3 handle is not initialized
- Note
- none
Definition at line 515 of file driver_sgp30.c.
◆ sgp30_set_tvoc_baseline()
| uint8_t sgp30_set_tvoc_baseline |
( |
sgp30_handle_t * | handle, |
|
|
uint16_t | tvoc_baseline ) |
set the chip tvoc baseline
- Parameters
-
| [in] | *handle | pointer to an sgp30 handle structure |
| [in] | tvoc_baseline | current tvoc baseline |
- Returns
- status code
- 0 success
- 1 set tvoc baseline failed
- 2 handle is NULL
- 3 handle is not initialized
- Note
- none
Definition at line 196 of file driver_sgp30.c.
◆ sgp30_soft_reset()
soft reset the chip
- Parameters
-
| [in] | *handle | pointer to an sgp30 handle structure |
- Returns
- status code
- 0 success
- 1 soft reset failed
- 2 handle is NULL
- 3 handle is not initialized
- Note
- none
Definition at line 315 of file driver_sgp30.c.