|
Nol.A SDK Library 26.11.2
For IoT System Software Development
|
Asynchronous Plantower PMS3003 particulate sensor. Call begin() and install a callback; keep the UART and driver alive while receiving. More...
#include <PMS3003.hpp>
Public Member Functions | |
| PMS3003 (SerialPort &, int pinSet, int pinReset) | |
| Bind the UART, SET output pin, and RESET output pin. | |
| void | begin () |
| Configure the sensor UART and control pins, then start listening. | |
| void | onReadDone (void(*func)(int32_t pm1_0_CF1, int32_t pm2_5_CF1, int32_t pm10_0_CF1, int32_t pm1_0_Atmosphere, int32_t pm2_5_Atmosphere, int32_t pm10_0_Atmosphere)) |
| Register notification for a complete measurement frame. | |
Protected Member Functions | |
| virtual void | eventSensorDataReceived () |
Protected Attributes | |
| void(* | callback )(int32_t pm1_0_CF1, int32_t pm2_5_CF1, int32_t pm10_0_CF1, int32_t pm1_0_Atmosphere, int32_t pm2_5_Atmosphere, int32_t pm10_0_Atmosphere) = NULL |
| SerialPort & | p |
| const int | pinSet |
| const int | pinReset |
| uint8_t | index = 0 |
| uint8_t | high = 0 |
| uint16_t | checkCode |
Asynchronous Plantower PMS3003 particulate sensor. Call begin() and install a callback; keep the UART and driver alive while receiving.
| void PMS3003::onReadDone | ( | void(* | func )(int32_t pm1_0_CF1, int32_t pm2_5_CF1, int32_t pm10_0_CF1, int32_t pm1_0_Atmosphere, int32_t pm2_5_Atmosphere, int32_t pm10_0_Atmosphere) | ) |
Register notification for a complete measurement frame.
| func | Receives PM1.0, PM2.5, and PM10 mass concentrations in micrograms/m^3 for CF=1 and atmospheric calibration, respectively. All six values are -1 on checksum failure; nullptr disables notification. |