Shadowtrance board implementations (#241)

Adapted from pull request https://github.com/ByteWelder/Tactility/pull/238
- JC2432W328C - ST7789 - CST820 (816) 240x320 - 2.8 inch
- ESP32-8048S043C - ST7262 - GT911 800x480 - 4.3 inch
- JC8048W550C - ST7262 - GT911 800x480 - 5 inch
This commit is contained in:
Ken Van Hoeylandt 2025-03-11 21:21:44 +01:00 committed by GitHub
parent 85a6ad3bbe
commit 778e003d4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
37 changed files with 1328 additions and 14 deletions

View File

@ -90,3 +90,30 @@ jobs:
with:
board_id: unphone
arch: esp32s3
cyd-jc2432w328c:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Build"
uses: ./.github/actions/build-firmware
with:
board_id: cyd-jc2432w328c
arch: esp32
cyd-8048S043c:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Build"
uses: ./.github/actions/build-firmware
with:
board_id: cyd-8048S043c
arch: esp32s3
cyd-jc8048w550c:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Build"
uses: ./.github/actions/build-firmware
with:
board_id: cyd-jc8048w550c
arch: esp32s3

View File

@ -9,6 +9,7 @@ if (DEFINED ENV{ESP_IDF_VERSION})
ElecrowCrowpanelBasic28
ElecrowCrowpanelBasic35
M5stackCore2
CYD-JC2432W328C
)
endif()
@ -19,6 +20,8 @@ if (DEFINED ENV{ESP_IDF_VERSION})
LilygoTdeck
M5stackCoreS3
UnPhone
CYD-8048S043C
CYD-JC8048W550C
)
endif()

View File

@ -13,6 +13,12 @@ menu "Tactility App"
bool "Custom"
config TT_BOARD_CYD_2432S024C
bool "CYD 2432S024C"
config TT_BOARD_CYD_8048S043C
bool "CYD 8048S043C"
config TT_BOARD_CYD_JC2432W328C
bool "CYD JC2432W328C"
config TT_BOARD_CYD_JC8048W550C
bool "CYD JC8048W550C"
config TT_BOARD_ELECROW_CROWPANEL_ADVANCE_28
bool "Elecrow CrowPanel Advance 2.8"
config TT_BOARD_ELECROW_CROWPANEL_ADVANCE_35

View File

@ -31,6 +31,15 @@
#elif defined(CONFIG_TT_BOARD_UNPHONE)
#include "UnPhone.h"
#define TT_BOARD_HARDWARE &unPhone
#elif defined(CONFIG_TT_BOARD_CYD_JC2432W328C)
#include "JC2432W328C.h"
#define TT_BOARD_HARDWARE &cyd_jc2432w328c_config
#elif defined(CONFIG_TT_BOARD_CYD_8048S043C)
#include "CYD8048S043C.h"
#define TT_BOARD_HARDWARE &cyd_8048s043c_config
#elif defined(CONFIG_TT_BOARD_CYD_JC8048W550C)
#include "JC8048W550C.h"
#define TT_BOARD_HARDWARE &cyd_jc8048w550c_config
#else
#define TT_BOARD_HARDWARE NULL
#error Replace TT_BOARD_HARDWARE in main.c with your own. Or copy one of the ./sdkconfig.board.* files into ./sdkconfig.

View File

@ -0,0 +1,7 @@
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
idf_component_register(
SRCS ${SOURCE_FILES}
INCLUDE_DIRS "Source"
REQUIRES Tactility esp_lvgl_port esp_lcd GT911 driver vfs fatfs
)

View File

@ -0,0 +1,79 @@
#include "CYD8048S043C.h"
#include "Tactility/lvgl/LvglSync.h"
#include "hal/YellowDisplay.h"
#include "hal/YellowDisplayConstants.h"
#include "hal/YellowSdCard.h"
#include <Tactility/hal/Configuration.h>
using namespace tt::hal;
const Configuration cyd_8048s043c_config = {
.createDisplay = createDisplay,
.sdcard = createYellowSdCard(),
.power = nullptr,
.i2c = {
//Touch
i2c::Configuration {
.name = "Internal",
.port = I2C_NUM_0,
.initMode = i2c::InitMode::ByTactility,
.isMutable = true,
.config = (i2c_config_t) {
.mode = I2C_MODE_MASTER,
.sda_io_num = GPIO_NUM_19,
.scl_io_num = GPIO_NUM_20,
.sda_pullup_en = true,
.scl_pullup_en = true,
.master = {
.clk_speed = 400000
},
.clk_flags = 0
}
},
//P4 header, JST SH 1.0, GND / 3.3V / IO17 / IO18
i2c::Configuration {
.name = "External",
.port = I2C_NUM_1,
.initMode = i2c::InitMode::ByTactility,
.isMutable = true,
.config = (i2c_config_t) {
.mode = I2C_MODE_MASTER,
.sda_io_num = GPIO_NUM_17,
.scl_io_num = GPIO_NUM_18,
.sda_pullup_en = true,
.scl_pullup_en = true,
.master = {
.clk_speed = 400000
},
.clk_flags = 0
}
}
},
.spi {
//SD Card
spi::Configuration {
.device = SPI2_HOST,
.dma = SPI_DMA_CH_AUTO,
.config = {
.mosi_io_num = GPIO_NUM_11,
.miso_io_num = GPIO_NUM_13,
.sclk_io_num = GPIO_NUM_12,
.quadwp_io_num = -1,
.quadhd_io_num = -1,
.data4_io_num = 0,
.data5_io_num = 0,
.data6_io_num = 0,
.data7_io_num = 0,
.data_io_default_level = false,
.max_transfer_sz = 8192,
.flags = 0,
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
.intr_flags = 0
},
.initMode = spi::InitMode::ByTactility,
.isMutable = false,
.lock = nullptr
}
}
};

View File

@ -0,0 +1,6 @@
#pragma once
#include <Tactility/hal/Configuration.h>
// Capacitive touch version of the 4.3" yellow board
extern const tt::hal::Configuration cyd_8048s043c_config;

View File

