New board: Elecrow CrowPanel Basic 2.8" (#225)
- Implemented Elecrow CrowPanel Basic 2.8" - Change default "invert" setting for ILI934x driver from `true` to `false` - Created `Xpt2046` driver subproject - Refactored unPhone to use new `Xpt2046` driver subproject
This commit is contained in:
committed by
GitHub
parent
0563e42dc9
commit
6e8fbae62b
@@ -1,32 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "Tactility/hal/touch/TouchDevice.h"
|
||||
#include <Tactility/TactilityCore.h>
|
||||
#include <esp_lcd_panel_io_interface.h>
|
||||
#include <esp_lcd_touch.h>
|
||||
#include <memory>
|
||||
#include <Xpt2046Touch.h>
|
||||
|
||||
class UnPhoneTouch : public tt::hal::touch::TouchDevice {
|
||||
extern std::shared_ptr<Xpt2046Touch> touchInstance;
|
||||
|
||||
private:
|
||||
|
||||
static UnPhoneTouch* instance;
|
||||
|
||||
esp_lcd_panel_io_handle_t _Nullable ioHandle = nullptr;
|
||||
esp_lcd_touch_handle_t _Nullable touchHandle = nullptr;
|
||||
lv_indev_t* _Nullable deviceHandle = nullptr;
|
||||
void cleanup();
|
||||
|
||||
public:
|
||||
|
||||
std::string getName() const final { return "XPT2046"; }
|
||||
std::string getDescription() const final { return "I2C touch driver"; }
|
||||
|
||||
bool start(lv_display_t* display) override;
|
||||
bool stop() override;
|
||||
lv_indev_t* _Nullable getLvglIndev() override { return deviceHandle; }
|
||||
|
||||
bool getVBat(float& outputVbat);
|
||||
|
||||
/** Used for accessing getVBat() in Power driver */
|
||||
static UnPhoneTouch* getInstance() { return instance; }
|
||||
};
|
||||
std::shared_ptr<Xpt2046Touch> createTouch();
|
||||
|
||||
Reference in New Issue
Block a user