54 uint32_t second_check;
57 int16_t reg16s0_check;
59 int16_t reg16s1_check;
61 int16_t reg16s2_check;
63 int16_t reg16s3_check;
65 int16_t reg16s4_check;
67 int16_t reg16s5_check;
69 uint16_t reg16u0_check;
73 uint16_t state_check[4];
197 second = rand() % 65536 + 65536;
234 reg16s0 = rand() % 100;
235 reg16s1 = -(rand() % 100);
236 reg16u0 = rand() % 100;
276 reg16u0 = rand() % 100;
312 reg16s0 = (rand() % 100) + 1;
313 reg16s1 = (rand() % 100) + 1;
314 reg16s2 = (rand() % 100) + 1;
315 reg16s3 = (rand() % 100) + 1;
316 reg16s4 = (rand() % 100) + 10;
317 reg16s5 = (rand() % 100) + 1;
319 reg16s3, reg16s4, reg16s5);
334 ®16s3_check, ®16s4_check, ®16s5_check);
365 reg16s0 = (rand() % 100) + 1;
366 reg16s1 = (rand() % 100) + 1;
368 reg16s3 = (rand() % 100) + 1;
370 reg16s5 = (rand() % 100) + 1;
372 reg16s3, reg16s4, reg16s5);
387 ®16s3_check, ®16s4_check, ®16s5_check);
484 state[0] = rand() % 0xFFFFU;
485 state[1] = rand() % 0xFFFFU;
486 state[2] = rand() % 0xFFFFU;
487 state[3] = rand() % 0xFFFFU;
655 sen5x_interface_debug_print(
"sen5x: sen5x_temperature_compensation_convert_to_register/sen5x_temperature_compensation_convert_to_data test.\n");
657 f0 = (float)(rand() % 100) / 10.0f;
658 f1 = (float)(rand() % 100) / 100.0f;
659 f2 = (float)(rand() % 100);
driver sen5x register test header file
uint8_t sen5x_set_nox_algorithm_tuning(sen5x_handle_t *handle, int16_t index_offset, int16_t learning_time_offset_hour, int16_t learning_time_gain_hour, int16_t gating_max_duration_minute, int16_t std_initial, int16_t gain_factor)
set nox algorithm tuning
uint8_t sen5x_temperature_compensation_convert_to_register(sen5x_handle_t *handle, float temperature_offset_degree, float normalized_temperature_offset_slope_factor, float time_constant_second, int16_t *temperature_offset_reg, int16_t *normalized_temperature_offset_slope_reg, uint16_t *time_constant_reg)
convert the temperature compensation to the register raw data
uint8_t sen5x_info(sen5x_info_t *info)
get chip information
uint8_t sen5x_set_voc_algorithm_state(sen5x_handle_t *handle, uint16_t state[4])
set voc algorithm state
uint8_t sen5x_get_temperature_compensation(sen5x_handle_t *handle, int16_t *temperature_offset, int16_t *normalized_temperature_offset_slope, uint16_t *time_constant)
get temperature compensation
uint8_t sen5x_set_temperature_compensation(sen5x_handle_t *handle, int16_t temperature_offset, int16_t normalized_temperature_offset_slope, uint16_t time_constant)
set temperature compensation
uint8_t sen5x_get_warm_start(sen5x_handle_t *handle, uint16_t *param)
get warm start
uint8_t sen5x_set_type(sen5x_handle_t *handle, sen5x_type_t type)
set the chip type
uint8_t sen5x_read_data_flag(sen5x_handle_t *handle, sen5x_data_ready_flag_t *flag)
read the data flag
uint8_t sen5x_get_device_status(sen5x_handle_t *handle, uint32_t *status)
get the device status
uint8_t sen5x_start_fan_cleaning(sen5x_handle_t *handle)
start the fan cleaning
uint8_t sen5x_get_version(sen5x_handle_t *handle, uint8_t *version)
get the version
uint8_t sen5x_start_measurement(sen5x_handle_t *handle)
start the measurement
uint8_t sen5x_get_nox_algorithm_tuning(sen5x_handle_t *handle, int16_t *index_offset, int16_t *learning_time_offset_hour, int16_t *learning_time_gain_hour, int16_t *gating_max_duration_minute, int16_t *std_initial, int16_t *gain_factor)
get nox algorithm tuning
uint8_t sen5x_get_type(sen5x_handle_t *handle, sen5x_type_t *type)
get the chip type
sen5x_data_ready_flag_t
sen5x data ready flag enumeration definition
uint8_t sen5x_reset(sen5x_handle_t *handle)
reset the chip
uint8_t sen5x_get_rht_acceleration_mode(sen5x_handle_t *handle, sen5x_rht_acceleration_mode_t *mode)
get rht acceleration mode
sen5x_type_t
sen5x type enumeration definition
uint8_t sen5x_deinit(sen5x_handle_t *handle)
close the chip
uint8_t sen5x_get_serial_number(sen5x_handle_t *handle, char sn[32])
get the serial number
struct sen5x_handle_s sen5x_handle_t
sen5x handle structure definition
uint8_t sen5x_get_product_name(sen5x_handle_t *handle, char name[32])
get the product name
uint8_t sen5x_get_voc_algorithm_tuning(sen5x_handle_t *handle, int16_t *index_offset, int16_t *learning_time_offset_hour, int16_t *learning_time_gain_hour, int16_t *gating_max_duration_minute, int16_t *std_initial, int16_t *gain_factor)
get voc algorithm tuning
uint8_t sen5x_clear_device_status(sen5x_handle_t *handle)
clear the device status
uint8_t sen5x_set_voc_algorithm_tuning(sen5x_handle_t *handle, int16_t index_offset, int16_t learning_time_offset_hour, int16_t learning_time_gain_hour, int16_t gating_max_duration_minute, int16_t std_initial, int16_t gain_factor)
set voc algorithm tuning
uint8_t sen5x_get_auto_cleaning_interval(sen5x_handle_t *handle, uint32_t *second)
get the auto cleaning interval
uint8_t sen5x_temperature_compensation_convert_to_data(sen5x_handle_t *handle, int16_t temperature_offset_reg, int16_t normalized_temperature_offset_slope_reg, uint16_t time_constant_reg, float *temperature_offset_degree, float *normalized_temperature_offset_slope_factor, float *time_constant_second)
convert the temperature compensation to the real data
uint8_t sen5x_disable_auto_cleaning_interval(sen5x_handle_t *handle)
disable the auto cleaning interval
uint8_t sen5x_set_rht_acceleration_mode(sen5x_handle_t *handle, sen5x_rht_acceleration_mode_t mode)
set rht acceleration mode
struct sen5x_info_s sen5x_info_t
sen5x information structure definition
uint8_t sen5x_init(sen5x_handle_t *handle)
initialize the chip
uint8_t sen5x_set_warm_start(sen5x_handle_t *handle, uint16_t param)
set warm start
uint8_t sen5x_set_auto_cleaning_interval(sen5x_handle_t *handle, uint32_t second)
set the auto cleaning interval
uint8_t sen5x_stop_measurement(sen5x_handle_t *handle)
stop the measurement
sen5x_rht_acceleration_mode_t
sen5x rht acceleration mode enumeration definition
uint8_t sen5x_get_voc_algorithm_state(sen5x_handle_t *handle, uint16_t state[4])
get voc algorithm state
@ SEN5X_RHT_ACCELERATION_MEDIUM
@ SEN5X_RHT_ACCELERATION_HIGH
@ SEN5X_RHT_ACCELERATION_LOW
uint8_t sen5x_interface_iic_write_cmd(uint8_t addr, uint8_t *buf, uint16_t len)
interface iic bus write
uint8_t sen5x_interface_iic_read_cmd(uint8_t addr, uint8_t *buf, uint16_t len)
interface iic bus read
uint8_t sen5x_interface_iic_init(void)
interface iic bus init
uint8_t sen5x_interface_iic_deinit(void)
interface iic bus deinit
void sen5x_interface_delay_ms(uint32_t ms)
interface delay ms
void sen5x_interface_debug_print(const char *const fmt,...)
interface print format data
#define DRIVER_SEN5X_LINK_DEBUG_PRINT(HANDLE, FUC)
link debug_print function
#define DRIVER_SEN5X_LINK_IIC_READ_COMMAND(HANDLE, FUC)
link iic_read_cmd function
#define DRIVER_SEN5X_LINK_DELAY_MS(HANDLE, FUC)
link delay_ms function
#define DRIVER_SEN5X_LINK_IIC_DEINIT(HANDLE, FUC)
link iic_deinit function
#define DRIVER_SEN5X_LINK_IIC_INIT(HANDLE, FUC)
link iic_init function
#define DRIVER_SEN5X_LINK_IIC_WRITE_COMMAND(HANDLE, FUC)
link iic_write_cmd function
#define DRIVER_SEN5X_LINK_INIT(HANDLE, STRUCTURE)
initialize sen5x_handle_t structure
uint8_t sen5x_register_test(sen5x_type_t type)
register test
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v