mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-19 03:13:14 +00:00
## 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
41 lines
1.6 KiB
C++
41 lines
1.6 KiB
C++
#include "St7789Display.h"
|
|
|
|
#include <esp_lcd_panel_st7789.h>
|
|
|
|
std::shared_ptr<EspLcdConfiguration> St7789Display::createEspLcdConfiguration(const Configuration& configuration) {
|
|
return std::make_shared<EspLcdConfiguration>(EspLcdConfiguration {
|
|
.horizontalResolution = configuration.horizontalResolution,
|
|
.verticalResolution = configuration.verticalResolution,
|
|
.gapX = configuration.gapX,
|
|
.gapY = configuration.gapY,
|
|
.monochrome = false,
|
|
.swapXY = configuration.swapXY,
|
|
.mirrorX = configuration.mirrorX,
|
|
.mirrorY = configuration.mirrorY,
|
|
.invertColor = configuration.invertColor,
|
|
.bufferSize = configuration.bufferSize,
|
|
.touch = configuration.touch,
|
|
.backlightDutyFunction = configuration.backlightDutyFunction,
|
|
.resetPin = configuration.resetPin,
|
|
.lvglColorFormat = LV_COLOR_FORMAT_RGB565,
|
|
.lvglSwapBytes = false
|
|
});
|
|
}
|
|
|
|
esp_lcd_panel_dev_config_t St7789Display::createPanelConfig(std::shared_ptr<EspLcdConfiguration> espLcdConfiguration, gpio_num_t resetPin) {
|
|
return {
|
|
.reset_gpio_num = resetPin,
|
|
.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB,
|
|
.data_endian = LCD_RGB_DATA_ENDIAN_LITTLE,
|
|
.bits_per_pixel = 16,
|
|
.flags = {
|
|
.reset_active_high = false
|
|
},
|
|
.vendor_config = nullptr
|
|
};
|
|
}
|
|
|
|
bool St7789Display::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, const esp_lcd_panel_dev_config_t& panelConfig, esp_lcd_panel_handle_t& panelHandle) {
|
|
return esp_lcd_new_panel_st7789(ioHandle, &panelConfig, &panelHandle) == ESP_OK;
|
|
}
|