@ -0,0 +1,220 @@
#include "YellowDisplay.h"
#include "YellowDisplayConstants.h"
#include <Gt911Touch.h>
#include <Tactility/Log.h>
#include <Tactility/TactilityCore.h>
#include <esp_lcd_panel_commands.h>
#include <driver/gpio.h>
#include <driver/ledc.h>
#include <esp_err.h>
#include <esp_lcd_panel_rgb.h>
#include <esp_lcd_panel_ops.h>
#include <esp_lvgl_port.h>
#define TAG "yellow_display"
static bool isBacklightInitialized = false;
static bool initBacklight() {
ledc_timer_config_t ledc_timer = {
.speed_mode = CYD8048S043_LCD_BACKLIGHT_LEDC_MODE,
.duty_resolution = CYD8048S043_LCD_BACKLIGHT_LEDC_DUTY_RES,
.timer_num = CYD8048S043_LCD_BACKLIGHT_LEDC_TIMER,
.freq_hz = CYD8048S043_LCD_BACKLIGHT_LEDC_FREQUENCY,
.clk_cfg = LEDC_AUTO_CLK,
.deconfigure = false
};
if (ledc_timer_config(&ledc_timer) != ESP_OK) {
TT_LOG_E(TAG, "Backlight led timer config failed");
return false;
}
return true;
}
static bool setBacklight(uint8_t duty) {
ledc_channel_config_t ledc_channel = {
.gpio_num = CYD8048S043_LCD_PIN_BACKLIGHT,
.speed_mode = CYD8048S043_LCD_BACKLIGHT_LEDC_MODE,
.channel = CYD8048S043_LCD_BACKLIGHT_LEDC_CHANNEL,
.intr_type = LEDC_INTR_DISABLE,
.timer_sel = CYD8048S043_LCD_BACKLIGHT_LEDC_TIMER,
.duty = duty,
.hpoint = 0,
.sleep_mode = LEDC_SLEEP_MODE_NO_ALIVE_NO_PD,
.flags = {
.output_invert = false
}
};
if (ledc_channel_config(&ledc_channel) != ESP_OK) {
TT_LOG_E(TAG, "Backlight init failed");
return false;
}
return true;
}
bool YellowDisplay::start() {
TT_LOG_I(TAG, "Starting");
const esp_lcd_rgb_panel_config_t panel_config = {
.clk_src = LCD_CLK_SRC_DEFAULT,
.timings = {
.pclk_hz = 16000000,
.h_res = CYD8048S043_LCD_HORIZONTAL_RESOLUTION,
.v_res = CYD8048S043_LCD_VERTICAL_RESOLUTION,
.hsync_pulse_width = 4,
.hsync_back_porch = 8,
.hsync_front_porch = 8,
.vsync_pulse_width = 4,
.vsync_back_porch = 8,
.vsync_front_porch = 8,
.flags = {
.hsync_idle_low = false,
.vsync_idle_low = false,
.de_idle_high = false,
.pclk_active_neg = true,
.pclk_idle_high = false
}
},
.data_width = 16,
.bits_per_pixel = 0,
.num_fbs = 2,
.bounce_buffer_size_px = CYD8048S043_LCD_HORIZONTAL_RESOLUTION * 10,
.sram_trans_align = 8,
.psram_trans_align = 64,
.hsync_gpio_num = CYD8048S043_LCD_PIN_HSYNC,
.vsync_gpio_num = CYD8048S043_LCD_PIN_VSYNC,
.de_gpio_num = CYD8048S043_LCD_PIN_DE,
.pclk_gpio_num = CYD8048S043_LCD_PIN_PCLK,
.disp_gpio_num = CYD8048S043_LCD_PIN_DISP_EN,
.data_gpio_nums = {
CYD8048S043_LCD_PIN_DATA0,
CYD8048S043_LCD_PIN_DATA1,
CYD8048S043_LCD_PIN_DATA2,
CYD8048S043_LCD_PIN_DATA3,
CYD8048S043_LCD_PIN_DATA4,
CYD8048S043_LCD_PIN_DATA5,
CYD8048S043_LCD_PIN_DATA6,
CYD8048S043_LCD_PIN_DATA7,
CYD8048S043_LCD_PIN_DATA8,
CYD8048S043_LCD_PIN_DATA9,
CYD8048S043_LCD_PIN_DATA10,
CYD8048S043_LCD_PIN_DATA11,
CYD8048S043_LCD_PIN_DATA12,
CYD8048S043_LCD_PIN_DATA13,
CYD8048S043_LCD_PIN_DATA14,
CYD8048S043_LCD_PIN_DATA15
},
.flags = {
.disp_active_low = false,
.refresh_on_demand = false,
.fb_in_psram = true,
.double_fb = true,
.no_fb = false,
.bb_invalidate_cache = false
}
};
if (esp_lcd_new_rgb_panel(&panel_config, &panelHandle) != ESP_OK) {
TT_LOG_E(TAG, "Failed to create panel");
return false;
}
if (esp_lcd_panel_reset(panelHandle) != ESP_OK) {
TT_LOG_E(TAG, "Failed to reset panel");
return false;
}
if (esp_lcd_panel_init(panelHandle) != ESP_OK) {
TT_LOG_E(TAG, "Failed to init panel");
return false;
}
const lvgl_port_display_cfg_t disp_cfg = {
.io_handle = ioHandle,
.panel_handle = panelHandle,
.control_handle = nullptr,
.buffer_size = CYD8048S043_LCD_DRAW_BUFFER_SIZE,
.double_buffer = true,
.trans_size = 0,
.hres = CYD8048S043_LCD_HORIZONTAL_RESOLUTION,
.vres = CYD8048S043_LCD_VERTICAL_RESOLUTION,
.monochrome = false,
.rotation = {
.swap_xy = false,
.mirror_x = false,
.mirror_y = false,
},
.color_format = LV_COLOR_FORMAT_RGB565,
.flags = {
.buff_dma = false,
.buff_spiram = true,
.sw_rotate = false,
.swap_bytes = false,
.full_refresh = false,
.direct_mode = false
}
};
const lvgl_port_display_rgb_cfg_t rgb_cfg = {
.flags = {
.bb_mode = true,
.avoid_tearing = false
}
};
displayHandle = lvgl_port_add_disp_rgb(&disp_cfg, &rgb_cfg);
TT_LOG_I(TAG, "Finished");
return displayHandle != nullptr;
}
bool YellowDisplay::stop() {
assert(displayHandle != nullptr);
lvgl_port_remove_disp(displayHandle);
if (esp_lcd_panel_del(panelHandle) != ESP_OK) {
return false;
}
if (esp_lcd_panel_io_del(ioHandle) != ESP_OK) {
return false;
}
displayHandle = nullptr;
return true;
}
std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable YellowDisplay::createTouch() {
// Note for future changes: Reset pin is 38 and interrupt pin is 18
// or INT = NC, schematic and other info floating around is kinda conflicting...
auto configuration = std::make_unique<Gt911Touch::Configuration>(
I2C_NUM_0,
800,
480
);
return std::make_shared<Gt911Touch>(std::move(configuration));
}
void YellowDisplay::setBacklightDuty(uint8_t backlightDuty) {
if (!isBacklightInitialized) {
tt_check(initBacklight());
isBacklightInitialized = true;
}
if (!setBacklight(backlightDuty)) {
TT_LOG_E(TAG, "Failed to configure display backlight");
}
}
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
return std::make_shared<YellowDisplay>();
}

