165 rh = (float)(rand() % 1000) / 10.0f;
180 temp = (float)(rand() % 500) / 10.0f;
driver sgp40 register test header file
uint8_t sgp40_get_serial_id(sgp40_handle_t *handle, uint16_t id[3])
get the chip serial id
uint8_t sgp40_init(sgp40_handle_t *handle)
initialize the chip
uint8_t sgp40_soft_reset(sgp40_handle_t *handle)
soft reset the chip
uint8_t sgp40_info(sgp40_info_t *info)
get chip information
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_turn_heater_off(sgp40_handle_t *handle)
turn heater off
uint8_t sgp40_deinit(sgp40_handle_t *handle)
close the chip
uint8_t sgp40_get_measure_test(sgp40_handle_t *handle, uint16_t *result)
get the chip measure test
struct sgp40_handle_s sgp40_handle_t
sgp40 handle structure definition
uint8_t sgp40_temperature_convert_to_register(sgp40_handle_t *handle, float temp, uint16_t *reg)
convert the temperature to the register data
struct sgp40_info_s sgp40_info_t
sgp40 information structure definition
uint8_t sgp40_interface_iic_read_cmd(uint8_t addr, uint8_t *buf, uint16_t len)
interface iic bus read command
uint8_t sgp40_interface_iic_deinit(void)
interface iic bus deinit
void sgp40_interface_delay_ms(uint32_t ms)
interface delay ms
uint8_t sgp40_interface_iic_init(void)
interface iic bus init
uint8_t sgp40_interface_iic_write_cmd(uint8_t addr, uint8_t *buf, uint16_t len)
interface iic bus write command
void sgp40_interface_debug_print(const char *const fmt,...)
interface print format data
#define DRIVER_SGP40_LINK_INIT(HANDLE, STRUCTURE)
initialize sgp40_handle_t structure
#define DRIVER_SGP40_LINK_IIC_READ_COMMAND(HANDLE, FUC)
link iic_read_cmd function
#define DRIVER_SGP40_LINK_DELAY_MS(HANDLE, FUC)
link delay_ms function
#define DRIVER_SGP40_LINK_IIC_DEINIT(HANDLE, FUC)
link iic_deinit function
#define DRIVER_SGP40_LINK_IIC_INIT(HANDLE, FUC)
link iic_init function
#define DRIVER_SGP40_LINK_DEBUG_PRINT(HANDLE, FUC)
link debug_print function
#define DRIVER_SGP40_LINK_IIC_WRITE_COMMAND(HANDLE, FUC)
link iic_write_cmd function
uint8_t sgp40_register_test(void)
register test
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v