mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 10:53:17 +00:00
* **New Features** * Added a standalone LVGL module and enabled LVGL support in the simulator for richer local UI testing. * **Refactor** * HAL and LVGL split into distinct modules; startup and device attach/detach flows reorganized for clearer lifecycle management. * Public APIs tightened with clearer nullability/documentation. * **Bug Fixes** * More consistent LVGL start/stop and device attach/detach behavior for improved stability.
31 lines
798 B
C++
31 lines
798 B
C++
#pragma once
|
|
|
|
#include <Tactility/hal/encoder/EncoderDevice.h>
|
|
#include <driver/pulse_cnt.h>
|
|
|
|
class TpagerEncoder final : public tt::hal::encoder::EncoderDevice {
|
|
|
|
lv_indev_t* encHandle = nullptr;
|
|
pcnt_unit_handle_t encPcntUnit = nullptr;
|
|
|
|
bool initEncoder();
|
|
bool deinitEncoder();
|
|
|
|
static void readCallback(lv_indev_t* indev, lv_indev_data_t* data);
|
|
|
|
public:
|
|
|
|
TpagerEncoder() {}
|
|
~TpagerEncoder() override {}
|
|
|
|
std::string getName() const override { return "T-Lora Pager Encoder"; }
|
|
std::string getDescription() const override { return "The encoder wheel next to the display"; }
|
|
|
|
bool startLvgl(lv_display_t* display) override;
|
|
bool stopLvgl() override;
|
|
|
|
int getEncoderPulses() const;
|
|
|
|
lv_indev_t* getLvglIndev() override { return encHandle; }
|
|
};
|