LibDriver SEN5X
Loading...
Searching...
No Matches
sen5x basic driver function

sen5x basic driver modules More...

Collaboration diagram for sen5x basic driver function:

Data Structures

struct  sen55_data_s
 sen55 data structure definition More...
struct  sen54_data_s
 sen54 data structure definition More...
struct  sen50_data_s
 sen50 data structure definition More...
struct  sen5x_pm_s
 sen5x pm structure definition More...
struct  sen5x_raw_s
 sen5x raw structure definition More...
struct  sen5x_handle_s
 sen5x handle structure definition More...
struct  sen5x_info_s
 sen5x information structure definition More...

Typedefs

typedef struct sen55_data_s sen55_data_t
 sen55 data structure definition
typedef struct sen54_data_s sen54_data_t
 sen54 data structure definition
typedef struct sen50_data_s sen50_data_t
 sen50 data structure definition
typedef struct sen5x_pm_s sen5x_pm_t
 sen5x pm structure definition
typedef struct sen5x_raw_s sen5x_raw_t
 sen5x raw structure definition
typedef struct sen5x_handle_s sen5x_handle_t
 sen5x handle structure definition
typedef struct sen5x_info_s sen5x_info_t
 sen5x information structure definition

Enumerations

enum  sen5x_type_t { SEN50 = 0x00 , SEN54 = 0x01 , SEN55 = 0x02 }
 sen5x type enumeration definition More...
enum  sen5x_data_ready_flag_t { SEN5X_DATA_READY_FLAG_NOT_READY = 0x00 , SEN5X_DATA_READY_FLAG_AVAILABLE = 0x01 }
 sen5x data ready flag enumeration definition More...
enum  sen5x_status_t {
  SEN5X_STATUS_FAN_SPEED_ERROR = (1 << 21) , SEN5X_STATUS_FAN_CLEANING_ACTIVE = (1 << 19) , SEN5X_STATUS_GAS_ERROR = (1 << 7) , SEN5X_STATUS_RHT_ERROR = (1 << 6) ,
  SEN5X_STATUS_LASER_ERROR = (1 << 5) , SEN5X_STATUS_FAN_ERROR = (1 << 4)
}
 sen5x status enumeration definition More...
enum  sen5x_rht_acceleration_mode_t { SEN5X_RHT_ACCELERATION_LOW = 0 , SEN5X_RHT_ACCELERATION_HIGH = 1 , SEN5X_RHT_ACCELERATION_MEDIUM = 2 }
 sen5x rht acceleration mode enumeration definition More...

Functions

uint8_t sen5x_info (sen5x_info_t *info)
 get chip information
uint8_t sen5x_set_type (sen5x_handle_t *handle, sen5x_type_t type)
 set the chip type
uint8_t sen5x_get_type (sen5x_handle_t *handle, sen5x_type_t *type)
 get the chip type
uint8_t sen5x_init (sen5x_handle_t *handle)
 initialize the chip
uint8_t sen5x_deinit (sen5x_handle_t *handle)
 close the chip
uint8_t sen5x_start_measurement (sen5x_handle_t *handle)
 start the measurement
uint8_t sen5x_start_measurement_without_pm (sen5x_handle_t *handle)
 start the measurement without pm
uint8_t sen5x_stop_measurement (sen5x_handle_t *handle)
 stop the measurement
uint8_t sen5x_read_data_flag (sen5x_handle_t *handle, sen5x_data_ready_flag_t *flag)
 read the data flag
uint8_t sen55_read (sen5x_handle_t *handle, sen55_data_t *output)
 read the result
uint8_t sen54_read (sen5x_handle_t *handle, sen54_data_t *output)
 read the result
uint8_t sen50_read (sen5x_handle_t *handle, sen50_data_t *output)
 read the result
uint8_t sen5x_read_pm_value (sen5x_handle_t *handle, sen5x_pm_t *pm)
 read the pm value
uint8_t sen5x_read_raw_value (sen5x_handle_t *handle, sen5x_raw_t *raw)
 read raw value
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_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_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_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_set_warm_start (sen5x_handle_t *handle, uint16_t param)
 set warm start
