Merge develop into main (#391)
## Improvements - Created new base driver classes: `EspLcdDisplayV2' and `EspLcdSpiDisplay` - Updated `St7789Display` to implement `EspLcdSpiDisplay` - Updated all boards with ST7789 display ## Fixes - Ensure that `tmp/` is created on startup (for all writeable filesystems) - Fix for `lv_list` padding on small screen devices - Fix for `PreferencesEsp` not processing result when writing string to NVS ## Other - Remove unused build scripts
This commit is contained in:
committed by
GitHub
parent
37420db000
commit
db6d3b4acb
@@ -5,15 +5,9 @@
|
||||
|
||||
#include <Tactility/lvgl/LvglSync.h>
|
||||
|
||||
#define SPI_TRANSFER_SIZE_LIMIT (LCD_DRAW_BUFFER_SIZE * LV_COLOR_DEPTH / 8)
|
||||
|
||||
using namespace tt::hal;
|
||||
|
||||
constexpr auto* TAG = "StickCPlus";
|
||||
|
||||
bool initBoot() {
|
||||
TT_LOG_I(TAG, "initBoot");
|
||||
|
||||
// CH552 applies 4 V to GPIO 0, which reduces Wi-Fi sensitivity
|
||||
// Setting output to high adds a bias of 3.3 V and suppresses over-voltage:
|
||||
gpio::configure(0, gpio::Mode::Output, false, false);
|
||||
@@ -85,7 +79,7 @@ extern const Configuration m5stack_stickc_plus = {
|
||||
.data6_io_num = GPIO_NUM_NC,
|
||||
.data7_io_num = GPIO_NUM_NC,
|
||||
.data_io_default_level = false,
|
||||
.max_transfer_sz = SPI_TRANSFER_SIZE_LIMIT,
|
||||
.max_transfer_sz = LCD_SPI_TRANSFER_SIZE_LIMIT,
|
||||
.flags = 0,
|
||||
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
|
||||
.intr_flags = 0
|
||||
|
||||
@@ -38,26 +38,28 @@ static void setBrightness(uint8_t brightness) {
|
||||
}
|
||||
|
||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
||||
auto configuration = std::make_unique<St7789Display::Configuration>(
|
||||
LCD_SPI_HOST,
|
||||
LCD_PIN_CS,
|
||||
LCD_PIN_DC,
|
||||
LCD_HORIZONTAL_RESOLUTION,
|
||||
LCD_VERTICAL_RESOLUTION,
|
||||
nullptr,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
LCD_DRAW_BUFFER_SIZE,
|
||||
52,
|
||||
40
|
||||
);
|
||||
St7789Display::Configuration panel_configuration = {
|
||||
.horizontalResolution = LCD_HORIZONTAL_RESOLUTION,
|
||||
.verticalResolution = LCD_VERTICAL_RESOLUTION,
|
||||
.gapX = 52,
|
||||
.gapY = 40,
|
||||
.swapXY = false,
|
||||
.mirrorX = false,
|
||||
.mirrorY = false,
|
||||
.invertColor = true,
|
||||
.bufferSize = LCD_BUFFER_SIZE,
|
||||
.touch = nullptr,
|
||||
.backlightDutyFunction = setBrightness,
|
||||
.resetPin = LCD_PIN_RESET
|
||||
};
|
||||
|
||||
configuration->pixelClockFrequency = 40'000'000;
|
||||
configuration->resetPin = LCD_PIN_RESET;
|
||||
auto spi_configuration = std::make_shared<St7789Display::SpiConfiguration>(St7789Display::SpiConfiguration {
|
||||
.spiHostDevice = LCD_SPI_HOST,
|
||||
.csPin = LCD_PIN_CS,
|
||||
.dcPin = LCD_PIN_DC,
|
||||
.pixelClockFrequency = 40'000'000,
|
||||
.transactionQueueDepth = 10
|
||||
});
|
||||
|
||||
configuration->backlightDutyFunction = setBrightness;
|
||||
const auto display = std::make_shared<St7789Display>(std::move(configuration));
|
||||
return std::reinterpret_pointer_cast<tt::hal::display::DisplayDevice>(display);
|
||||
return std::make_shared<St7789Display>(panel_configuration, spi_configuration);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include "Tactility/hal/display/DisplayDevice.h"
|
||||
#include <Tactility/hal/display/DisplayDevice.h>
|
||||
#include <memory>
|
||||
#include <driver/gpio.h>
|
||||
#include <driver/spi_common.h>
|
||||
|
||||
#define LCD_SPI_HOST SPI2_HOST
|
||||
#define LCD_PIN_CS GPIO_NUM_5
|
||||
#define LCD_PIN_DC GPIO_NUM_23
|
||||
#define LCD_PIN_RESET GPIO_NUM_18
|
||||
#define LCD_HORIZONTAL_RESOLUTION 135
|
||||
#define LCD_VERTICAL_RESOLUTION 240
|
||||
#define LCD_DRAW_BUFFER_HEIGHT (LCD_VERTICAL_RESOLUTION / 3)
|
||||
#define LCD_DRAW_BUFFER_SIZE (LCD_HORIZONTAL_RESOLUTION * LCD_DRAW_BUFFER_HEIGHT)
|
||||
constexpr auto LCD_SPI_HOST = SPI2_HOST;
|
||||
constexpr auto LCD_PIN_CS = GPIO_NUM_5;
|
||||
constexpr auto LCD_PIN_DC = GPIO_NUM_23;
|
||||
constexpr auto LCD_PIN_RESET = GPIO_NUM_18;
|
||||
constexpr auto LCD_HORIZONTAL_RESOLUTION = 135;
|
||||
constexpr auto LCD_VERTICAL_RESOLUTION = 240;
|
||||
constexpr auto LCD_BUFFER_HEIGHT = LCD_VERTICAL_RESOLUTION / 3;
|
||||
constexpr auto LCD_BUFFER_SIZE = LCD_HORIZONTAL_RESOLUTION * LCD_BUFFER_HEIGHT;
|
||||
constexpr auto LCD_SPI_TRANSFER_SIZE_LIMIT = LCD_BUFFER_SIZE * LV_COLOR_DEPTH / 8;
|
||||
|
||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();
|
||||
|
||||
Reference in New Issue
Block a user