![]() |
LibDriver SEN5X
|
driver sen5x source file More...
#include "driver_sen5x.h"Go to the source code of this file.
Functions | |
| 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 | |
| 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_set_reg (sen5x_handle_t *handle, uint16_t reg, uint8_t *buf, uint16_t len) |
| set the chip register | |
| uint8_t | sen5x_get_reg (sen5x_handle_t *handle, uint16_t reg, uint8_t *buf, uint16_t len) |
| get the chip register | |
| uint8_t | sen5x_info (sen5x_info_t *info) |
| get chip information | |
driver sen5x source 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.
| Date | Version | Author | Description |
|---|---|---|---|
| 2025/06/15 | 1.0 | Shifeng Li | first upload |
Definition in file driver_sen5x.c.
| #define CHIP_NAME "Sensirion SEN5X" |
| #define DRIVER_VERSION 1000 |
driver version
Definition at line 49 of file driver_sen5x.c.
| #define MANUFACTURER_NAME "Sensirion" |
manufacturer name
Definition at line 43 of file driver_sen5x.c.
| #define MAX_CURRENT 100.0f |
chip max current
Definition at line 46 of file driver_sen5x.c.
| #define SEN5X_ADDRESS (0x69 << 1) |
| #define SEN5X_IIC_COMMAND_CLEAR_DEVICE_STATUS_REG 0xD210U |
clear device status register command
Definition at line 76 of file driver_sen5x.c.
| #define SEN5X_IIC_COMMAND_READ_DATA_READY_FLAG 0x0202U |
read data ready flag command
Definition at line 62 of file driver_sen5x.c.
| #define SEN5X_IIC_COMMAND_READ_DEVICE_STATUS_REG 0xD206U |
read device status register command
Definition at line 75 of file driver_sen5x.c.
| #define SEN5X_IIC_COMMAND_READ_MEASURED_PM_VALUES 0x0413U |
read measured pm values command
Definition at line 78 of file driver_sen5x.c.
| #define SEN5X_IIC_COMMAND_READ_MEASURED_RAW_VALUES 0x03D2U |
read measured raw values command
Definition at line 79 of file driver_sen5x.c.
| #define SEN5X_IIC_COMMAND_READ_MEASURED_VALUES 0x03C4U |
read measured values command
Definition at line 63 of file driver_sen5x.c.
| #define SEN5X_IIC_COMMAND_READ_PRODUCT_NAME 0xD014U |
read product name command
Definition at line 72 of file driver_sen5x.c.
| #define SEN5X_IIC_COMMAND_READ_SERIAL_NUMBER 0xD033U |
read serial number command
Definition at line 73 of file driver_sen5x.c.
| #define SEN5X_IIC_COMMAND_READ_VERSION 0xD100U |
read version command
Definition at line 74 of file driver_sen5x.c.
| #define SEN5X_IIC_COMMAND_READ_WRITE_AUTO_CLEANING_INTERVAL 0x8004U |
read/write auto cleaning interval command
Definition at line 71 of file driver_sen5x.c.
| #define SEN5X_IIC_COMMAND_READ_WRITE_NOX_ALG_TUNING_PARAMS 0x60E1U |
read/write nox algorithm tuning parameters command
Definition at line 67 of file driver_sen5x.c.
| #define SEN5X_IIC_COMMAND_READ_WRITE_RHT_ACC_MODE 0x60F7U |
read/write data and parameters command
Definition at line 68 of file driver_sen5x.c.
| #define SEN5X_IIC_COMMAND_READ_WRITE_TEMPERATURE_COMPENSATION 0x60B2U |
read/write temperature compensation parameters command
Definition at line 64 of file driver_sen5x.c.
| #define SEN5X_IIC_COMMAND_READ_WRITE_VOC_ALG_STATE 0x6181U |
read/write voc algorithm state command
Definition at line 69 of file driver_sen5x.c.
| #define SEN5X_IIC_COMMAND_READ_WRITE_VOC_ALG_TUNING_PARAMS 0x60D0U |
read/write voc algorithm tuning parameters command
Definition at line 66 of file driver_sen5x.c.
| #define SEN5X_IIC_COMMAND_READ_WRITE_WARM_START_PARAMS 0x60C6U |
read/write warm start parameters command
Definition at line 65 of file driver_sen5x.c.
| #define SEN5X_IIC_COMMAND_RESET 0xD304U |
reset command
Definition at line 77 of file driver_sen5x.c.
| #define SEN5X_IIC_COMMAND_START_FAN_CLEANING 0x5607U |
start fan cleaning command
Definition at line 70 of file driver_sen5x.c.
| #define SEN5X_IIC_COMMAND_START_MEASUREMENT 0x0021U |
| #define SEN5X_IIC_COMMAND_START_MEASUREMENT_IN_RHT_GAS_ONLY 0x0037U |
start measurement in rht/gas-only measurement mode command
Definition at line 60 of file driver_sen5x.c.
| #define SEN5X_IIC_COMMAND_STOP_MEASUREMENT 0x0104U |
stop measurement command
Definition at line 61 of file driver_sen5x.c.
| #define SUPPLY_VOLTAGE_MAX 5.50f |
chip max supply voltage
Definition at line 45 of file driver_sen5x.c.
| #define SUPPLY_VOLTAGE_MIN 4.50f |
chip min supply voltage
Definition at line 44 of file driver_sen5x.c.
| #define TEMPERATURE_MAX 60.0f |
chip max operating temperature
Definition at line 48 of file driver_sen5x.c.
| #define TEMPERATURE_MIN -10.0f |
chip min operating temperature
Definition at line 47 of file driver_sen5x.c.