View File

@ -0,0 +1,32 @@
#pragma once
#include "Tactility/hal/display/DisplayDevice.h"
#include <esp_lcd_types.h>
#include <lvgl.h>
class YellowDisplay : public tt::hal::display::DisplayDevice {
private:
esp_lcd_panel_io_handle_t ioHandle = nullptr;
esp_lcd_panel_handle_t panelHandle = nullptr;
lv_display_t* displayHandle = nullptr;
public:
std::string getName() const final { return "ST7262"; }
std::string getDescription() const final { return "RGB Display"; }
bool start() override;
bool stop() override;
std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable createTouch() override;
void setBacklightDuty(uint8_t backlightDuty) override;
bool supportsBacklightDuty() const override { return true; }
lv_display_t* _Nullable getLvglDisplay() const override { return displayHandle; }
};
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();

View File

@ -0,0 +1,42 @@
#pragma once
// Display backlight (PWM)
#define CYD8048S043_LCD_BACKLIGHT_LEDC_TIMER LEDC_TIMER_0
#define CYD8048S043_LCD_BACKLIGHT_LEDC_MODE LEDC_LOW_SPEED_MODE
#define CYD8048S043_LCD_BACKLIGHT_LEDC_CHANNEL LEDC_CHANNEL_0
#define CYD8048S043_LCD_BACKLIGHT_LEDC_DUTY_RES LEDC_TIMER_8_BIT
#define CYD8048S043_LCD_BACKLIGHT_LEDC_FREQUENCY (1000)
#define CYD8048S043_LCD_PIN_BACKLIGHT GPIO_NUM_2
// Display pins
#define CYD8048S043_LCD_PIN_HSYNC GPIO_NUM_39 // HSYNC
#define CYD8048S043_LCD_PIN_VSYNC GPIO_NUM_41 // VSYNC
#define CYD8048S043_LCD_PIN_DE GPIO_NUM_40 // DE
#define CYD8048S043_LCD_PIN_PCLK GPIO_NUM_42 // DCLK
#define CYD8048S043_LCD_PIN_DATA0 GPIO_NUM_8 // B3
#define CYD8048S043_LCD_PIN_DATA1 GPIO_NUM_3 // B4
#define CYD8048S043_LCD_PIN_DATA2 GPIO_NUM_46 // B5
#define CYD8048S043_LCD_PIN_DATA3 GPIO_NUM_9 // B6
#define CYD8048S043_LCD_PIN_DATA4 GPIO_NUM_1 // B7
#define CYD8048S043_LCD_PIN_DATA5 GPIO_NUM_5 // G2
#define CYD8048S043_LCD_PIN_DATA6 GPIO_NUM_6 // G3
#define CYD8048S043_LCD_PIN_DATA7 GPIO_NUM_7 // G4
#define CYD8048S043_LCD_PIN_DATA8 GPIO_NUM_15 // G5
#define CYD8048S043_LCD_PIN_DATA9 GPIO_NUM_16 // G6
#define CYD8048S043_LCD_PIN_DATA10 GPIO_NUM_4 // G7
#define CYD8048S043_LCD_PIN_DATA11 GPIO_NUM_45 // R3
#define CYD8048S043_LCD_PIN_DATA12 GPIO_NUM_48 // R4
#define CYD8048S043_LCD_PIN_DATA13 GPIO_NUM_47 // R5
#define CYD8048S043_LCD_PIN_DATA14 GPIO_NUM_21 // R6
#define CYD8048S043_LCD_PIN_DATA15 GPIO_NUM_14 // R7
#define CYD8048S043_LCD_PIN_DISP_EN GPIO_NUM_NC // not connected
// Display
#define CYD8048S043_LCD_HORIZONTAL_RESOLUTION 800
#define CYD8048S043_LCD_VERTICAL_RESOLUTION 480
#define CYD8048S043_LCD_DRAW_BUFFER_SIZE (CYD8048S043_LCD_HORIZONTAL_RESOLUTION * CYD8048S043_LCD_VERTICAL_RESOLUTION)

View File

@ -0,0 +1,31 @@
#include "YellowSdCard.h"
#define TAG "cyd8048s043c_sdcard"
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
#include <Tactility/lvgl/LvglSync.h>
#define SDCARD_SPI_HOST SPI2_HOST
#define SDCARD_PIN_CS GPIO_NUM_10
using tt::hal::sdcard::SpiSdCardDevice;
std::shared_ptr<SdCardDevice> createYellowSdCard() {
auto* configuration = new SpiSdCardDevice::Config(
SDCARD_PIN_CS,
GPIO_NUM_NC,
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCardDevice::MountBehaviour::AtBoot,
std::make_shared<tt::Mutex>(),
std::vector<gpio_num_t>(),
SDCARD_SPI_HOST
);
auto* sdcard = (SdCardDevice*) new SpiSdCardDevice(
std::unique_ptr<SpiSdCardDevice::Config>(configuration)
);
return std::shared_ptr<SdCardDevice>(sdcard);
}

