mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-21 18:22:32 +00:00
RAK Rotary and simple up/down/press button support for Canned Messages
This commit is contained in:
30
src/input/UpDownInterruptBase.h
Normal file
30
src/input/UpDownInterruptBase.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include "SinglePortModule.h" // TODO: what header file to include?
|
||||
#include "InputBroker.h"
|
||||
|
||||
class UpDownInterruptBase :
|
||||
public Observable<const InputEvent *>,
|
||||
private concurrency::OSThread
|
||||
{
|
||||
public:
|
||||
explicit UpDownInterruptBase(
|
||||
const char *name);
|
||||
void init(
|
||||
uint8_t pinDown, uint8_t pinUp, uint8_t pinPress,
|
||||
char eventDown, char eventUp, char eventPressed,
|
||||
void (*onIntDown)(), void (*onIntUp)(), void (*onIntPress)());
|
||||
void intPressHandler();
|
||||
void intDownHandler();
|
||||
void intUpHandler();
|
||||
|
||||
protected:
|
||||
virtual int32_t runOnce() override;
|
||||
private:
|
||||
uint8_t _pinDown = 0;
|
||||
uint8_t _pinUp = 0;
|
||||
char _eventDown = InputEventChar_KEY_NONE;
|
||||
char _eventUp = InputEventChar_KEY_NONE;
|
||||
char _eventPressed = InputEventChar_KEY_NONE;
|
||||
const char *_originName;
|
||||
};
|
||||
Reference in New Issue
Block a user