sgp41 base driver modules
More...
|
| uint8_t | sgp41_info (sgp41_info_t *info) |
| | get chip information
|
| uint8_t | sgp41_init (sgp41_handle_t *handle) |
| | initialize the chip
|
| uint8_t | sgp41_deinit (sgp41_handle_t *handle) |
| | close the chip
|
| uint8_t | sgp41_get_execute_conditioning (sgp41_handle_t *handle, uint16_t *sraw_voc) |
| | get execute conditioning
|
| uint8_t | sgp41_get_measure_raw (sgp41_handle_t *handle, uint16_t raw_humidity, uint16_t raw_temperature, uint16_t *sraw_voc, uint16_t *sraw_nox) |
| | get the measure raw result
|
| uint8_t | sgp41_get_measure_raw_without_compensation (sgp41_handle_t *handle, uint16_t *sraw_voc, uint16_t *sraw_nox) |
| | get the measure raw result without compensation
|
| uint8_t | sgp41_humidity_convert_to_register (sgp41_handle_t *handle, float rh, uint16_t *reg) |
| | convert the humidity to the register data
|
| uint8_t | sgp41_temperature_convert_to_register (sgp41_handle_t *handle, float temp, uint16_t *reg) |
| | convert the temperature to the register data
|
| uint8_t | sgp41_get_measure_test (sgp41_handle_t *handle, uint16_t *result) |
| | get the chip measure test
|
| uint8_t | sgp41_soft_reset (sgp41_handle_t *handle) |
| | soft reset the chip
|
| uint8_t | sgp41_turn_heater_off (sgp41_handle_t *handle) |
| | turn heater off
|
| uint8_t | sgp41_get_serial_id (sgp41_handle_t *handle, uint16_t id[3]) |
| | get the chip serial id
|
sgp41 base driver modules
◆ sgp41_handle_t
sgp41 handle structure definition
◆ sgp41_info_t
sgp41 information structure definition
◆ sgp41_deinit()
close the chip
- Parameters
-
| [in] | *handle | pointer to an sgp41 handle structure |
- Returns
- status code
- 0 success
- 1 iic deinit failed
- 2 handle is NULL
- 3 handle is not initialized
- 4 turn heater off failed
- Note
- none
Definition at line 699 of file driver_sgp41.c.
◆ sgp41_get_execute_conditioning()
| uint8_t sgp41_get_execute_conditioning |
( |
sgp41_handle_t * | handle, |
|
|
uint16_t * | sraw_voc ) |
get execute conditioning
- Parameters
-
| [in] | *handle | pointer to an sgp41 handle structure |
| [out] | *sraw_voc | pointer to a raw tvoc buffer |
- Returns
- status code
- 0 success
- 1 get execute conditioning failed
- 2 handle is NULL
- 3 handle is not initialized
- Note
- none
Definition at line 290 of file driver_sgp41.c.
◆ sgp41_get_measure_raw()
| uint8_t sgp41_get_measure_raw |
( |
sgp41_handle_t * | handle, |
|
|
uint16_t | raw_humidity, |
|
|
uint16_t | raw_temperature, |
|
|
uint16_t * | sraw_voc, |
|
|
uint16_t * | sraw_nox ) |
get the measure raw result
- Parameters
-
| [in] | *handle | pointer to an sgp41 handle structure |
| [in] | raw_humidity | humidity raw data |
| [in] | raw_temperature | temperature raw data |
| [out] | *sraw_voc | pointer to a raw tvoc buffer |
| [out] | *sraw_nox | pointer to a raw nox 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 345 of file driver_sgp41.c.
◆ sgp41_get_measure_raw_without_compensation()
| uint8_t sgp41_get_measure_raw_without_compensation |
( |
sgp41_handle_t * | handle, |
|
|
uint16_t * | sraw_voc, |
|
|
uint16_t * | sraw_nox ) |
get the measure raw result without compensation
- Parameters
-
| [in] | *handle | pointer to an sgp41 handle structure |
| [out] | *sraw_voc | pointer to a raw tvoc buffer |
| [out] | *sraw_nox | pointer to a raw nox buffer |
- Returns
- status code
- 0 success
- 1 get measure raw without compensation failed
- 2 handle is NULL
- 3 handle is not initialized
- Note
- none
Definition at line 405 of file driver_sgp41.c.
◆ sgp41_get_measure_test()
| uint8_t sgp41_get_measure_test |
( |
sgp41_handle_t * | handle, |
|
|
uint16_t * | result ) |
get the chip measure test
- Parameters
-
| [in] | *handle | pointer to an sgp41 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 463 of file driver_sgp41.c.
◆ sgp41_get_serial_id()
| uint8_t sgp41_get_serial_id |
( |
sgp41_handle_t * | handle, |
|
|
uint16_t | id[3] ) |
get the chip serial id
- Parameters
-
| [in] | *handle | pointer to an sgp41 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 579 of file driver_sgp41.c.
◆ sgp41_humidity_convert_to_register()
| uint8_t sgp41_humidity_convert_to_register |
( |
sgp41_handle_t * | handle, |
|
|
float | rh, |
|
|
uint16_t * | reg ) |
convert the humidity to the register data
- Parameters
-
| [in] | *handle | pointer to an sgp41 handle structure |
| [in] | rh | current relative humidity |
| [out] | *reg | pointer to a converted register data |
- Returns
- status code
- 0 success
- 1 humidity convert to register failed
- 2 handle is NULL
- 3 handle is not initialized
- Note
- none
Definition at line 235 of file driver_sgp41.c.
◆ sgp41_info()
get chip information
- Parameters
-
| [out] | *info | pointer to an sgp41 info structure |
- Returns
- status code
- 0 success
- 2 handle is NULL
- Note
- none
Definition at line 789 of file driver_sgp41.c.
◆ sgp41_init()
initialize the chip
- Parameters
-
| [in] | *handle | pointer to an sgp41 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 636 of file driver_sgp41.c.
◆ sgp41_soft_reset()
soft reset the chip
- Parameters
-
| [in] | *handle | pointer to an sgp41 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 506 of file driver_sgp41.c.
◆ sgp41_temperature_convert_to_register()
| uint8_t sgp41_temperature_convert_to_register |
( |
sgp41_handle_t * | handle, |
|
|
float | temp, |
|
|
uint16_t * | reg ) |
convert the temperature to the register data
- Parameters
-
| [in] | *handle | pointer to an sgp41 handle structure |
| [in] | temp | current temperature |
| [out] | *reg | pointer to a converted register data |
- Returns
- status code
- 0 success
- 1 temperature convert to register failed
- 2 handle is NULL
- 3 handle is not initialized
- Note
- none
Definition at line 263 of file driver_sgp41.c.
◆ sgp41_turn_heater_off()
turn heater off
- Parameters
-
| [in] | *handle | pointer to an sgp41 handle structure |
- Returns
- status code
- 0 success
- 1 turn heater off failed
- 2 handle is NULL
- 3 handle is not initialized
- Note
- none
Definition at line 543 of file driver_sgp41.c.