View File

@ -0,0 +1,8 @@
#pragma once
#include "Tactility/hal/sdcard/SdCardDevice.h"
using tt::hal::sdcard::SdCardDevice;
std::shared_ptr<SdCardDevice> createYellowSdCard();

View File

@ -0,0 +1,7 @@
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
idf_component_register(
SRCS ${SOURCE_FILES}
INCLUDE_DIRS "Source"
REQUIRES Tactility esp_lvgl_port ST7789 CST816S PwmBacklight driver vfs fatfs
)

View File

@ -0,0 +1,122 @@
#include "JC2432W328C.h"
#include "hal/YellowDisplay.h"
#include "hal/YellowDisplayConstants.h"
#include "hal/YellowSdCard.h"
#include <Tactility/lvgl/LvglSync.h>
#include <PwmBacklight.h>
#include <Tactility/hal/Configuration.h>
using namespace tt::hal;
#define CYD_SPI_TRANSFER_SIZE_LIMIT (JC2432W328C_LCD_DRAW_BUFFER_SIZE * LV_COLOR_DEPTH / 8)
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
//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
return driver::pwmbacklight::init(JC2432W328C_LCD_PIN_BACKLIGHT);
}
const Configuration cyd_jc2432w328c_config = {
.initBoot = initBoot,
.createDisplay = createDisplay,
.sdcard = createYellowSdCard(),
.power = nullptr,
.i2c = {
//Touch
i2c::Configuration {
.name = "Internal",
.port = I2C_NUM_0,
.initMode = i2c::InitMode::ByTactility,
.isMutable = true,
.config = (i2c_config_t) {
.mode = I2C_MODE_MASTER,
.sda_io_num = GPIO_NUM_33,
.scl_io_num = GPIO_NUM_32,
.sda_pullup_en = false,
.scl_pullup_en = false,
.master = {
.clk_speed = 400000
},
.clk_flags = 0
}
},
//CN1 header, JST SH 1.25, GND / IO22 / IO21 / 3.3V
i2c::Configuration {
.name = "External",
.port = I2C_NUM_1,
.initMode = i2c::InitMode::ByTactility,
.isMutable = true,
.config = (i2c_config_t) {
.mode = I2C_MODE_MASTER,
.sda_io_num = GPIO_NUM_21,
.scl_io_num = GPIO_NUM_22,
.sda_pullup_en = false,
.scl_pullup_en = false,
.master = {
.clk_speed = 400000
},
.clk_flags = 0
}
}
},
.spi {
//Display
spi::Configuration {
.device = SPI2_HOST,
.dma = SPI_DMA_CH_AUTO,
.config = {
.mosi_io_num = GPIO_NUM_13,
.miso_io_num = GPIO_NUM_NC,
.sclk_io_num = GPIO_NUM_14,
.quadwp_io_num = -1,
.quadhd_io_num = -1,
.data4_io_num = 0,
.data5_io_num = 0,
.data6_io_num = 0,
.data7_io_num = 0,
.data_io_default_level = false,
.max_transfer_sz = CYD_SPI_TRANSFER_SIZE_LIMIT,
.flags = 0,
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
.intr_flags = 0
},
.initMode = spi::InitMode::ByTactility,
.isMutable = false,
.lock = tt::lvgl::getSyncLock()
},
//SD Card
spi::Configuration {
.device = SPI3_HOST,
.dma = SPI_DMA_CH_AUTO,
.config = {
.mosi_io_num = GPIO_NUM_23,
.miso_io_num = GPIO_NUM_19,
.sclk_io_num = GPIO_NUM_18,
.quadwp_io_num = -1,
.quadhd_io_num = -1,
.data4_io_num = 0,
.data5_io_num = 0,
.data6_io_num = 0,
.data7_io_num = 0,
.data_io_default_level = false,
.max_transfer_sz = 8192,
.flags = 0,
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
.intr_flags = 0
},
.initMode = spi::InitMode::ByTactility,
.isMutable = false,
.lock = nullptr
},
}
};

View File

@ -0,0 +1,6 @@
#pragma once
#include <Tactility/hal/Configuration.h>
// Capacitive touch version of the 2.8" yellow board
extern const tt::hal::Configuration cyd_jc2432w328c_config;

View File

@ -0,0 +1,38 @@
#include "YellowDisplay.h"
#include "Cst816Touch.h"
#include "YellowDisplayConstants.h"
#include <St7789Display.h>
#include <PwmBacklight.h>
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
auto configuration = std::make_unique<Cst816sTouch::Configuration>(
I2C_NUM_0,
240,
320
);
return std::make_shared<Cst816sTouch>(std::move(configuration));
}
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
auto touch = createTouch();
auto configuration = std::make_unique<St7789Display::Configuration>(
JC2432W328C_LCD_SPI_HOST,
JC2432W328C_LCD_PIN_CS,
JC2432W328C_LCD_PIN_DC,
JC2432W328C_LCD_HORIZONTAL_RESOLUTION,
JC2432W328C_LCD_VERTICAL_RESOLUTION,
touch,
false,
false,
false,
false,
JC2432W328C_LCD_DRAW_BUFFER_SIZE
);
configuration->backlightDutyFunction = driver::pwmbacklight::setBacklightDuty;
return std::make_shared<St7789Display>(std::move(configuration));
}

View File

@ -0,0 +1,6 @@
#pragma once
#include "Tactility/hal/display/DisplayDevice.h"
#include <memory>
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();

View File

@ -0,0 +1,14 @@
#pragma once
// Display backlight (PWM)
#define JC2432W328C_LCD_PIN_BACKLIGHT GPIO_NUM_27
// Display
#define JC2432W328C_LCD_SPI_HOST SPI2_HOST
#define JC2432W328C_LCD_HORIZONTAL_RESOLUTION 240
#define JC2432W328C_LCD_VERTICAL_RESOLUTION 320
#define JC2432W328C_LCD_DRAW_BUFFER_HEIGHT (JC2432W328C_LCD_VERTICAL_RESOLUTION / 10)
#define JC2432W328C_LCD_DRAW_BUFFER_SIZE (JC2432W328C_LCD_HORIZONTAL_RESOLUTION * JC2432W328C_LCD_DRAW_BUFFER_HEIGHT)
#define JC2432W328C_LCD_PIN_CS GPIO_NUM_15
#define JC2432W328C_LCD_PIN_DC GPIO_NUM_2

