firmware/src/plugins/input/RotaryEncoderInterruptImpl1.h

24 lines
856 B
C
Raw Normal View History

2022-01-09 09:08:31 +00:00
#pragma once
#include "RotaryEncoderInterruptBase.h"
2022-01-11 12:12:04 +00:00
/**
* @brief The idea behind this class to have static methods for the event handlers.
* Check attachInterrupt() at RotaryEncoderInteruptBase.cpp
* Technically you can have as many rotary encoders hardver attached
* to your device as you wish, but you always need to have separate event
* handlers, thus you need to have a RotaryEncoderInterrupt implementation.
*/
2022-01-09 09:08:31 +00:00
class RotaryEncoderInterruptImpl1 :
public RotaryEncoderInterruptBase
{
public:
2022-01-11 12:12:04 +00:00
RotaryEncoderInterruptImpl1();
void init(
2022-01-09 09:08:31 +00:00
uint8_t pinA, uint8_t pinB, uint8_t pinPress,
char eventCw, char eventCcw, char eventPressed);
static void handleIntA();
static void handleIntB();
static void handleIntPressed();
};
extern RotaryEncoderInterruptImpl1 *rotaryEncoderInterruptImpl1;