Generalized-Core-Counter 3.20
Particle-based generalized core counter firmware
Loading...
Searching...
No Matches
SensorDefinitions.h
Go to the documentation of this file.
1// src/SensorDefinitions.h
2#ifndef SENSORDEFINITIONS_H
3#define SENSORDEFINITIONS_H
4
5#include "SensorFactory.h"
6
20
22
23// NOTE: Keep this table in sync with SensorType in SensorFactory.h.
24// Only a subset of sensor types are currently implemented.
25static constexpr SensorDefinition DEFINITIONS[] = {
26 // Vehicle pressure sensor (legacy tire sensor) - LED enable is ACTIVE-HIGH
27 { SensorType::VEHICLE_PRESSURE, "VehiclePressure", true, true },
28
29 // PIR pedestrian sensor (current default) - LED enable is ACTIVE-LOW
30 { SensorType::PIR, "PIR", false, true },
31
32 // Additional sensor types can be added here as they are implemented.
33};
34
40 for (const auto& def : DEFINITIONS) {
41 if (def.type == type) {
42 return &def;
43 }
44 }
45 return nullptr;
46}
47
48} // namespace SensorDefinitions
49
50#endif /* SENSORDEFINITIONS_H */
SensorType
Enumeration of available sensor types (backward-compatible IDs).
@ PIR
Pedestrian Infrared Sensor.
const SensorDefinition * getDefinition(SensorType type)
Lookup helper to get the SensorDefinition for a given SensorType.
Static metadata for each supported sensor type.
bool usesInterrupt
true if sensor uses a hardware interrupt line
bool ledDefaultOn
true if LED should be ON at boot (polarity-specific)
const char * name
Short name for logging / display.
SensorType type
SensorType enum value.