View File

@ -0,0 +1,31 @@
#include "YellowSdCard.h"
#define TAG "jc2432w328c_sdcard"
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
#include <Tactility/lvgl/LvglSync.h>
#define SDCARD_SPI_HOST SPI3_HOST
#define SDCARD_PIN_CS GPIO_NUM_5
using tt::hal::sdcard::SpiSdCardDevice;
std::shared_ptr<SdCardDevice> createYellowSdCard() {
auto* configuration = new SpiSdCardDevice::Config(
SDCARD_PIN_CS,
GPIO_NUM_NC,
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCardDevice::MountBehaviour::AtBoot,
std::make_shared<tt::Mutex>(),
std::vector<gpio_num_t>(),
SDCARD_SPI_HOST
);
auto* sdcard = (SdCardDevice*) new SpiSdCardDevice(
std::unique_ptr<SpiSdCardDevice::Config>(configuration)
);
return std::shared_ptr<SdCardDevice>(sdcard);
}

View File

@ -0,0 +1,8 @@
#pragma once
#include "Tactility/hal/sdcard/SdCardDevice.h"
using tt::hal::sdcard::SdCardDevice;
std::shared_ptr<SdCardDevice> createYellowSdCard();

View File

@ -0,0 +1,7 @@
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
idf_component_register(
SRCS ${SOURCE_FILES}
INCLUDE_DIRS "Source"
REQUIRES Tactility esp_lvgl_port esp_lcd RgbDisplay GT911 PwmBacklight driver vfs fatfs
)

View File

@ -0,0 +1,82 @@
#include "JC8048W550C.h" // Don't remove, or we get a linker error ("undefined reference to `cyd_jc8048w550c_config'" - GCC bug?)
#include "PwmBacklight.h"
#include "hal/CydDisplay.h"
#include "hal/CydSdCard.h"
using namespace tt::hal;
bool initBoot() {
return driver::pwmbacklight::init(GPIO_NUM_2);
}
const Configuration cyd_jc8048w550c_config = {
.initBoot = initBoot,
.createDisplay = createDisplay,
.sdcard = createSdCard(),
.power = nullptr,
.i2c = {
//Touch
i2c::Configuration {
.name = "Internal",
.port = I2C_NUM_0,
.initMode = i2c::InitMode::ByTactility,
.isMutable = true,
.config = (i2c_config_t) {
.mode = I2C_MODE_MASTER,
.sda_io_num = GPIO_NUM_19,
.scl_io_num = GPIO_NUM_20,
.sda_pullup_en = true,
.scl_pullup_en = true,
.master = {
.clk_speed = 400000
},
.clk_flags = 0
}
},
//P4 header, JST SH 1.25, GND / 3.3V / IO17 / IO18 or
//P5 header, JST SH 1.0, GND / 3.3V / IO17 / IO18
i2c::Configuration {
.name = "External",
.port = I2C_NUM_1,
.initMode = i2c::InitMode::ByTactility,
.isMutable = true,
.config = (i2c_config_t) {
.mode = I2C_MODE_MASTER,
.sda_io_num = GPIO_NUM_17,
.scl_io_num = GPIO_NUM_18,
.sda_pullup_en = true,
.scl_pullup_en = true,
.master = {
.clk_speed = 400000
},
.clk_flags = 0
}
}
},
.spi {
//SD Card
spi::Configuration {
.device = SPI2_HOST,
.dma = SPI_DMA_CH_AUTO,
.config = {
.mosi_io_num = GPIO_NUM_11,
.miso_io_num = GPIO_NUM_13,
.sclk_io_num = GPIO_NUM_12,
.quadwp_io_num = -1,
.quadhd_io_num = -1,
.data4_io_num = 0,
.data5_io_num = 0,
.data6_io_num = 0,
.data7_io_num = 0,
.data_io_default_level = false,
.max_transfer_sz = 8192,
.flags = 0,
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
.intr_flags = 0
},
.initMode = spi::InitMode::ByTactility,
.isMutable = false,
.lock = nullptr
}
}
};

View File

@ -0,0 +1,6 @@
#pragma once
#include <Tactility/hal/Configuration.h>
// Capacitive touch version of the 5" black board
extern const tt::hal::Configuration cyd_jc8048w550c_config;

View File

