LibDriver SGP30
Loading...
Searching...
No Matches
driver_sgp30.h File Reference

driver sgp30 header file More...

#include <math.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
Include dependency graph for driver_sgp30.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  sgp30_handle_s
 sgp30 handle structure definition More...
struct  sgp30_info_s
 sgp30 information structure definition More...

Macros

#define DRIVER_SGP30_LINK_INIT(HANDLE, STRUCTURE)
 initialize sgp30_handle_t structure
#define DRIVER_SGP30_LINK_IIC_INIT(HANDLE, FUC)
 link iic_init function
#define DRIVER_SGP30_LINK_IIC_DEINIT(HANDLE, FUC)
 link iic_deinit function
#define DRIVER_SGP30_LINK_IIC_WRITE_COMMAND(HANDLE, FUC)
 link iic_write_cmd function
#define DRIVER_SGP30_LINK_IIC_READ_COMMAND(HANDLE, FUC)
 link iic_read_cmd function
#define DRIVER_SGP30_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_SGP30_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function

Typedefs

typedef struct sgp30_handle_s sgp30_handle_t
 sgp30 handle structure definition
typedef struct sgp30_info_s sgp30_info_t
 sgp30 information structure definition

Functions

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
uint8_t sgp30_set_reg (sgp30_handle_t *handle, uint16_t reg, uint8_t *buf, uint16_t len)
 set the chip register
uint8_t sgp30_get_reg (sgp30_handle_t *handle, uint16_t reg, uint8_t *buf, uint16_t len)
 get the chip register

Detailed Description

driver sgp30 header file

Copyright (c) 2015 - present LibDriver All rights reserved

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version
2.0.0
Author
Shifeng Li
Date
2021-03-07

history

Date Version Author Description
2021/03/07 2.0 Shifeng Li format the code
2020/11/05 1.0 Shifeng Li first upload

Definition in file driver_sgp30.h.