sgp40 base driver modules
More...
|
| uint8_t | sgp40_info (sgp40_info_t *info) |
| | get chip information
|
| uint8_t | sgp40_init (sgp40_handle_t *handle) |
| | initialize the chip
|
| uint8_t | sgp40_deinit (sgp40_handle_t *handle) |
| | close the chip
|
| uint8_t | sgp40_get_measure_raw (sgp40_handle_t *handle, uint16_t raw_humidity, uint16_t raw_temperature, uint16_t *sraw_voc) |
| | get the measure raw result
|
| uint8_t | sgp40_get_measure_raw_without_compensation (sgp40_handle_t *handle, uint16_t *sraw_voc) |
| | get the measure raw result without compensation
|
| uint8_t | sgp40_humidity_convert_to_register (sgp40_handle_t *handle, float rh, uint16_t *reg) |
| | convert the humidity to the register data
|
| uint8_t | sgp40_temperature_convert_to_register (sgp40_handle_t *handle, float temp, uint16_t *reg) |
| | convert the temperature to the register data
|
| uint8_t | sgp40_get_measure_test (sgp40_handle_t *handle, uint16_t *result) |
| | get the chip measure test
|
| uint8_t | sgp40_soft_reset (sgp40_handle_t *handle) |
| | soft reset the chip
|
| uint8_t | sgp40_turn_heater_off (sgp40_handle_t *handle) |
| | turn heater off
|
| uint8_t | sgp40_get_serial_id (sgp40_handle_t *handle, uint16_t id[3]) |
| | get the chip serial id
|
sgp40 base driver modules
◆ sgp40_handle_t
sgp40 handle structure definition
◆ sgp40_info_t
sgp40 information structure definition
◆ sgp40_deinit()
close the chip
- Parameters
-
| [in] | *handle | pointer to an sgp40 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 630 of file driver_sgp40.c.
◆ sgp40_get_measure_raw()
| uint8_t sgp40_get_measure_raw |
( |
sgp40_handle_t * | handle, |
|
|
uint16_t | raw_humidity, |
|
|
uint16_t | raw_temperature, |
|
|
uint16_t * | sraw_voc ) |
get the measure raw result
- Parameters
-
| [in] | *handle | pointer to an sgp40 handle structure |
| [in] | raw_humidity | humidity raw data |
| [in] | raw_temperature | temperature raw data |
| [out] | *sraw_voc | pointer to a raw tvoc 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 291 of file driver_sgp40.c.
◆ sgp40_get_measure_raw_without_compensation()
| uint8_t sgp40_get_measure_raw_without_compensation |
( |
sgp40_handle_t * | handle, |
|
|
uint16_t * | sraw_voc ) |
get the measure raw result without compensation
- Parameters
-
| [in] | *handle | pointer to an sgp40 handle structure |
| [out] | *sraw_voc | pointer to a raw tvoc 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 343 of file driver_sgp40.c.
◆ sgp40_get_measure_test()
| uint8_t sgp40_get_measure_test |
( |
sgp40_handle_t * | handle, |
|
|
uint16_t * | result ) |
get the chip measure test
- Parameters
-
| [in] | *handle | pointer to an sgp40 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 394 of file driver_sgp40.c.
◆ sgp40_get_serial_id()
| uint8_t sgp40_get_serial_id |
( |
sgp40_handle_t * | handle, |
|
|
uint16_t | id[3] ) |
get the chip serial id
- Parameters
-
| [in] | *handle | pointer to an sgp40 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 510 of file driver_sgp40.c.
◆ sgp40_humidity_convert_to_register()
| uint8_t sgp40_humidity_convert_to_register |
( |
sgp40_handle_t * | handle, |
|
|
float | rh, |
|
|
uint16_t * | reg ) |
convert the humidity to the register data
- Parameters
-
| [in] | *handle | pointer to an sgp40 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 234 of file driver_sgp40.c.
◆ sgp40_info()
get chip information
- Parameters
-
| [out] | *info | pointer to an sgp40 info structure |
- Returns
- status code
- 0 success
- 2 handle is NULL
- Note
- none
Definition at line 720 of file driver_sgp40.c.
◆ sgp40_init()
initialize the chip
- Parameters
-
| [in] | *handle | pointer to an sgp40 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 567 of file driver_sgp40.c.
◆ sgp40_soft_reset()
soft reset the chip
- Parameters
-
| [in] | *handle | pointer to an sgp40 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 437 of file driver_sgp40.c.
◆ sgp40_temperature_convert_to_register()
| uint8_t sgp40_temperature_convert_to_register |
( |
sgp40_handle_t * | handle, |
|
|
float | temp, |
|
|
uint16_t * | reg ) |
convert the temperature to the register data
- Parameters
-
| [in] | *handle | pointer to an sgp40 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 262 of file driver_sgp40.c.
◆ sgp40_turn_heater_off()
turn heater off
- Parameters
-
| [in] | *handle | pointer to an sgp40 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 474 of file driver_sgp40.c.