![]() |
LibDriver SPS30
1.0.0
SPS30 full-featured driver
|
driver sps30 source file More...
#include "driver_sps30.h"
Go to the source code of this file.
Functions | |
uint8_t | sps30_set_interface (sps30_handle_t *handle, sps30_interface_t interface) |
set the chip interface More... | |
uint8_t | sps30_get_interface (sps30_handle_t *handle, sps30_interface_t *interface) |
get the chip interface More... | |
uint8_t | sps30_start_measurement (sps30_handle_t *handle, sps30_format_t format) |
start the measurement More... | |
uint8_t | sps30_stop_measurement (sps30_handle_t *handle) |
stop the measurement More... | |
uint8_t | sps30_read_data_flag (sps30_handle_t *handle, sps30_data_ready_flag_t *flag) |
read the data read flag More... | |
uint8_t | sps30_sleep (sps30_handle_t *handle) |
enter the sleep mode More... | |
uint8_t | sps30_wake_up (sps30_handle_t *handle) |
wake up the chip More... | |
uint8_t | sps30_start_fan_cleaning (sps30_handle_t *handle) |
start the fan cleaning More... | |
uint8_t | sps30_set_auto_cleaning_interval (sps30_handle_t *handle, uint32_t second) |
set the auto cleaning interval More... | |
uint8_t | sps30_get_auto_cleaning_interval (sps30_handle_t *handle, uint32_t *second) |
get the auto cleaning interval More... | |
uint8_t | sps30_disable_auto_cleaning_interval (sps30_handle_t *handle) |
disable the auto cleaning interval More... | |
uint8_t | sps30_get_product_type (sps30_handle_t *handle, char type[9]) |
get the product type More... | |
uint8_t | sps30_get_serial_number (sps30_handle_t *handle, char sn[17]) |
get the serial number More... | |
uint8_t | sps30_get_version (sps30_handle_t *handle, uint8_t *major, uint8_t *minor) |
get the version More... | |
uint8_t | sps30_get_device_status (sps30_handle_t *handle, uint32_t *status) |
get the device status More... | |
uint8_t | sps30_clear_device_status (sps30_handle_t *handle) |
clear the device status More... | |
uint8_t | sps30_reset (sps30_handle_t *handle) |
reset the chip More... | |
uint8_t | sps30_read (sps30_handle_t *handle, sps30_pm_t *pm) |
read the result More... | |
uint8_t | sps30_init (sps30_handle_t *handle) |
initialize the chip More... | |
uint8_t | sps30_deinit (sps30_handle_t *handle) |
close the chip More... | |
uint8_t | sps30_set_get_reg_uart (sps30_handle_t *handle, uint8_t *input, uint16_t in_len, uint8_t *output, uint16_t out_len) |
set and get the chip register with uart interface More... | |
uint8_t | sps30_set_reg_iic (sps30_handle_t *handle, uint16_t reg, uint8_t *buf, uint16_t len) |
set the chip register with iic interface More... | |
uint8_t | sps30_get_reg_iic (sps30_handle_t *handle, uint16_t reg, uint8_t *buf, uint16_t len) |
get the chip register with iic interface More... | |
uint8_t | sps30_info (sps30_info_t *info) |
get chip information More... | |
driver sps30 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 |
---|---|---|---|
2021/07/25 | 1.0 | Shifeng Li | first upload |
Definition in file driver_sps30.c.
#define CHIP_NAME "Sensirion SPS30" |
#define DRIVER_VERSION 1000 |
driver version
Definition at line 49 of file driver_sps30.c.
#define MANUFACTURER_NAME "Sensirion" |
manufacturer name
Definition at line 43 of file driver_sps30.c.
#define MAX_CURRENT 80.0f |
chip max current
Definition at line 46 of file driver_sps30.c.
#define SPS30_ADDRESS (0x69 << 1) |
#define SPS30_IIC_COMMAND_CLEAR_DEVICE_STATUS_REG 0xD210U |
clear device status register command
Definition at line 71 of file driver_sps30.c.
#define SPS30_IIC_COMMAND_READ_DATA_READY_FLAG 0x0202U |
read data ready flag command
Definition at line 61 of file driver_sps30.c.
#define SPS30_IIC_COMMAND_READ_DEVICE_STATUS_REG 0xD206U |
read device status register command
Definition at line 70 of file driver_sps30.c.
#define SPS30_IIC_COMMAND_READ_MEASURED_VALUES 0x0300U |
read measured values command
Definition at line 62 of file driver_sps30.c.
#define SPS30_IIC_COMMAND_READ_PRODUCT_TYPE 0xD002U |
read product type command
Definition at line 67 of file driver_sps30.c.
#define SPS30_IIC_COMMAND_READ_SERIAL_NUMBER 0xD033U |
read serial number command
Definition at line 68 of file driver_sps30.c.
#define SPS30_IIC_COMMAND_READ_VERSION 0xD100U |
read version command
Definition at line 69 of file driver_sps30.c.
#define SPS30_IIC_COMMAND_READ_WRITE_AUTO_CLEANING_INTERVAL 0x8004U |
read/write auto cleaning interval command
Definition at line 66 of file driver_sps30.c.
#define SPS30_IIC_COMMAND_RESET 0xD304U |
reset command
Definition at line 72 of file driver_sps30.c.
#define SPS30_IIC_COMMAND_SLEEP 0x1001U |
sleep command
Definition at line 63 of file driver_sps30.c.
#define SPS30_IIC_COMMAND_START_FAN_CLEANING 0x5607U |
start fan cleaning command
Definition at line 65 of file driver_sps30.c.
#define SPS30_IIC_COMMAND_START_MEASUREMENT 0x0010U |
#define SPS30_IIC_COMMAND_STOP_MEASUREMENT 0x0104U |
stop measurement command
Definition at line 60 of file driver_sps30.c.
#define SPS30_IIC_COMMAND_WAKE_UP 0x1103U |
wake up command
Definition at line 64 of file driver_sps30.c.
#define SPS30_UART_COMMAND_READ_DEVICE_STATUS_REG 0xD2 |
read device status register command
Definition at line 82 of file driver_sps30.c.
#define SPS30_UART_COMMAND_READ_MEASURED_VALUES 0x03 |
read measured values command
Definition at line 75 of file driver_sps30.c.
#define SPS30_UART_COMMAND_READ_PRODUCT_TYPE 0xD0 |
read product type command
Definition at line 80 of file driver_sps30.c.
#define SPS30_UART_COMMAND_READ_VERSION 0xD1 |
read version command
Definition at line 81 of file driver_sps30.c.
#define SPS30_UART_COMMAND_READ_WRITE_AUTO_CLEANING_INTERVAL 0x80 |
read/write auto cleaning interval command
Definition at line 79 of file driver_sps30.c.
#define SPS30_UART_COMMAND_RESET 0xD3 |
reset command
Definition at line 83 of file driver_sps30.c.
#define SPS30_UART_COMMAND_SLEEP 0x10 |
sleep command
Definition at line 76 of file driver_sps30.c.
#define SPS30_UART_COMMAND_START_FAN_CLEANING 0x56 |
start fan cleaning command
Definition at line 78 of file driver_sps30.c.
#define SPS30_UART_COMMAND_START_MEASUREMENT 0x00 |
start measurement command
Definition at line 73 of file driver_sps30.c.
#define SPS30_UART_COMMAND_STOP_MEASUREMENT 0x01 |
stop measurement command
Definition at line 74 of file driver_sps30.c.
#define SPS30_UART_COMMAND_WAKE_UP 0x11 |
wake up command
Definition at line 77 of file driver_sps30.c.
#define SUPPLY_VOLTAGE_MAX 5.50f |
chip max supply voltage
Definition at line 45 of file driver_sps30.c.
#define SUPPLY_VOLTAGE_MIN 4.50f |
chip min supply voltage
Definition at line 44 of file driver_sps30.c.
#define TEMPERATURE_MAX 60.0f |
chip max operating temperature
Definition at line 48 of file driver_sps30.c.
#define TEMPERATURE_MIN -10.0f |
chip min operating temperature
Definition at line 47 of file driver_sps30.c.