uint8_t sen5x_get_warm_start (sen5x_handle_t *handle, uint16_t *param)
 get warm start
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_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_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_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_set_rht_acceleration_mode (sen5x_handle_t *handle, sen5x_rht_acceleration_mode_t mode)
 set rht acceleration mode
uint8_t sen5x_get_rht_acceleration_mode (sen5x_handle_t *handle, sen5x_rht_acceleration_mode_t *mode)
 get rht acceleration mode
uint8_t sen5x_set_voc_algorithm_state (sen5x_handle_t *handle, uint16_t state[4])
 set voc algorithm state
uint8_t sen5x_get_voc_algorithm_state (sen5x_handle_t *handle, uint16_t state[4])
 get voc algorithm state
uint8_t sen5x_start_fan_cleaning (sen5x_handle_t *handle)
 start the fan cleaning
uint8_t sen5x_set_auto_cleaning_interval (sen5x_handle_t *handle, uint32_t second)
 set the auto cleaning interval
uint8_t sen5x_get_auto_cleaning_interval (sen5x_handle_t *handle, uint32_t *second)
 get the auto cleaning interval
uint8_t sen5x_disable_auto_cleaning_interval (sen5x_handle_t *handle)
 disable the auto cleaning interval
uint8_t sen5x_get_product_name (sen5x_handle_t *handle, char name[32])
 get the product name
uint8_t sen5x_get_serial_number (sen5x_handle_t *handle, char sn[32])
 get the serial number
uint8_t sen5x_get_version (sen5x_handle_t *handle, uint8_t *version)
 get the version
uint8_t sen5x_get_device_status (sen5x_handle_t *handle, uint32_t *status)
 get the device status
uint8_t sen5x_clear_device_status (sen5x_handle_t *handle)
 clear the device status
uint8_t sen5x_reset (sen5x_handle_t *handle)
 reset the chip

Detailed Description

sen5x basic driver modules

Typedef Documentation

◆ sen50_data_t

typedef struct sen50_data_s sen50_data_t

sen50 data structure definition

◆ sen54_data_t

typedef struct sen54_data_s sen54_data_t

sen54 data structure definition

◆ sen55_data_t

typedef struct sen55_data_s sen55_data_t

sen55 data structure definition

◆ sen5x_handle_t

sen5x handle structure definition

◆ sen5x_info_t

typedef struct sen5x_info_s sen5x_info_t

sen5x information structure definition

◆ sen5x_pm_t

typedef struct sen5x_pm_s sen5x_pm_t

sen5x pm structure definition

◆ sen5x_raw_t

typedef struct sen5x_raw_s sen5x_raw_t

sen5x raw structure definition

Enumeration Type Documentation

◆ sen5x_data_ready_flag_t

sen5x data ready flag enumeration definition

Enumerator
SEN5X_DATA_READY_FLAG_NOT_READY 

no new measurements available

SEN5X_DATA_READY_FLAG_AVAILABLE 

new measurements ready to read

Definition at line 73 of file driver_sen5x.h.

◆ sen5x_rht_acceleration_mode_t

sen5x rht acceleration mode enumeration definition

Enumerator
SEN5X_RHT_ACCELERATION_LOW 

low acceleration

SEN5X_RHT_ACCELERATION_HIGH 

high acceleration

SEN5X_RHT_ACCELERATION_MEDIUM 

medium acceleration

Definition at line 95 of file driver_sen5x.h.

◆ sen5x_status_t

sen5x status enumeration definition

Enumerator
SEN5X_STATUS_FAN_SPEED_ERROR 

fan speed is too high or too low

SEN5X_STATUS_FAN_CLEANING_ACTIVE 

fan cleaning active

SEN5X_STATUS_GAS_ERROR 

gas sensor error

SEN5X_STATUS_RHT_ERROR 

error in internal communication with the rht sensor

SEN5X_STATUS_LASER_ERROR 

laser is switched on and current is out of range