@ -0,0 +1,106 @@
#include "RgbDisplay.h"
#include "CydDisplay.h"
#include <PwmBacklight.h>
#include <Gt911Touch.h>
#include <Tactility/Log.h>
std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable createTouch() {
// Note for future changes: Reset pin is 38 and interrupt pin is 18
// or INT = NC, schematic and other info floating around is kinda conflicting...
auto configuration = std::make_unique<Gt911Touch::Configuration>(
I2C_NUM_0,
800,
480
);
return std::make_shared<Gt911Touch>(std::move(configuration));
}
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
auto touch = createTouch();
constexpr uint32_t bufferPixels = 800 * 10;
esp_lcd_rgb_panel_config_t rgb_panel_config = {
.clk_src = LCD_CLK_SRC_DEFAULT,
.timings = {
.pclk_hz = 16000000,
.h_res = 800,
.v_res = 480,
.hsync_pulse_width = 4,
.hsync_back_porch = 8,
.hsync_front_porch = 8,
.vsync_pulse_width = 4,
.vsync_back_porch = 8,
.vsync_front_porch = 8,
.flags = {
.hsync_idle_low = false,
.vsync_idle_low = false,
.de_idle_high = false,
.pclk_active_neg = true,
.pclk_idle_high = false
}
},
.data_width = 16,
.bits_per_pixel = 0,
.num_fbs = 2,
.bounce_buffer_size_px = bufferPixels,
.sram_trans_align = 8,
.psram_trans_align = 64,
.hsync_gpio_num = GPIO_NUM_39,
.vsync_gpio_num = GPIO_NUM_41,
.de_gpio_num = GPIO_NUM_40 ,
.pclk_gpio_num = GPIO_NUM_42,
.disp_gpio_num = GPIO_NUM_NC,
.data_gpio_nums = {
GPIO_NUM_8, // B3
GPIO_NUM_3, // B4
GPIO_NUM_46, // B5
GPIO_NUM_9, // B6
GPIO_NUM_1, // B7
GPIO_NUM_5, // G2
GPIO_NUM_6, // G3
GPIO_NUM_7, // G4
GPIO_NUM_15, // G5
GPIO_NUM_16, // G6
GPIO_NUM_4, // G7
GPIO_NUM_45, // R3
GPIO_NUM_48, // R4
GPIO_NUM_47, // R5
GPIO_NUM_21, // R6
GPIO_NUM_14, // R7
},
.flags = {
.disp_active_low = false,
.refresh_on_demand = false,
.fb_in_psram = true,
.double_fb = true,
.no_fb = false,
.bb_invalidate_cache = false
}
};
RgbDisplay::BufferConfiguration buffer_config = {
.size = bufferPixels,
.useSpi = true,
.doubleBuffer = true,
.bounceBufferMode = true,
.avoidTearing = false
};
auto configuration = std::make_unique<RgbDisplay::Configuration>(
rgb_panel_config,
buffer_config,
touch,
LV_COLOR_FORMAT_RGB565,
false,
false,
false,
false,
driver::pwmbacklight::setBacklightDuty
);
return std::make_shared<RgbDisplay>(std::move(configuration));
}

View File

@ -0,0 +1,5 @@
#pragma once
#include "Tactility/hal/display/DisplayDevice.h"
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();

View File

@ -0,0 +1,25 @@
#include "CydSdCard.h"
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
#include <Tactility/lvgl/LvglSync.h>
using tt::hal::sdcard::SpiSdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard() {
auto config = std::make_unique<SpiSdCardDevice::Config>(
GPIO_NUM_10,
GPIO_NUM_NC,
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCardDevice::MountBehaviour::AtBoot,
std::make_shared<tt::Mutex>(),
std::vector<gpio_num_t>(),
SPI2_HOST
);
auto sdcard = std::make_shared<SpiSdCardDevice>(
std::move(config)
);
return std::static_pointer_cast<SdCardDevice>(sdcard);
}

View File

@ -0,0 +1,7 @@
#pragma once
#include "Tactility/hal/sdcard/SdCardDevice.h"
using tt::hal::sdcard::SdCardDevice;
std::shared_ptr<SdCardDevice> createSdCard();

View File

@ -31,8 +31,17 @@ release lilygo-tdeck
releaseSdk release/TactilitySDK-esp32s3
build yellow-board
release yellow-board
build cyd-2432s024c
release cyd-2432s024c
build cyd-8048s043c
release cyd-8048s043c
build cyd-jc2432w328c
release cyd-jc2432w328c
build cyd-jc8048w550c
release cyd-jc8048w550c
releaseSdk release/TactilitySDK-esp32

View File

@ -34,16 +34,10 @@ if (DEFINED ENV{ESP_IDF_VERSION})
set(EXCLUDE_COMPONENTS "Simulator")
# Non-ESP32 boards
if(NOT "${IDF_TARGET}" STREQUAL "esp32")
set(EXCLUDE_COMPONENTS "CYD-2432S024C")
set(EXCLUDE_COMPONENTS "ElecrowCrowpanelBasic28")
set(EXCLUDE_COMPONENTS "ElecrowCrowpanelBasic35")
set(EXCLUDE_COMPONENTS "M5stackCore2")
endif()
# Non-ESP32-S3 boards
if(NOT "${IDF_TARGET}" STREQUAL "esp32s3")
# ESP32 target should exclude ESP32-S3 boards
if("${IDF_TARGET}" STREQUAL "esp32")
set(EXCLUDE_COMPONENTS "CYD-8048S043C")
set(EXCLUDE_COMPONENTS "CYD-JC8048W550C")
set(EXCLUDE_COMPONENTS "ElecrowCrowpanelAdvance28")
set(EXCLUDE_COMPONENTS "ElecrowCrowpanelAdvance35")
set(EXCLUDE_COMPONENTS "LilygoTdeck")
@ -51,6 +45,15 @@ if (DEFINED ENV{ESP_IDF_VERSION})
set(EXCLUDE_COMPONENTS "UnPhone")
endif()
# ESP32-S3 target should exclude ESP32 boards
if("${IDF_TARGET}" STREQUAL "esp32s3")
set(EXCLUDE_COMPONENTS "CYD-2432S024C")
set(EXCLUDE_COMPONENTS "CYD-JC2432W328C")
set(EXCLUDE_COMPONENTS "ElecrowCrowpanelBasic28")
set(EXCLUDE_COMPONENTS "ElecrowCrowpanelBasic35")
set(EXCLUDE_COMPONENTS "M5stackCore2")
endif()
# LVGL
get_filename_component(
LVGL_CONFIG_FULL_PATH Libraries/lvgl_conf ABSOLUTE

View File

@ -94,5 +94,3 @@ public:
lv_display_t* _Nullable getLvglDisplay() const final { return displayHandle; }
};
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();

View File

@ -0,0 +1,5 @@
idf_component_register(
SRC_DIRS "Source"
INCLUDE_DIRS "Source"
REQUIRES Tactility esp_lvgl_port esp_lcd
)

View File

@ -0,0 +1,3 @@
# RGB Display Driver
This driver is used for displays that use multiple parallel data lanes.

View File

