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:
Ken Van Hoeylandt
2025-10-26 23:26:28 +01:00
committed by GitHub
parent db6d3b4acb
commit 8115ca4fd9
126 changed files with 562 additions and 905 deletions
@@ -1,6 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
// Capacitive touch version of the 2.4" yellow board
extern const tt::hal::Configuration cyd_2432s024c_config;
@@ -1,14 +1,22 @@
#include "CYD2432S024C.h"
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
#include <PwmBacklight.h>
#define CYD_SPI_TRANSFER_SIZE_LIMIT (TWODOTFOUR_LCD_DRAW_BUFFER_SIZE * LV_COLOR_DEPTH / 8)
static bool initBoot() {
return driver::pwmbacklight::init(TWODOTFOUR_LCD_PIN_BACKLIGHT);
// Set the RGB LED Pins to output and turn them off
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT)); // Red
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_16, GPIO_MODE_OUTPUT)); // Green
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_17, GPIO_MODE_OUTPUT)); // Blue
// 0 on, 1 off
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_4, 1)); // Red
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_16, 1)); // Green
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_17, 1)); // Blue
return driver::pwmbacklight::init(LCD_PIN_BACKLIGHT);
}
static tt::hal::DeviceVector createDevices() {
@@ -18,7 +26,7 @@ static tt::hal::DeviceVector createDevices() {
};
}
const tt::hal::Configuration cyd_2432s024c_config = {
extern const tt::hal::Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices,
.i2c = {
@@ -72,7 +80,7 @@ const tt::hal::Configuration cyd_2432s024c_config = {
.data6_io_num = GPIO_NUM_NC,
.data7_io_num = GPIO_NUM_NC,
.data_io_default_level = false,
.max_transfer_sz = CYD_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
+24 -15
View File
@@ -16,21 +16,30 @@ static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
}
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
Ili934xDisplay::Configuration panel_configuration = {
.horizontalResolution = LCD_HORIZONTAL_RESOLUTION,
.verticalResolution = LCD_VERTICAL_RESOLUTION,
.gapX = 0,
.gapY = 0,
.swapXY = false,
.mirrorX = true,
.mirrorY = false,
.invertColor = false,
.swapBytes = true,
.bufferSize = LCD_BUFFER_SIZE,
.touch = createTouch(),
.backlightDutyFunction = driver::pwmbacklight::setBacklightDuty,
.resetPin = GPIO_NUM_NC,
.rgbElementOrder = LCD_RGB_ELEMENT_ORDER_BGR
};
auto touch = createTouch();
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
});
auto configuration = std::make_unique<Ili934xDisplay::Configuration>(
TWODOTFOUR_LCD_SPI_HOST,
TWODOTFOUR_LCD_PIN_CS,
TWODOTFOUR_LCD_PIN_DC,
TWODOTFOUR_LCD_HORIZONTAL_RESOLUTION,
TWODOTFOUR_LCD_VERTICAL_RESOLUTION,
touch
);
configuration->mirrorX = true;
configuration->backlightDutyFunction = driver::pwmbacklight::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);
}
+12 -10
View File
@@ -1,17 +1,19 @@
#pragma once
#include "Tactility/hal/display/DisplayDevice.h"
#include <Tactility/hal/display/DisplayDevice.h>
#include <driver/gpio.h>
#include <driver/spi_common.h>
#include <memory>
#define TWODOTFOUR_LCD_PIN_BACKLIGHT GPIO_NUM_27
// Display
#define TWODOTFOUR_LCD_SPI_HOST SPI2_HOST
#define TWODOTFOUR_LCD_HORIZONTAL_RESOLUTION 240
#define TWODOTFOUR_LCD_VERTICAL_RESOLUTION 320
#define TWODOTFOUR_LCD_DRAW_BUFFER_HEIGHT (TWODOTFOUR_LCD_VERTICAL_RESOLUTION / 10)
#define TWODOTFOUR_LCD_DRAW_BUFFER_SIZE (TWODOTFOUR_LCD_HORIZONTAL_RESOLUTION * TWODOTFOUR_LCD_DRAW_BUFFER_HEIGHT)
#define TWODOTFOUR_LCD_PIN_CS GPIO_NUM_15
#define TWODOTFOUR_LCD_PIN_DC GPIO_NUM_2
constexpr auto LCD_PIN_BACKLIGHT = GPIO_NUM_27;
constexpr auto LCD_SPI_HOST = SPI2_HOST;
constexpr auto LCD_PIN_CS = GPIO_NUM_15;
constexpr auto LCD_PIN_DC = GPIO_NUM_2;
constexpr auto LCD_HORIZONTAL_RESOLUTION = 240;
constexpr auto LCD_VERTICAL_RESOLUTION = 320;
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();
@@ -1,6 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
// Resistive touch version of the 2.8" yellow board
extern const tt::hal::Configuration cyd_2432s028r_config;
@@ -1,22 +1,22 @@
#include "CYD2432S028RV3.h"
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
#include <PwmBacklight.h>
#include <Tactility/hal/Configuration.h>
using namespace tt::hal;
static bool initBoot() {
// Set the RGB LED Pins to output and turn them off
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT)); //Red
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_16, GPIO_MODE_OUTPUT)); //Green
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_17, GPIO_MODE_OUTPUT)); //Blue
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT)); // Red
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_16, GPIO_MODE_OUTPUT)); // Green
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_17, GPIO_MODE_OUTPUT)); // Blue
// 0 on, 1 off... yep it's backwards.
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_4, 1)); //Red
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_16, 1)); //Green
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_17, 1)); //Blue
// 0 on, 1 off
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_4, 1)); // Red
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_16, 1)); // Green
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_17, 1)); // Blue
return driver::pwmbacklight::init(LCD_PIN_BACKLIGHT);
}
@@ -28,7 +28,7 @@ static DeviceVector createDevices() {
};
}
const Configuration cyd_2432s028rv3_config = {
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices,
.i2c = {
+31 -36
View File
@@ -3,52 +3,47 @@
#include <Ili934xDisplay.h>
#include <PwmBacklight.h>
constexpr auto* TAG = "CYD";
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
auto configuration = std::make_unique<Xpt2046SoftSpi::Configuration>(
CYD_TOUCH_MOSI_PIN,
CYD_TOUCH_MISO_PIN,
CYD_TOUCH_SCK_PIN,
CYD_TOUCH_CS_PIN,
CYD2432S028R_LCD_HORIZONTAL_RESOLUTION, // 240
CYD2432S028R_LCD_VERTICAL_RESOLUTION, // 320
TOUCH_MOSI_PIN,
TOUCH_MISO_PIN,
TOUCH_SCK_PIN,
TOUCH_CS_PIN,
LCD_HORIZONTAL_RESOLUTION,
LCD_VERTICAL_RESOLUTION,
false, // swapXY
true, // mirrorX
false // mirrorY
);
// Allocate the driver
auto touch = std::make_shared<Xpt2046SoftSpi>(std::move(configuration));
// Start the driver
if (!touch->start()) {
ESP_LOGE(TAG, "Touch driver start failed");
return nullptr;
}
return touch;
return std::make_shared<Xpt2046SoftSpi>(std::move(configuration));
}
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 = true,
.mirrorY = false,
.invertColor = false,
.swapBytes = true,
.bufferSize = LCD_BUFFER_SIZE,
.touch = createTouch(),
.backlightDutyFunction = driver::pwmbacklight::setBacklightDuty,
.resetPin = GPIO_NUM_NC,
.rgbElementOrder = LCD_RGB_ELEMENT_ORDER_BGR
};
auto configuration = std::make_unique<Ili934xDisplay::Configuration>(
CYD2432S028R_LCD_SPI_HOST,
CYD2432S028R_LCD_PIN_CS,
CYD2432S028R_LCD_PIN_DC,
CYD2432S028R_LCD_HORIZONTAL_RESOLUTION,
CYD2432S028R_LCD_VERTICAL_RESOLUTION,
touch,
false, // swapXY
true, // mirrorX
false, // mirrorY
false,
CYD2432S028R_LCD_DRAW_BUFFER_SIZE
);
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 = driver::pwmbacklight::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);
}
+19 -13
View File
@@ -1,22 +1,28 @@
#pragma once
#include "Tactility/hal/display/DisplayDevice.h"
#include <Tactility/hal/display/DisplayDevice.h>
#include <driver/gpio.h>
#include <driver/spi_common.h>
#include <memory>
// Display
#define CYD2432S028R_LCD_SPI_HOST SPI2_HOST
#define CYD2432S028R_LCD_HORIZONTAL_RESOLUTION 240
#define CYD2432S028R_LCD_VERTICAL_RESOLUTION 320
#define CYD2432S028R_LCD_DRAW_BUFFER_HEIGHT (CYD2432S028R_LCD_VERTICAL_RESOLUTION / 10)
#define CYD2432S028R_LCD_DRAW_BUFFER_SIZE (CYD2432S028R_LCD_HORIZONTAL_RESOLUTION * CYD2432S028R_LCD_DRAW_BUFFER_HEIGHT)
#define CYD2432S028R_LCD_PIN_CS GPIO_NUM_15
#define CYD2432S028R_LCD_PIN_DC GPIO_NUM_2
constexpr auto LCD_SPI_HOST = SPI2_HOST;
constexpr auto LCD_PIN_CS = GPIO_NUM_15;
constexpr auto LCD_PIN_DC = GPIO_NUM_2;
constexpr auto LCD_HORIZONTAL_RESOLUTION = 240;
constexpr auto LCD_VERTICAL_RESOLUTION = 320;
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;
// Display backlight (PWM)
constexpr auto LCD_PIN_BACKLIGHT = GPIO_NUM_21;
// Touch (Software SPI)
#define CYD_TOUCH_MISO_PIN GPIO_NUM_39
#define CYD_TOUCH_MOSI_PIN GPIO_NUM_32
#define CYD_TOUCH_SCK_PIN GPIO_NUM_25
#define CYD_TOUCH_CS_PIN GPIO_NUM_33
#define CYD_TOUCH_IRQ_PIN GPIO_NUM_36
constexpr auto TOUCH_MISO_PIN = GPIO_NUM_39;
constexpr auto TOUCH_MOSI_PIN = GPIO_NUM_32;
constexpr auto TOUCH_SCK_PIN = GPIO_NUM_25;
constexpr auto TOUCH_CS_PIN = GPIO_NUM_33;
constexpr auto TOUCH_IRQ_PIN = GPIO_NUM_36;
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();
@@ -1,6 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
// Resistive touch version of the 2.8" yellow board version 3
extern const tt::hal::Configuration cyd_2432s028rv3_config;
@@ -1,29 +1,24 @@
#include "CYD2432S028R.h"
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
#include <PwmBacklight.h>
#include <Tactility/hal/Configuration.h>
// SPI Transfer
#define CYD_SPI_TRANSFER_SIZE_LIMIT (CYD2432S028R_LCD_DRAW_BUFFER_SIZE * LV_COLOR_DEPTH / 8)
// Display backlight (PWM)
#define CYD2432S028R_LCD_PIN_BACKLIGHT GPIO_NUM_21
using namespace tt::hal;
static bool initBoot() {
//Set the RGB Led Pins to output and turn them off
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT)); //Red
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_16, GPIO_MODE_OUTPUT)); //Green
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_17, GPIO_MODE_OUTPUT)); //Blue
// Set the RGB LED Pins to output and turn them off
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT)); // Red
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_16, GPIO_MODE_OUTPUT)); // Green
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_17, GPIO_MODE_OUTPUT)); // Blue
//0 on, 1 off... yep it's backwards.
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_4, 1)); //Red
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_16, 1)); //Green
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_17, 1)); //Blue
// 0 on, 1 off
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_4, 1)); // Red
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_16, 1)); // Green
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_17, 1)); // Blue
return driver::pwmbacklight::init(CYD2432S028R_LCD_PIN_BACKLIGHT);
return driver::pwmbacklight::init(LCD_PIN_BACKLIGHT);
}
static DeviceVector createDevices() {
@@ -33,7 +28,7 @@ static DeviceVector createDevices() {
};
}
const Configuration cyd_2432s028r_config = {
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices,
.i2c = {
@@ -71,7 +66,7 @@ const Configuration cyd_2432s028r_config = {
.data6_io_num = GPIO_NUM_NC,
.data7_io_num = GPIO_NUM_NC,
.data_io_default_level = false,
.max_transfer_sz = CYD_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
@@ -11,23 +11,14 @@ static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
TOUCH_MISO_PIN,
TOUCH_SCK_PIN,
TOUCH_CS_PIN,
LCD_HORIZONTAL_RESOLUTION, // 240
LCD_VERTICAL_RESOLUTION, // 320
LCD_HORIZONTAL_RESOLUTION,
LCD_VERTICAL_RESOLUTION,
false, // swapXY
true, // mirrorX
false // mirrorY
);
// Allocate the driver
auto touch = std::make_shared<Xpt2046SoftSpi>(std::move(configuration));
// Start the driver
if (!touch->start()) {
ESP_LOGE(TAG, "Touch driver start failed");
return nullptr;
}
return touch;
return std::make_shared<Xpt2046SoftSpi>(std::move(configuration));
}
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
@@ -50,7 +41,7 @@ std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
.spiHostDevice = LCD_SPI_HOST,
.csPin = LCD_PIN_CS,
.dcPin = LCD_PIN_DC,
.pixelClockFrequency = 80'000'000,
.pixelClockFrequency = 62'500'000,
.transactionQueueDepth = 10
});
@@ -1,6 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
// Capacitive touch version of the 2.4" yellow board
extern const tt::hal::Configuration cyd_2432S032c_config;
@@ -1,17 +1,27 @@
#include "CYD2432S032C.h"
#include "Tactility/lvgl/LvglSync.h"
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <Tactility/hal/Configuration.h>
#include <Tactility/kernel/SystemEvents.h>
#include <Tactility/lvgl/LvglSync.h>
#include <PwmBacklight.h>
bool initBoot() {
if (!driver::pwmbacklight::init(GPIO_NUM_27)) {
if (!driver::pwmbacklight::init(LCD_PIN_BACKLIGHT)) {
return false;
}
// Set the RGB LED Pins to output and turn them off
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT)); // Red
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_16, GPIO_MODE_OUTPUT)); // Green
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_17, GPIO_MODE_OUTPUT)); // Blue
// 0 on, 1 off
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_4, 1)); // Red
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_16, 1)); // Green
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_17, 1)); // Blue
// This display has a weird glitch with gamma during boot, which results in uneven dark gray colours.
// Setting gamma curve index to 0 doesn't work at boot for an unknown reason, so we set the curve index to 1:
tt::kernel::subscribeSystemEvent(tt::kernel::SystemEvent::BootSplash, [](auto) {
@@ -32,7 +42,7 @@ static tt::hal::DeviceVector createDevices() {
};
}
const tt::hal::Configuration cyd_2432S032c_config = {
extern const tt::hal::Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices,
.i2c = {
@@ -55,6 +65,7 @@ const tt::hal::Configuration cyd_2432S032c_config = {
}
},
.spi {
// Display
tt::hal::spi::Configuration {
.device = SPI2_HOST,
.dma = SPI_DMA_CH_AUTO,
@@ -69,7 +80,7 @@ const tt::hal::Configuration cyd_2432S032c_config = {
.data6_io_num = GPIO_NUM_NC,
.data7_io_num = GPIO_NUM_NC,
.data_io_default_level = false,
.max_transfer_sz = 0,
.max_transfer_sz = LCD_SPI_TRANSFER_SIZE_LIMIT,
.flags = 0,
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
.intr_flags = 0
@@ -78,6 +89,7 @@ const tt::hal::Configuration cyd_2432S032c_config = {
.isMutable = false,
.lock = tt::lvgl::getSyncLock() // esp_lvgl_port owns the lock for the display
},
// SD card
tt::hal::spi::Configuration {
.device = SPI3_HOST,
.dma = SPI_DMA_CH_AUTO,
+26 -22
View File
@@ -7,34 +7,38 @@
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
auto configuration = std::make_unique<Gt911Touch::Configuration>(
I2C_NUM_0,
240,
320
LCD_HORIZONTAL_RESOLUTION,
LCD_VERTICAL_RESOLUTION
);
return std::make_shared<Gt911Touch>(std::move(configuration));
}
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
Ili934xDisplay::Configuration panel_configuration = {
.horizontalResolution = LCD_HORIZONTAL_RESOLUTION,
.verticalResolution = LCD_VERTICAL_RESOLUTION,
.gapX = 0,
.gapY = 0,
.swapXY = true,
.mirrorX = true,
.mirrorY = true,
.invertColor = true,
.swapBytes = true,
.bufferSize = LCD_BUFFER_SIZE,
.touch = createTouch(),
.backlightDutyFunction = driver::pwmbacklight::setBacklightDuty,
.resetPin = GPIO_NUM_NC,
.rgbElementOrder = LCD_RGB_ELEMENT_ORDER_RGB
};
auto touch = createTouch();
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
});
auto configuration = std::make_unique<Ili934xDisplay::Configuration>(
SPI2_HOST,
GPIO_NUM_15,
GPIO_NUM_2,
240,
320,
touch,
true,
true,
true,
true,
0,
LCD_RGB_ELEMENT_ORDER_RGB
);
configuration->backlightDutyFunction = driver::pwmbacklight::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,6 +1,19 @@
#pragma once
#include <Tactility/hal/display/DisplayDevice.h>
#include <driver/gpio.h>
#include <driver/spi_common.h>
#include <memory>
// Display
constexpr auto LCD_SPI_HOST = SPI2_HOST;
constexpr auto LCD_PIN_CS = GPIO_NUM_15;
constexpr auto LCD_PIN_DC = GPIO_NUM_2;
constexpr auto LCD_PIN_BACKLIGHT = GPIO_NUM_27;
constexpr auto LCD_HORIZONTAL_RESOLUTION = 240;
constexpr auto LCD_VERTICAL_RESOLUTION = 320;
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();
@@ -1,6 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
// Capacitive touch version of the 4" square yellow board
extern const tt::hal::Configuration cyd_4848s040c_config;
@@ -1,10 +1,9 @@
#include "CYD4848S040C.h"
#include "Tactility/kernel/SystemEvents.h"
#include "Tactility/lvgl/LvglSync.h"
#include "devices/St7701Display.h"
#include "devices/SdCard.h"
#include <Tactility/hal/Configuration.h>
#include <Tactility/kernel/SystemEvents.h>
#include <Tactility/lvgl/LvglSync.h>
#include <PwmBacklight.h>
using namespace tt::hal;
@@ -20,7 +19,7 @@ static DeviceVector createDevices() {
};
}
const Configuration cyd_4848s040c_config = {
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices,
.i2c = {
@@ -1,6 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
// Capacitive touch version of the 4.3" yellow board
extern const tt::hal::Configuration cyd_8048s043c_config;
@@ -1,8 +1,9 @@
#include "CYD8048S043C.h" // Don't remove, or we get a linker error ("undefined reference to `cyd_8048s043c_config'" - GCC bug?)
#include "PwmBacklight.h"
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <Tactility/hal/Configuration.h>
using namespace tt::hal;
static bool initBoot() {
@@ -17,7 +18,7 @@ static DeviceVector createDevices() {
};
}
const Configuration cyd_8048s043c_config = {
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices,
.i2c = {
@@ -1,13 +1,12 @@
#include "E32R28T.h"
#include "devices/SdCard.h"
#include "devices/Display.h"
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
#include <PwmBacklight.h>
#define CYD_SPI_TRANSFER_SIZE_LIMIT (240 * 320 / 4 * 2)
static bool initBoot() {
return driver::pwmbacklight::init(CYD_BACKLIGHT_PIN);
return driver::pwmbacklight::init(LCD_BACKLIGHT_PIN);
}
static tt::hal::DeviceVector createDevices() {
@@ -17,7 +16,7 @@ static tt::hal::DeviceVector createDevices() {
};
}
const tt::hal::Configuration cyd_e32r28t_config = {
extern const tt::hal::Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices,
.i2c = {},
@@ -36,7 +35,7 @@ const tt::hal::Configuration cyd_e32r28t_config = {
.data6_io_num = GPIO_NUM_NC,
.data7_io_num = GPIO_NUM_NC,
.data_io_default_level = false,
.max_transfer_sz = CYD_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
@@ -59,7 +58,7 @@ const tt::hal::Configuration cyd_e32r28t_config = {
.data6_io_num = GPIO_NUM_NC,
.data7_io_num = GPIO_NUM_NC,
.data_io_default_level = false,
.max_transfer_sz = CYD_SPI_TRANSFER_SIZE_LIMIT,
.max_transfer_sz = 0,
.flags = 0,
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
.intr_flags = 0
-6
View File
@@ -1,6 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
// Resistive touch version of the waveshare 2.8" yellow board
extern const tt::hal::Configuration cyd_e32r28t_config;
+32 -22
View File
@@ -7,12 +7,12 @@
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
auto config = std::make_unique<Xpt2046SoftSpi::Configuration>(
CYD_TOUCH_MOSI_PIN,
CYD_TOUCH_MISO_PIN,
CYD_TOUCH_SCK_PIN,
CYD_TOUCH_CS_PIN,
CYD_DISPLAY_HORIZONTAL_RESOLUTION,
CYD_DISPLAY_VERTICAL_RESOLUTION,
TOUCH_MOSI_PIN,
TOUCH_MISO_PIN,
TOUCH_SCK_PIN,
TOUCH_CS_PIN,
LCD_HORIZONTAL_RESOLUTION,
LCD_VERTICAL_RESOLUTION,
false,
true,
false
@@ -22,20 +22,30 @@ static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
}
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
auto configuration = std::make_unique<Ili934xDisplay::Configuration>(
CYD_DISPLAY_SPI_HOST,
CYD_DISPLAY_PIN_CS,
CYD_DISPLAY_PIN_DC,
CYD_DISPLAY_HORIZONTAL_RESOLUTION,
CYD_DISPLAY_VERTICAL_RESOLUTION,
createTouch(),
false,
true,
false,
false,
0,
LCD_RGB_ELEMENT_ORDER_BGR
);
configuration->backlightDutyFunction = driver::pwmbacklight::setBacklightDuty;
return std::make_shared<Ili934xDisplay>(std::move(configuration));
Ili934xDisplay::Configuration panel_configuration = {
.horizontalResolution = LCD_HORIZONTAL_RESOLUTION,
.verticalResolution = LCD_VERTICAL_RESOLUTION,
.gapX = 0,
.gapY = 0,
.swapXY = false,
.mirrorX = true,
.mirrorY = false,
.invertColor = false,
.swapBytes = true,
.bufferSize = LCD_BUFFER_SIZE,
.touch = createTouch(),
.backlightDutyFunction = driver::pwmbacklight::setBacklightDuty,
.resetPin = GPIO_NUM_NC,
.rgbElementOrder = LCD_RGB_ELEMENT_ORDER_BGR
};
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
});
return std::make_shared<Ili934xDisplay>(panel_configuration, spi_configuration, true);
}
+16 -13
View File
@@ -1,25 +1,28 @@
#pragma once
#include <Tactility/hal/display/DisplayDevice.h>
#include <driver/gpio.h>
#include <driver/spi_common.h>
#include <memory>
// Display
#define CYD_DISPLAY_SPI_HOST SPI2_HOST
#define CYD_DISPLAY_PIN_CS GPIO_NUM_15
#define CYD_DISPLAY_PIN_DC GPIO_NUM_2
#define CYD_DISPLAY_HORIZONTAL_RESOLUTION 240
#define CYD_DISPLAY_VERTICAL_RESOLUTION 320
#define CYD_DISPLAY_DRAW_BUFFER_HEIGHT (CYD_DISPLAY_VERTICAL_RESOLUTION / 10)
#define CYD_DISPLAY_DRAW_BUFFER_SIZE (CYD_DISPLAY_HORIZONTAL_RESOLUTION * CYD_DISPLAY_DRAW_BUFFER_HEIGHT)
constexpr auto LCD_SPI_HOST = SPI2_HOST;
constexpr auto LCD_PIN_CS = GPIO_NUM_15;
constexpr auto LCD_PIN_DC = GPIO_NUM_2;
constexpr auto LCD_HORIZONTAL_RESOLUTION = 240;
constexpr auto LCD_VERTICAL_RESOLUTION = 320;
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;
// Touch (Software SPI)
#define CYD_TOUCH_MISO_PIN GPIO_NUM_39
#define CYD_TOUCH_MOSI_PIN GPIO_NUM_32
#define CYD_TOUCH_SCK_PIN GPIO_NUM_25
#define CYD_TOUCH_CS_PIN GPIO_NUM_33
#define CYD_TOUCH_IRQ_PIN GPIO_NUM_36
constexpr auto TOUCH_MISO_PIN = GPIO_NUM_39;
constexpr auto TOUCH_MOSI_PIN = GPIO_NUM_32;
constexpr auto TOUCH_SCK_PIN = GPIO_NUM_25;
constexpr auto TOUCH_CS_PIN = GPIO_NUM_33;
constexpr auto TOUCH_IRQ_PIN = GPIO_NUM_36;
// Backlight
#define CYD_BACKLIGHT_PIN GPIO_NUM_21
constexpr auto LCD_BACKLIGHT_PIN = GPIO_NUM_21;
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();
@@ -1,4 +1,3 @@
#include "JC2432W328C.h"
#include "devices/Display.h"
#include "devices/SdCard.h"
@@ -29,7 +28,7 @@ static DeviceVector createDevices() {
};
}
const Configuration cyd_jc2432w328c_config = {
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices,
.i2c = {
@@ -1,6 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
// Capacitive touch version of the 2.8" yellow board
extern const tt::hal::Configuration cyd_jc2432w328c_config;
@@ -34,7 +34,7 @@ std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
.spiHostDevice = LCD_SPI_HOST,
.csPin = LCD_PIN_CS,
.dcPin = LCD_PIN_DC,
.pixelClockFrequency = 80'000'000,
.pixelClockFrequency = 62'500'000,
.transactionQueueDepth = 10
});
@@ -1,8 +1,9 @@
#include "JC8048W550C.h" // Don't remove, or we get a linker error ("undefined reference to `cyd_jc8048w550c_config'" - GCC bug?)
#include "PwmBacklight.h"
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <Tactility/hal/Configuration.h>
using namespace tt::hal;
static bool initBoot() {
@@ -16,7 +17,7 @@ static DeviceVector createDevices() {
};
}
const Configuration cyd_jc8048w550c_config = {
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices,
.i2c = {
@@ -1,6 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
// Capacitive touch version of the 5" black board
extern const tt::hal::Configuration cyd_jc8048w550c_config;
@@ -2,8 +2,8 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <Tactility/lvgl/LvglSync.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
using namespace tt::hal;
@@ -18,7 +18,7 @@ static DeviceVector createDevices() {
};
}
extern const Configuration crowpanel_advance_28 = {
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices,
.i2c = {
@@ -1,5 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
extern const tt::hal::Configuration crowpanel_advance_28;
@@ -38,7 +38,7 @@ std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
.spiHostDevice = LCD_SPI_HOST,
.csPin = LCD_PIN_CS,
.dcPin = LCD_PIN_DC,
.pixelClockFrequency = 80'000'000,
.pixelClockFrequency = 62'500'000,
.transactionQueueDepth = 10
});
@@ -1,9 +1,9 @@
#include "PwmBacklight.h"
#include "Tactility/lvgl/LvglSync.h"
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
#include <PwmBacklight.h>
#define CROWPANEL_SPI_TRANSFER_SIZE_LIMIT (CROWPANEL_LCD_HORIZONTAL_RESOLUTION * CROWPANEL_LCD_SPI_TRANSFER_HEIGHT * (LV_COLOR_DEPTH / 8))
@@ -20,7 +20,7 @@ static DeviceVector createDevices() {
};
}
extern const Configuration crowpanel_advance_35 = {
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices,
.i2c = {
@@ -1,5 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
extern const tt::hal::Configuration crowpanel_advance_35;
@@ -28,7 +28,7 @@ static DeviceVector createDevices() {
};
}
extern const Configuration crowpanel_advance_50 = {
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices,
.i2c = {
@@ -1,5 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
extern const tt::hal::Configuration crowpanel_advance_50;
@@ -2,11 +2,9 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <Xpt2046Power.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
#define CROWPANEL_SPI_TRANSFER_SIZE_LIMIT (CROWPANEL_LCD_HORIZONTAL_RESOLUTION * CROWPANEL_LCD_SPI_TRANSFER_HEIGHT * (LV_COLOR_DEPTH / 8))
#include <Xpt2046Power.h>
using namespace tt::hal;
@@ -22,7 +20,7 @@ static DeviceVector createDevices() {
};
}
extern const Configuration crowpanel_basic_28 = {
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices,
.i2c = {
@@ -62,7 +60,7 @@ extern const Configuration crowpanel_basic_28 = {
.data6_io_num = GPIO_NUM_NC,
.data7_io_num = GPIO_NUM_NC,
.data_io_default_level = false,
.max_transfer_sz = CROWPANEL_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
@@ -1,5 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
extern const tt::hal::Configuration crowpanel_basic_28;
@@ -7,10 +7,10 @@
std::shared_ptr<Xpt2046Touch> createTouch() {
auto configuration = std::make_unique<Xpt2046Touch::Configuration>(
CROWPANEL_LCD_SPI_HOST,
CROWPANEL_TOUCH_PIN_CS,
240,
320,
LCD_SPI_HOST,
TOUCH_PIN_CS,
LCD_HORIZONTAL_RESOLUTION,
LCD_VERTICAL_RESOLUTION,
false,
true,
false
@@ -20,20 +20,30 @@ std::shared_ptr<Xpt2046Touch> 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 = true,
.mirrorY = false,
.invertColor = false,
.swapBytes = true,
.bufferSize = LCD_BUFFER_SIZE,
.touch = createTouch(),
.backlightDutyFunction = driver::pwmbacklight::setBacklightDuty,
.resetPin = GPIO_NUM_NC,
.rgbElementOrder = LCD_RGB_ELEMENT_ORDER_BGR
};
auto configuration = std::make_unique<Ili934xDisplay::Configuration>(
CROWPANEL_LCD_SPI_HOST,
CROWPANEL_LCD_PIN_CS,
CROWPANEL_LCD_PIN_DC,
240,
320,
touch
);
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->mirrorX = true;
configuration->backlightDutyFunction = driver::pwmbacklight::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,13 +1,17 @@
#pragma once
#include <Tactility/hal/display/DisplayDevice.h>
#include <driver/gpio.h>
#include <driver/spi_common.h>
#define CROWPANEL_LCD_SPI_HOST SPI2_HOST
#define CROWPANEL_LCD_PIN_CS GPIO_NUM_15
#define CROWPANEL_TOUCH_PIN_CS GPIO_NUM_33
#define CROWPANEL_LCD_PIN_DC GPIO_NUM_2 // RS
#define CROWPANEL_LCD_HORIZONTAL_RESOLUTION 320
#define CROWPANEL_LCD_VERTICAL_RESOLUTION 240
#define CROWPANEL_LCD_SPI_TRANSFER_HEIGHT (CROWPANEL_LCD_VERTICAL_RESOLUTION / 10)
constexpr auto LCD_SPI_HOST = SPI2_HOST;
constexpr auto LCD_PIN_CS = GPIO_NUM_15;
constexpr auto TOUCH_PIN_CS = GPIO_NUM_33;
constexpr auto LCD_PIN_DC = GPIO_NUM_2; // RS
constexpr auto LCD_HORIZONTAL_RESOLUTION = 240;
constexpr auto LCD_VERTICAL_RESOLUTION = 320;
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();
@@ -3,8 +3,8 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <Xpt2046Power.h>
#include <Tactility/hal/Configuration.h>
#include <Xpt2046Power.h>
constexpr auto CROWPANEL_SPI_TRANSFER_SIZE_LIMIT = (CROWPANEL_LCD_HORIZONTAL_RESOLUTION * CROWPANEL_LCD_SPI_TRANSFER_HEIGHT * (LV_COLOR_DEPTH / 8));
@@ -22,7 +22,7 @@ static DeviceVector createDevices() {
};
}
extern const Configuration crowpanel_basic_35 = {
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices,
.i2c = {
@@ -1,5 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
extern const tt::hal::Configuration crowpanel_basic_35;
@@ -1,8 +1,8 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <PwmBacklight.h>
#include <Tactility/hal/Configuration.h>
#include <PwmBacklight.h>
using namespace tt::hal;
@@ -18,7 +18,7 @@ static DeviceVector createDevices() {
};
}
extern const Configuration crowpanel_basic_50 = {
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices,
.i2c = {
@@ -1,5 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
extern const tt::hal::Configuration crowpanel_basic_50;
@@ -1,13 +1,13 @@
#include "Tactility/lvgl/LvglSync.h"
#include "devices/Display.h"
#include "devices/SdCard.h"
#include "devices/TpagerEncoder.h"
#include "devices/TpagerKeyboard.h"
#include "devices/TpagerPower.h"
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
#include <Bq25896.h>
#include <Drv2605.h>
#include <Tactility/hal/Configuration.h>
#define TPAGER_SPI_TRANSFER_SIZE_LIMIT (480 * 222 * (LV_COLOR_DEPTH / 8))
@@ -35,7 +35,7 @@ static DeviceVector createDevices() {
};
}
extern const Configuration lilygo_tlora_pager = {
extern const Configuration hardwareConfiguration = {
.initBoot = tpagerInit,
.createDevices = createDevices,
.i2c = {
@@ -1,5 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
extern const tt::hal::Configuration lilygo_tlora_pager;
@@ -1,11 +1,11 @@
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
#include "devices/Display.h"
#include "devices/Power.h"
#include "devices/Sdcard.h"
#include "devices/TdeckKeyboard.h"
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
bool initBoot();
using namespace tt::hal;
@@ -19,7 +19,7 @@ static std::vector<std::shared_ptr<Device>> createDevices() {
};
}
extern const Configuration lilygo_tdeck = {
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices,
.i2c = {
-5
View File
@@ -1,5 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
extern const tt::hal::Configuration lilygo_tdeck;
@@ -38,7 +38,7 @@ std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
.spiHostDevice = LCD_SPI_HOST,
.csPin = LCD_PIN_CS,
.dcPin = LCD_PIN_DC,
.pixelClockFrequency = 80'000'000,
.pixelClockFrequency = 62'500'000,
.transactionQueueDepth = 10
});
@@ -1,9 +1,9 @@
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
#include "devices/Display.h"
#include "devices/Sdcard.h"
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
#define TDECK_SPI_TRANSFER_SIZE_LIMIT (80 * 160 * (LV_COLOR_DEPTH / 8))
bool initBoot();
@@ -17,7 +17,7 @@ static std::vector<std::shared_ptr<Device>> createDevices() {
};
}
extern const Configuration lilygo_tdongle_s3 = {
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.uiScale = UiScale::Smallest,
.createDevices = createDevices,
@@ -1,5 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
extern const tt::hal::Configuration lilygo_tdongle_s3;
@@ -1,4 +1,3 @@
#include "M5stackCardputer.h"
#include "InitBoot.h"
#include "devices/Display.h"
#include "devices/SdCard.h"
@@ -6,8 +5,9 @@
#include "devices/CardputerKeyboard.h"
#include "devices/CardputerPower.h"
#include <lvgl.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
#include <lvgl.h>
using namespace tt::hal;
@@ -21,7 +21,7 @@ static DeviceVector createDevices() {
};
}
extern const Configuration m5stack_cardputer = {
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.uiScale = UiScale::Smallest,
.createDevices = createDevices,
@@ -1,5 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
extern const tt::hal::Configuration m5stack_cardputer;
@@ -23,7 +23,7 @@ std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
.spiHostDevice = LCD_SPI_HOST,
.csPin = LCD_PIN_CS,
.dcPin = LCD_PIN_DC,
.pixelClockFrequency = 80'000'000,
.pixelClockFrequency = 62'500'000,
.transactionQueueDepth = 10
});
@@ -1,19 +1,13 @@
#include "M5stackCore2.h"
#include "devices/Display.h"
#include "devices/SdCard.h"
#include "devices/Power.h"
#include <lvgl.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
#define CORE2_SPI_TRANSFER_SIZE_LIMIT (CORE2_LCD_DRAW_BUFFER_SIZE * LV_COLOR_DEPTH / 8)
using namespace tt::hal;
constexpr auto* TAG = "Core2";
bool initBoot() {
TT_LOG_I(TAG, "initBoot");
return initAxp();
}
@@ -25,7 +19,7 @@ static DeviceVector createDevices() {
};
}
extern const Configuration m5stack_core2 = {
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices,
.i2c = {
@@ -79,7 +73,7 @@ extern const Configuration m5stack_core2 = {
.data6_io_num = GPIO_NUM_NC,
.data7_io_num = GPIO_NUM_NC,
.data_io_default_level = false,
.max_transfer_sz = CORE2_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
@@ -1,5 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
extern const tt::hal::Configuration m5stack_core2;
+26 -17
View File
@@ -7,8 +7,8 @@ std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
auto configuration = std::make_unique<Ft6x36Touch::Configuration>(
I2C_NUM_0,
GPIO_NUM_39,
CORE2_LCD_HORIZONTAL_RESOLUTION,
CORE2_LCD_VERTICAL_RESOLUTION
LCD_HORIZONTAL_RESOLUTION,
LCD_VERTICAL_RESOLUTION
);
auto touch = std::make_shared<Ft6x36Touch>(std::move(configuration));
@@ -16,21 +16,30 @@ 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 = nullptr,
.resetPin = GPIO_NUM_NC,
.rgbElementOrder = LCD_RGB_ELEMENT_ORDER_BGR
};
auto configuration = std::make_unique<Ili934xDisplay::Configuration>(
CORE2_LCD_SPI_HOST,
CORE2_LCD_PIN_CS,
CORE2_LCD_PIN_DC,
CORE2_LCD_HORIZONTAL_RESOLUTION,
CORE2_LCD_VERTICAL_RESOLUTION,
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
});
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);
}
+11 -8
View File
@@ -1,14 +1,17 @@
#pragma once
#include "Tactility/hal/display/DisplayDevice.h"
#include <Tactility/hal/display/DisplayDevice.h>
#include <driver/gpio.h>
#include <driver/spi_common.h>
#include <memory>
#define CORE2_LCD_SPI_HOST SPI2_HOST
#define CORE2_LCD_PIN_CS GPIO_NUM_5
#define CORE2_LCD_PIN_DC GPIO_NUM_15
#define CORE2_LCD_HORIZONTAL_RESOLUTION 320
#define CORE2_LCD_VERTICAL_RESOLUTION 240
#define CORE2_LCD_DRAW_BUFFER_HEIGHT (CORE2_LCD_VERTICAL_RESOLUTION / 10)
#define CORE2_LCD_DRAW_BUFFER_SIZE (CORE2_LCD_HORIZONTAL_RESOLUTION * CORE2_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_15;
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();
+1 -1
View File
@@ -1,6 +1,6 @@
#pragma once
#include "Tactility/hal/sdcard/SdCardDevice.h"
#include <Tactility/hal/sdcard/SdCardDevice.h>
using tt::hal::sdcard::SdCardDevice;
@@ -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;
+26 -19
View File
@@ -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);
}
+10 -7
View File
@@ -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();
@@ -1,9 +1,9 @@
#include "M5StackStickCPlus.h"
#include "devices/Display.h"
#include "devices/Power.h"
#include <ButtonControl.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
#include <ButtonControl.h>
using namespace tt::hal;
@@ -24,7 +24,7 @@ static DeviceVector createDevices() {
};
}
extern const Configuration m5stack_stickc_plus = {
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.uiScale = UiScale::Smallest,
.createDevices = createDevices,
@@ -1,5 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
extern const tt::hal::Configuration m5stack_stickc_plus;
@@ -1,9 +1,9 @@
#include "M5StackStickCPlus2.h"
#include "devices/Display.h"
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
#include <ButtonControl.h>
#include <PwmBacklight.h>
#include <Tactility/lvgl/LvglSync.h>
using namespace tt::hal;
@@ -26,7 +26,7 @@ static DeviceVector createDevices() {
};
}
extern const Configuration m5stack_stickc_plus2 = {
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.uiScale = UiScale::Smallest,
.createDevices = createDevices,
@@ -1,5 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
extern const tt::hal::Configuration m5stack_stickc_plus2;
+1 -1
View File
@@ -37,7 +37,7 @@ static std::vector<std::shared_ptr<Device>> createDevices() {
};
}
extern const Configuration hardware = {
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices,
.i2c = {
@@ -1,9 +1,10 @@
#include "Tactility/lvgl/LvglSync.h"
#include "UnPhoneFeatures.h"
#include "Xpt2046Power.h"
#include "devices/Hx8357Display.h"
#include "devices/SdCard.h"
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
#include <Xpt2046Power.h>
#define UNPHONE_SPI_TRANSFER_SIZE_LIMIT (UNPHONE_LCD_HORIZONTAL_RESOLUTION * UNPHONE_LCD_SPI_TRANSFER_HEIGHT * LV_COLOR_DEPTH / 8)
@@ -17,7 +18,7 @@ static tt::hal::DeviceVector createDevices() {
};
}
extern const tt::hal::Configuration unPhone = {
extern const tt::hal::Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices,
.i2c = {
-5
View File
@@ -1,5 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
extern const tt::hal::Configuration unPhone;
@@ -1,9 +1,9 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <PwmBacklight.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
#include <PwmBacklight.h>
using namespace tt::hal;
@@ -18,7 +18,7 @@ static bool initBoot() {
return driver::pwmbacklight::init(GPIO_NUM_20, 256);
}
extern const Configuration waveshare_s3_lcd_13 = {
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.uiScale = UiScale::Smallest,
.createDevices = createDevices,
@@ -1,5 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
extern const tt::hal::Configuration waveshare_s3_lcd_13;
@@ -23,7 +23,7 @@ std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
.spiHostDevice = SPI2_HOST,
.csPin = GPIO_NUM_39,
.dcPin = GPIO_NUM_38,
.pixelClockFrequency = 80'000'000,
.pixelClockFrequency = 62'500'000,
.transactionQueueDepth = 10
});
@@ -12,7 +12,7 @@ static DeviceVector createDevices() {
};
}
extern const Configuration waveshare_s3_touch_43 = {
extern const Configuration hardwareConfiguration = {
.uiScale = UiScale::Smallest,
.createDevices = createDevices,
.i2c = {
@@ -1,5 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
extern const tt::hal::Configuration waveshare_s3_touch_43;
@@ -1,9 +1,9 @@
#include "devices/Display.h"
#include "devices/SdCard.h"
#include <PwmBacklight.h>
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
#include <PwmBacklight.h>
using namespace tt::hal;
@@ -20,7 +20,7 @@ static bool initBoot() {
return driver::pwmbacklight::init(GPIO_NUM_2, 256);
}
extern const Configuration waveshare_s3_touch_lcd_128 = {
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.uiScale = UiScale::Smallest,
.createDevices = createDevices,
@@ -1,5 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
extern const tt::hal::Configuration waveshare_s3_touch_lcd_128;
@@ -1,9 +1,9 @@
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
#include "devices/Display.h"
#include "devices/Sdcard.h"
#include <Tactility/hal/Configuration.h>
#include <Tactility/lvgl/LvglSync.h>
#define SPI_TRANSFER_SIZE_LIMIT (172 * 320 * (LV_COLOR_DEPTH / 8))
bool initBoot();
@@ -17,7 +17,7 @@ static std::vector<std::shared_ptr<Device>> createDevices() {
};
}
extern const Configuration waveshare_s3_touch_lcd_147 = {
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.uiScale = UiScale::Smallest,
.createDevices = createDevices,
@@ -1,5 +0,0 @@
#pragma once
#include <Tactility/hal/Configuration.h>
extern const tt::hal::Configuration waveshare_s3_touch_lcd_147;