Merge develop into main (#303)
- `DisplayDevice` improvements related `DisplayDriver` - Replaced incorrect usage of `spiBusHandle` with `spiHostDevice` in all SPI display devices - Disabled `DisplayDriver` support for RGB displays for now - Updated `GraphicsDemo` project for the above changes - TactilityC improvements: - created `tt_hal_device_find()` - created `tt_hal_display_*` - created `tt_hal_touch_*` - created `tt_lvgl_*` - export `tt_app_*` calls
This commit is contained in:
committed by
GitHub
parent
d875ade8cb
commit
fbaff8cbac
@@ -58,13 +58,13 @@ bool EspLcdDisplay::startLvgl() {
|
||||
TT_LOG_W(TAG, "DisplayDriver is still in use.");
|
||||
}
|
||||
|
||||
lvglPortDisplayConfig = getLvglPortDisplayConfig(ioHandle, panelHandle);
|
||||
auto lvgl_port_config = getLvglPortDisplayConfig(ioHandle, panelHandle);
|
||||
|
||||
if (isRgbPanel()) {
|
||||
auto rgb_config = getLvglPortDisplayRgbConfig(ioHandle, panelHandle);
|
||||
lvglDisplay = lvgl_port_add_disp_rgb(&lvglPortDisplayConfig, &rgb_config);
|
||||
lvglDisplay = lvgl_port_add_disp_rgb(&lvgl_port_config , &rgb_config);
|
||||
} else {
|
||||
lvglDisplay = lvgl_port_add_disp(&lvglPortDisplayConfig);
|
||||
lvglDisplay = lvgl_port_add_disp(&lvgl_port_config );
|
||||
}
|
||||
|
||||
auto touch_device = getTouchDevice();
|
||||
@@ -90,12 +90,40 @@ bool EspLcdDisplay::stopLvgl() {
|
||||
return true;
|
||||
}
|
||||
|
||||
std::shared_ptr<display::DisplayDriver> EspLcdDisplay::getDisplayDriver() {
|
||||
std::shared_ptr<tt::hal::display::DisplayDriver> EspLcdDisplay::getDisplayDriver() {
|
||||
assert(lvglDisplay == nullptr); // Still attached to LVGL context. Call stopLvgl() first.
|
||||
if (displayDriver == nullptr) {
|
||||
auto lvgl_port_config = getLvglPortDisplayConfig(ioHandle, panelHandle);
|
||||
|
||||
tt::hal::display::ColorFormat color_format;
|
||||
if (lvgl_port_config.color_format == LV_COLOR_FORMAT_I1) {
|
||||
color_format = tt::hal::display::ColorFormat::Monochrome;
|
||||
} else if (lvgl_port_config.color_format == LV_COLOR_FORMAT_RGB565) {
|
||||
if (rgbElementOrder == LCD_RGB_ELEMENT_ORDER_RGB) {
|
||||
if (lvgl_port_config.flags.swap_bytes) {
|
||||
color_format = tt::hal::display::ColorFormat::RGB565Swapped;
|
||||
} else {
|
||||
color_format = tt::hal::display::ColorFormat::RGB565;
|
||||
}
|
||||
} else {
|
||||
if (lvgl_port_config.flags.swap_bytes) {
|
||||
color_format = tt::hal::display::ColorFormat::BGR565Swapped;
|
||||
} else {
|
||||
color_format = tt::hal::display::ColorFormat::BGR565;
|
||||
}
|
||||
}
|
||||
} else if (lvgl_port_config.color_format == LV_COLOR_FORMAT_RGB888) {
|
||||
color_format = tt::hal::display::ColorFormat::RGB888;
|
||||
} else {
|
||||
tt_crash("unsupported driver");
|
||||
}
|
||||
|
||||
displayDriver = std::make_shared<EspLcdDisplayDriver>(
|
||||
panelHandle,
|
||||
lvglPortDisplayConfig
|
||||
lock,
|
||||
lvgl_port_config.hres,
|
||||
lvgl_port_config.vres,
|
||||
color_format
|
||||
);
|
||||
}
|
||||
return displayDriver;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "Tactility/Lock.h"
|
||||
|
||||
#include <Tactility/hal/display/DisplayDevice.h>
|
||||
|
||||
#include <esp_lcd_types.h>
|
||||
@@ -11,8 +13,9 @@ class EspLcdDisplay : tt::hal::display::DisplayDevice {
|
||||
esp_lcd_panel_io_handle_t _Nullable ioHandle = nullptr;
|
||||
esp_lcd_panel_handle_t _Nullable panelHandle = nullptr;
|
||||
lv_display_t* _Nullable lvglDisplay = nullptr;
|
||||
lvgl_port_display_cfg_t _Nullable lvglPortDisplayConfig;
|
||||
std::shared_ptr<tt::hal::display::DisplayDriver> _Nullable displayDriver;
|
||||
std::shared_ptr<tt::Lock> lock;
|
||||
lcd_rgb_element_order_t rgbElementOrder;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -31,8 +34,12 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
EspLcdDisplay(std::shared_ptr<tt::Lock> lock) : lock(lock) {}
|
||||
|
||||
~EspLcdDisplay() override;
|
||||
|
||||
std::shared_ptr<tt::Lock> getLock() const { return lock; }
|
||||
|
||||
bool start() final;
|
||||
|
||||
bool stop() final;
|
||||
|
||||
@@ -1,44 +1,40 @@
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/Mutex.h>
|
||||
#include <Tactility/hal/display/DisplayDriver.h>
|
||||
|
||||
#include <esp_lcd_panel_ops.h>
|
||||
#include <esp_lvgl_port_disp.h>
|
||||
|
||||
using namespace tt::hal;
|
||||
|
||||
class EspLcdDisplayDriver : public display::DisplayDriver {
|
||||
class EspLcdDisplayDriver : public tt::hal::display::DisplayDriver {
|
||||
|
||||
esp_lcd_panel_handle_t panelHandle;
|
||||
const lvgl_port_display_cfg_t& lvglPortDisplayConfig;
|
||||
std::shared_ptr<tt::Lock> lock;
|
||||
uint16_t hRes;
|
||||
uint16_t vRes;
|
||||
tt::hal::display::ColorFormat colorFormat;
|
||||
|
||||
public:
|
||||
|
||||
EspLcdDisplayDriver(
|
||||
esp_lcd_panel_handle_t panelHandle,
|
||||
const lvgl_port_display_cfg_t& lvglPortDisplayConfig
|
||||
) : panelHandle(panelHandle), lvglPortDisplayConfig(lvglPortDisplayConfig) {}
|
||||
std::shared_ptr<tt::Lock> lock,
|
||||
uint16_t hRes,
|
||||
uint16_t vRes,
|
||||
tt::hal::display::ColorFormat colorFormat
|
||||
) : panelHandle(panelHandle), lock(lock), hRes(hRes), vRes(vRes), colorFormat(colorFormat) {}
|
||||
|
||||
display::ColorFormat getColorFormat() const override {
|
||||
using display::ColorFormat;
|
||||
switch (lvglPortDisplayConfig.color_format) {
|
||||
case LV_COLOR_FORMAT_I1:
|
||||
return ColorFormat::Monochrome;
|
||||
case LV_COLOR_FORMAT_RGB565:
|
||||
// swap_bytes is only used for the 565 color format
|
||||
// see lvgl_port_flush_callback() in esp_lvgl_port_disp.c
|
||||
return lvglPortDisplayConfig.flags.swap_bytes ? ColorFormat::BGR565 : ColorFormat::RGB565;
|
||||
case LV_COLOR_FORMAT_RGB888:
|
||||
return ColorFormat::RGB888;
|
||||
default:
|
||||
return ColorFormat::RGB565;
|
||||
}
|
||||
tt::hal::display::ColorFormat getColorFormat() const override {
|
||||
return colorFormat;
|
||||
}
|
||||
|
||||
bool drawBitmap(int xStart, int yStart, int xEnd, int yEnd, const void* pixelData) override {
|
||||
return esp_lcd_panel_draw_bitmap(panelHandle, xStart, yStart, xEnd, yEnd, pixelData) == ESP_OK;
|
||||
bool result = esp_lcd_panel_draw_bitmap(panelHandle, xStart, yStart, xEnd, yEnd, pixelData) == ESP_OK;
|
||||
return result;
|
||||
}
|
||||
|
||||
uint16_t getPixelWidth() const override { return lvglPortDisplayConfig.hres; }
|
||||
uint16_t getPixelWidth() const override { return hRes; }
|
||||
|
||||
uint16_t getPixelHeight() const override { return lvglPortDisplayConfig.vres; }
|
||||
uint16_t getPixelHeight() const override { return vRes; }
|
||||
|
||||
std::shared_ptr<tt::Lock> getLock() const override { return lock; }
|
||||
};
|
||||
|
||||
@@ -9,5 +9,5 @@ bool EspLcdTouchDriver::getTouchedPoints(uint16_t* x, uint16_t* y, uint16_t* _Nu
|
||||
TT_LOG_E(TAG, "Read data failed");
|
||||
return false;
|
||||
}
|
||||
return esp_lcd_touch_get_coordinates(handle, x, y, strength, pointCount, maxPointCount) == ESP_OK;
|
||||
return esp_lcd_touch_get_coordinates(handle, x, y, strength, pointCount, maxPointCount);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ bool Ili934xDisplay::createIoHandle(esp_lcd_panel_io_handle_t& outHandle) {
|
||||
}
|
||||
};
|
||||
|
||||
return esp_lcd_new_panel_io_spi(configuration->spiBusHandle, &panel_io_config, &outHandle) == ESP_OK;
|
||||
return esp_lcd_new_panel_io_spi(configuration->spiHostDevice, &panel_io_config, &outHandle) == ESP_OK;
|
||||
}
|
||||
|
||||
bool Ili934xDisplay::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, esp_lcd_panel_handle_t& panelHandle) {
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include "Tactility/hal/display/DisplayDevice.h"
|
||||
#include <Tactility/hal/display/DisplayDevice.h>
|
||||
#include <Tactility/hal/spi/Spi.h>
|
||||
|
||||
#include <EspLcdDisplay.h>
|
||||
|
||||
#include <driver/spi_common.h>
|
||||
#include <driver/gpio.h>
|
||||
#include <esp_lcd_panel_io.h>
|
||||
#include <esp_lcd_types.h>
|
||||
#include <functional>
|
||||
#include <lvgl.h>
|
||||
|
||||
#include <EspLcdDisplay.h>
|
||||
|
||||
class Ili934xDisplay final : public EspLcdDisplay {
|
||||
|
||||
public:
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
public:
|
||||
|
||||
Configuration(
|
||||
esp_lcd_spi_bus_handle_t spi_bus_handle,
|
||||
spi_host_device_t spiHostDevice,
|
||||
gpio_num_t csPin,
|
||||
gpio_num_t dcPin,
|
||||
unsigned int horizontalResolution,
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
bool invertColor = false,
|
||||
uint32_t bufferSize = 0, // Size in pixel count. 0 means default, which is 1/10 of the screen size,
|
||||
lcd_rgb_element_order_t rgbElementOrder = LCD_RGB_ELEMENT_ORDER_BGR
|
||||
) : spiBusHandle(spi_bus_handle),
|
||||
) : spiHostDevice(spiHostDevice),
|
||||
csPin(csPin),
|
||||
dcPin(dcPin),
|
||||
horizontalResolution(horizontalResolution),
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
esp_lcd_spi_bus_handle_t spiBusHandle;
|
||||
spi_host_device_t spiHostDevice;
|
||||
gpio_num_t csPin;
|
||||
gpio_num_t dcPin;
|
||||
gpio_num_t resetPin = GPIO_NUM_NC;
|
||||
@@ -80,7 +80,10 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
explicit Ili934xDisplay(std::unique_ptr<Configuration> inConfiguration) : configuration(std::move(inConfiguration)) {
|
||||
explicit Ili934xDisplay(std::unique_ptr<Configuration> inConfiguration) :
|
||||
EspLcdDisplay(tt::hal::spi::getLock(inConfiguration->spiHostDevice)),
|
||||
configuration(std::move(inConfiguration)
|
||||
) {
|
||||
assert(configuration != nullptr);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ bool Ili9488Display::createIoHandle(esp_lcd_panel_io_handle_t& outHandle) {
|
||||
}
|
||||
};
|
||||
|
||||
return esp_lcd_new_panel_io_spi(configuration->spiBusHandle, &panel_io_config, &outHandle) == ESP_OK;
|
||||
return esp_lcd_new_panel_io_spi(configuration->spiHostDevice, &panel_io_config, &outHandle) == ESP_OK;
|
||||
}
|
||||
|
||||
bool Ili9488Display::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, esp_lcd_panel_handle_t& panelHandle) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "Tactility/hal/display/DisplayDevice.h"
|
||||
#include <Tactility/hal/display/DisplayDevice.h>
|
||||
#include <Tactility/hal/spi/Spi.h>
|
||||
|
||||
#include <EspLcdDisplay.h>
|
||||
|
||||
@@ -17,7 +18,7 @@ public:
|
||||
public:
|
||||
|
||||
Configuration(
|
||||
esp_lcd_spi_bus_handle_t spi_bus_handle,
|
||||
spi_host_device_t spiHostDevice,
|
||||
gpio_num_t csPin,
|
||||
gpio_num_t dcPin,
|
||||
unsigned int horizontalResolution,
|
||||
@@ -28,7 +29,7 @@ public:
|
||||
bool mirrorY = false,
|
||||
bool invertColor = false,
|
||||
uint32_t bufferSize = 0 // Size in pixel count. 0 means default, which is 1/20 of the screen size
|
||||
) : spiBusHandle(spi_bus_handle),
|
||||
) : spiHostDevice(spiHostDevice),
|
||||
csPin(csPin),
|
||||
dcPin(dcPin),
|
||||
horizontalResolution(horizontalResolution),
|
||||
@@ -44,7 +45,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
esp_lcd_spi_bus_handle_t spiBusHandle;
|
||||
spi_host_device_t spiHostDevice;
|
||||
gpio_num_t csPin;
|
||||
gpio_num_t dcPin;
|
||||
gpio_num_t resetPin = GPIO_NUM_NC;
|
||||
@@ -73,7 +74,10 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
explicit Ili9488Display(std::unique_ptr<Configuration> inConfiguration) : configuration(std::move(inConfiguration)) {
|
||||
explicit Ili9488Display(std::unique_ptr<Configuration> inConfiguration) :
|
||||
EspLcdDisplay(tt::hal::spi::getLock(inConfiguration->spiHostDevice)),
|
||||
configuration(std::move(inConfiguration)
|
||||
) {
|
||||
assert(configuration != nullptr);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,11 @@
|
||||
#include <Tactility/hal/display/DisplayDevice.h>
|
||||
#include <EspLcdDisplayDriver.h>
|
||||
#include <esp_lcd_panel_rgb.h>
|
||||
#include <esp_lvgl_port_disp.h>
|
||||
|
||||
class RgbDisplay final : public display::DisplayDevice {
|
||||
class RgbDisplay final : public tt::hal::display::DisplayDevice {
|
||||
|
||||
std::shared_ptr<tt::Lock> lock = std::make_shared<tt::Mutex>(tt::Mutex::Type::Recursive);
|
||||
|
||||
public:
|
||||
|
||||
@@ -21,7 +24,7 @@ public:
|
||||
|
||||
esp_lcd_rgb_panel_config_t panelConfig;
|
||||
BufferConfiguration bufferConfiguration;
|
||||
std::shared_ptr<touch::TouchDevice> touch;
|
||||
std::shared_ptr<tt::hal::touch::TouchDevice> touch;
|
||||
lv_color_format_t colorFormat;
|
||||
bool swapXY;
|
||||
bool mirrorX;
|
||||
@@ -32,7 +35,7 @@ public:
|
||||
Configuration(
|
||||
esp_lcd_rgb_panel_config_t panelConfig,
|
||||
BufferConfiguration bufferConfiguration,
|
||||
std::shared_ptr<touch::TouchDevice> touch,
|
||||
std::shared_ptr<tt::hal::touch::TouchDevice> touch,
|
||||
lv_color_format_t colorFormat,
|
||||
bool swapXY = false,
|
||||
bool mirrorX = false,
|
||||
@@ -61,7 +64,7 @@ private:
|
||||
std::unique_ptr<Configuration> _Nullable configuration = nullptr;
|
||||
esp_lcd_panel_handle_t _Nullable panelHandle = nullptr;
|
||||
lv_display_t* _Nullable lvglDisplay = nullptr;
|
||||
std::shared_ptr<display::DisplayDriver> _Nullable displayDriver;
|
||||
std::shared_ptr<tt::hal::display::DisplayDriver> _Nullable displayDriver;
|
||||
|
||||
lvgl_port_display_cfg_t getLvglPortDisplayConfig() const;
|
||||
|
||||
@@ -86,7 +89,7 @@ public:
|
||||
|
||||
bool stopLvgl() override;
|
||||
|
||||
std::shared_ptr<touch::TouchDevice> _Nullable getTouchDevice() override { return configuration->touch; }
|
||||
std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable getTouchDevice() override { return configuration->touch; }
|
||||
|
||||
void setBacklightDuty(uint8_t backlightDuty) override {
|
||||
if (configuration->backlightDutyFunction != nullptr) {
|
||||
@@ -98,11 +101,13 @@ public:
|
||||
|
||||
lv_display_t* _Nullable getLvglDisplay() const override { return lvglDisplay; }
|
||||
|
||||
bool supportsDisplayDriver() const override { return true; }
|
||||
// TODO: Fix driver and re-enable
|
||||
bool supportsDisplayDriver() const override { return false; }
|
||||
|
||||
std::shared_ptr<display::DisplayDriver> _Nullable getDisplayDriver() override {
|
||||
std::shared_ptr<tt::hal::display::DisplayDriver> _Nullable getDisplayDriver() override {
|
||||
if (displayDriver == nullptr) {
|
||||
displayDriver = std::make_shared<EspLcdDisplayDriver>(panelHandle, getLvglPortDisplayConfig());
|
||||
auto config = getLvglPortDisplayConfig();
|
||||
displayDriver = std::make_shared<EspLcdDisplayDriver>(panelHandle, lock, config.hres, config.vres, tt::hal::display::ColorFormat::RGB888);
|
||||
}
|
||||
return displayDriver;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ bool St7789Display::createIoHandle(esp_lcd_panel_io_handle_t& outHandle) {
|
||||
}
|
||||
};
|
||||
|
||||
if (esp_lcd_new_panel_io_spi(configuration->spiBusHandle, &panel_io_config, &outHandle) != ESP_OK) {
|
||||
if (esp_lcd_new_panel_io_spi(configuration->spiHostDevice, &panel_io_config, &outHandle) != ESP_OK) {
|
||||
TT_LOG_E(TAG, "Failed to create panel");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "Tactility/hal/spi/Spi.h"
|
||||
|
||||
#include <EspLcdDisplay.h>
|
||||
#include <Tactility/hal/display/DisplayDevice.h>
|
||||
|
||||
@@ -11,6 +13,8 @@
|
||||
|
||||
class St7789Display final : public EspLcdDisplay {
|
||||
|
||||
std::shared_ptr<tt::Lock> lock;
|
||||
|
||||
public:
|
||||
|
||||
class Configuration {
|
||||
@@ -18,7 +22,7 @@ public:
|
||||
public:
|
||||
|
||||
Configuration(
|
||||
esp_lcd_spi_bus_handle_t spi_bus_handle,
|
||||
spi_host_device_t spiHostDevice,
|
||||
gpio_num_t csPin,
|
||||
gpio_num_t dcPin,
|
||||
unsigned int horizontalResolution,
|
||||
@@ -29,7 +33,7 @@ public:
|
||||
bool mirrorY = false,
|
||||
bool invertColor = false,
|
||||
uint32_t bufferSize = 0 // Size in pixel count. 0 means default, which is 1/10 of the screen size
|
||||
) : spiBusHandle(spi_bus_handle),
|
||||
) : spiHostDevice(spiHostDevice),
|
||||
csPin(csPin),
|
||||
dcPin(dcPin),
|
||||
horizontalResolution(horizontalResolution),
|
||||
@@ -46,7 +50,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
esp_lcd_spi_bus_handle_t spiBusHandle;
|
||||
spi_host_device_t spiHostDevice;
|
||||
gpio_num_t csPin;
|
||||
gpio_num_t dcPin;
|
||||
gpio_num_t resetPin = GPIO_NUM_NC;
|
||||
@@ -75,8 +79,12 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
explicit St7789Display(std::unique_ptr<Configuration> inConfiguration) : configuration(std::move(inConfiguration)) {
|
||||
explicit St7789Display(std::unique_ptr<Configuration> inConfiguration) :
|
||||
EspLcdDisplay(tt::hal::spi::getLock(inConfiguration->spiHostDevice)),
|
||||
configuration(std::move(inConfiguration)
|
||||
) {
|
||||
assert(configuration != nullptr);
|
||||
assert(getLock() != nullptr);
|
||||
}
|
||||
|
||||
std::string getName() const override { return "ST7789"; }
|
||||
|
||||
@@ -33,7 +33,7 @@ bool St7796Display::createIoHandle(esp_lcd_panel_io_handle_t& ioHandle) {
|
||||
}
|
||||
};
|
||||
|
||||
return esp_lcd_new_panel_io_spi(configuration->spiBusHandle, &panel_io_config, &ioHandle) == ESP_OK;
|
||||
return esp_lcd_new_panel_io_spi(configuration->spiHostDevice, &panel_io_config, &ioHandle) == ESP_OK;
|
||||
}
|
||||
|
||||
bool St7796Display::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, esp_lcd_panel_handle_t& panelHandle) {
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/hal/display/DisplayDevice.h>
|
||||
#include <Tactility/hal/spi/Spi.h>
|
||||
|
||||
#include <EspLcdDisplay.h>
|
||||
#include <driver/gpio.h>
|
||||
#include <functional>
|
||||
@@ -13,7 +16,7 @@ public:
|
||||
public:
|
||||
|
||||
Configuration(
|
||||
esp_lcd_spi_bus_handle_t spi_bus_handle,
|
||||
spi_host_device_t spiHostDevice,
|
||||
gpio_num_t csPin,
|
||||
gpio_num_t dcPin,
|
||||
unsigned int horizontalResolution,
|
||||
@@ -26,7 +29,7 @@ public:
|
||||
unsigned int gapX = 0,
|
||||
unsigned int gapY = 0,
|
||||
uint32_t bufferSize = 0 // Size in pixel count. 0 means default, which is 1/10 of the screen size
|
||||
) : spiBusHandle(spi_bus_handle),
|
||||
) : spiHostDevice(spiHostDevice),
|
||||
csPin(csPin),
|
||||
dcPin(dcPin),
|
||||
horizontalResolution(horizontalResolution),
|
||||
@@ -44,7 +47,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
esp_lcd_spi_bus_handle_t spiBusHandle;
|
||||
spi_host_device_t spiHostDevice;
|
||||
gpio_num_t csPin;
|
||||
gpio_num_t dcPin;
|
||||
gpio_num_t resetPin = GPIO_NUM_NC;
|
||||
@@ -75,7 +78,10 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
explicit St7796Display(std::unique_ptr<Configuration> inConfiguration) : configuration(std::move(inConfiguration)) {
|
||||
explicit St7796Display(std::unique_ptr<Configuration> inConfiguration) :
|
||||
EspLcdDisplay(tt::hal::spi::getLock(inConfiguration->spiHostDevice)),
|
||||
configuration(std::move(inConfiguration)
|
||||
) {
|
||||
assert(configuration != nullptr);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user