@ -0,0 +1,109 @@
#include "RgbDisplay.h"
#include <Tactility/Log.h>
#include <esp_err.h>
#include <esp_lcd_panel_rgb.h>
#include <esp_lcd_panel_ops.h>
#include <esp_lvgl_port.h>
#define TAG "RgbDisplay"
bool RgbDisplay::start() {
TT_LOG_I(TAG, "Starting");
if (esp_lcd_new_rgb_panel(&configuration->panelConfig, &panelHandle) != ESP_OK) {
TT_LOG_E(TAG, "Failed to create panel");
return false;
}
if (esp_lcd_panel_reset(panelHandle) != ESP_OK) {
TT_LOG_E(TAG, "Failed to reset panel");
return false;
}
if (esp_lcd_panel_init(panelHandle) != ESP_OK) {
TT_LOG_E(TAG, "Failed to init panel");
return false;
}
if (esp_lcd_panel_swap_xy(panelHandle, configuration->swapXY) != ESP_OK) {
TT_LOG_E(TAG, "Failed to swap XY");
return false;
}
if (esp_lcd_panel_mirror(panelHandle, configuration->mirrorX, configuration->mirrorY) != ESP_OK) {
TT_LOG_E(TAG, "Failed to set panel to mirror");
return false;
}
if (esp_lcd_panel_invert_color(panelHandle, configuration->invertColor) != ESP_OK) {
TT_LOG_E(TAG, "Failed to set panel to invert");
return false;
}
auto horizontal_resolution = configuration->panelConfig.timings.h_res;
auto vertical_resolution = configuration->panelConfig.timings.v_res;
uint32_t buffer_size;
if (configuration->bufferConfiguration.size == 0) {
buffer_size = horizontal_resolution * vertical_resolution / 15;
} else {
buffer_size = configuration->bufferConfiguration.size;
}
const lvgl_port_display_cfg_t display_config = {
.io_handle = ioHandle,
.panel_handle = panelHandle,
.control_handle = nullptr,
.buffer_size = buffer_size,
.double_buffer = configuration->bufferConfiguration.doubleBuffer,
.trans_size = 0,
.hres = horizontal_resolution,
.vres = vertical_resolution,
.monochrome = false,
.rotation = {
.swap_xy = configuration->swapXY,
.mirror_x = configuration->mirrorX,
.mirror_y = configuration->mirrorY,
},
.color_format = configuration->colorFormat,
.flags = {
.buff_dma = !configuration->bufferConfiguration.useSpi,
.buff_spiram = configuration->bufferConfiguration.useSpi,
.sw_rotate = false,
.swap_bytes = false,
.full_refresh = false,
.direct_mode = false
}
};
const lvgl_port_display_rgb_cfg_t rgb_config = {
.flags = {
.bb_mode = configuration->bufferConfiguration.bounceBufferMode,
.avoid_tearing = configuration->bufferConfiguration.avoidTearing
}
};
displayHandle = lvgl_port_add_disp_rgb(&display_config, &rgb_config);
TT_LOG_I(TAG, "Finished");
return displayHandle != nullptr;
}
bool RgbDisplay::stop() {
assert(displayHandle != nullptr);
lvgl_port_remove_disp(displayHandle);
if (esp_lcd_panel_del(panelHandle) != ESP_OK) {
return false;
}
if (esp_lcd_panel_io_del(ioHandle) != ESP_OK) {
return false;
}
displayHandle = nullptr;
return true;
}

View File

@ -0,0 +1,91 @@
#pragma once
#include "Tactility/hal/display/DisplayDevice.h"
#include <esp_lcd_panel_rgb.h>
#include <esp_lcd_types.h>
#include <lvgl.h>
#include <utility>
class RgbDisplay : public tt::hal::display::DisplayDevice {
public:
struct BufferConfiguration final {
uint32_t size; // Size in pixel count. 0 means default, which is 1/15 of the screen size
bool useSpi;
bool doubleBuffer;
bool bounceBufferMode;
bool avoidTearing;
};
class Configuration final {
public:
esp_lcd_rgb_panel_config_t panelConfig;
BufferConfiguration bufferConfiguration;
std::shared_ptr<tt::hal::touch::TouchDevice> touch;
lv_color_format_t colorFormat;
bool swapXY;
bool mirrorX;
bool mirrorY;
bool invertColor;
std::function<void(uint8_t)> _Nullable backlightDutyFunction;
Configuration(
esp_lcd_rgb_panel_config_t panelConfig,
BufferConfiguration bufferConfiguration,
std::shared_ptr<tt::hal::touch::TouchDevice> touch,
lv_color_format_t colorFormat,
bool swapXY = false,
bool mirrorX = false,
bool mirrorY = false,
bool invertColor = false,
std::function<void(uint8_t)> _Nullable backlightDutyFunction = nullptr
) : panelConfig(panelConfig),
bufferConfiguration(bufferConfiguration),
touch(std::move(touch)),
colorFormat(colorFormat),
swapXY(swapXY),
mirrorX(mirrorX),
mirrorY(mirrorY),
invertColor(invertColor),
backlightDutyFunction(std::move(backlightDutyFunction))
{}
};
private:
std::unique_ptr<Configuration> configuration = nullptr;
esp_lcd_panel_io_handle_t ioHandle = nullptr;
esp_lcd_panel_handle_t panelHandle = nullptr;
lv_display_t* displayHandle = nullptr;
public:
explicit RgbDisplay(std::unique_ptr<Configuration> inConfiguration) : configuration(std::move(inConfiguration)) {
assert(configuration != nullptr);
}
std::string getName() const final { return "RGB Display"; }
std::string getDescription() const final { return "RGB Display"; }
bool start() override;
bool stop() override;
std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable createTouch() final { return configuration->touch; }
void setBacklightDuty(uint8_t backlightDuty) final {
if (configuration->backlightDutyFunction != nullptr) {
configuration->backlightDutyFunction(backlightDuty);
}
}
bool supportsBacklightDuty() const final { return configuration->backlightDutyFunction != nullptr; }
lv_display_t* _Nullable getLvglDisplay() const override { return displayHandle; }
};
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();

View File