SEN5X_STATUS_FAN_ERROR 

fan is switched on but the measured fan speed is 0 rpm

Definition at line 82 of file driver_sen5x.h.

◆ sen5x_type_t

sen5x type enumeration definition

Enumerator
SEN50 

sen50

SEN54 

sen54

SEN55 

sen55

Definition at line 63 of file driver_sen5x.h.

Function Documentation

◆ sen50_read()

uint8_t sen50_read ( sen5x_handle_t * handle,
sen50_data_t * output )

read the result

Parameters
[in]*handlepointer to a sen5x handle structure
[out]*outputpointer to a data structure
Returns
status code
  • 0 success
  • 1 read failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 only sen50 can use this function
Note
only sen50 can use this function

Definition at line 602 of file driver_sen5x.c.

◆ sen54_read()

uint8_t sen54_read ( sen5x_handle_t * handle,
sen54_data_t * output )

read the result

Parameters
[in]*handlepointer to a sen5x handle structure
[out]*outputpointer to a data structure
Returns
status code
  • 0 success
  • 1 read failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 only sen54 can use this function
Note
only sen54 can use this function

Definition at line 478 of file driver_sen5x.c.

◆ sen55_read()

uint8_t sen55_read ( sen5x_handle_t * handle,
sen55_data_t * output )

read the result

Parameters
[in]*handlepointer to a sen5x handle structure
[out]*outputpointer to a data structure
Returns
status code
  • 0 success
  • 1 read failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 only sen55 can use this function
Note
only sen55 can use this function

Definition at line 345 of file driver_sen5x.c.

◆ sen5x_clear_device_status()

uint8_t sen5x_clear_device_status ( sen5x_handle_t * handle)

clear the device status

Parameters
[in]*handlepointer to a sen5x handle structure
Returns
status code
  • 0 success
  • 1 clear device status failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2167 of file driver_sen5x.c.

◆ sen5x_deinit()

uint8_t sen5x_deinit ( sen5x_handle_t * handle)

close the chip

Parameters
[in]*handlepointer to a sen5x handle structure
Returns
status code
  • 0 success
  • 1 iic deinit failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 soft reset failed
Note
none

Definition at line 2351 of file driver_sen5x.c.

◆ sen5x_disable_auto_cleaning_interval()

uint8_t sen5x_disable_auto_cleaning_interval ( sen5x_handle_t * handle)

disable the auto cleaning interval

Parameters
[in]*handlepointer to a sen5x handle structure
Returns
status code
  • 0 success
  • 1 disable auto cleaning interval failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1919 of file driver_sen5x.c.

◆ sen5x_get_auto_cleaning_interval()

uint8_t sen5x_get_auto_cleaning_interval ( sen5x_handle_t * handle,
uint32_t * second )

get the auto cleaning interval

Parameters
[in]*handlepointer to a sen5x handle structure
[out]*secondpointer to an interval buffer
Returns
status code
  • 0 success
  • 1 get auto cleaning interval failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1868 of file driver_sen5x.c.

◆ sen5x_get_device_status()

uint8_t sen5x_get_device_status ( sen5x_handle_t * handle,
uint32_t * status )

get the device status

Parameters
[in]*handlepointer to a sen5x handle structure
[out]*statuspointer to a status buffer
Returns
status code
  • 0 success
  • 1 get device status failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2116 of file driver_sen5x.c.

◆ sen5x_get_nox_algorithm_tuning()

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

Parameters
[in]*handlepointer to a sen5x handle structure
[out]*index_offsetpointer to an index offset buffer
[out]*learning_time_offset_hourpointer to a learning time offset hour buffer
[out]*learning_time_gain_hourpointer to a learning time gain hour buffer
[out]*gating_max_duration_minutepointer to a gating max duration minute buffer
[out]*std_initialpointer to a std initial buffer
[out]*gain_factorpointer to a gain factor buffer
Returns
status code
  • 0 success
  • 1 get nox algorithm tuning failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1502 of file driver_sen5x.c.

◆ sen5x_get_product_name()

