28 lines
494 B
C++
28 lines
494 B
C++
// EncoderHandler.h
|
|
#ifndef EncoderHandler_h
|
|
#define EncoderHandler_h
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include "pico/multicore.h"
|
|
#include "DisplayHandler.h"
|
|
|
|
|
|
class EncoderHandler {
|
|
private:
|
|
|
|
|
|
public:
|
|
EncoderHandler(DisplayHandler* display_handler);
|
|
|
|
DisplayHandler* display_handler;
|
|
uint8_t encoder_pos;
|
|
bool button_pressed;
|
|
uint16_t clk_last_state;
|
|
|
|
void setup();
|
|
static void gpio_callback(uint gpio, uint32_t events);
|
|
void moveCursor(bool dir = 1);
|
|
};
|
|
|
|
#endif
|