@ -0,0 +1,55 @@
# Software defaults
# Increase stack size for WiFi (fixes crash after scan)
CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=3072
CONFIG_LV_FONT_MONTSERRAT_14=y
CONFIG_LV_FONT_MONTSERRAT_18=y
CONFIG_LV_USE_USER_DATA=y
CONFIG_LV_USE_FS_STDIO=y
CONFIG_LV_FS_STDIO_LETTER=65
CONFIG_LV_FS_STDIO_PATH=""
CONFIG_LV_FS_STDIO_CACHE_SIZE=4096
CONFIG_LV_USE_LODEPNG=y
CONFIG_LV_USE_BUILTIN_MALLOC=n
CONFIG_LV_USE_CLIB_MALLOC=y
CONFIG_LV_USE_MSGBOX=n
CONFIG_LV_USE_SPINNER=n
CONFIG_LV_USE_WIN=n
CONFIG_LV_USE_SNAPSHOT=y
CONFIG_FREERTOS_HZ=1000
CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=2
CONFIG_FREERTOS_SMP=n
CONFIG_FREERTOS_UNICORE=n
CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=4096
CONFIG_FREERTOS_USE_TRACE_FACILITY=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
CONFIG_FATFS_LFN_HEAP=y
CONFIG_FATFS_VOLUME_COUNT=3
# Hardware: Main
CONFIG_COMPILER_OPTIMIZATION_PERF=y
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
CONFIG_TT_BOARD_CYD_8048S043C=y
CONFIG_TT_BOARD_NAME="CYD 8048S043C"
CONFIG_TT_BOARD_ID="cyd-8048s043c"
CONFIG_IDF_TARGET="esp32s3"
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
CONFIG_FLASHMODE_QIO=y
# Hardware: SPI RAM
CONFIG_ESP32S3_SPIRAM_SUPPORT=y
CONFIG_SPIRAM_MODE_OCT=y
CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y
CONFIG_SPIRAM_RODATA=y
CONFIG_SPIRAM_XIP_FROM_PSRAM=y
CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y
CONFIG_SPIRAM_SPEED_80M=y
CONFIG_SPIRAM_USE_MALLOC=y
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y
# SPI Flash
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
# LVGL
CONFIG_LV_DISP_DEF_REFR_PERIOD=10
CONFIG_LV_DPI_DEF=139

View File

@ -0,0 +1,46 @@
# Software defaults
# Increase stack size for WiFi (fixes crash after scan)
CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=3072
CONFIG_LV_FONT_MONTSERRAT_14=y
CONFIG_LV_FONT_MONTSERRAT_18=y
CONFIG_LV_USE_USER_DATA=y
CONFIG_LV_USE_FS_STDIO=y
CONFIG_LV_FS_STDIO_LETTER=65
CONFIG_LV_FS_STDIO_PATH=""
CONFIG_LV_FS_STDIO_CACHE_SIZE=4096
CONFIG_LV_USE_LODEPNG=y
CONFIG_LV_USE_BUILTIN_MALLOC=n
CONFIG_LV_USE_CLIB_MALLOC=y
CONFIG_LV_USE_MSGBOX=n
CONFIG_LV_USE_SPINNER=n
CONFIG_LV_USE_WIN=n
CONFIG_LV_USE_SNAPSHOT=y
CONFIG_FREERTOS_HZ=1000
CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=2
CONFIG_FREERTOS_SMP=n
CONFIG_FREERTOS_UNICORE=n
CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=4096
CONFIG_FREERTOS_USE_TRACE_FACILITY=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
CONFIG_FATFS_LFN_HEAP=y
CONFIG_FATFS_VOLUME_COUNT=3
# Hardware: Main
CONFIG_TT_BOARD_CYD_JC2432W328C=y
CONFIG_TT_BOARD_NAME="CYD JC2432W328C"
CONFIG_TT_BOARD_ID="cyd-jc2432W328c"
CONFIG_IDF_TARGET="esp32"
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_FLASHMODE_QIO=y
# LVGL
CONFIG_LV_DISP_DEF_REFR_PERIOD=10
CONFIG_LV_DPI_DEF=160
# Fix for IRAM
CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y
CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH=y
CONFIG_HEAP_PLACE_FUNCTION_INTO_FLASH=y
CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH=y

View File

@ -0,0 +1,55 @@
# Software defaults
# Increase stack size for WiFi (fixes crash after scan)
CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=3072
CONFIG_LV_FONT_MONTSERRAT_14=y
CONFIG_LV_FONT_MONTSERRAT_18=y
CONFIG_LV_USE_USER_DATA=y
CONFIG_LV_USE_FS_STDIO=y
CONFIG_LV_FS_STDIO_LETTER=65
CONFIG_LV_FS_STDIO_PATH=""
CONFIG_LV_FS_STDIO_CACHE_SIZE=4096
CONFIG_LV_USE_LODEPNG=y
CONFIG_LV_USE_BUILTIN_MALLOC=n
CONFIG_LV_USE_CLIB_MALLOC=y
CONFIG_LV_USE_MSGBOX=n
CONFIG_LV_USE_SPINNER=n
CONFIG_LV_USE_WIN=n
CONFIG_LV_USE_SNAPSHOT=y
CONFIG_FREERTOS_HZ=1000
CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=2
CONFIG_FREERTOS_SMP=n
CONFIG_FREERTOS_UNICORE=n
CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=4096
CONFIG_FREERTOS_USE_TRACE_FACILITY=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
CONFIG_FATFS_LFN_HEAP=y
CONFIG_FATFS_VOLUME_COUNT=3
# Hardware: Main
CONFIG_COMPILER_OPTIMIZATION_PERF=y
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
CONFIG_TT_BOARD_CYD_JC8048W550C=y
CONFIG_TT_BOARD_NAME="CYD JC8048W550C"
CONFIG_TT_BOARD_ID="cyd-jc8048w550c"
CONFIG_IDF_TARGET="esp32s3"
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
CONFIG_FLASHMODE_QIO=y
# Hardware: SPI RAM
CONFIG_ESP32S3_SPIRAM_SUPPORT=y
CONFIG_SPIRAM_MODE_OCT=y
CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y
CONFIG_SPIRAM_RODATA=y
CONFIG_SPIRAM_XIP_FROM_PSRAM=y
CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y
CONFIG_SPIRAM_SPEED_80M=y
CONFIG_SPIRAM_USE_MALLOC=y
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y
# SPI Flash
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
# LVGL
CONFIG_LV_DISP_DEF_REFR_PERIOD=10
CONFIG_LV_DPI_DEF=139