mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
42 lines
1.2 KiB
C++
42 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <esp_lcd_touch.h>
|
|
#include <esp_lcd_types.h>
|
|
#include <lvgl.h>
|
|
#include <Tactility/hal/touch/TouchDevice.h>
|
|
|
|
class EspLcdTouch : public tt::hal::touch::TouchDevice {
|
|
|
|
esp_lcd_touch_config_t config;
|
|
esp_lcd_panel_io_handle_t _Nullable ioHandle = nullptr;
|
|
esp_lcd_touch_handle_t _Nullable touchHandle = nullptr;
|
|
lv_indev_t* _Nullable lvglDevice = nullptr;
|
|
std::shared_ptr<tt::hal::touch::NativeTouch> nativeTouch;
|
|
|
|
protected:
|
|
|
|
esp_lcd_touch_handle_t _Nullable getTouchHandle() const { return touchHandle; }
|
|
|
|
virtual bool createIoHandle(esp_lcd_panel_io_handle_t& ioHandle) = 0;
|
|
|
|
virtual bool createTouchHandle(esp_lcd_panel_io_handle_t ioHandle, const esp_lcd_touch_config_t& configuration, esp_lcd_touch_handle_t& touchHandle) = 0;
|
|
|
|
virtual esp_lcd_touch_config_t createEspLcdTouchConfig() = 0;
|
|
|
|
public:
|
|
|
|
bool start() final;
|
|
|
|
bool stop() final;
|
|
|
|
bool supportsLvgl() const final { return true; }
|
|
|
|
bool startLvgl(lv_display_t* display) final;
|
|
|
|
bool stopLvgl() final;
|
|
|
|
lv_indev_t* _Nullable getLvglIndev() final { return lvglDevice; }
|
|
|
|
std::shared_ptr<tt::hal::touch::NativeTouch> _Nullable getNativeTouch() final;
|
|
};
|