uint8_t sen5x_get_product_name ( sen5x_handle_t * handle,
char name[32] )

get the product name

Parameters
[in]*handlepointer to a sen5x handle structure
[out]*namepointer to a product name buffer
Returns
status code
  • 0 success
  • 1 get product name failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1964 of file driver_sen5x.c.

◆ sen5x_get_rht_acceleration_mode()

uint8_t sen5x_get_rht_acceleration_mode ( sen5x_handle_t * handle,
sen5x_rht_acceleration_mode_t * mode )

get rht acceleration mode

Parameters
[in]*handlepointer to a sen5x handle structure
[out]*modepointer to a rht acceleration mode buffer
Returns
status code
  • 0 success
  • 1 get rht acceleration mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1626 of file driver_sen5x.c.

◆ sen5x_get_serial_number()

uint8_t sen5x_get_serial_number ( sen5x_handle_t * handle,
char sn[32] )

get the serial number

Parameters
[in]*handlepointer to a sen5x handle structure
[out]*snpointer to a serial number buffer
Returns
status code
  • 0 success
  • 1 get serial number failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2018 of file driver_sen5x.c.

◆ sen5x_get_temperature_compensation()

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

Parameters
[in]*handlepointer to a sen5x handle structure
[out]*temperature_offsetpointer to a temperature offset buffer
[out]*normalized_temperature_offset_slopepointer to a normalized temperature offset slope buffer
[out]*time_constantpointer to a time constant buffer
Returns
status code
  • 0 success
  • 1 get temperature compensation failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 972 of file driver_sen5x.c.

◆ sen5x_get_type()

uint8_t sen5x_get_type ( sen5x_handle_t * handle,
sen5x_type_t * type )

get the chip type

Parameters
[in]*handlepointer to a sen5x handle structure
[out]*typepointer to a chip type buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 2255 of file driver_sen5x.c.

◆ sen5x_get_version()

uint8_t sen5x_get_version ( sen5x_handle_t * handle,
uint8_t * version )

get the version

Parameters
[in]*handlepointer to a sen5x handle structure
[out]*versionpointer to a version buffer
Returns
status code
  • 0 success
  • 1 get version failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2072 of file driver_sen5x.c.

◆ sen5x_get_voc_algorithm_state()

uint8_t sen5x_get_voc_algorithm_state ( sen5x_handle_t * handle,
uint16_t state[4] )

get voc algorithm state

Parameters
[in]*handlepointer to a sen5x handle structure
[out]*statepointer to a state buffer
Returns
status code
  • 0 success
  • 1 get voc algorithm state failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1719 of file driver_sen5x.c.

◆ sen5x_get_voc_algorithm_tuning()

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

Parameters
[in]*handlepointer to a sen5x handle structure
[out]*index_offsetpointer to an index offset buffer
[out]*learning_time_offset_hourpointer to a learning time offset hour buffer
[out]*learning_time_gain_hourpointer to a learning time gain hour buffer
[out]*gating_max_duration_minutepointer to a gating max duration minute buffer
[out]*std_initialpointer to a std initial buffer
[out]*gain_factorpointer to a gain factor buffer
Returns
status code
  • 0 success
  • 1 get voc algorithm tuning failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1306 of file driver_sen5x.c.

◆ sen5x_get_warm_start()

uint8_t sen5x_get_warm_start ( sen5x_handle_t * handle,
uint16_t * param )

get warm start

Parameters
[in]*handlepointer to a sen5x handle structure
[out]*parampointer to a warm start param buffer
Returns
status code
  • 0 success
  • 1 get warm start failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1150 of file driver_sen5x.c.

◆ sen5x_info()

uint8_t sen5x_info ( sen5x_info_t * info)

get chip information

Parameters
[out]*infopointer to a sen5x info structure
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 2445 of file driver_sen5x.c.

◆ sen5x_init()

