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)
This commit is contained in:
committed by
GitHub
parent
db6d3b4acb
commit
8115ca4fd9
+5
-7
@@ -1,13 +1,11 @@
|
||||
#include "M5stackCoreS3.h"
|
||||
#include "InitBoot.h"
|
||||
#include "devices/Display.h"
|
||||
#include "devices/SdCard.h"
|
||||
|
||||
#include <Axp2101Power.h>
|
||||
#include <Tactility/lvgl/LvglSync.h>
|
||||
#include <Tactility/hal/Configuration.h>
|
||||
#include <Tactility/hal/uart/Uart.h>
|
||||
|
||||
#define CORES3_TRANSACTION_SIZE (CORES3_LCD_DRAW_BUFFER_SIZE * LV_COLOR_DEPTH / 8)
|
||||
#include <Tactility/lvgl/LvglSync.h>
|
||||
#include <Axp2101Power.h>
|
||||
|
||||
using namespace tt::hal;
|
||||
|
||||
@@ -21,7 +19,7 @@ static DeviceVector createDevices() {
|
||||
};
|
||||
}
|
||||
|
||||
const Configuration m5stack_cores3 = {
|
||||
extern const Configuration hardwareConfiguration = {
|
||||
.initBoot = initBoot,
|
||||
.createDevices = createDevices,
|
||||
.i2c = {
|
||||
@@ -109,7 +107,7 @@ const Configuration m5stack_cores3 = {
|
||||
.data6_io_num = GPIO_NUM_NC,
|
||||
.data7_io_num = GPIO_NUM_NC,
|
||||
.data_io_default_level = false,
|
||||
.max_transfer_sz = CORES3_TRANSACTION_SIZE,
|
||||
.max_transfer_sz = LCD_SPI_TRANSFER_SIZE_LIMIT,
|
||||
.flags = 0,
|
||||
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
|
||||
.intr_flags = 0
|
||||
@@ -1,5 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/hal/Configuration.h>
|
||||
|
||||
extern const tt::hal::Configuration m5stack_cores3;
|
||||
@@ -20,8 +20,8 @@ static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
|
||||
// Note for future changes: Reset pin is 48 and interrupt pin is 47
|
||||
auto configuration = std::make_unique<Ft5x06Touch::Configuration>(
|
||||
I2C_NUM_0,
|
||||
320,
|
||||
240
|
||||
LCD_HORIZONTAL_RESOLUTION,
|
||||
LCD_VERTICAL_RESOLUTION
|
||||
);
|
||||
|
||||
auto touch = std::make_shared<Ft5x06Touch>(std::move(configuration));
|
||||
@@ -29,23 +29,30 @@ static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
|
||||
}
|
||||
|
||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
||||
auto touch = createTouch();
|
||||
Ili934xDisplay::Configuration panel_configuration = {
|
||||
.horizontalResolution = LCD_HORIZONTAL_RESOLUTION,
|
||||
.verticalResolution = LCD_VERTICAL_RESOLUTION,
|
||||
.gapX = 0,
|
||||
.gapY = 0,
|
||||
.swapXY = false,
|
||||
.mirrorX = false,
|
||||
.mirrorY = false,
|
||||
.invertColor = true,
|
||||
.swapBytes = true,
|
||||
.bufferSize = LCD_BUFFER_SIZE,
|
||||
.touch = createTouch(),
|
||||
.backlightDutyFunction = ::setBacklightDuty,
|
||||
.resetPin = GPIO_NUM_NC,
|
||||
.rgbElementOrder = LCD_RGB_ELEMENT_ORDER_BGR
|
||||
};
|
||||
|
||||
auto configuration = std::make_unique<Ili934xDisplay::Configuration>(
|
||||
SPI3_HOST,
|
||||
GPIO_NUM_3,
|
||||
GPIO_NUM_35,
|
||||
320,
|
||||
240,
|
||||
touch,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true
|
||||
);
|
||||
auto spi_configuration = std::make_shared<Ili934xDisplay::SpiConfiguration>(Ili934xDisplay::SpiConfiguration {
|
||||
.spiHostDevice = LCD_SPI_HOST,
|
||||
.csPin = LCD_PIN_CS,
|
||||
.dcPin = LCD_PIN_DC,
|
||||
.pixelClockFrequency = 40'000'000,
|
||||
.transactionQueueDepth = 10
|
||||
});
|
||||
|
||||
configuration->backlightDutyFunction = ::setBacklightDuty;
|
||||
|
||||
auto display = std::make_shared<Ili934xDisplay>(std::move(configuration));
|
||||
return std::reinterpret_pointer_cast<tt::hal::display::DisplayDevice>(display);
|
||||
return std::make_shared<Ili934xDisplay>(panel_configuration, spi_configuration, true);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/hal/display/DisplayDevice.h>
|
||||
#include <driver/gpio.h>
|
||||
#include <driver/spi_common.h>
|
||||
|
||||
// Display
|
||||
#define CORES3_LCD_SPI_HOST SPI3_HOST
|
||||
#define CORES3_LCD_PIN_CS GPIO_NUM_3
|
||||
#define CORES3_LCD_PIN_DC GPIO_NUM_35
|
||||
#define CORES3_LCD_HORIZONTAL_RESOLUTION 320
|
||||
#define CORES3_LCD_VERTICAL_RESOLUTION 240
|
||||
#define CORES3_LCD_DRAW_BUFFER_HEIGHT (CORES3_LCD_VERTICAL_RESOLUTION / 10)
|
||||
#define CORES3_LCD_DRAW_BUFFER_SIZE (CORES3_LCD_HORIZONTAL_RESOLUTION * CORES3_LCD_DRAW_BUFFER_HEIGHT)
|
||||
constexpr auto LCD_SPI_HOST = SPI3_HOST;
|
||||
constexpr auto LCD_PIN_CS = GPIO_NUM_3;
|
||||
constexpr auto LCD_PIN_DC = GPIO_NUM_35;
|
||||
constexpr auto LCD_HORIZONTAL_RESOLUTION = 320;
|
||||
constexpr auto LCD_VERTICAL_RESOLUTION = 240;
|
||||
constexpr auto LCD_BUFFER_HEIGHT = LCD_VERTICAL_RESOLUTION / 10;
|
||||
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