|
Generalized-Core-Counter 3.20
Particle-based generalized core counter firmware
|
PIR (Passive Infrared) Motion Sensor Implementation. More...
#include <PIRSensor.h>
Public Member Functions | |
| SensorData | getData () const override |
| Get latest sensor reading. | |
| const char * | getSensorType () const override |
| Get sensor type identifier. | |
| bool | isReady () const override |
| Check if sensor is ready. | |
| bool | loop () override |
| Poll the PIR sensor for motion detection. | |
| void | onSleep () override |
| Prepare sensor for deep sleep: detach ISR and power down. | |
| bool | onWake () override |
| Wake sensor from deep sleep: power up and re-attach ISR. | |
| void | reset () override |
| Reset sensor state. | |
| bool | setup () override |
| Initialize the PIR sensor. | |
| bool | usesInterrupt () const override |
| This sensor uses a hardware interrupt for motion events. | |
| Public Member Functions inherited from ISensor | |
| virtual bool | initializeHardware () |
| Initialize underlying hardware after power-on. | |
| virtual bool | isHealthy () const |
| Health check for the sensor. | |
| virtual int | lastErrorCode () const |
| Last sensor-specific error code (if any). | |
| virtual | ~ISensor () |
Static Public Member Functions | |
| static PIRSensor & | instance () |
| Get singleton instance. | |
PIR (Passive Infrared) Motion Sensor Implementation.
This is a placeholder/template for future PIR sensor implementation. PIR sensors detect motion by measuring infrared light radiating from objects.
Typical usage:
Hardware Requirements:
Definition at line 26 of file PIRSensor.h.
|
inlineoverridevirtual |
Get latest sensor reading.
Implements ISensor.
Definition at line 94 of file PIRSensor.h.
|
inlineoverridevirtual |
|
inlinestatic |
Get singleton instance.
Definition at line 31 of file PIRSensor.h.
Referenced by SensorFactory::createSensor().
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Poll the PIR sensor for motion detection.
Implements ISensor.
Definition at line 67 of file PIRSensor.h.
|
inlineoverridevirtual |
Prepare sensor for deep sleep: detach ISR and power down.
Reimplemented from ISensor.
Definition at line 131 of file PIRSensor.h.
References disableModule, intPin, and ledPower.
|
inlineoverridevirtual |
Wake sensor from deep sleep: power up and re-attach ISR.
Reimplemented from ISensor.
Definition at line 146 of file PIRSensor.h.
References disableModule, intPin, and ledPower.
|
inlineoverridevirtual |
Reset sensor state.
Implements ISensor.
Definition at line 115 of file PIRSensor.h.
Referenced by setup().
|
inlineoverridevirtual |
Initialize the PIR sensor.
Implements ISensor.
Definition at line 40 of file PIRSensor.h.
References disableModule, intPin, ledPower, and reset().
|
inlineoverridevirtual |
This sensor uses a hardware interrupt for motion events.
Reimplemented from ISensor.
Definition at line 126 of file PIRSensor.h.