24#include "stm32wlxx_hal.h"
124int8_t
sps30_Is(I2C_HandleTypeDef *hi2c, int8_t tryInit);
130HAL_StatusTypeDef
sps30_Init(I2C_HandleTypeDef *hi2c);
136HAL_StatusTypeDef
sps30_On(I2C_HandleTypeDef *hi2c);
142HAL_StatusTypeDef
sps30_Off(I2C_HandleTypeDef *hi2c);
153HAL_StatusTypeDef
sps30_Read(I2C_HandleTypeDef *hi2c);
158HAL_StatusTypeDef
sps30_IsOnOff(I2C_HandleTypeDef *hi2c, uint8_t *onOff);
AQI_Level_t sps30_ClassifyPM25(char **label)
Classify the current PM2.5 mass concentration according to the AQI scale.
sps30_t _bck_sps30Data
Snapshot copy of the last completed SPS30 measurement; used for LoRaWAN transmission.
HAL_StatusTypeDef sps30_Read(I2C_HandleTypeDef *hi2c)
Read data if data is available.
HAL_StatusTypeDef sps30_StartCleaning(I2C_HandleTypeDef *hi2c)
manually start fan for cleaning, runs for about 10s Note: The sensor will be busy cleaning for 10 sec...
void sps30_LogData(char *buf)
log data to buffer
HAL_StatusTypeDef sps30_SetAutoCleanInterval(I2C_HandleTypeDef *hi2c, uint32_t interval_sec)
set interval for auto cleaning
HAL_StatusTypeDef sps30_IsOnOff(I2C_HandleTypeDef *hi2c, uint8_t *onOff)
helper to check if sensor is on or not
HAL_StatusTypeDef sps30_Off(I2C_HandleTypeDef *hi2c)
Turn off laser and fan to stop measurements.
AQI_Level_t
Air Quality Index (AQI) level based on PM2.5 mass concentration. Follows US EPA / WHO PM2....
@ AQI_UNHEALTHY_SENSITIVE
HAL_StatusTypeDef sps30_GetAutoCleanInterval(I2C_HandleTypeDef *hi2c, uint32_t *interval_sec)
interval for auto cleaning
int8_t sps30_Is(I2C_HandleTypeDef *hi2c, int8_t tryInit)
check if SPS30 sensor is present
int8_t sps30_Service(I2C_HandleTypeDef *hi2c)
the sensor need to be cleaning
HAL_StatusTypeDef sps30_Init(I2C_HandleTypeDef *hi2c)
initialization of sensor sps30
HAL_StatusTypeDef sps30_IsDataReady(I2C_HandleTypeDef *hi2c)
Check if data is available.
HAL_StatusTypeDef sps30_On(I2C_HandleTypeDef *hi2c)
Turn on laser and fan to allow measurements.
sps30_t _sps30Data
Live measurement data from the SPS30 sensor; updated by sps30_Read().
Measurement data produced by the SPS30 particulate matter sensor. Populated by sps30_Read(); check Is...
float Typical_particle_size