Tactility/Drivers/ILI934x/Source/Ili934xDisplay.h
Ken Van Hoeylandt 8115ca4fd9
Merge develop into main (#392)
- Refactor `Ili934xDisplay` to use `EspLcdSpiDisplay` as base class
- Update `St7789Display` for changes to `EspLcdDisplayV2` related to ILI934x driver
- Updated all board driver implementations for ILI934x driver changes
- Simplified board configurations:
  - All boards now have a `Configuration.cpp`
  - All board config's headers are removed
  - Removed `Boards.h`
- Fix for untar-ing large files
- Increase main task stack size to avoid stackoverflow when downloading apps in App Hub
- Reduce SPI frequency for ST7789 displays (according to spec)
2025-10-26 23:26:28 +01:00

56 lines
1.7 KiB
C++

#pragma once
#include <EspLcdSpiDisplay.h>
#include <driver/gpio.h>
#include <functional>
#include <lvgl.h>
class Ili934xDisplay final : public EspLcdSpiDisplay {
std::shared_ptr<tt::Lock> lock;
public:
/** Minimal set of overrides for EspLcdConfiguration */
struct Configuration {
unsigned int horizontalResolution;
unsigned int verticalResolution;
int gapX;
int gapY;
bool swapXY;
bool mirrorX;
bool mirrorY;
bool invertColor;
bool swapBytes;
uint32_t bufferSize; // Pixel count, not byte count. Set to 0 for default (1/10th of display size)
std::shared_ptr<tt::hal::touch::TouchDevice> touch;
std::function<void(uint8_t)> _Nullable backlightDutyFunction;
gpio_num_t resetPin;
lcd_rgb_element_order_t rgbElementOrder;
};
private:
static std::shared_ptr<EspLcdConfiguration> createEspLcdConfiguration(const Configuration& configuration);
esp_lcd_panel_dev_config_t createPanelConfig(std::shared_ptr<EspLcdConfiguration> espLcdConfiguration, gpio_num_t resetPin) override;
bool createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, const esp_lcd_panel_dev_config_t& panelConfig, esp_lcd_panel_handle_t& panelHandle) override;
public:
explicit Ili934xDisplay(const Configuration& configuration, const std::shared_ptr<SpiConfiguration>& spiConfiguration, bool hasGammaCurves) :
EspLcdSpiDisplay(
createEspLcdConfiguration(configuration),
spiConfiguration,
(hasGammaCurves ? 4 : 0)
)
{
}
std::string getName() const override { return "ILI934x"; }
std::string getDescription() const override { return "ILI934x display"; }
};