2025-08-26 16:35:25 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
2025-09-14 20:17:24 +02:00
|
|
|
// This is a version of RotaryEncoder which is based on a debounce inherent FSM table (see RotaryEncoder library)
|
2025-08-26 16:35:25 +02:00
|
|
|
|
|
|
|
|
#include "InputBroker.h"
|
|
|
|
|
#include "concurrency/OSThread.h"
|
|
|
|
|
#include "mesh/NodeDB.h"
|
|
|
|
|
|
|
|
|
|
class RotaryEncoder;
|
|
|
|
|
|
2025-09-21 03:23:16 +02:00
|
|
|
class RotaryEncoderImpl : public InputPollable
|
2025-08-26 16:35:25 +02:00
|
|
|
{
|
|
|
|
|
public:
|
2025-09-21 03:23:16 +02:00
|
|
|
RotaryEncoderImpl();
|
2025-08-26 16:35:25 +02:00
|
|
|
bool init(void);
|
2025-09-19 22:05:18 +02:00
|
|
|
virtual void pollOnce() override;
|
2025-08-26 16:35:25 +02:00
|
|
|
|
|
|
|
|
protected:
|
2025-09-21 03:23:16 +02:00
|
|
|
static RotaryEncoderImpl *interruptInstance;
|
2025-09-12 05:53:35 +02:00
|
|
|
|
2025-08-26 16:35:25 +02:00
|
|
|
input_broker_event eventCw = INPUT_BROKER_NONE;
|
|
|
|
|
input_broker_event eventCcw = INPUT_BROKER_NONE;
|
|
|
|
|
input_broker_event eventPressed = INPUT_BROKER_NONE;
|
|
|
|
|
|
|
|
|
|
RotaryEncoder *rotary;
|
|
|
|
|
};
|
|
|
|
|
|
2025-09-21 03:23:16 +02:00
|
|
|
extern RotaryEncoderImpl *rotaryEncoderImpl;
|