55 uint8_t product_version;
56 uint16_t tvoc, tvoc_check;
57 uint16_t co2_eq, co2_eq_check;
164 tvoc = (uint16_t)(rand() % 65535);
186 tvoc = (uint16_t)(rand() % 65535);
187 co2_eq = (uint16_t)(rand() % 65535);
210 temp = (float)(rand() % 3000) / 100.0f;
211 rh = (float)(rand() % 10000) / 100.0f;
driver sgp30 register test header file
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_tvoc_baseline(sgp30_handle_t *handle, uint16_t tvoc_baseline)
set the chip tvoc baseline
struct sgp30_handle_s sgp30_handle_t
sgp30 handle structure definition
uint8_t sgp30_init(sgp30_handle_t *handle)
initialize the chip
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_deinit(sgp30_handle_t *handle)
close the chip
struct sgp30_info_s sgp30_info_t
sgp30 information structure definition
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_set_absolute_humidity(sgp30_handle_t *handle, uint16_t humidity)
set the chip absolute_humidity
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_info(sgp30_info_t *info)
get chip information
uint8_t sgp30_soft_reset(sgp30_handle_t *handle)
soft reset the chip
uint8_t sgp30_iaq_init(sgp30_handle_t *handle)
initialize the chip iaq
uint8_t sgp30_get_tvoc_inceptive_baseline(sgp30_handle_t *handle, uint16_t *tvoc_baseline)
get the chip tvoc inceptive baseline
uint8_t sgp30_interface_iic_write_cmd(uint8_t addr, uint8_t *buf, uint16_t len)
interface iic bus write command
uint8_t sgp30_interface_iic_init(void)
interface iic bus init
uint8_t sgp30_interface_iic_read_cmd(uint8_t addr, uint8_t *buf, uint16_t len)
interface iic bus read command
void sgp30_interface_delay_ms(uint32_t ms)
interface delay ms
void sgp30_interface_debug_print(const char *const fmt,...)
interface print format data
uint8_t sgp30_interface_iic_deinit(void)
interface iic bus deinit
#define DRIVER_SGP30_LINK_DEBUG_PRINT(HANDLE, FUC)
link debug_print function
#define DRIVER_SGP30_LINK_INIT(HANDLE, STRUCTURE)
initialize sgp30_handle_t structure
#define DRIVER_SGP30_LINK_IIC_WRITE_COMMAND(HANDLE, FUC)
link iic_write_cmd function
#define DRIVER_SGP30_LINK_IIC_INIT(HANDLE, FUC)
link iic_init function
#define DRIVER_SGP30_LINK_DELAY_MS(HANDLE, FUC)
link delay_ms function
#define DRIVER_SGP30_LINK_IIC_DEINIT(HANDLE, FUC)
link iic_deinit function
#define DRIVER_SGP30_LINK_IIC_READ_COMMAND(HANDLE, FUC)
link iic_read_cmd function
uint8_t sgp30_register_test(void)
register test
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v