uint8_t sen5x_init ( sen5x_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to a sen5x handle structure
Returns
status code
  • 0 success
  • 1 iic initialization failed
  • 2 handle is NULL
  • 3 linked functions is NULL
  • 4 reset failed
Note
none

Definition at line 2278 of file driver_sen5x.c.

◆ sen5x_read_data_flag()

uint8_t sen5x_read_data_flag ( sen5x_handle_t * handle,
sen5x_data_ready_flag_t * flag )

read the data flag

Parameters
[in]*handlepointer to a sen5x handle structure
[out]*flagpointer to a data ready flag buffer
Returns
status code
  • 0 success
  • 1 read data flag failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 300 of file driver_sen5x.c.

◆ sen5x_read_pm_value()

uint8_t sen5x_read_pm_value ( sen5x_handle_t * handle,
sen5x_pm_t * pm )

read the pm value

Parameters
[in]*handlepointer to a sen5x handle structure
[out]*pmpointer to a sen5x pm structure
Returns
status code
  • 0 success
  • 1 read failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 698 of file driver_sen5x.c.

◆ sen5x_read_raw_value()

uint8_t sen5x_read_raw_value ( sen5x_handle_t * handle,
sen5x_raw_t * raw )

read raw value

Parameters
[in]*handlepointer to a sen5x handle structure
[out]*rawpointer to a sen5x raw structure
Returns
status code
  • 0 success
  • 1 read failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 sen50 doesn't support this function
Note
sen50 doesn't support this function

Definition at line 810 of file driver_sen5x.c.

◆ sen5x_reset()

uint8_t sen5x_reset ( sen5x_handle_t * handle)

reset the chip

Parameters
[in]*handlepointer to a sen5x handle structure
Returns
status code
  • 0 success
  • 1 reset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2201 of file driver_sen5x.c.

◆ sen5x_set_auto_cleaning_interval()

uint8_t sen5x_set_auto_cleaning_interval ( sen5x_handle_t * handle,
uint32_t second )

set the auto cleaning interval

Parameters
[in]*handlepointer to a sen5x handle structure
[in]secondinterval
Returns
status code
  • 0 success
  • 1 set auto cleaning interval failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 second is invalid
Note
10 <= second <= 604800

Definition at line 1819 of file driver_sen5x.c.

◆ sen5x_set_nox_algorithm_tuning()

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

Parameters
[in]*handlepointer to a sen5x handle structure
[in]index_offsetindex offset
[in]learning_time_offset_hourlearning time offset hour
[in]learning_time_gain_hourlearning time gain hour
[in]gating_max_duration_minutegating max duration minute
[in]std_initialstd initial
[in]gain_factorgain factor
Returns
status code
  • 0 success
  • 1 set nox algorithm tuning failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 param is invalid
Note
1 <= index_offset <= 250 1 <= learning_time_offset_hour <= 1000 learning_time_gain_hour = 12 0 <= gating_max_duration_minute <= 3000 std_initial = 50 1 <= gain_factor <= 1000

Definition at line 1401 of file driver_sen5x.c.

◆ sen5x_set_rht_acceleration_mode()

uint8_t sen5x_set_rht_acceleration_mode ( sen5x_handle_t * handle,
sen5x_rht_acceleration_mode_t mode )

set rht acceleration mode

Parameters
[in]*handlepointer to a sen5x handle structure
[in]moderht acceleration mode
Returns
status code
  • 0 success
  • 1 set rht acceleration mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1586 of file driver_sen5x.c.

◆ sen5x_set_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

Parameters
[in]*handlepointer to a sen5x handle structure
[in]temperature_offsettemperature offset
[in]normalized_temperature_offset_slopenormalized temperature offset slope
[in]time_constanttime constant
Returns
status code
  • 0 success
  • 1 set temperature compensation failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 922 of file driver_sen5x.c.

◆ sen5x_set_type()

uint8_t sen5x_set_type ( sen5x_handle_t * handle,
sen5x_type_t type )

set the chip type

Parameters
[in]*handlepointer to a sen5x handle structure
[in]typechip type
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 2234 of file driver_sen5x.c.

◆ sen5x_set_voc_algorithm_state()

uint8_t sen5x_set_voc_algorithm_state ( sen5x_handle_t * handle,
uint16_t state[4] )

set voc algorithm state

Parameters
[in]*handlepointer to a sen5x handle structure
[in]*statepointer to a state buffer
Returns
status code
  • 0 success
  • 1 set voc algorithm state failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1670 of file driver_sen5x.c.

◆ sen5x_set_voc_algorithm_tuning()

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

Parameters
[in]*handlepointer to a sen5x handle structure
[in]index_offsetindex offset
[in]learning_time_offset_hourlearning time offset hour
[in]learning_time_gain_hourlearning time gain hour
[in]gating_max_duration_minutegating max duration minute
[in]std_initialstd initial
[in]gain_factorgain factor
Returns
status code
  • 0 success
  • 1 set voc algorithm tuning failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 param is invalid
Note
1 <= index_offset <= 250 1 <= learning_time_offset_hour <= 1000 1 <= learning_time_gain_hour <= 1000 0 <= gating_max_duration_minute <= 3000 10 <= std_initial <= 5000 1 <= gain_factor <= 1000

Definition at line 1205 of file driver_sen5x.c.

◆ sen5x_set_warm_start()

uint8_t sen5x_set_warm_start ( sen5x_handle_t * handle,
uint16_t param )

set warm start

Parameters
[in]*handlepointer to a sen5x handle structure
[in]paramwarm start param
Returns
status code
  • 0 success
  • 1 set warm start failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1110 of file driver_sen5x.c.

◆ sen5x_start_fan_cleaning()

uint8_t sen5x_start_fan_cleaning ( sen5x_handle_t * handle)

start the fan cleaning

Parameters
[in]*handlepointer to a sen5x handle structure
Returns
status code
  • 0 success
  • 1 start fan cleaning failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1783 of file driver_sen5x.c.

◆ sen5x_start_measurement()

uint8_t sen5x_start_measurement ( sen5x_handle_t * handle)

start the measurement

Parameters
[in]*handlepointer to a sen5x handle structure
Returns
status code
  • 0 success
  • 1 start measurement failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 189 of file driver_sen5x.c.

◆ sen5x_start_measurement_without_pm()

uint8_t sen5x_start_measurement_without_pm ( sen5x_handle_t * handle)

start the measurement without pm

Parameters
[in]*handlepointer to a sen5x handle structure
Returns
status code
  • 0 success
  • 1 start measurement failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 sen50 doesn't support this function
Note
sen50 doesn't support this function

Definition at line 224 of file driver_sen5x.c.

◆ sen5x_stop_measurement()

uint8_t sen5x_stop_measurement ( sen5x_handle_t * handle)

stop the measurement

Parameters
[in]*handlepointer to a sen5x handle structure
Returns
status code
  • 0 success
  • 1 stop measurement failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 265 of file driver_sen5x.c.

◆ sen5x_temperature_compensation_convert_to_data()

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

Parameters
[in]*handlepointer to a sen5x handle structure
[in]temperature_offset_regtemperature offset register raw data
[in]normalized_temperature_offset_slope_regnormalized temperature offset slope register raw data
[in]time_constant_regtime constant register raw data
[out]*temperature_offset_degreepointer to a temperature offset buffer
[out]*normalized_temperature_offset_slope_factorpointer to a normalized temperature offset slope buffer
[out]*time_constant_secondpointer to a time constant buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1075 of file driver_sen5x.c.

◆ sen5x_temperature_compensation_convert_to_register()

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

Parameters
[in]*handlepointer to a sen5x handle structure
[in]temperature_offset_degreetemperature offset degree
[in]normalized_temperature_offset_slope_factornormalized temperature offset slope factor
[in]time_constant_secondtime constant second
[out]*temperature_offset_regpointer to a temperature offset reg buffer
[out]*normalized_temperature_offset_slope_regpointer to a normalized temperature offset slope reg buffer
[out]*time_constant_regpointer to a time constant reg buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1036 of file driver_sen5x.c.