78 : scheduler{scheduler}, pollInterval{pollInterval}
94 uint32_t detectionThreshold = 1,
95 bool reverted =
false);
114 void periodicPinValueCheck(miosix::GpioPin pin);
117 uint32_t pollInterval;
120 std::map<miosix::GpioPin, PinData, GpioPinCompare> callbacks;
std::function< void(PinTransition)> PinCallback
void resetPinChangesCount(miosix::GpioPin pin)
Resets the changes counter for the specified pin.
PinObserver(TaskScheduler &scheduler, uint32_t pollInterval=20)
Construct a new PinObserver object.
bool registerPinCallback(miosix::GpioPin pin, PinCallback callback, uint32_t detectionThreshold=1, bool reverted=false)
PinData getPinData(miosix::GpioPin pin)
Returns the information for the specified pin.
The Task Scheduler allow to manage simple tasks with a single thread. All the task added must not tak...
This file includes all the types the logdecoder script will decode.
PinTransition
Pin transition.
@ FALLING_EDGE
The pin goes from high to low.
@ RISING_EDGE
The pin goes from low to high.
uint64_t lastStateTimestamp
Timestamp of the last measurement.
uint32_t changesCount
Incremental count of the pin changes.
uint32_t threshold
Number of periods to trigger an event.
bool lastState
The last measured pin state.
bool reverted
Whether to revert the pin state.
std::function< void(PinTransition)> callback
The callback function.
uint32_t periodCount
Number of periods the value was the same.