2020-08-17 13:47:05 -07:00
|
|
|
|
#include "configuration.h"
|
2023-10-05 05:24:25 +02:00
|
|
|
|
#include "main.h"
|
2025-07-02 20:50:49 -05:00
|
|
|
|
|
2024-01-12 02:00:31 -06:00
|
|
|
|
#if ARCH_PORTDUINO
|
2023-12-12 20:27:31 -06:00
|
|
|
|
#include "platform/portduino/PortduinoGlue.h"
|
|
|
|
|
|
#endif
|
2020-08-17 13:47:05 -07:00
|
|
|
|
|
2023-07-15 15:53:26 +02:00
|
|
|
|
#ifndef TFT_BACKLIGHT_ON
|
|
|
|
|
|
#define TFT_BACKLIGHT_ON HIGH
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
2024-05-06 13:48:57 +02:00
|
|
|
|
#ifdef GPIO_EXTENDER
|
|
|
|
|
|
#include <SparkFunSX1509.h>
|
|
|
|
|
|
#include <Wire.h>
|
|
|
|
|
|
extern SX1509 gpioExtender;
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
2025-07-02 20:50:49 -05:00
|
|
|
|
#ifdef TFT_MESH_OVERRIDE
|
|
|
|
|
|
uint16_t TFT_MESH = TFT_MESH_OVERRIDE;
|
|
|
|
|
|
#else
|
|
|
|
|
|
uint16_t TFT_MESH = COLOR565(0x67, 0xEA, 0x94);
|
2023-08-16 22:07:22 +02:00
|
|
|
|
#endif
|
2023-07-15 15:53:26 +02:00
|
|
|
|
|
|
|
|
|
|
#if defined(ST7735S)
|
|
|
|
|
|
#include <LovyanGFX.hpp> // Graphics and font library for ST7735 driver chip
|
|
|
|
|
|
|
2024-01-26 07:40:16 -07:00
|
|
|
|
#ifndef TFT_INVERT
|
|
|
|
|
|
#define TFT_INVERT true
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
2023-07-15 15:53:26 +02:00
|
|
|
|
class LGFX : public lgfx::LGFX_Device
|
|
|
|
|
|
{
|
|
|
|
|
|
lgfx::Panel_ST7735S _panel_instance;
|
|
|
|
|
|
lgfx::Bus_SPI _bus_instance;
|
|
|
|
|
|
lgfx::Light_PWM _light_instance;
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
LGFX(void)
|
|
|
|
|
|
{
|
|
|
|
|
|
{
|
|
|
|
|
|
auto cfg = _bus_instance.config();
|
|
|
|
|
|
|
|
|
|
|
|
// configure SPI
|
|
|
|
|
|
cfg.spi_host = ST7735_SPI_HOST; // ESP32-S2,S3,C3 : SPI2_HOST or SPI3_HOST / ESP32 : VSPI_HOST or HSPI_HOST
|
|
|
|
|
|
cfg.spi_mode = 0;
|
|
|
|
|
|
cfg.freq_write = SPI_FREQUENCY; // SPI clock for transmission (up to 80MHz, rounded to the value obtained by dividing
|
|
|
|
|
|
// 80MHz by an integer)
|
|
|
|
|
|
cfg.freq_read = SPI_READ_FREQUENCY; // SPI clock when receiving
|
|
|
|
|
|
cfg.spi_3wire = false; // Set to true if reception is done on the MOSI pin
|
|
|
|
|
|
cfg.use_lock = true; // Set to true to use transaction locking
|
|
|
|
|
|
cfg.dma_channel = SPI_DMA_CH_AUTO; // SPI_DMA_CH_AUTO; // Set DMA channel to use (0=not use DMA / 1=1ch / 2=ch /
|
|
|
|
|
|
// SPI_DMA_CH_AUTO=auto setting)
|
|
|
|
|
|
cfg.pin_sclk = ST7735_SCK; // Set SPI SCLK pin number
|
|
|
|
|
|
cfg.pin_mosi = ST7735_SDA; // Set SPI MOSI pin number
|
|
|
|
|
|
cfg.pin_miso = ST7735_MISO; // Set SPI MISO pin number (-1 = disable)
|
|
|
|
|
|
cfg.pin_dc = ST7735_RS; // Set SPI DC pin number (-1 = disable)
|
|
|
|
|
|
|
|
|
|
|
|
_bus_instance.config(cfg); // applies the set value to the bus.
|
|
|
|
|
|
_panel_instance.setBus(&_bus_instance); // set the bus on the panel.
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
{ // Set the display panel control.
|
|
|
|
|
|
auto cfg = _panel_instance.config(); // Gets a structure for display panel settings.
|
|
|
|
|
|
|
|
|
|
|
|
cfg.pin_cs = ST7735_CS; // Pin number where CS is connected (-1 = disable)
|
|
|
|
|
|
cfg.pin_rst = ST7735_RESET; // Pin number where RST is connected (-1 = disable)
|
|
|
|
|
|
cfg.pin_busy = ST7735_BUSY; // Pin number where BUSY is connected (-1 = disable)
|
|
|
|
|
|
|
|
|
|
|
|
// The following setting values are general initial values for each panel, so please comment out any
|
|
|
|
|
|
// unknown items and try them.
|
|
|
|
|
|
|
|
|
|
|
|
cfg.panel_width = TFT_WIDTH; // actual displayable width
|
|
|
|
|
|
cfg.panel_height = TFT_HEIGHT; // actual displayable height
|
|
|
|
|
|
cfg.offset_x = TFT_OFFSET_X; // Panel offset amount in X direction
|
|
|
|
|
|
cfg.offset_y = TFT_OFFSET_Y; // Panel offset amount in Y direction
|
|
|
|
|
|
cfg.offset_rotation = 0; // Rotation direction value offset 0~7 (4~7 is upside down)
|
|
|
|
|
|
cfg.dummy_read_pixel = 8; // Number of bits for dummy read before pixel readout
|
|
|
|
|
|
cfg.dummy_read_bits = 1; // Number of bits for dummy read before non-pixel data read
|
|
|
|
|
|
cfg.readable = true; // Set to true if data can be read
|
2024-01-26 07:40:16 -07:00
|
|
|
|
cfg.invert = TFT_INVERT; // Set to true if the light/darkness of the panel is reversed
|
2023-07-15 15:53:26 +02:00
|
|
|
|
cfg.rgb_order = false; // Set to true if the panel's red and blue are swapped
|
|
|
|
|
|
cfg.dlen_16bit =
|
|
|
|
|
|
false; // Set to true for panels that transmit data length in 16-bit units with 16-bit parallel or SPI
|
|
|
|
|
|
cfg.bus_shared = true; // If the bus is shared with the SD card, set to true (bus control with drawJpgFile etc.)
|
|
|
|
|
|
|
|
|
|
|
|
// Set the following only when the display is shifted with a driver with a variable number of pixels, such as the
|
|
|
|
|
|
// ST7735 or ILI9163.
|
|
|
|
|
|
cfg.memory_width = TFT_WIDTH; // Maximum width supported by the driver IC
|
|
|
|
|
|
cfg.memory_height = TFT_HEIGHT; // Maximum height supported by the driver IC
|
|
|
|
|
|
_panel_instance.config(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-08-22 09:15:59 -07:00
|
|
|
|
#ifdef TFT_BL
|
2023-07-15 15:53:26 +02:00
|
|
|
|
// Set the backlight control
|
|
|
|
|
|
{
|
|
|
|
|
|
auto cfg = _light_instance.config(); // Gets a structure for backlight settings.
|
|
|
|
|
|
|
2024-08-22 09:15:59 -07:00
|
|
|
|
cfg.pin_bl = TFT_BL; // Pin number to which the backlight is connected
|
|
|
|
|
|
cfg.invert = true; // true to invert the brightness of the backlight
|
2023-07-15 15:53:26 +02:00
|
|
|
|
// cfg.freq = 44100; // PWM frequency of backlight
|
|
|
|
|
|
// cfg.pwm_channel = 1; // PWM channel number to use
|
|
|
|
|
|
|
|
|
|
|
|
_light_instance.config(cfg);
|
|
|
|
|
|
_panel_instance.setLight(&_light_instance); // Set the backlight on the panel.
|
|
|
|
|
|
}
|
2024-08-22 09:15:59 -07:00
|
|
|
|
#endif
|
2023-07-15 15:53:26 +02:00
|
|
|
|
|
|
|
|
|
|
setPanel(&_panel_instance);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2023-12-12 20:27:31 -06:00
|
|
|
|
static LGFX *tft = nullptr;
|
2023-07-15 15:53:26 +02:00
|
|
|
|
|
2023-11-13 05:20:49 -07:00
|
|
|
|
#elif defined(RAK14014)
|
2024-06-15 08:36:20 +08:00
|
|
|
|
#include <RAK14014_FT6336U.h>
|
2024-06-14 19:53:47 -05:00
|
|
|
|
#include <TFT_eSPI.h>
|
2023-12-12 20:27:31 -06:00
|
|
|
|
TFT_eSPI *tft = nullptr;
|
2024-06-15 08:36:20 +08:00
|
|
|
|
FT6336U ft6336u;
|
|
|
|
|
|
|
|
|
|
|
|
static uint8_t _rak14014_touch_int = false; // TP interrupt generation flag.
|
|
|
|
|
|
static void rak14014_tpIntHandle(void)
|
|
|
|
|
|
{
|
|
|
|
|
|
_rak14014_touch_int = true;
|
|
|
|
|
|
}
|
2023-11-13 05:20:49 -07:00
|
|
|
|
|
2025-04-17 16:03:37 +02:00
|
|
|
|
#elif defined(ST72xx_DE)
|
|
|
|
|
|
#include <LovyanGFX.hpp>
|
|
|
|
|
|
#include <TCA9534.h>
|
|
|
|
|
|
#include <lgfx/v1/platforms/esp32s3/Bus_RGB.hpp>
|
|
|
|
|
|
#include <lgfx/v1/platforms/esp32s3/Panel_RGB.hpp>
|
|
|
|
|
|
TCA9534 ioex;
|
|
|
|
|
|
|
|
|
|
|
|
class LGFX : public lgfx::LGFX_Device
|
|
|
|
|
|
{
|
|
|
|
|
|
lgfx::Bus_RGB _bus_instance;
|
|
|
|
|
|
lgfx::Panel_RGB _panel_instance;
|
|
|
|
|
|
lgfx::Touch_GT911 _touch_instance;
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
const uint16_t screenWidth = TFT_WIDTH;
|
|
|
|
|
|
const uint16_t screenHeight = TFT_HEIGHT;
|
|
|
|
|
|
|
|
|
|
|
|
bool init_impl(bool use_reset, bool use_clear) override
|
|
|
|
|
|
{
|
|
|
|
|
|
ioex.attach(Wire);
|
|
|
|
|
|
ioex.setDeviceAddress(0x18);
|
|
|
|
|
|
ioex.config(1, TCA9534::Config::OUT);
|
|
|
|
|
|
ioex.config(2, TCA9534::Config::OUT);
|
|
|
|
|
|
ioex.config(3, TCA9534::Config::OUT);
|
|
|
|
|
|
ioex.config(4, TCA9534::Config::OUT);
|
|
|
|
|
|
|
|
|
|
|
|
ioex.output(1, TCA9534::Level::H);
|
|
|
|
|
|
ioex.output(3, TCA9534::Level::L);
|
|
|
|
|
|
ioex.output(4, TCA9534::Level::H);
|
|
|
|
|
|
|
|
|
|
|
|
pinMode(1, OUTPUT);
|
|
|
|
|
|
digitalWrite(1, LOW);
|
|
|
|
|
|
ioex.output(2, TCA9534::Level::L);
|
|
|
|
|
|
delay(20);
|
|
|
|
|
|
ioex.output(2, TCA9534::Level::H);
|
|
|
|
|
|
delay(100);
|
|
|
|
|
|
pinMode(1, INPUT);
|
|
|
|
|
|
|
|
|
|
|
|
return LGFX_Device::init_impl(use_reset, use_clear);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
LGFX(void)
|
|
|
|
|
|
{
|
|
|
|
|
|
{
|
|
|
|
|
|
auto cfg = _panel_instance.config();
|
|
|
|
|
|
|
|
|
|
|
|
cfg.memory_width = screenWidth;
|
|
|
|
|
|
cfg.memory_height = screenHeight;
|
|
|
|
|
|
cfg.panel_width = screenWidth;
|
|
|
|
|
|
cfg.panel_height = screenHeight;
|
|
|
|
|
|
cfg.offset_x = 0;
|
|
|
|
|
|
cfg.offset_y = 0;
|
|
|
|
|
|
cfg.offset_rotation = 0;
|
|
|
|
|
|
_panel_instance.config(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
auto cfg = _panel_instance.config_detail();
|
|
|
|
|
|
cfg.use_psram = 0;
|
|
|
|
|
|
_panel_instance.config_detail(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
auto cfg = _bus_instance.config();
|
|
|
|
|
|
cfg.panel = &_panel_instance;
|
|
|
|
|
|
cfg.pin_d0 = ST72xx_B0; // B0
|
|
|
|
|
|
cfg.pin_d1 = ST72xx_B1; // B1
|
|
|
|
|
|
cfg.pin_d2 = ST72xx_B2; // B2
|
|
|
|
|
|
cfg.pin_d3 = ST72xx_B3; // B3
|
|
|
|
|
|
cfg.pin_d4 = ST72xx_B4; // B4
|
|
|
|
|
|
cfg.pin_d5 = ST72xx_G0; // G0
|
|
|
|
|
|
cfg.pin_d6 = ST72xx_G1; // G1
|
|
|
|
|
|
cfg.pin_d7 = ST72xx_G2; // G2
|
|
|
|
|
|
cfg.pin_d8 = ST72xx_G3; // G3
|
|
|
|
|
|
cfg.pin_d9 = ST72xx_G4; // G4
|
|
|
|
|
|
cfg.pin_d10 = ST72xx_G5; // G5
|
|
|
|
|
|
cfg.pin_d11 = ST72xx_R0; // R0
|
|
|
|
|
|
cfg.pin_d12 = ST72xx_R1; // R1
|
|
|
|
|
|
cfg.pin_d13 = ST72xx_R2; // R2
|
|
|
|
|
|
cfg.pin_d14 = ST72xx_R3; // R3
|
|
|
|
|
|
cfg.pin_d15 = ST72xx_R4; // R4
|
|
|
|
|
|
|
|
|
|
|
|
cfg.pin_henable = ST72xx_DE;
|
|
|
|
|
|
cfg.pin_vsync = ST72xx_VSYNC;
|
|
|
|
|
|
cfg.pin_hsync = ST72xx_HSYNC;
|
|
|
|
|
|
cfg.pin_pclk = ST72xx_PCLK;
|
|
|
|
|
|
cfg.freq_write = 13000000;
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef ST7265_HSYNC_POLARITY
|
|
|
|
|
|
cfg.hsync_polarity = ST7265_HSYNC_POLARITY;
|
|
|
|
|
|
cfg.hsync_front_porch = ST7265_HSYNC_FRONT_PORCH; // 8;
|
|
|
|
|
|
cfg.hsync_pulse_width = ST7265_HSYNC_PULSE_WIDTH; // 4;
|
|
|
|
|
|
cfg.hsync_back_porch = ST7265_HSYNC_BACK_PORCH; // 8;
|
|
|
|
|
|
|
|
|
|
|
|
cfg.vsync_polarity = ST7265_VSYNC_POLARITY; // 0;
|
|
|
|
|
|
cfg.vsync_front_porch = ST7265_VSYNC_FRONT_PORCH; // 8;
|
|
|
|
|
|
cfg.vsync_pulse_width = ST7265_VSYNC_PULSE_WIDTH; // 4;
|
|
|
|
|
|
cfg.vsync_back_porch = ST7265_VSYNC_BACK_PORCH; // 8;
|
|
|
|
|
|
|
|
|
|
|
|
cfg.pclk_idle_high = 1;
|
|
|
|
|
|
cfg.pclk_active_neg = ST7265_PCLK_ACTIVE_NEG; // 0;
|
|
|
|
|
|
// cfg.pclk_idle_high = 0;
|
|
|
|
|
|
// cfg.de_idle_high = 1;
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef ST7262_HSYNC_POLARITY
|
|
|
|
|
|
cfg.hsync_polarity = ST7262_HSYNC_POLARITY;
|
|
|
|
|
|
cfg.hsync_front_porch = ST7262_HSYNC_FRONT_PORCH; // 8;
|
|
|
|
|
|
cfg.hsync_pulse_width = ST7262_HSYNC_PULSE_WIDTH; // 4;
|
|
|
|
|
|
cfg.hsync_back_porch = ST7262_HSYNC_BACK_PORCH; // 8;
|
|
|
|
|
|
|
|
|
|
|
|
cfg.vsync_polarity = ST7262_VSYNC_POLARITY; // 0;
|
|
|
|
|
|
cfg.vsync_front_porch = ST7262_VSYNC_FRONT_PORCH; // 8;
|
|
|
|
|
|
cfg.vsync_pulse_width = ST7262_VSYNC_PULSE_WIDTH; // 4;
|
|
|
|
|
|
cfg.vsync_back_porch = ST7262_VSYNC_BACK_PORCH; // 8;
|
|
|
|
|
|
|
|
|
|
|
|
cfg.pclk_idle_high = 1;
|
|
|
|
|
|
cfg.pclk_active_neg = ST7262_PCLK_ACTIVE_NEG; // 0;
|
|
|
|
|
|
// cfg.pclk_idle_high = 0;
|
|
|
|
|
|
// cfg.de_idle_high = 1;
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef SC7277_HSYNC_POLARITY
|
|
|
|
|
|
cfg.hsync_polarity = SC7277_HSYNC_POLARITY;
|
|
|
|
|
|
cfg.hsync_front_porch = SC7277_HSYNC_FRONT_PORCH; // 8;
|
|
|
|
|
|
cfg.hsync_pulse_width = SC7277_HSYNC_PULSE_WIDTH; // 4;
|
|
|
|
|
|
cfg.hsync_back_porch = SC7277_HSYNC_BACK_PORCH; // 8;
|
|
|
|
|
|
|
|
|
|
|
|
cfg.vsync_polarity = SC7277_VSYNC_POLARITY; // 0;
|
|
|
|
|
|
cfg.vsync_front_porch = SC7277_VSYNC_FRONT_PORCH; // 8;
|
|
|
|
|
|
cfg.vsync_pulse_width = SC7277_VSYNC_PULSE_WIDTH; // 4;
|
|
|
|
|
|
cfg.vsync_back_porch = SC7277_VSYNC_BACK_PORCH; // 8;
|
|
|
|
|
|
|
|
|
|
|
|
cfg.pclk_idle_high = 1;
|
|
|
|
|
|
cfg.pclk_active_neg = SC7277_PCLK_ACTIVE_NEG; // 0;
|
|
|
|
|
|
// cfg.pclk_idle_high = 0;
|
|
|
|
|
|
// cfg.de_idle_high = 1;
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
_bus_instance.config(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
_panel_instance.setBus(&_bus_instance);
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
auto cfg = _touch_instance.config();
|
|
|
|
|
|
cfg.x_min = 0;
|
|
|
|
|
|
cfg.x_max = TFT_WIDTH;
|
|
|
|
|
|
cfg.y_min = 0;
|
|
|
|
|
|
cfg.y_max = TFT_HEIGHT;
|
|
|
|
|
|
cfg.pin_int = -1;
|
|
|
|
|
|
cfg.pin_rst = -1;
|
|
|
|
|
|
cfg.bus_shared = true;
|
|
|
|
|
|
cfg.offset_rotation = 0;
|
|
|
|
|
|
|
|
|
|
|
|
cfg.i2c_port = 0;
|
|
|
|
|
|
cfg.i2c_addr = 0x5D;
|
|
|
|
|
|
cfg.pin_sda = I2C_SDA;
|
|
|
|
|
|
cfg.pin_scl = I2C_SCL;
|
|
|
|
|
|
cfg.freq = 400000;
|
|
|
|
|
|
_touch_instance.config(cfg);
|
|
|
|
|
|
_panel_instance.setTouch(&_touch_instance);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
setPanel(&_panel_instance);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static LGFX *tft = nullptr;
|
|
|
|
|
|
|
|
|
|
|
|
#elif defined(ILI9488_CS)
|
|
|
|
|
|
#include <LovyanGFX.hpp> // Graphics and font library for ILI9488 driver chip
|
|
|
|
|
|
|
|
|
|
|
|
class LGFX : public lgfx::LGFX_Device
|
|
|
|
|
|
{
|
|
|
|
|
|
lgfx::Panel_ILI9488 _panel_instance;
|
|
|
|
|
|
lgfx::Bus_SPI _bus_instance;
|
|
|
|
|
|
lgfx::Light_PWM _light_instance;
|
|
|
|
|
|
lgfx::Touch_GT911 _touch_instance;
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
LGFX(void)
|
|
|
|
|
|
{
|
|
|
|
|
|
{
|
|
|
|
|
|
auto cfg = _bus_instance.config();
|
|
|
|
|
|
|
|
|
|
|
|
// configure SPI
|
|
|
|
|
|
cfg.spi_host = ILI9488_SPI_HOST; // ESP32-S2,S3,C3 : SPI2_HOST or SPI3_HOST / ESP32 : VSPI_HOST or HSPI_HOST
|
|
|
|
|
|
cfg.spi_mode = 0;
|
|
|
|
|
|
cfg.freq_write = SPI_FREQUENCY; // SPI clock for transmission (up to 80MHz, rounded to the value obtained by dividing
|
|
|
|
|
|
// 80MHz by an integer)
|
|
|
|
|
|
cfg.freq_read = SPI_READ_FREQUENCY; // SPI clock when receiving
|
|
|
|
|
|
cfg.spi_3wire = false; // Set to true if reception is done on the MOSI pin
|
|
|
|
|
|
cfg.use_lock = true; // Set to true to use transaction locking
|
|
|
|
|
|
cfg.dma_channel = SPI_DMA_CH_AUTO; // SPI_DMA_CH_AUTO; // Set DMA channel to use (0=not use DMA / 1=1ch / 2=ch /
|
|
|
|
|
|
// SPI_DMA_CH_AUTO=auto setting)
|
|
|
|
|
|
cfg.pin_sclk = ILI9488_SCK; // Set SPI SCLK pin number
|
|
|
|
|
|
cfg.pin_mosi = ILI9488_SDA; // Set SPI MOSI pin number
|
|
|
|
|
|
cfg.pin_miso = ILI9488_MISO; // Set SPI MISO pin number (-1 = disable)
|
|
|
|
|
|
cfg.pin_dc = ILI9488_RS; // Set SPI DC pin number (-1 = disable)
|
|
|
|
|
|
|
|
|
|
|
|
_bus_instance.config(cfg); // applies the set value to the bus.
|
|
|
|
|
|
_panel_instance.setBus(&_bus_instance); // set the bus on the panel.
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
{ // Set the display panel control.
|
|
|
|
|
|
auto cfg = _panel_instance.config(); // Gets a structure for display panel settings.
|
|
|
|
|
|
|
|
|
|
|
|
cfg.pin_cs = ILI9488_CS; // Pin number where CS is connected (-1 = disable)
|
|
|
|
|
|
cfg.pin_rst = -1; // Pin number where RST is connected (-1 = disable)
|
|
|
|
|
|
cfg.pin_busy = -1; // Pin number where BUSY is connected (-1 = disable)
|
|
|
|
|
|
|
|
|
|
|
|
// The following setting values are general initial values for each panel, so please comment out any
|
|
|
|
|
|
// unknown items and try them.
|
|
|
|
|
|
|
|
|
|
|
|
cfg.memory_width = TFT_WIDTH; // Maximum width supported by the driver IC
|
|
|
|
|
|
cfg.memory_height = TFT_HEIGHT; // Maximum height supported by the driver IC
|
|
|
|
|
|
cfg.panel_width = TFT_WIDTH; // actual displayable width
|
|
|
|
|
|
cfg.panel_height = TFT_HEIGHT; // actual displayable height
|
|
|
|
|
|
cfg.offset_x = TFT_OFFSET_X; // Panel offset amount in X direction
|
|
|
|
|
|
cfg.offset_y = TFT_OFFSET_Y; // Panel offset amount in Y direction
|
|
|
|
|
|
cfg.offset_rotation = TFT_OFFSET_ROTATION; // Rotation direction value offset 0~7 (4~7 is mirrored)
|
|
|
|
|
|
#ifdef TFT_DUMMY_READ_PIXELS
|
|
|
|
|
|
cfg.dummy_read_pixel = TFT_DUMMY_READ_PIXELS; // Number of bits for dummy read before pixel readout
|
|
|
|
|
|
#else
|
|
|
|
|
|
cfg.dummy_read_pixel = 9; // Number of bits for dummy read before pixel readout
|
|
|
|
|
|
#endif
|
|
|
|
|
|
cfg.dummy_read_bits = 1; // Number of bits for dummy read before non-pixel data read
|
|
|
|
|
|
cfg.readable = true; // Set to true if data can be read
|
|
|
|
|
|
cfg.invert = true; // Set to true if the light/darkness of the panel is reversed
|
|
|
|
|
|
cfg.rgb_order = false; // Set to true if the panel's red and blue are swapped
|
|
|
|
|
|
cfg.dlen_16bit =
|
|
|
|
|
|
false; // Set to true for panels that transmit data length in 16-bit units with 16-bit parallel or SPI
|
|
|
|
|
|
cfg.bus_shared = true; // If the bus is shared with the SD card, set to true (bus control with drawJpgFile etc.)
|
|
|
|
|
|
|
|
|
|
|
|
// Set the following only when the display is shifted with a driver with a variable number of pixels, such as the
|
|
|
|
|
|
// ST7735 or ILI9163.
|
|
|
|
|
|
// cfg.memory_width = TFT_WIDTH; // Maximum width supported by the driver IC
|
|
|
|
|
|
// cfg.memory_height = TFT_HEIGHT; // Maximum height supported by the driver IC
|
|
|
|
|
|
_panel_instance.config(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef ILI9488_BL
|
|
|
|
|
|
// Set the backlight control
|
|
|
|
|
|
{
|
|
|
|
|
|
auto cfg = _light_instance.config(); // Gets a structure for backlight settings.
|
|
|
|
|
|
|
|
|
|
|
|
cfg.pin_bl = ILI9488_BL; // Pin number to which the backlight is connected
|
|
|
|
|
|
cfg.invert = false; // true to invert the brightness of the backlight
|
|
|
|
|
|
// cfg.freq = 44100; // PWM frequency of backlight
|
|
|
|
|
|
// cfg.pwm_channel = 1; // PWM channel number to use
|
|
|
|
|
|
|
|
|
|
|
|
_light_instance.config(cfg);
|
|
|
|
|
|
_panel_instance.setLight(&_light_instance); // Set the backlight on the panel.
|
|
|
|
|
|
}
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_TOUCHSCREEN
|
|
|
|
|
|
// Configure settings for touch screen control.
|
|
|
|
|
|
{
|
|
|
|
|
|
auto cfg = _touch_instance.config();
|
|
|
|
|
|
|
|
|
|
|
|
cfg.pin_cs = -1;
|
|
|
|
|
|
cfg.x_min = 0;
|
|
|
|
|
|
cfg.x_max = TFT_HEIGHT - 1;
|
|
|
|
|
|
cfg.y_min = 0;
|
|
|
|
|
|
cfg.y_max = TFT_WIDTH - 1;
|
|
|
|
|
|
cfg.pin_int = SCREEN_TOUCH_INT;
|
|
|
|
|
|
#ifdef SCREEN_TOUCH_RST
|
|
|
|
|
|
cfg.pin_rst = SCREEN_TOUCH_RST;
|
|
|
|
|
|
#endif
|
|
|
|
|
|
cfg.bus_shared = true;
|
|
|
|
|
|
cfg.offset_rotation = TFT_OFFSET_ROTATION;
|
|
|
|
|
|
// cfg.freq = 2500000;
|
|
|
|
|
|
|
|
|
|
|
|
// I2C
|
|
|
|
|
|
cfg.i2c_port = TOUCH_I2C_PORT;
|
|
|
|
|
|
cfg.i2c_addr = TOUCH_SLAVE_ADDRESS;
|
|
|
|
|
|
#ifdef SCREEN_TOUCH_USE_I2C1
|
|
|
|
|
|
cfg.pin_sda = I2C_SDA1;
|
|
|
|
|
|
cfg.pin_scl = I2C_SCL1;
|
|
|
|
|
|
#else
|
|
|
|
|
|
cfg.pin_sda = I2C_SDA;
|
|
|
|
|
|
cfg.pin_scl = I2C_SCL;
|
|
|
|
|
|
#endif
|
|
|
|
|
|
// cfg.freq = 400000;
|
|
|
|
|
|
|
|
|
|
|
|
_touch_instance.config(cfg);
|
|
|
|
|
|
_panel_instance.setTouch(&_touch_instance);
|
|
|
|
|
|
}
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
setPanel(&_panel_instance);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static LGFX *tft = nullptr;
|
|
|
|
|
|
|
2023-07-19 15:13:51 +02:00
|
|
|
|
#elif defined(ST7789_CS)
|
|
|
|
|
|
#include <LovyanGFX.hpp> // Graphics and font library for ST7735 driver chip
|
|
|
|
|
|
|
|
|
|
|
|
class LGFX : public lgfx::LGFX_Device
|
|
|
|
|
|
{
|
|
|
|
|
|
lgfx::Panel_ST7789 _panel_instance;
|
|
|
|
|
|
lgfx::Bus_SPI _bus_instance;
|
|
|
|
|
|
lgfx::Light_PWM _light_instance;
|
2023-08-07 19:34:42 +02:00
|
|
|
|
#if HAS_TOUCHSCREEN
|
2025-04-17 16:03:37 +02:00
|
|
|
|
#if defined(T_WATCH_S3) || defined(ELECROW)
|
2023-07-22 09:26:54 -05:00
|
|
|
|
lgfx::Touch_FT5x06 _touch_instance;
|
|
|
|
|
|
#else
|
2023-07-19 15:13:51 +02:00
|
|
|
|
lgfx::Touch_GT911 _touch_instance;
|
2023-08-07 19:34:42 +02:00
|
|
|
|
#endif
|
2023-07-22 09:26:54 -05:00
|
|
|
|
#endif
|
2023-07-19 15:13:51 +02:00
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
LGFX(void)
|
|
|
|
|
|
{
|
|
|
|
|
|
{
|
|
|
|
|
|
auto cfg = _bus_instance.config();
|
|
|
|
|
|
|
|
|
|
|
|
// SPI
|
|
|
|
|
|
cfg.spi_host = ST7789_SPI_HOST;
|
|
|
|
|
|
cfg.spi_mode = 0;
|
|
|
|
|
|
cfg.freq_write = SPI_FREQUENCY; // SPI clock for transmission (up to 80MHz, rounded to the value obtained by dividing
|
|
|
|
|
|
// 80MHz by an integer)
|
|
|
|
|
|
cfg.freq_read = SPI_READ_FREQUENCY; // SPI clock when receiving
|
2023-08-07 19:34:42 +02:00
|
|
|
|
cfg.spi_3wire = false;
|
|
|
|
|
|
cfg.use_lock = true; // Set to true to use transaction locking
|
|
|
|
|
|
cfg.dma_channel = SPI_DMA_CH_AUTO; // SPI_DMA_CH_AUTO; // Set DMA channel to use (0=not use DMA / 1=1ch / 2=ch /
|
|
|
|
|
|
// SPI_DMA_CH_AUTO=auto setting)
|
|
|
|
|
|
cfg.pin_sclk = ST7789_SCK; // Set SPI SCLK pin number
|
|
|
|
|
|
cfg.pin_mosi = ST7789_SDA; // Set SPI MOSI pin number
|
|
|
|
|
|
cfg.pin_miso = ST7789_MISO; // Set SPI MISO pin number (-1 = disable)
|
|
|
|
|
|
cfg.pin_dc = ST7789_RS; // Set SPI DC pin number (-1 = disable)
|
2023-07-19 15:13:51 +02:00
|
|
|
|
|
|
|
|
|
|
_bus_instance.config(cfg); // applies the set value to the bus.
|
|
|
|
|
|
_panel_instance.setBus(&_bus_instance); // set the bus on the panel.
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
{ // Set the display panel control.
|
|
|
|
|
|
auto cfg = _panel_instance.config(); // Gets a structure for display panel settings.
|
|
|
|
|
|
|
|
|
|
|
|
cfg.pin_cs = ST7789_CS; // Pin number where CS is connected (-1 = disable)
|
|
|
|
|
|
cfg.pin_rst = -1; // Pin number where RST is connected (-1 = disable)
|
|
|
|
|
|
cfg.pin_busy = -1; // Pin number where BUSY is connected (-1 = disable)
|
|
|
|
|
|
|
|
|
|
|
|
// The following setting values are general initial values for each panel, so please comment out any
|
|
|
|
|
|
// unknown items and try them.
|
2025-06-09 06:27:52 -04:00
|
|
|
|
#if defined(T_WATCH_S3)
|
|
|
|
|
|
cfg.panel_width = 240;
|
|
|
|
|
|
cfg.panel_height = 240;
|
|
|
|
|
|
cfg.memory_width = 240;
|
|
|
|
|
|
cfg.memory_height = 320;
|
|
|
|
|
|
cfg.offset_x = 0;
|
|
|
|
|
|
cfg.offset_y = 0; // No vertical shift needed — panel is top-aligned
|
|
|
|
|
|
cfg.offset_rotation = 2; // Rotate 180° to correct upside-down layout
|
|
|
|
|
|
#else
|
|
|
|
|
|
cfg.memory_width = TFT_WIDTH; // Maximum width supported by the driver IC
|
|
|
|
|
|
cfg.memory_height = TFT_HEIGHT; // Maximum height supported by the driver IC
|
|
|
|
|
|
cfg.panel_width = TFT_WIDTH; // actual displayable width
|
|
|
|
|
|
cfg.panel_height = TFT_HEIGHT; // actual displayable height
|
|
|
|
|
|
cfg.offset_x = TFT_OFFSET_X; // Panel offset amount in X direction
|
|
|
|
|
|
cfg.offset_y = TFT_OFFSET_Y; // Panel offset amount in Y direction
|
|
|
|
|
|
cfg.offset_rotation = TFT_OFFSET_ROTATION; // Rotation direction value offset 0~7 (4~7 is mirrored)
|
|
|
|
|
|
#endif
|
2025-04-17 16:03:37 +02:00
|
|
|
|
#ifdef TFT_DUMMY_READ_PIXELS
|
|
|
|
|
|
cfg.dummy_read_pixel = TFT_DUMMY_READ_PIXELS; // Number of bits for dummy read before pixel readout
|
|
|
|
|
|
#else
|
2025-06-09 06:27:52 -04:00
|
|
|
|
cfg.dummy_read_pixel = 9; // Number of bits for dummy read before pixel readout
|
2025-04-17 16:03:37 +02:00
|
|
|
|
#endif
|
|
|
|
|
|
cfg.dummy_read_bits = 1; // Number of bits for dummy read before non-pixel data read
|
|
|
|
|
|
cfg.readable = true; // Set to true if data can be read
|
|
|
|
|
|
cfg.invert = true; // Set to true if the light/darkness of the panel is reversed
|
|
|
|
|
|
cfg.rgb_order = false; // Set to true if the panel's red and blue are swapped
|
2023-07-19 15:13:51 +02:00
|
|
|
|
cfg.dlen_16bit =
|
|
|
|
|
|
false; // Set to true for panels that transmit data length in 16-bit units with 16-bit parallel or SPI
|
|
|
|
|
|
cfg.bus_shared = true; // If the bus is shared with the SD card, set to true (bus control with drawJpgFile etc.)
|
|
|
|
|
|
|
|
|
|
|
|
// Set the following only when the display is shifted with a driver with a variable number of pixels, such as the
|
|
|
|
|
|
// ST7735 or ILI9163.
|
|
|
|
|
|
// cfg.memory_width = TFT_WIDTH; // Maximum width supported by the driver IC
|
|
|
|
|
|
// cfg.memory_height = TFT_HEIGHT; // Maximum height supported by the driver IC
|
|
|
|
|
|
_panel_instance.config(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-08-22 10:50:44 -07:00
|
|
|
|
#ifdef ST7789_BL
|
2023-07-19 15:13:51 +02:00
|
|
|
|
// Set the backlight control. (delete if not necessary)
|
|
|
|
|
|
{
|
|
|
|
|
|
auto cfg = _light_instance.config(); // Gets a structure for backlight settings.
|
|
|
|
|
|
|
|
|
|
|
|
cfg.pin_bl = ST7789_BL; // Pin number to which the backlight is connected
|
2023-07-30 14:51:26 +02:00
|
|
|
|
cfg.invert = false; // true to invert the brightness of the backlight
|
2023-07-19 15:13:51 +02:00
|
|
|
|
// cfg.pwm_channel = 0;
|
|
|
|
|
|
|
|
|
|
|
|
_light_instance.config(cfg);
|
|
|
|
|
|
_panel_instance.setLight(&_light_instance); // Set the backlight on the panel.
|
|
|
|
|
|
}
|
2024-08-22 10:50:44 -07:00
|
|
|
|
#endif
|
2023-07-19 15:13:51 +02:00
|
|
|
|
|
2023-08-07 19:34:42 +02:00
|
|
|
|
#if HAS_TOUCHSCREEN
|
2023-07-19 15:13:51 +02:00
|
|
|
|
// Configure settings for touch screen control.
|
|
|
|
|
|
{
|
|
|
|
|
|
auto cfg = _touch_instance.config();
|
|
|
|
|
|
|
|
|
|
|
|
cfg.pin_cs = -1;
|
|
|
|
|
|
cfg.x_min = 0;
|
|
|
|
|
|
cfg.x_max = TFT_HEIGHT - 1;
|
|
|
|
|
|
cfg.y_min = 0;
|
|
|
|
|
|
cfg.y_max = TFT_WIDTH - 1;
|
|
|
|
|
|
cfg.pin_int = SCREEN_TOUCH_INT;
|
2025-04-17 16:03:37 +02:00
|
|
|
|
#ifdef SCREEN_TOUCH_RST
|
|
|
|
|
|
cfg.pin_rst = SCREEN_TOUCH_RST;
|
|
|
|
|
|
#endif
|
2023-07-19 15:13:51 +02:00
|
|
|
|
cfg.bus_shared = true;
|
2023-08-08 18:06:39 +02:00
|
|
|
|
cfg.offset_rotation = TFT_OFFSET_ROTATION;
|
2023-07-19 15:13:51 +02:00
|
|
|
|
// cfg.freq = 2500000;
|
|
|
|
|
|
|
|
|
|
|
|
// I2C
|
2023-07-30 14:51:26 +02:00
|
|
|
|
cfg.i2c_port = TOUCH_I2C_PORT;
|
2023-07-19 15:13:51 +02:00
|
|
|
|
cfg.i2c_addr = TOUCH_SLAVE_ADDRESS;
|
2023-07-22 09:26:54 -05:00
|
|
|
|
#ifdef SCREEN_TOUCH_USE_I2C1
|
|
|
|
|
|
cfg.pin_sda = I2C_SDA1;
|
|
|
|
|
|
cfg.pin_scl = I2C_SCL1;
|
|
|
|
|
|
#else
|
2023-07-19 15:13:51 +02:00
|
|
|
|
cfg.pin_sda = I2C_SDA;
|
|
|
|
|
|
cfg.pin_scl = I2C_SCL;
|
2023-07-22 09:26:54 -05:00
|
|
|
|
#endif
|
2023-07-30 14:51:26 +02:00
|
|
|
|
// cfg.freq = 400000;
|
2023-07-19 15:13:51 +02:00
|
|
|
|
|
|
|
|
|
|
_touch_instance.config(cfg);
|
|
|
|
|
|
_panel_instance.setTouch(&_touch_instance);
|
|
|
|
|
|
}
|
2023-08-07 19:34:42 +02:00
|
|
|
|
#endif
|
2023-07-19 15:13:51 +02:00
|
|
|
|
|
|
|
|
|
|
setPanel(&_panel_instance); // Sets the panel to use.
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2023-12-12 20:27:31 -06:00
|
|
|
|
static LGFX *tft = nullptr;
|
2023-07-19 15:13:51 +02:00
|
|
|
|
|
2024-10-04 14:47:14 +02:00
|
|
|
|
#elif defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER)
|
2023-08-06 15:45:47 +02:00
|
|
|
|
|
2024-10-04 14:47:14 +02:00
|
|
|
|
#include <LovyanGFX.hpp> // Graphics and font library for ILI9341/ILI9342 driver chip
|
2023-08-06 15:45:47 +02:00
|
|
|
|
|
|
|
|
|
|
#if defined(ILI9341_BACKLIGHT_EN) && !defined(TFT_BL)
|
|
|
|
|
|
#define TFT_BL ILI9341_BACKLIGHT_EN
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
class LGFX : public lgfx::LGFX_Device
|
|
|
|
|
|
{
|
2024-10-04 14:47:14 +02:00
|
|
|
|
#if defined(ILI9341_DRIVER)
|
2023-08-06 15:45:47 +02:00
|
|
|
|
lgfx::Panel_ILI9341 _panel_instance;
|
2024-10-04 14:47:14 +02:00
|
|
|
|
#elif defined(ILI9342_DRIVER)
|
|
|
|
|
|
lgfx::Panel_ILI9342 _panel_instance;
|
|
|
|
|
|
#endif
|
2023-08-06 15:45:47 +02:00
|
|
|
|
lgfx::Bus_SPI _bus_instance;
|
|
|
|
|
|
lgfx::Light_PWM _light_instance;
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
LGFX(void)
|
|
|
|
|
|
{
|
|
|
|
|
|
{
|
|
|
|
|
|
auto cfg = _bus_instance.config();
|
|
|
|
|
|
|
|
|
|
|
|
// configure SPI
|
2024-10-04 14:47:14 +02:00
|
|
|
|
#if defined(ILI9341_DRIVER)
|
2023-08-06 15:45:47 +02:00
|
|
|
|
cfg.spi_host = ILI9341_SPI_HOST; // ESP32-S2,S3,C3 : SPI2_HOST or SPI3_HOST / ESP32 : VSPI_HOST or HSPI_HOST
|
2024-10-04 14:47:14 +02:00
|
|
|
|
#elif defined(ILI9342_DRIVER)
|
|
|
|
|
|
cfg.spi_host = ILI9342_SPI_HOST; // ESP32-S2,S3,C3 : SPI2_HOST or SPI3_HOST / ESP32 : VSPI_HOST or HSPI_HOST
|
|
|
|
|
|
#endif
|
2023-08-06 15:45:47 +02:00
|
|
|
|
cfg.spi_mode = 0;
|
|
|
|
|
|
cfg.freq_write = SPI_FREQUENCY; // SPI clock for transmission (up to 80MHz, rounded to the value obtained by dividing
|
|
|
|
|
|
// 80MHz by an integer)
|
|
|
|
|
|
cfg.freq_read = SPI_READ_FREQUENCY; // SPI clock when receiving
|
|
|
|
|
|
cfg.spi_3wire = false; // Set to true if reception is done on the MOSI pin
|
|
|
|
|
|
cfg.use_lock = true; // Set to true to use transaction locking
|
|
|
|
|
|
cfg.dma_channel = SPI_DMA_CH_AUTO; // SPI_DMA_CH_AUTO; // Set DMA channel to use (0=not use DMA / 1=1ch / 2=ch /
|
|
|
|
|
|
// SPI_DMA_CH_AUTO=auto setting)
|
2023-08-06 16:03:04 +02:00
|
|
|
|
cfg.pin_sclk = TFT_SCLK; // Set SPI SCLK pin number
|
|
|
|
|
|
cfg.pin_mosi = TFT_MOSI; // Set SPI MOSI pin number
|
|
|
|
|
|
cfg.pin_miso = TFT_MISO; // Set SPI MISO pin number (-1 = disable)
|
|
|
|
|
|
cfg.pin_dc = TFT_DC; // Set SPI DC pin number (-1 = disable)
|
2023-08-06 15:45:47 +02:00
|
|
|
|
|
|
|
|
|
|
_bus_instance.config(cfg); // applies the set value to the bus.
|
|
|
|
|
|
_panel_instance.setBus(&_bus_instance); // set the bus on the panel.
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
{ // Set the display panel control.
|
|
|
|
|
|
auto cfg = _panel_instance.config(); // Gets a structure for display panel settings.
|
|
|
|
|
|
|
|
|
|
|
|
cfg.pin_cs = TFT_CS; // Pin number where CS is connected (-1 = disable)
|
2023-08-06 16:03:04 +02:00
|
|
|
|
cfg.pin_rst = TFT_RST; // Pin number where RST is connected (-1 = disable)
|
2023-08-06 15:45:47 +02:00
|
|
|
|
cfg.pin_busy = TFT_BUSY; // Pin number where BUSY is connected (-1 = disable)
|
|
|
|
|
|
|
|
|
|
|
|
// The following setting values are general initial values for each panel, so please comment out any
|
|
|
|
|
|
// unknown items and try them.
|
|
|
|
|
|
|
|
|
|
|
|
cfg.panel_width = TFT_WIDTH; // actual displayable width
|
|
|
|
|
|
cfg.panel_height = TFT_HEIGHT; // actual displayable height
|
|
|
|
|
|
cfg.offset_x = TFT_OFFSET_X; // Panel offset amount in X direction
|
|
|
|
|
|
cfg.offset_y = TFT_OFFSET_Y; // Panel offset amount in Y direction
|
|
|
|
|
|
cfg.offset_rotation = 0; // Rotation direction value offset 0~7 (4~7 is upside down)
|
|
|
|
|
|
cfg.dummy_read_pixel = 8; // Number of bits for dummy read before pixel readout
|
|
|
|
|
|
cfg.dummy_read_bits = 1; // Number of bits for dummy read before non-pixel data read
|
|
|
|
|
|
cfg.readable = true; // Set to true if data can be read
|
2023-08-06 16:03:04 +02:00
|
|
|
|
cfg.invert = false; // Set to true if the light/darkness of the panel is reversed
|
2023-08-06 15:45:47 +02:00
|
|
|
|
cfg.rgb_order = false; // Set to true if the panel's red and blue are swapped
|
|
|
|
|
|
cfg.dlen_16bit =
|
|
|
|
|
|
false; // Set to true for panels that transmit data length in 16-bit units with 16-bit parallel or SPI
|
|
|
|
|
|
cfg.bus_shared = true; // If the bus is shared with the SD card, set to true (bus control with drawJpgFile etc.)
|
2023-08-06 16:03:04 +02:00
|
|
|
|
|
2023-08-06 15:45:47 +02:00
|
|
|
|
// Set the following only when the display is shifted with a driver with a variable number of pixels, such as the
|
|
|
|
|
|
// ST7735 or ILI9163.
|
|
|
|
|
|
cfg.memory_width = TFT_WIDTH; // Maximum width supported by the driver IC
|
|
|
|
|
|
cfg.memory_height = TFT_HEIGHT; // Maximum height supported by the driver IC
|
|
|
|
|
|
_panel_instance.config(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-08-22 10:50:44 -07:00
|
|
|
|
#ifdef TFT_BL
|
2023-08-06 15:45:47 +02:00
|
|
|
|
// Set the backlight control
|
|
|
|
|
|
{
|
|
|
|
|
|
auto cfg = _light_instance.config(); // Gets a structure for backlight settings.
|
|
|
|
|
|
|
|
|
|
|
|
cfg.pin_bl = TFT_BL; // Pin number to which the backlight is connected
|
2023-08-06 16:03:04 +02:00
|
|
|
|
cfg.invert = false; // true to invert the brightness of the backlight
|
2023-08-06 15:45:47 +02:00
|
|
|
|
// cfg.freq = 44100; // PWM frequency of backlight
|
|
|
|
|
|
// cfg.pwm_channel = 1; // PWM channel number to use
|
|
|
|
|
|
|
|
|
|
|
|
_light_instance.config(cfg);
|
|
|
|
|
|
_panel_instance.setLight(&_light_instance); // Set the backlight on the panel.
|
|
|
|
|
|
}
|
2024-08-22 10:50:44 -07:00
|
|
|
|
#endif
|
2023-08-06 15:45:47 +02:00
|
|
|
|
|
|
|
|
|
|
setPanel(&_panel_instance);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2023-12-12 20:27:31 -06:00
|
|
|
|
static LGFX *tft = nullptr;
|
2023-08-06 15:45:47 +02:00
|
|
|
|
|
|
|
|
|
|
#elif defined(ST7735_CS)
|
2024-10-04 14:47:14 +02:00
|
|
|
|
#include <TFT_eSPI.h> // Graphics and font library for ILI9342 driver chip
|
2023-07-15 15:53:26 +02:00
|
|
|
|
|
2023-12-12 20:27:31 -06:00
|
|
|
|
static TFT_eSPI *tft = nullptr; // Invoke library, pins defined in User_Setup.h
|
Unify the native display config between legacy display and MUI (#6838)
* Add missed include
* Another Warning fix
* Add another HAS_SCREEN
* Namespace fixes
* Removed depricated destination types and re-factored destination screen
* Get rid of Arduino Strings
* Clean up after Copilot
* SixthLine Def, Screen Rename
Added Sixth Line Definition Screen Rename, and Automatic Line Adjustment
* Consistency is hard - fixed "Sixth"
* System Frame Updates
Adjusted line construction to ensure we fit maximum content per screen.
* Fix up notifications
* Add a couple more ifdef HAS_SCREEN lines
* Add screen->isOverlayBannerShowing()
* Don't forget the invert!
* Adjust Nodelist Center Divider
Adjust Nodelist Center Divider
* Fix variable casting
* Fix entryText variable as empty before update to fix validation
* Altitude is int32_t
* Update PowerTelemetry to have correct data type
* Fix cppcheck warnings (#6945)
* Fix cppcheck warnings
* Adjust logic in Power.cpp for power sensor
---------
Co-authored-by: Jason P <applewiz@mac.com>
* More pixel wrangling so things line up NodeList edition
* Adjust NodeList alignments and plumb some background padding for a possible title fix
* Better alignment for banner notifications
* Move title into drawCommonHeader; initial screen tested
* Fonts make spacing items difficult
* Improved beeping booping and other buzzer based feedback (#6947)
* Improved beeping booping and other buzzer based feedback
* audible button feedback (#6949)
* Refactor
---------
Co-authored-by: todd-herbert <herbert.todd@gmail.com>
* Sandpapered the corners of the notification popup
* Finalize drawCommonHeader migration
* Update Title of Favorite Node Screens
* Update node metric alignment on LoRa screen
* Update the border for popups to separate it from background
* Update PaxcounterModule.cpp with CommonHeader
* Update WiFi screen with CommonHeader and related data reflow
* It was not, in fact, pointing up
* Fix build on wismeshtap
* T-deck trackball debounce
* Fix uptime on Device Focused page to actually detail
* Update Sys screen for new uptime, add label to Freq/Chan on LoRa
* Don't display DOP any longer, make Uptime consistent
* Revert Uptime change on Favorites, Apply to Device Focused
* Label the satelite number to avoid confusion
* Boop boop boop boop
* Correct GPS positioning and string consistency across strings for GPS
* Fix GPS text alignment
* Enable canned messages by default
* Don't wake screen on new nodes
* Cannedmessage list emote support added
* Fn+e emote picker for freetext screen
* Actually block CannedInput actions while display is shown
* Add selection menu to bannerOverlay
* Off by one
* Move to unified text layouts and spacing
* Still my Fav without an "e"
* Fully remove EVENT_NODEDB_UPDATED
* Simply LoRa screen
* Make some char pointers const to fix compilation on native targets
* Update drawCompassNorth to include radius
* Fix warning
* button thread cleanup
* Pull OneButton handling from PowerFSM and add MUI switch (#6973)
* Trunk
* Onebutton Menu Support
* Add temporary clock icon
* Add gps location to fsi
* Banner message state reset
* Cast to char to satisfy compiler
* Better fast handling of input during banner
* Fix warning
* Derp
* oops
* Update ref
* Wire buzzer_mode
* remove legacy string->print()
* Only init screen if one found
* Unsigned Char
* More buttonThread cleaning
* screen.cpp button handling cleanup
* The Great Event Rename of 2025
* Fix the Radiomaster
* Missed trackball type change
* Remove unused function
* Make ButtonThread an InputBroker
* Coffee hadn't kicked in yet
* Add clock icon for Navigation Bar
* Restore clock screen definition code - whoops
* ExternalNotifications now observe inputBroker
* Clock rework (#6992)
* Move Clock bits into ClockRenderer space
* Rework clock into all device navigation
* T-Watch Actually Builds Different
* Compile fix
---------
Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
* Add AM/PM to Digital Clock
* Flip Seconds and AM/PM on Clock Display
* Tik-tok pixels are hard
* Fix builds on Thinknode M1
* Check for GPS and don't crash
* Don't endif til the end
* Rework the OneButton thread to be much less of a mess. (#6997)
* Rework the OneButton thread to be much less of a mess. And break lots of targets temporarily
* Update src/input/ButtonThread.h
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix GPS toggle
* Send the shutdown event, not just the kbchar
* Honor the back button in a notificaiton popup
* Draw the right size box for popup with options
* Try to un-break all the things
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* 24-hour Clock Should have leading zero, but not 12-hour
* Fixup some compile errors
* Add intRoutine to ButtonThread init, to get more responsive user button back
* Add Timezone picker
* Fix Warning
* Optionally set the initial selection for the chooser popup
* Make back buttons work in canned messages
* Drop the wrapper classes
* LonPressTime now configurable
* Clock Frame can not longer be blank; just add valid time
* Back buttons everywhere!
* Key Verification confirm banner
* Make Elecrow M* top button a back button
* Add settings saves
* EInk responsiveness fixes
* Linux Input Fixes
* Add Native Trackball/Joystick support, and move UserButton to Input
* No Flight Stick Mode
* Send input event
* Add Channel Utilization to Device Focused frame
* Don't shift screens when we draw new ones
* Add showOverlayBanner arguments to no-op
* trunk
* Default Native trackball to NC
* Fix crash in simulator mode
* Add longLong button press
* Get the args right
* Adjust Bluetooth Pairing Screen to account for bottom navigation.
* Trackball everywhere, and unPhone buttons
* Remap visionmaster secondary button to TB_UP
* Kill ScanAndSelect
* trunk
* No longer need the canned messages input filter
* All Canned All the time
* Fix stm32 compile error regarding inputBroker
* Unify tft lineheights (#7033)
* Create variable line heights based upon SCREEN_HEIGHT
* Refactor textPositions into method -> getTextPositions
* Update SharedUIDisplay.h
---------
Co-authored-by: Jason P <applewiz@mac.com>
* Adjust top distance for larger displays
* Adjust icon sizes for larger displays
* Fix Paxcounter compile errors after code updates
* Pixel wrangling to make larger screens fit better
* Alert frame has precedence over banner -- for now
* Unify on ALT_BUTTON
* Align AM/PM to the digit, not the segment on larger displays
* Move some global pin defines into configuration.h
* Scaffolding for BMM150 9-axis gyro
* Alt button behavior
* Don't add the blank GPS frames without HAS_GPS
* EVENT_NODEDB_UPDATED has been retired
* Clean out LOG_WARN messages from debugging
* Add dismiss message function
* Minor buttonThread cleanup
* Add BMM150 support
* Clean up last warning from dev
* Simplify bmm150 init return logic
* Add option to reply to messages
* Add minimal menu upon selecting home screen
* Move Messages to slot 2, rename GPS to Position, move variables nearer functional usage in Screen.cpp
* Properly dismiss message
* T-Deck Trackball press is not user button
* Add select on favorite frame to launch cannedMessage DM
* Minor wording change
* Less capital letters
* Fix empty message check, time isn't reliable
* drop dead code
* Make UIRenderer a static class instead of namespace
* Fix the select on favorite
* Check if message is empty early and then 'return'
* Add kb_found, and show the option to launch freetype if appropriate
* Ignore impossible touchscreen touches
* Auto scroll fix
* Move linebreak after "from" for banners to maximize screen usage.
* Center "No messages to show" on Message frame
* Start consolidating buzzer behavior
* Fixed signed / unsigned warning
* Cast second parameter of max() to make some targets happy
* Cast kbchar to (char) to make arduino string happy
* Shorten the notice of "No messages"
* Add buzzer mode chooser
* Add regionPicker to Lora icon
* Reduce line spacing and reorder Position screen to resolve overlapping issues
* Update message titles, fix GPS icons, add Back options
* Leftover boops
* Remove chirp
* Make the region selection dismissable when a region is already set
* Add read-aloud functionality on messages w/ esp8266sam
* "Last Heard" is a better label
* tweak the beep
* 5 options
* properly tear down freetext upon cancel
* de-convelute canned messages just a bit
* Correct height of Mail icon in navigation bar
* Remove unused warning
* Consolidate time methods into TimeFormatters
* Oops
* Change LoRa Picker Cancel to Back
* Tweak selection characters on Banner
* Message render not scrolling on 5th line
* More fixes for message scrolling
* Remove the safety next on text overflow - we found that root cause
* Add pin definitions to fix compilation for obscure target
* Don't let the touchscreen send unitialized kbchar values
* Make virtual KB just a bit quicker
* No more double tap, swipe!
* Left is left, and Right is right
* Update horizontal lightning bolt design
* Move from solid to dashed separator for Message Frame
* Single emote feature fix
* Manually sort overlapping elements for now
* Freetext and clearer choices
* Fix ESP32 InkHUD builds on the unify-tft branch (#7087)
* Remove BaseUI branding
* Capitalization is fun
* Revert Meshtastic Boot Frame Changes
* Add ANZ_433 LoRa region to picker
* Update settings.json
---------
Co-authored-by: HarukiToreda <116696711+HarukiToreda@users.noreply.github.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Jason P <applewiz@mac.com>
Co-authored-by: todd-herbert <herbert.todd@gmail.com>
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-21 06:36:04 -05:00
|
|
|
|
#elif ARCH_PORTDUINO
|
2023-12-12 20:27:31 -06:00
|
|
|
|
#include <LovyanGFX.hpp> // Graphics and font library for ST7735 driver chip
|
|
|
|
|
|
|
|
|
|
|
|
class LGFX : public lgfx::LGFX_Device
|
|
|
|
|
|
{
|
2024-12-31 11:18:29 +11:00
|
|
|
|
lgfx::Panel_Device *_panel_instance;
|
2024-04-24 12:47:59 -05:00
|
|
|
|
lgfx::Bus_SPI _bus_instance;
|
2023-12-12 20:27:31 -06:00
|
|
|
|
|
|
|
|
|
|
lgfx::ITouch *_touch_instance;
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
LGFX(void)
|
|
|
|
|
|
{
|
2024-01-12 02:00:31 -06:00
|
|
|
|
if (settingsMap[displayPanel] == st7789)
|
|
|
|
|
|
_panel_instance = new lgfx::Panel_ST7789;
|
|
|
|
|
|
else if (settingsMap[displayPanel] == st7735)
|
|
|
|
|
|
_panel_instance = new lgfx::Panel_ST7735;
|
|
|
|
|
|
else if (settingsMap[displayPanel] == st7735s)
|
|
|
|
|
|
_panel_instance = new lgfx::Panel_ST7735S;
|
2024-12-31 11:18:29 +11:00
|
|
|
|
else if (settingsMap[displayPanel] == st7796)
|
|
|
|
|
|
_panel_instance = new lgfx::Panel_ST7796;
|
2024-02-08 16:29:15 -06:00
|
|
|
|
else if (settingsMap[displayPanel] == ili9341)
|
|
|
|
|
|
_panel_instance = new lgfx::Panel_ILI9341;
|
2024-10-04 14:47:14 +02:00
|
|
|
|
else if (settingsMap[displayPanel] == ili9342)
|
|
|
|
|
|
_panel_instance = new lgfx::Panel_ILI9342;
|
2024-12-31 11:18:29 +11:00
|
|
|
|
else if (settingsMap[displayPanel] == ili9488)
|
|
|
|
|
|
_panel_instance = new lgfx::Panel_ILI9488;
|
|
|
|
|
|
else if (settingsMap[displayPanel] == hx8357d)
|
|
|
|
|
|
_panel_instance = new lgfx::Panel_HX8357D;
|
|
|
|
|
|
else {
|
|
|
|
|
|
_panel_instance = new lgfx::Panel_NULL;
|
2024-12-31 12:01:21 +11:00
|
|
|
|
LOG_ERROR("Unknown display panel configured!");
|
2024-12-31 11:18:29 +11:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-12 20:27:31 -06:00
|
|
|
|
auto buscfg = _bus_instance.config();
|
|
|
|
|
|
buscfg.spi_mode = 0;
|
2024-05-01 13:20:26 -05:00
|
|
|
|
buscfg.spi_host = settingsMap[displayspidev];
|
2023-12-12 20:27:31 -06:00
|
|
|
|
|
|
|
|
|
|
buscfg.pin_dc = settingsMap[displayDC]; // Set SPI DC pin number (-1 = disable)
|
|
|
|
|
|
|
|
|
|
|
|
_bus_instance.config(buscfg); // applies the set value to the bus.
|
|
|
|
|
|
_panel_instance->setBus(&_bus_instance); // set the bus on the panel.
|
|
|
|
|
|
|
|
|
|
|
|
auto cfg = _panel_instance->config(); // Gets a structure for display panel settings.
|
Unify the native display config between legacy display and MUI (#6838)
* Add missed include
* Another Warning fix
* Add another HAS_SCREEN
* Namespace fixes
* Removed depricated destination types and re-factored destination screen
* Get rid of Arduino Strings
* Clean up after Copilot
* SixthLine Def, Screen Rename
Added Sixth Line Definition Screen Rename, and Automatic Line Adjustment
* Consistency is hard - fixed "Sixth"
* System Frame Updates
Adjusted line construction to ensure we fit maximum content per screen.
* Fix up notifications
* Add a couple more ifdef HAS_SCREEN lines
* Add screen->isOverlayBannerShowing()
* Don't forget the invert!
* Adjust Nodelist Center Divider
Adjust Nodelist Center Divider
* Fix variable casting
* Fix entryText variable as empty before update to fix validation
* Altitude is int32_t
* Update PowerTelemetry to have correct data type
* Fix cppcheck warnings (#6945)
* Fix cppcheck warnings
* Adjust logic in Power.cpp for power sensor
---------
Co-authored-by: Jason P <applewiz@mac.com>
* More pixel wrangling so things line up NodeList edition
* Adjust NodeList alignments and plumb some background padding for a possible title fix
* Better alignment for banner notifications
* Move title into drawCommonHeader; initial screen tested
* Fonts make spacing items difficult
* Improved beeping booping and other buzzer based feedback (#6947)
* Improved beeping booping and other buzzer based feedback
* audible button feedback (#6949)
* Refactor
---------
Co-authored-by: todd-herbert <herbert.todd@gmail.com>
* Sandpapered the corners of the notification popup
* Finalize drawCommonHeader migration
* Update Title of Favorite Node Screens
* Update node metric alignment on LoRa screen
* Update the border for popups to separate it from background
* Update PaxcounterModule.cpp with CommonHeader
* Update WiFi screen with CommonHeader and related data reflow
* It was not, in fact, pointing up
* Fix build on wismeshtap
* T-deck trackball debounce
* Fix uptime on Device Focused page to actually detail
* Update Sys screen for new uptime, add label to Freq/Chan on LoRa
* Don't display DOP any longer, make Uptime consistent
* Revert Uptime change on Favorites, Apply to Device Focused
* Label the satelite number to avoid confusion
* Boop boop boop boop
* Correct GPS positioning and string consistency across strings for GPS
* Fix GPS text alignment
* Enable canned messages by default
* Don't wake screen on new nodes
* Cannedmessage list emote support added
* Fn+e emote picker for freetext screen
* Actually block CannedInput actions while display is shown
* Add selection menu to bannerOverlay
* Off by one
* Move to unified text layouts and spacing
* Still my Fav without an "e"
* Fully remove EVENT_NODEDB_UPDATED
* Simply LoRa screen
* Make some char pointers const to fix compilation on native targets
* Update drawCompassNorth to include radius
* Fix warning
* button thread cleanup
* Pull OneButton handling from PowerFSM and add MUI switch (#6973)
* Trunk
* Onebutton Menu Support
* Add temporary clock icon
* Add gps location to fsi
* Banner message state reset
* Cast to char to satisfy compiler
* Better fast handling of input during banner
* Fix warning
* Derp
* oops
* Update ref
* Wire buzzer_mode
* remove legacy string->print()
* Only init screen if one found
* Unsigned Char
* More buttonThread cleaning
* screen.cpp button handling cleanup
* The Great Event Rename of 2025
* Fix the Radiomaster
* Missed trackball type change
* Remove unused function
* Make ButtonThread an InputBroker
* Coffee hadn't kicked in yet
* Add clock icon for Navigation Bar
* Restore clock screen definition code - whoops
* ExternalNotifications now observe inputBroker
* Clock rework (#6992)
* Move Clock bits into ClockRenderer space
* Rework clock into all device navigation
* T-Watch Actually Builds Different
* Compile fix
---------
Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
* Add AM/PM to Digital Clock
* Flip Seconds and AM/PM on Clock Display
* Tik-tok pixels are hard
* Fix builds on Thinknode M1
* Check for GPS and don't crash
* Don't endif til the end
* Rework the OneButton thread to be much less of a mess. (#6997)
* Rework the OneButton thread to be much less of a mess. And break lots of targets temporarily
* Update src/input/ButtonThread.h
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix GPS toggle
* Send the shutdown event, not just the kbchar
* Honor the back button in a notificaiton popup
* Draw the right size box for popup with options
* Try to un-break all the things
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* 24-hour Clock Should have leading zero, but not 12-hour
* Fixup some compile errors
* Add intRoutine to ButtonThread init, to get more responsive user button back
* Add Timezone picker
* Fix Warning
* Optionally set the initial selection for the chooser popup
* Make back buttons work in canned messages
* Drop the wrapper classes
* LonPressTime now configurable
* Clock Frame can not longer be blank; just add valid time
* Back buttons everywhere!
* Key Verification confirm banner
* Make Elecrow M* top button a back button
* Add settings saves
* EInk responsiveness fixes
* Linux Input Fixes
* Add Native Trackball/Joystick support, and move UserButton to Input
* No Flight Stick Mode
* Send input event
* Add Channel Utilization to Device Focused frame
* Don't shift screens when we draw new ones
* Add showOverlayBanner arguments to no-op
* trunk
* Default Native trackball to NC
* Fix crash in simulator mode
* Add longLong button press
* Get the args right
* Adjust Bluetooth Pairing Screen to account for bottom navigation.
* Trackball everywhere, and unPhone buttons
* Remap visionmaster secondary button to TB_UP
* Kill ScanAndSelect
* trunk
* No longer need the canned messages input filter
* All Canned All the time
* Fix stm32 compile error regarding inputBroker
* Unify tft lineheights (#7033)
* Create variable line heights based upon SCREEN_HEIGHT
* Refactor textPositions into method -> getTextPositions
* Update SharedUIDisplay.h
---------
Co-authored-by: Jason P <applewiz@mac.com>
* Adjust top distance for larger displays
* Adjust icon sizes for larger displays
* Fix Paxcounter compile errors after code updates
* Pixel wrangling to make larger screens fit better
* Alert frame has precedence over banner -- for now
* Unify on ALT_BUTTON
* Align AM/PM to the digit, not the segment on larger displays
* Move some global pin defines into configuration.h
* Scaffolding for BMM150 9-axis gyro
* Alt button behavior
* Don't add the blank GPS frames without HAS_GPS
* EVENT_NODEDB_UPDATED has been retired
* Clean out LOG_WARN messages from debugging
* Add dismiss message function
* Minor buttonThread cleanup
* Add BMM150 support
* Clean up last warning from dev
* Simplify bmm150 init return logic
* Add option to reply to messages
* Add minimal menu upon selecting home screen
* Move Messages to slot 2, rename GPS to Position, move variables nearer functional usage in Screen.cpp
* Properly dismiss message
* T-Deck Trackball press is not user button
* Add select on favorite frame to launch cannedMessage DM
* Minor wording change
* Less capital letters
* Fix empty message check, time isn't reliable
* drop dead code
* Make UIRenderer a static class instead of namespace
* Fix the select on favorite
* Check if message is empty early and then 'return'
* Add kb_found, and show the option to launch freetype if appropriate
* Ignore impossible touchscreen touches
* Auto scroll fix
* Move linebreak after "from" for banners to maximize screen usage.
* Center "No messages to show" on Message frame
* Start consolidating buzzer behavior
* Fixed signed / unsigned warning
* Cast second parameter of max() to make some targets happy
* Cast kbchar to (char) to make arduino string happy
* Shorten the notice of "No messages"
* Add buzzer mode chooser
* Add regionPicker to Lora icon
* Reduce line spacing and reorder Position screen to resolve overlapping issues
* Update message titles, fix GPS icons, add Back options
* Leftover boops
* Remove chirp
* Make the region selection dismissable when a region is already set
* Add read-aloud functionality on messages w/ esp8266sam
* "Last Heard" is a better label
* tweak the beep
* 5 options
* properly tear down freetext upon cancel
* de-convelute canned messages just a bit
* Correct height of Mail icon in navigation bar
* Remove unused warning
* Consolidate time methods into TimeFormatters
* Oops
* Change LoRa Picker Cancel to Back
* Tweak selection characters on Banner
* Message render not scrolling on 5th line
* More fixes for message scrolling
* Remove the safety next on text overflow - we found that root cause
* Add pin definitions to fix compilation for obscure target
* Don't let the touchscreen send unitialized kbchar values
* Make virtual KB just a bit quicker
* No more double tap, swipe!
* Left is left, and Right is right
* Update horizontal lightning bolt design
* Move from solid to dashed separator for Message Frame
* Single emote feature fix
* Manually sort overlapping elements for now
* Freetext and clearer choices
* Fix ESP32 InkHUD builds on the unify-tft branch (#7087)
* Remove BaseUI branding
* Capitalization is fun
* Revert Meshtastic Boot Frame Changes
* Add ANZ_433 LoRa region to picker
* Update settings.json
---------
Co-authored-by: HarukiToreda <116696711+HarukiToreda@users.noreply.github.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Jason P <applewiz@mac.com>
Co-authored-by: todd-herbert <herbert.todd@gmail.com>
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-21 06:36:04 -05:00
|
|
|
|
LOG_DEBUG("Width: %d, Height: %d", settingsMap[displayWidth], settingsMap[displayHeight]);
|
2024-01-12 02:00:31 -06:00
|
|
|
|
cfg.pin_cs = settingsMap[displayCS]; // Pin number where CS is connected (-1 = disable)
|
|
|
|
|
|
cfg.pin_rst = settingsMap[displayReset];
|
Unify the native display config between legacy display and MUI (#6838)
* Add missed include
* Another Warning fix
* Add another HAS_SCREEN
* Namespace fixes
* Removed depricated destination types and re-factored destination screen
* Get rid of Arduino Strings
* Clean up after Copilot
* SixthLine Def, Screen Rename
Added Sixth Line Definition Screen Rename, and Automatic Line Adjustment
* Consistency is hard - fixed "Sixth"
* System Frame Updates
Adjusted line construction to ensure we fit maximum content per screen.
* Fix up notifications
* Add a couple more ifdef HAS_SCREEN lines
* Add screen->isOverlayBannerShowing()
* Don't forget the invert!
* Adjust Nodelist Center Divider
Adjust Nodelist Center Divider
* Fix variable casting
* Fix entryText variable as empty before update to fix validation
* Altitude is int32_t
* Update PowerTelemetry to have correct data type
* Fix cppcheck warnings (#6945)
* Fix cppcheck warnings
* Adjust logic in Power.cpp for power sensor
---------
Co-authored-by: Jason P <applewiz@mac.com>
* More pixel wrangling so things line up NodeList edition
* Adjust NodeList alignments and plumb some background padding for a possible title fix
* Better alignment for banner notifications
* Move title into drawCommonHeader; initial screen tested
* Fonts make spacing items difficult
* Improved beeping booping and other buzzer based feedback (#6947)
* Improved beeping booping and other buzzer based feedback
* audible button feedback (#6949)
* Refactor
---------
Co-authored-by: todd-herbert <herbert.todd@gmail.com>
* Sandpapered the corners of the notification popup
* Finalize drawCommonHeader migration
* Update Title of Favorite Node Screens
* Update node metric alignment on LoRa screen
* Update the border for popups to separate it from background
* Update PaxcounterModule.cpp with CommonHeader
* Update WiFi screen with CommonHeader and related data reflow
* It was not, in fact, pointing up
* Fix build on wismeshtap
* T-deck trackball debounce
* Fix uptime on Device Focused page to actually detail
* Update Sys screen for new uptime, add label to Freq/Chan on LoRa
* Don't display DOP any longer, make Uptime consistent
* Revert Uptime change on Favorites, Apply to Device Focused
* Label the satelite number to avoid confusion
* Boop boop boop boop
* Correct GPS positioning and string consistency across strings for GPS
* Fix GPS text alignment
* Enable canned messages by default
* Don't wake screen on new nodes
* Cannedmessage list emote support added
* Fn+e emote picker for freetext screen
* Actually block CannedInput actions while display is shown
* Add selection menu to bannerOverlay
* Off by one
* Move to unified text layouts and spacing
* Still my Fav without an "e"
* Fully remove EVENT_NODEDB_UPDATED
* Simply LoRa screen
* Make some char pointers const to fix compilation on native targets
* Update drawCompassNorth to include radius
* Fix warning
* button thread cleanup
* Pull OneButton handling from PowerFSM and add MUI switch (#6973)
* Trunk
* Onebutton Menu Support
* Add temporary clock icon
* Add gps location to fsi
* Banner message state reset
* Cast to char to satisfy compiler
* Better fast handling of input during banner
* Fix warning
* Derp
* oops
* Update ref
* Wire buzzer_mode
* remove legacy string->print()
* Only init screen if one found
* Unsigned Char
* More buttonThread cleaning
* screen.cpp button handling cleanup
* The Great Event Rename of 2025
* Fix the Radiomaster
* Missed trackball type change
* Remove unused function
* Make ButtonThread an InputBroker
* Coffee hadn't kicked in yet
* Add clock icon for Navigation Bar
* Restore clock screen definition code - whoops
* ExternalNotifications now observe inputBroker
* Clock rework (#6992)
* Move Clock bits into ClockRenderer space
* Rework clock into all device navigation
* T-Watch Actually Builds Different
* Compile fix
---------
Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
* Add AM/PM to Digital Clock
* Flip Seconds and AM/PM on Clock Display
* Tik-tok pixels are hard
* Fix builds on Thinknode M1
* Check for GPS and don't crash
* Don't endif til the end
* Rework the OneButton thread to be much less of a mess. (#6997)
* Rework the OneButton thread to be much less of a mess. And break lots of targets temporarily
* Update src/input/ButtonThread.h
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix GPS toggle
* Send the shutdown event, not just the kbchar
* Honor the back button in a notificaiton popup
* Draw the right size box for popup with options
* Try to un-break all the things
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* 24-hour Clock Should have leading zero, but not 12-hour
* Fixup some compile errors
* Add intRoutine to ButtonThread init, to get more responsive user button back
* Add Timezone picker
* Fix Warning
* Optionally set the initial selection for the chooser popup
* Make back buttons work in canned messages
* Drop the wrapper classes
* LonPressTime now configurable
* Clock Frame can not longer be blank; just add valid time
* Back buttons everywhere!
* Key Verification confirm banner
* Make Elecrow M* top button a back button
* Add settings saves
* EInk responsiveness fixes
* Linux Input Fixes
* Add Native Trackball/Joystick support, and move UserButton to Input
* No Flight Stick Mode
* Send input event
* Add Channel Utilization to Device Focused frame
* Don't shift screens when we draw new ones
* Add showOverlayBanner arguments to no-op
* trunk
* Default Native trackball to NC
* Fix crash in simulator mode
* Add longLong button press
* Get the args right
* Adjust Bluetooth Pairing Screen to account for bottom navigation.
* Trackball everywhere, and unPhone buttons
* Remap visionmaster secondary button to TB_UP
* Kill ScanAndSelect
* trunk
* No longer need the canned messages input filter
* All Canned All the time
* Fix stm32 compile error regarding inputBroker
* Unify tft lineheights (#7033)
* Create variable line heights based upon SCREEN_HEIGHT
* Refactor textPositions into method -> getTextPositions
* Update SharedUIDisplay.h
---------
Co-authored-by: Jason P <applewiz@mac.com>
* Adjust top distance for larger displays
* Adjust icon sizes for larger displays
* Fix Paxcounter compile errors after code updates
* Pixel wrangling to make larger screens fit better
* Alert frame has precedence over banner -- for now
* Unify on ALT_BUTTON
* Align AM/PM to the digit, not the segment on larger displays
* Move some global pin defines into configuration.h
* Scaffolding for BMM150 9-axis gyro
* Alt button behavior
* Don't add the blank GPS frames without HAS_GPS
* EVENT_NODEDB_UPDATED has been retired
* Clean out LOG_WARN messages from debugging
* Add dismiss message function
* Minor buttonThread cleanup
* Add BMM150 support
* Clean up last warning from dev
* Simplify bmm150 init return logic
* Add option to reply to messages
* Add minimal menu upon selecting home screen
* Move Messages to slot 2, rename GPS to Position, move variables nearer functional usage in Screen.cpp
* Properly dismiss message
* T-Deck Trackball press is not user button
* Add select on favorite frame to launch cannedMessage DM
* Minor wording change
* Less capital letters
* Fix empty message check, time isn't reliable
* drop dead code
* Make UIRenderer a static class instead of namespace
* Fix the select on favorite
* Check if message is empty early and then 'return'
* Add kb_found, and show the option to launch freetype if appropriate
* Ignore impossible touchscreen touches
* Auto scroll fix
* Move linebreak after "from" for banners to maximize screen usage.
* Center "No messages to show" on Message frame
* Start consolidating buzzer behavior
* Fixed signed / unsigned warning
* Cast second parameter of max() to make some targets happy
* Cast kbchar to (char) to make arduino string happy
* Shorten the notice of "No messages"
* Add buzzer mode chooser
* Add regionPicker to Lora icon
* Reduce line spacing and reorder Position screen to resolve overlapping issues
* Update message titles, fix GPS icons, add Back options
* Leftover boops
* Remove chirp
* Make the region selection dismissable when a region is already set
* Add read-aloud functionality on messages w/ esp8266sam
* "Last Heard" is a better label
* tweak the beep
* 5 options
* properly tear down freetext upon cancel
* de-convelute canned messages just a bit
* Correct height of Mail icon in navigation bar
* Remove unused warning
* Consolidate time methods into TimeFormatters
* Oops
* Change LoRa Picker Cancel to Back
* Tweak selection characters on Banner
* Message render not scrolling on 5th line
* More fixes for message scrolling
* Remove the safety next on text overflow - we found that root cause
* Add pin definitions to fix compilation for obscure target
* Don't let the touchscreen send unitialized kbchar values
* Make virtual KB just a bit quicker
* No more double tap, swipe!
* Left is left, and Right is right
* Update horizontal lightning bolt design
* Move from solid to dashed separator for Message Frame
* Single emote feature fix
* Manually sort overlapping elements for now
* Freetext and clearer choices
* Fix ESP32 InkHUD builds on the unify-tft branch (#7087)
* Remove BaseUI branding
* Capitalization is fun
* Revert Meshtastic Boot Frame Changes
* Add ANZ_433 LoRa region to picker
* Update settings.json
---------
Co-authored-by: HarukiToreda <116696711+HarukiToreda@users.noreply.github.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Jason P <applewiz@mac.com>
Co-authored-by: todd-herbert <herbert.todd@gmail.com>
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-21 06:36:04 -05:00
|
|
|
|
if (settingsMap[displayRotate]) {
|
|
|
|
|
|
cfg.panel_width = settingsMap[displayHeight]; // actual displayable width
|
|
|
|
|
|
cfg.panel_height = settingsMap[displayWidth]; // actual displayable height
|
|
|
|
|
|
} else {
|
|
|
|
|
|
cfg.panel_width = settingsMap[displayWidth]; // actual displayable width
|
|
|
|
|
|
cfg.panel_height = settingsMap[displayHeight]; // actual displayable height
|
|
|
|
|
|
}
|
2024-12-31 11:18:29 +11:00
|
|
|
|
cfg.offset_x = settingsMap[displayOffsetX]; // Panel offset amount in X direction
|
|
|
|
|
|
cfg.offset_y = settingsMap[displayOffsetY]; // Panel offset amount in Y direction
|
|
|
|
|
|
cfg.offset_rotation = settingsMap[displayOffsetRotate]; // Rotation direction value offset 0~7 (4~7 is mirrored)
|
|
|
|
|
|
cfg.invert = settingsMap[displayInvert]; // Set to true if the light/darkness of the panel is reversed
|
2023-12-12 20:27:31 -06:00
|
|
|
|
|
|
|
|
|
|
_panel_instance->config(cfg);
|
|
|
|
|
|
|
|
|
|
|
|
// Configure settings for touch control.
|
|
|
|
|
|
if (settingsMap[touchscreenModule]) {
|
|
|
|
|
|
if (settingsMap[touchscreenModule] == xpt2046) {
|
|
|
|
|
|
_touch_instance = new lgfx::Touch_XPT2046;
|
2024-02-08 16:29:15 -06:00
|
|
|
|
} else if (settingsMap[touchscreenModule] == stmpe610) {
|
|
|
|
|
|
_touch_instance = new lgfx::Touch_STMPE610;
|
2024-04-23 14:18:51 -05:00
|
|
|
|
} else if (settingsMap[touchscreenModule] == ft5x06) {
|
|
|
|
|
|
_touch_instance = new lgfx::Touch_FT5x06;
|
2023-12-12 20:27:31 -06:00
|
|
|
|
}
|
|
|
|
|
|
auto touch_cfg = _touch_instance->config();
|
|
|
|
|
|
|
|
|
|
|
|
touch_cfg.pin_cs = settingsMap[touchscreenCS];
|
|
|
|
|
|
touch_cfg.x_min = 0;
|
|
|
|
|
|
touch_cfg.x_max = settingsMap[displayHeight] - 1;
|
|
|
|
|
|
touch_cfg.y_min = 0;
|
|
|
|
|
|
touch_cfg.y_max = settingsMap[displayWidth] - 1;
|
|
|
|
|
|
touch_cfg.pin_int = settingsMap[touchscreenIRQ];
|
|
|
|
|
|
touch_cfg.bus_shared = true;
|
2024-12-31 11:18:29 +11:00
|
|
|
|
touch_cfg.offset_rotation = settingsMap[touchscreenRotate];
|
2024-04-23 14:18:51 -05:00
|
|
|
|
if (settingsMap[touchscreenI2CAddr] != -1) {
|
|
|
|
|
|
touch_cfg.i2c_addr = settingsMap[touchscreenI2CAddr];
|
2024-05-01 13:20:26 -05:00
|
|
|
|
} else {
|
|
|
|
|
|
touch_cfg.spi_host = settingsMap[touchscreenspidev];
|
2024-04-23 14:18:51 -05:00
|
|
|
|
}
|
2023-12-12 20:27:31 -06:00
|
|
|
|
|
|
|
|
|
|
_touch_instance->config(touch_cfg);
|
|
|
|
|
|
_panel_instance->setTouch(_touch_instance);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
setPanel(_panel_instance); // Sets the panel to use.
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
2023-07-15 15:53:26 +02:00
|
|
|
|
|
2023-12-12 20:27:31 -06:00
|
|
|
|
static LGFX *tft = nullptr;
|
2024-04-03 20:17:13 +01:00
|
|
|
|
|
|
|
|
|
|
#elif defined(HX8357_CS)
|
|
|
|
|
|
#include <LovyanGFX.hpp> // Graphics and font library for HX8357 driver chip
|
|
|
|
|
|
|
|
|
|
|
|
class LGFX : public lgfx::LGFX_Device
|
|
|
|
|
|
{
|
|
|
|
|
|
lgfx::Panel_HX8357D _panel_instance;
|
|
|
|
|
|
lgfx::Bus_SPI _bus_instance;
|
2024-04-03 20:34:31 +01:00
|
|
|
|
#if defined(USE_XPT2046)
|
2024-04-16 13:29:08 +01:00
|
|
|
|
lgfx::Touch_XPT2046 _touch_instance;
|
2024-04-03 20:34:31 +01:00
|
|
|
|
#endif
|
2024-04-03 20:17:13 +01:00
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
LGFX(void)
|
|
|
|
|
|
{
|
|
|
|
|
|
// Panel_HX8357D
|
|
|
|
|
|
{
|
|
|
|
|
|
// configure SPI
|
|
|
|
|
|
auto cfg = _bus_instance.config();
|
|
|
|
|
|
|
|
|
|
|
|
cfg.spi_host = HX8357_SPI_HOST;
|
|
|
|
|
|
cfg.spi_mode = 0;
|
|
|
|
|
|
cfg.freq_write = SPI_FREQUENCY; // SPI clock for transmission (up to 80MHz, rounded to the value obtained by dividing
|
|
|
|
|
|
// 80MHz by an integer)
|
|
|
|
|
|
cfg.freq_read = SPI_READ_FREQUENCY; // SPI clock when receiving
|
|
|
|
|
|
cfg.spi_3wire = false; // Set to true if reception is done on the MOSI pin
|
|
|
|
|
|
cfg.use_lock = true; // Set to true to use transaction locking
|
|
|
|
|
|
cfg.dma_channel = SPI_DMA_CH_AUTO; // SPI_DMA_CH_AUTO; // Set DMA channel to use (0=not use DMA / 1=1ch / 2=ch /
|
|
|
|
|
|
// SPI_DMA_CH_AUTO=auto setting)
|
|
|
|
|
|
cfg.pin_sclk = HX8357_SCK; // Set SPI SCLK pin number
|
|
|
|
|
|
cfg.pin_mosi = HX8357_MOSI; // Set SPI MOSI pin number
|
|
|
|
|
|
cfg.pin_miso = HX8357_MISO; // Set SPI MISO pin number (-1 = disable)
|
|
|
|
|
|
cfg.pin_dc = HX8357_RS; // Set SPI DC pin number (-1 = disable)
|
|
|
|
|
|
|
|
|
|
|
|
_bus_instance.config(cfg); // applies the set value to the bus.
|
|
|
|
|
|
_panel_instance.setBus(&_bus_instance); // set the bus on the panel.
|
|
|
|
|
|
}
|
|
|
|
|
|
{
|
|
|
|
|
|
// Set the display panel control.
|
|
|
|
|
|
auto cfg = _panel_instance.config(); // Gets a structure for display panel settings.
|
|
|
|
|
|
|
|
|
|
|
|
cfg.pin_cs = HX8357_CS; // Pin number where CS is connected (-1 = disable)
|
|
|
|
|
|
cfg.pin_rst = HX8357_RESET; // Pin number where RST is connected (-1 = disable)
|
|
|
|
|
|
cfg.pin_busy = HX8357_BUSY; // Pin number where BUSY is connected (-1 = disable)
|
|
|
|
|
|
|
|
|
|
|
|
cfg.panel_width = TFT_WIDTH; // actual displayable width
|
|
|
|
|
|
cfg.panel_height = TFT_HEIGHT; // actual displayable height
|
|
|
|
|
|
cfg.offset_x = TFT_OFFSET_X; // Panel offset amount in X direction
|
|
|
|
|
|
cfg.offset_y = TFT_OFFSET_Y; // Panel offset amount in Y direction
|
|
|
|
|
|
cfg.offset_rotation = TFT_OFFSET_ROTATION; // Rotation direction value offset 0~7 (4~7 is upside down)
|
|
|
|
|
|
cfg.dummy_read_pixel = 8; // Number of bits for dummy read before pixel readout
|
|
|
|
|
|
cfg.dummy_read_bits = 1; // Number of bits for dummy read before non-pixel data read
|
|
|
|
|
|
cfg.readable = true; // Set to true if data can be read
|
|
|
|
|
|
cfg.invert = TFT_INVERT; // Set to true if the light/darkness of the panel is reversed
|
|
|
|
|
|
cfg.rgb_order = false; // Set to true if the panel's red and blue are swapped
|
|
|
|
|
|
cfg.dlen_16bit = false;
|
|
|
|
|
|
cfg.bus_shared = true; // If the bus is shared with the SD card, set to true (bus control with drawJpgFile etc.)
|
|
|
|
|
|
|
|
|
|
|
|
_panel_instance.config(cfg);
|
|
|
|
|
|
}
|
2024-04-03 20:34:31 +01:00
|
|
|
|
#if defined(USE_XPT2046)
|
2024-04-03 20:17:13 +01:00
|
|
|
|
{
|
|
|
|
|
|
// Configure settings for touch control.
|
2024-04-16 13:29:08 +01:00
|
|
|
|
auto touch_cfg = _touch_instance.config();
|
2024-04-03 20:17:13 +01:00
|
|
|
|
|
|
|
|
|
|
touch_cfg.pin_cs = TOUCH_CS;
|
|
|
|
|
|
touch_cfg.x_min = 0;
|
|
|
|
|
|
touch_cfg.x_max = TFT_HEIGHT - 1;
|
|
|
|
|
|
touch_cfg.y_min = 0;
|
|
|
|
|
|
touch_cfg.y_max = TFT_WIDTH - 1;
|
|
|
|
|
|
touch_cfg.pin_int = -1;
|
|
|
|
|
|
touch_cfg.bus_shared = true;
|
|
|
|
|
|
touch_cfg.offset_rotation = 1;
|
|
|
|
|
|
|
2024-04-16 13:29:08 +01:00
|
|
|
|
_touch_instance.config(touch_cfg);
|
|
|
|
|
|
_panel_instance.setTouch(&_touch_instance);
|
2024-04-03 20:17:13 +01:00
|
|
|
|
}
|
2024-04-03 20:34:31 +01:00
|
|
|
|
#endif
|
2024-04-03 20:17:13 +01:00
|
|
|
|
setPanel(&_panel_instance);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static LGFX *tft = nullptr;
|
|
|
|
|
|
|
2024-09-12 13:44:30 +02:00
|
|
|
|
#elif defined(ST7701_CS)
|
|
|
|
|
|
#include <LovyanGFX.hpp> // Graphics and font library for ST7701 driver chip
|
|
|
|
|
|
#include <lgfx/v1/platforms/esp32s3/Bus_RGB.hpp>
|
|
|
|
|
|
#include <lgfx/v1/platforms/esp32s3/Panel_RGB.hpp>
|
|
|
|
|
|
|
|
|
|
|
|
class LGFX : public lgfx::LGFX_Device
|
|
|
|
|
|
{
|
|
|
|
|
|
lgfx::Panel_ST7701 _panel_instance;
|
|
|
|
|
|
lgfx::Bus_RGB _bus_instance;
|
|
|
|
|
|
lgfx::Light_PWM _light_instance;
|
|
|
|
|
|
lgfx::Touch_FT5x06 _touch_instance;
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
LGFX(void)
|
|
|
|
|
|
{
|
|
|
|
|
|
{
|
|
|
|
|
|
auto cfg = _panel_instance.config();
|
|
|
|
|
|
cfg.memory_width = 800;
|
|
|
|
|
|
cfg.memory_height = 480;
|
|
|
|
|
|
cfg.panel_width = TFT_WIDTH;
|
|
|
|
|
|
cfg.panel_height = TFT_HEIGHT;
|
|
|
|
|
|
cfg.offset_x = TFT_OFFSET_X;
|
|
|
|
|
|
cfg.offset_y = TFT_OFFSET_Y;
|
|
|
|
|
|
_panel_instance.config(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
auto cfg = _panel_instance.config_detail();
|
|
|
|
|
|
cfg.pin_cs = ST7701_CS;
|
|
|
|
|
|
cfg.pin_sclk = ST7701_SCK;
|
|
|
|
|
|
cfg.pin_mosi = ST7701_SDA;
|
|
|
|
|
|
// cfg.use_psram = 1;
|
|
|
|
|
|
_panel_instance.config_detail(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
auto cfg = _bus_instance.config();
|
|
|
|
|
|
cfg.panel = &_panel_instance;
|
|
|
|
|
|
#ifdef SENSECAP_INDICATOR
|
|
|
|
|
|
cfg.pin_d0 = GPIO_NUM_15; // B0
|
|
|
|
|
|
cfg.pin_d1 = GPIO_NUM_14; // B1
|
|
|
|
|
|
cfg.pin_d2 = GPIO_NUM_13; // B2
|
|
|
|
|
|
cfg.pin_d3 = GPIO_NUM_12; // B3
|
|
|
|
|
|
cfg.pin_d4 = GPIO_NUM_11; // B4
|
|
|
|
|
|
|
|
|
|
|
|
cfg.pin_d5 = GPIO_NUM_10; // G0
|
|
|
|
|
|
cfg.pin_d6 = GPIO_NUM_9; // G1
|
|
|
|
|
|
cfg.pin_d7 = GPIO_NUM_8; // G2
|
|
|
|
|
|
cfg.pin_d8 = GPIO_NUM_7; // G3
|
|
|
|
|
|
cfg.pin_d9 = GPIO_NUM_6; // G4
|
|
|
|
|
|
cfg.pin_d10 = GPIO_NUM_5; // G5
|
|
|
|
|
|
|
|
|
|
|
|
cfg.pin_d11 = GPIO_NUM_4; // R0
|
|
|
|
|
|
cfg.pin_d12 = GPIO_NUM_3; // R1
|
|
|
|
|
|
cfg.pin_d13 = GPIO_NUM_2; // R2
|
|
|
|
|
|
cfg.pin_d14 = GPIO_NUM_1; // R3
|
|
|
|
|
|
cfg.pin_d15 = GPIO_NUM_0; // R4
|
|
|
|
|
|
|
|
|
|
|
|
cfg.pin_henable = GPIO_NUM_18;
|
|
|
|
|
|
cfg.pin_vsync = GPIO_NUM_17;
|
|
|
|
|
|
cfg.pin_hsync = GPIO_NUM_16;
|
|
|
|
|
|
cfg.pin_pclk = GPIO_NUM_21;
|
|
|
|
|
|
cfg.freq_write = 12000000;
|
|
|
|
|
|
|
|
|
|
|
|
cfg.hsync_polarity = 0;
|
|
|
|
|
|
cfg.hsync_front_porch = 10;
|
|
|
|
|
|
cfg.hsync_pulse_width = 8;
|
|
|
|
|
|
cfg.hsync_back_porch = 50;
|
|
|
|
|
|
|
|
|
|
|
|
cfg.vsync_polarity = 0;
|
|
|
|
|
|
cfg.vsync_front_porch = 10;
|
|
|
|
|
|
cfg.vsync_pulse_width = 8;
|
|
|
|
|
|
cfg.vsync_back_porch = 20;
|
|
|
|
|
|
|
|
|
|
|
|
cfg.pclk_active_neg = 0;
|
|
|
|
|
|
cfg.de_idle_high = 1;
|
|
|
|
|
|
cfg.pclk_idle_high = 0;
|
|
|
|
|
|
#endif
|
|
|
|
|
|
_bus_instance.config(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
_panel_instance.setBus(&_bus_instance);
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
auto cfg = _light_instance.config();
|
|
|
|
|
|
cfg.pin_bl = ST7701_BL;
|
|
|
|
|
|
_light_instance.config(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
_panel_instance.light(&_light_instance);
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
auto cfg = _touch_instance.config();
|
|
|
|
|
|
cfg.pin_cs = -1;
|
|
|
|
|
|
cfg.x_min = 0;
|
|
|
|
|
|
cfg.x_max = 479;
|
|
|
|
|
|
cfg.y_min = 0;
|
|
|
|
|
|
cfg.y_max = 479;
|
|
|
|
|
|
cfg.pin_int = -1; // don't use SCREEN_TOUCH_INT;
|
|
|
|
|
|
cfg.pin_rst = SCREEN_TOUCH_RST;
|
|
|
|
|
|
cfg.bus_shared = true;
|
|
|
|
|
|
cfg.offset_rotation = TFT_OFFSET_ROTATION;
|
|
|
|
|
|
|
|
|
|
|
|
cfg.i2c_port = TOUCH_I2C_PORT;
|
|
|
|
|
|
cfg.i2c_addr = TOUCH_SLAVE_ADDRESS;
|
|
|
|
|
|
cfg.pin_sda = I2C_SDA;
|
|
|
|
|
|
cfg.pin_scl = I2C_SCL;
|
|
|
|
|
|
cfg.freq = 400000;
|
|
|
|
|
|
_touch_instance.config(cfg);
|
|
|
|
|
|
_panel_instance.setTouch(&_touch_instance);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
setPanel(&_panel_instance);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static LGFX *tft = nullptr;
|
|
|
|
|
|
|
2023-07-15 15:53:26 +02:00
|
|
|
|
#endif
|
|
|
|
|
|
|
2024-10-04 14:47:14 +02:00
|
|
|
|
#if defined(ST7701_CS) || defined(ST7735_CS) || defined(ST7789_CS) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || \
|
2025-04-17 16:03:37 +02:00
|
|
|
|
defined(RAK14014) || defined(HX8357_CS) || defined(ILI9488_CS) || defined(ST72xx_DE) || (ARCH_PORTDUINO && HAS_SCREEN != 0)
|
2020-08-28 17:38:23 -07:00
|
|
|
|
#include "SPILock.h"
|
2020-09-26 09:40:48 -07:00
|
|
|
|
#include "TFTDisplay.h"
|
2020-08-17 13:47:05 -07:00
|
|
|
|
#include <SPI.h>
|
|
|
|
|
|
|
2024-04-16 13:29:08 +01:00
|
|
|
|
#ifdef UNPHONE
|
|
|
|
|
|
#include "unPhone.h"
|
|
|
|
|
|
extern unPhone unphone;
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
2024-08-28 10:44:46 -07:00
|
|
|
|
GpioPin *TFTDisplay::backlightEnable = NULL;
|
|
|
|
|
|
|
2023-03-08 19:13:46 -08:00
|
|
|
|
TFTDisplay::TFTDisplay(uint8_t address, int sda, int scl, OLEDDISPLAY_GEOMETRY geometry, HW_I2C i2cBus)
|
2020-08-28 15:06:52 -07:00
|
|
|
|
{
|
2024-10-14 06:11:43 +02:00
|
|
|
|
LOG_DEBUG("TFTDisplay!");
|
2024-08-22 10:38:19 -07:00
|
|
|
|
|
|
|
|
|
|
#ifdef TFT_BL
|
|
|
|
|
|
GpioPin *p = new GpioHwPin(TFT_BL);
|
|
|
|
|
|
|
|
|
|
|
|
if (!TFT_BACKLIGHT_ON) { // Need to invert the pin before hardware
|
|
|
|
|
|
auto virtPin = new GpioVirtPin();
|
|
|
|
|
|
new GpioNotTransformer(
|
|
|
|
|
|
virtPin, p); // We just leave this created object on the heap so it can stay watching virtPin and driving en_gpio
|
|
|
|
|
|
p = virtPin;
|
|
|
|
|
|
}
|
|
|
|
|
|
#else
|
|
|
|
|
|
GpioPin *p = new GpioVirtPin(); // Just simulate a pin
|
|
|
|
|
|
#endif
|
|
|
|
|
|
backlightEnable = p;
|
|
|
|
|
|
|
2024-01-12 02:00:31 -06:00
|
|
|
|
#if ARCH_PORTDUINO
|
2023-12-12 20:27:31 -06:00
|
|
|
|
if (settingsMap[displayRotate]) {
|
|
|
|
|
|
setGeometry(GEOMETRY_RAWMODE, settingsMap[configNames::displayWidth], settingsMap[configNames::displayHeight]);
|
Unify the native display config between legacy display and MUI (#6838)
* Add missed include
* Another Warning fix
* Add another HAS_SCREEN
* Namespace fixes
* Removed depricated destination types and re-factored destination screen
* Get rid of Arduino Strings
* Clean up after Copilot
* SixthLine Def, Screen Rename
Added Sixth Line Definition Screen Rename, and Automatic Line Adjustment
* Consistency is hard - fixed "Sixth"
* System Frame Updates
Adjusted line construction to ensure we fit maximum content per screen.
* Fix up notifications
* Add a couple more ifdef HAS_SCREEN lines
* Add screen->isOverlayBannerShowing()
* Don't forget the invert!
* Adjust Nodelist Center Divider
Adjust Nodelist Center Divider
* Fix variable casting
* Fix entryText variable as empty before update to fix validation
* Altitude is int32_t
* Update PowerTelemetry to have correct data type
* Fix cppcheck warnings (#6945)
* Fix cppcheck warnings
* Adjust logic in Power.cpp for power sensor
---------
Co-authored-by: Jason P <applewiz@mac.com>
* More pixel wrangling so things line up NodeList edition
* Adjust NodeList alignments and plumb some background padding for a possible title fix
* Better alignment for banner notifications
* Move title into drawCommonHeader; initial screen tested
* Fonts make spacing items difficult
* Improved beeping booping and other buzzer based feedback (#6947)
* Improved beeping booping and other buzzer based feedback
* audible button feedback (#6949)
* Refactor
---------
Co-authored-by: todd-herbert <herbert.todd@gmail.com>
* Sandpapered the corners of the notification popup
* Finalize drawCommonHeader migration
* Update Title of Favorite Node Screens
* Update node metric alignment on LoRa screen
* Update the border for popups to separate it from background
* Update PaxcounterModule.cpp with CommonHeader
* Update WiFi screen with CommonHeader and related data reflow
* It was not, in fact, pointing up
* Fix build on wismeshtap
* T-deck trackball debounce
* Fix uptime on Device Focused page to actually detail
* Update Sys screen for new uptime, add label to Freq/Chan on LoRa
* Don't display DOP any longer, make Uptime consistent
* Revert Uptime change on Favorites, Apply to Device Focused
* Label the satelite number to avoid confusion
* Boop boop boop boop
* Correct GPS positioning and string consistency across strings for GPS
* Fix GPS text alignment
* Enable canned messages by default
* Don't wake screen on new nodes
* Cannedmessage list emote support added
* Fn+e emote picker for freetext screen
* Actually block CannedInput actions while display is shown
* Add selection menu to bannerOverlay
* Off by one
* Move to unified text layouts and spacing
* Still my Fav without an "e"
* Fully remove EVENT_NODEDB_UPDATED
* Simply LoRa screen
* Make some char pointers const to fix compilation on native targets
* Update drawCompassNorth to include radius
* Fix warning
* button thread cleanup
* Pull OneButton handling from PowerFSM and add MUI switch (#6973)
* Trunk
* Onebutton Menu Support
* Add temporary clock icon
* Add gps location to fsi
* Banner message state reset
* Cast to char to satisfy compiler
* Better fast handling of input during banner
* Fix warning
* Derp
* oops
* Update ref
* Wire buzzer_mode
* remove legacy string->print()
* Only init screen if one found
* Unsigned Char
* More buttonThread cleaning
* screen.cpp button handling cleanup
* The Great Event Rename of 2025
* Fix the Radiomaster
* Missed trackball type change
* Remove unused function
* Make ButtonThread an InputBroker
* Coffee hadn't kicked in yet
* Add clock icon for Navigation Bar
* Restore clock screen definition code - whoops
* ExternalNotifications now observe inputBroker
* Clock rework (#6992)
* Move Clock bits into ClockRenderer space
* Rework clock into all device navigation
* T-Watch Actually Builds Different
* Compile fix
---------
Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
* Add AM/PM to Digital Clock
* Flip Seconds and AM/PM on Clock Display
* Tik-tok pixels are hard
* Fix builds on Thinknode M1
* Check for GPS and don't crash
* Don't endif til the end
* Rework the OneButton thread to be much less of a mess. (#6997)
* Rework the OneButton thread to be much less of a mess. And break lots of targets temporarily
* Update src/input/ButtonThread.h
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix GPS toggle
* Send the shutdown event, not just the kbchar
* Honor the back button in a notificaiton popup
* Draw the right size box for popup with options
* Try to un-break all the things
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* 24-hour Clock Should have leading zero, but not 12-hour
* Fixup some compile errors
* Add intRoutine to ButtonThread init, to get more responsive user button back
* Add Timezone picker
* Fix Warning
* Optionally set the initial selection for the chooser popup
* Make back buttons work in canned messages
* Drop the wrapper classes
* LonPressTime now configurable
* Clock Frame can not longer be blank; just add valid time
* Back buttons everywhere!
* Key Verification confirm banner
* Make Elecrow M* top button a back button
* Add settings saves
* EInk responsiveness fixes
* Linux Input Fixes
* Add Native Trackball/Joystick support, and move UserButton to Input
* No Flight Stick Mode
* Send input event
* Add Channel Utilization to Device Focused frame
* Don't shift screens when we draw new ones
* Add showOverlayBanner arguments to no-op
* trunk
* Default Native trackball to NC
* Fix crash in simulator mode
* Add longLong button press
* Get the args right
* Adjust Bluetooth Pairing Screen to account for bottom navigation.
* Trackball everywhere, and unPhone buttons
* Remap visionmaster secondary button to TB_UP
* Kill ScanAndSelect
* trunk
* No longer need the canned messages input filter
* All Canned All the time
* Fix stm32 compile error regarding inputBroker
* Unify tft lineheights (#7033)
* Create variable line heights based upon SCREEN_HEIGHT
* Refactor textPositions into method -> getTextPositions
* Update SharedUIDisplay.h
---------
Co-authored-by: Jason P <applewiz@mac.com>
* Adjust top distance for larger displays
* Adjust icon sizes for larger displays
* Fix Paxcounter compile errors after code updates
* Pixel wrangling to make larger screens fit better
* Alert frame has precedence over banner -- for now
* Unify on ALT_BUTTON
* Align AM/PM to the digit, not the segment on larger displays
* Move some global pin defines into configuration.h
* Scaffolding for BMM150 9-axis gyro
* Alt button behavior
* Don't add the blank GPS frames without HAS_GPS
* EVENT_NODEDB_UPDATED has been retired
* Clean out LOG_WARN messages from debugging
* Add dismiss message function
* Minor buttonThread cleanup
* Add BMM150 support
* Clean up last warning from dev
* Simplify bmm150 init return logic
* Add option to reply to messages
* Add minimal menu upon selecting home screen
* Move Messages to slot 2, rename GPS to Position, move variables nearer functional usage in Screen.cpp
* Properly dismiss message
* T-Deck Trackball press is not user button
* Add select on favorite frame to launch cannedMessage DM
* Minor wording change
* Less capital letters
* Fix empty message check, time isn't reliable
* drop dead code
* Make UIRenderer a static class instead of namespace
* Fix the select on favorite
* Check if message is empty early and then 'return'
* Add kb_found, and show the option to launch freetype if appropriate
* Ignore impossible touchscreen touches
* Auto scroll fix
* Move linebreak after "from" for banners to maximize screen usage.
* Center "No messages to show" on Message frame
* Start consolidating buzzer behavior
* Fixed signed / unsigned warning
* Cast second parameter of max() to make some targets happy
* Cast kbchar to (char) to make arduino string happy
* Shorten the notice of "No messages"
* Add buzzer mode chooser
* Add regionPicker to Lora icon
* Reduce line spacing and reorder Position screen to resolve overlapping issues
* Update message titles, fix GPS icons, add Back options
* Leftover boops
* Remove chirp
* Make the region selection dismissable when a region is already set
* Add read-aloud functionality on messages w/ esp8266sam
* "Last Heard" is a better label
* tweak the beep
* 5 options
* properly tear down freetext upon cancel
* de-convelute canned messages just a bit
* Correct height of Mail icon in navigation bar
* Remove unused warning
* Consolidate time methods into TimeFormatters
* Oops
* Change LoRa Picker Cancel to Back
* Tweak selection characters on Banner
* Message render not scrolling on 5th line
* More fixes for message scrolling
* Remove the safety next on text overflow - we found that root cause
* Add pin definitions to fix compilation for obscure target
* Don't let the touchscreen send unitialized kbchar values
* Make virtual KB just a bit quicker
* No more double tap, swipe!
* Left is left, and Right is right
* Update horizontal lightning bolt design
* Move from solid to dashed separator for Message Frame
* Single emote feature fix
* Manually sort overlapping elements for now
* Freetext and clearer choices
* Fix ESP32 InkHUD builds on the unify-tft branch (#7087)
* Remove BaseUI branding
* Capitalization is fun
* Revert Meshtastic Boot Frame Changes
* Add ANZ_433 LoRa region to picker
* Update settings.json
---------
Co-authored-by: HarukiToreda <116696711+HarukiToreda@users.noreply.github.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Jason P <applewiz@mac.com>
Co-authored-by: todd-herbert <herbert.todd@gmail.com>
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-21 06:36:04 -05:00
|
|
|
|
} else {
|
|
|
|
|
|
setGeometry(GEOMETRY_RAWMODE, settingsMap[configNames::displayHeight], settingsMap[configNames::displayWidth]);
|
2023-12-12 20:27:31 -06:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#elif defined(SCREEN_ROTATE)
|
2022-05-09 19:50:39 +02:00
|
|
|
|
setGeometry(GEOMETRY_RAWMODE, TFT_HEIGHT, TFT_WIDTH);
|
|
|
|
|
|
#else
|
|
|
|
|
|
setGeometry(GEOMETRY_RAWMODE, TFT_WIDTH, TFT_HEIGHT);
|
|
|
|
|
|
#endif
|
2020-08-28 15:06:52 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Write the buffer to the display memory
|
2023-12-12 20:27:31 -06:00
|
|
|
|
void TFTDisplay::display(bool fromBlank)
|
2020-08-28 15:06:52 -07:00
|
|
|
|
{
|
2023-12-12 20:27:31 -06:00
|
|
|
|
if (fromBlank)
|
2024-01-11 10:06:26 -06:00
|
|
|
|
tft->fillScreen(TFT_BLACK);
|
|
|
|
|
|
// tft->clear();
|
2020-08-28 17:38:23 -07:00
|
|
|
|
concurrency::LockGuard g(spiLock);
|
|
|
|
|
|
|
2023-01-20 16:34:39 +01:00
|
|
|
|
uint16_t x, y;
|
2022-09-19 16:57:18 +02:00
|
|
|
|
|
|
|
|
|
|
for (y = 0; y < displayHeight; y++) {
|
|
|
|
|
|
for (x = 0; x < displayWidth; x++) {
|
2022-05-09 19:50:39 +02:00
|
|
|
|
auto isset = buffer[x + (y / 8) * displayWidth] & (1 << (y & 7));
|
2023-12-12 20:27:31 -06:00
|
|
|
|
if (!fromBlank) {
|
|
|
|
|
|
// get src pixel in the page based ordering the OLED lib uses FIXME, super inefficent
|
|
|
|
|
|
auto dblbuf_isset = buffer_back[x + (y / 8) * displayWidth] & (1 << (y & 7));
|
|
|
|
|
|
if (isset != dblbuf_isset) {
|
|
|
|
|
|
tft->drawPixel(x, y, isset ? TFT_MESH : TFT_BLACK);
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if (isset) {
|
|
|
|
|
|
tft->drawPixel(x, y, TFT_MESH);
|
2022-09-19 16:57:18 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
// Copy the Buffer to the Back Buffer
|
|
|
|
|
|
for (y = 0; y < (displayHeight / 8); y++) {
|
|
|
|
|
|
for (x = 0; x < displayWidth; x++) {
|
|
|
|
|
|
uint16_t pos = x + y * displayWidth;
|
|
|
|
|
|
buffer_back[pos] = buffer[pos];
|
2020-08-28 15:33:33 -07:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-08-28 15:06:52 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Send a command to the display (low level function)
|
|
|
|
|
|
void TFTDisplay::sendCommand(uint8_t com)
|
|
|
|
|
|
{
|
2023-07-15 15:53:26 +02:00
|
|
|
|
// handle display on/off directly
|
|
|
|
|
|
switch (com) {
|
|
|
|
|
|
case DISPLAYON: {
|
2024-10-14 06:11:43 +02:00
|
|
|
|
// LOG_DEBUG("Display on");
|
2024-08-22 10:38:19 -07:00
|
|
|
|
backlightEnable->set(true);
|
2024-01-12 02:00:31 -06:00
|
|
|
|
#if ARCH_PORTDUINO
|
2023-12-12 20:27:31 -06:00
|
|
|
|
display(true);
|
|
|
|
|
|
if (settingsMap[displayBacklight] > 0)
|
|
|
|
|
|
digitalWrite(settingsMap[displayBacklight], TFT_BACKLIGHT_ON);
|
2024-04-14 16:11:27 +02:00
|
|
|
|
#elif !defined(RAK14014) && !defined(M5STACK) && !defined(UNPHONE)
|
|
|
|
|
|
tft->wakeup();
|
|
|
|
|
|
tft->powerSaveOff();
|
2023-07-15 15:53:26 +02:00
|
|
|
|
#endif
|
2024-02-20 14:27:48 +01:00
|
|
|
|
|
2023-07-15 15:53:26 +02:00
|
|
|
|
#ifdef VTFT_CTRL
|
|
|
|
|
|
digitalWrite(VTFT_CTRL, LOW);
|
2023-07-30 14:51:26 +02:00
|
|
|
|
#endif
|
2024-04-03 20:17:13 +01:00
|
|
|
|
#ifdef UNPHONE
|
2024-04-16 13:29:08 +01:00
|
|
|
|
unphone.backlight(true); // using unPhone library
|
2024-04-03 20:17:13 +01:00
|
|
|
|
#endif
|
2023-11-13 05:20:49 -07:00
|
|
|
|
#ifdef RAK14014
|
Added modifier key combination to allow keyboard shortcuts on t-deck (#3668)
* Updated kbI2cBase.cpp
Updated keyboard settings for t-deck to allow a modifier key to trigger 'tab', mute notifications, or quit. To trigger the modifier press the shift key and mic (0) button at the same time. Then press q (quit), m (mute), or t (tab).
* Update kbI2cBase.cpp
* fixed formatting issues in kbI2cBase.cpp
* Removed keyboard shortcut code that doesnt work
alt+t does not work on a t-deck so I removed it to avoid confusion.
* Updated kbI2cBase.cpp
Updated keyboard settings for t-deck to allow a modifier key to trigger 'tab', mute notifications, or quit. To trigger the modifier press the shift key and mic (0) button at the same time. Then press q (quit), m (mute), or t (tab).
* Update kbI2cBase.cpp
* fixed formatting issues in kbI2cBase.cpp
* Removed keyboard shortcut code that doesnt work
alt+t does not work on a t-deck so I removed it to avoid confusion.
* Changed modifier key to alt+c
* Added screen brightness functionality
Use modifier key with o(+) to increase brightness or i(-) to decrease.
Currently there are 4 levels of brightness, (L, ML, MH, H). I would like to add a popup message to tell you the brightness.
* Added checks to disable screen brightness changes on unsupported hardware
* Setting the brightness code to work on only applicable devices
* Added "function symbol" display to bottom right corner of screen. Now shows when mute is active or modifier key is pressed. Also fixed some other minor issues.
* commented out a log
* Reworked how modifier functions worked, added
I wasn’t happy with my previous implementation, and I think it would have caused issues with other devices. This should work on all devices.
* Added back the function I moved causing issue with versions
* Fixed the version conflicts, everything seems to work fine now
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
2024-05-08 08:37:50 -04:00
|
|
|
|
#elif !defined(M5STACK) && !defined(ST7789_CS) // T-Deck gets brightness set in Screen.cpp in the handleSetOn function
|
2024-02-20 14:27:48 +01:00
|
|
|
|
tft->setBrightness(172);
|
2023-07-15 15:53:26 +02:00
|
|
|
|
#endif
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
case DISPLAYOFF: {
|
2024-10-14 06:11:43 +02:00
|
|
|
|
// LOG_DEBUG("Display off");
|
2024-08-22 10:38:19 -07:00
|
|
|
|
backlightEnable->set(false);
|
2024-01-12 02:00:31 -06:00
|
|
|
|
#if ARCH_PORTDUINO
|
2023-12-12 20:27:31 -06:00
|
|
|
|
tft->clear();
|
|
|
|
|
|
if (settingsMap[displayBacklight] > 0)
|
|
|
|
|
|
digitalWrite(settingsMap[displayBacklight], !TFT_BACKLIGHT_ON);
|
2024-04-14 16:11:27 +02:00
|
|
|
|
#elif !defined(RAK14014) && !defined(M5STACK) && !defined(UNPHONE)
|
|
|
|
|
|
tft->sleep();
|
|
|
|
|
|
tft->powerSaveOn();
|
2023-07-15 15:53:26 +02:00
|
|
|
|
#endif
|
2024-04-14 16:11:27 +02:00
|
|
|
|
|
2023-07-15 15:53:26 +02:00
|
|
|
|
#ifdef VTFT_CTRL
|
|
|
|
|
|
digitalWrite(VTFT_CTRL, HIGH);
|
2023-07-30 14:51:26 +02:00
|
|
|
|
#endif
|
2024-04-03 20:17:13 +01:00
|
|
|
|
#ifdef UNPHONE
|
2024-04-16 13:29:08 +01:00
|
|
|
|
unphone.backlight(false); // using unPhone library
|
2024-04-03 20:17:13 +01:00
|
|
|
|
#endif
|
2023-11-13 05:20:49 -07:00
|
|
|
|
#ifdef RAK14014
|
|
|
|
|
|
#elif !defined(M5STACK)
|
2023-12-12 20:27:31 -06:00
|
|
|
|
tft->setBrightness(0);
|
2023-07-15 15:53:26 +02:00
|
|
|
|
#endif
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
default:
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Drop all other commands to device (we just update the buffer)
|
2020-08-28 15:06:52 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
Added modifier key combination to allow keyboard shortcuts on t-deck (#3668)
* Updated kbI2cBase.cpp
Updated keyboard settings for t-deck to allow a modifier key to trigger 'tab', mute notifications, or quit. To trigger the modifier press the shift key and mic (0) button at the same time. Then press q (quit), m (mute), or t (tab).
* Update kbI2cBase.cpp
* fixed formatting issues in kbI2cBase.cpp
* Removed keyboard shortcut code that doesnt work
alt+t does not work on a t-deck so I removed it to avoid confusion.
* Updated kbI2cBase.cpp
Updated keyboard settings for t-deck to allow a modifier key to trigger 'tab', mute notifications, or quit. To trigger the modifier press the shift key and mic (0) button at the same time. Then press q (quit), m (mute), or t (tab).
* Update kbI2cBase.cpp
* fixed formatting issues in kbI2cBase.cpp
* Removed keyboard shortcut code that doesnt work
alt+t does not work on a t-deck so I removed it to avoid confusion.
* Changed modifier key to alt+c
* Added screen brightness functionality
Use modifier key with o(+) to increase brightness or i(-) to decrease.
Currently there are 4 levels of brightness, (L, ML, MH, H). I would like to add a popup message to tell you the brightness.
* Added checks to disable screen brightness changes on unsupported hardware
* Setting the brightness code to work on only applicable devices
* Added "function symbol" display to bottom right corner of screen. Now shows when mute is active or modifier key is pressed. Also fixed some other minor issues.
* commented out a log
* Reworked how modifier functions worked, added
I wasn’t happy with my previous implementation, and I think it would have caused issues with other devices. This should work on all devices.
* Added back the function I moved causing issue with versions
* Fixed the version conflicts, everything seems to work fine now
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
2024-05-08 08:37:50 -04:00
|
|
|
|
void TFTDisplay::setDisplayBrightness(uint8_t _brightness)
|
|
|
|
|
|
{
|
2024-06-15 08:36:20 +08:00
|
|
|
|
#ifdef RAK14014
|
2024-06-14 19:53:47 -05:00
|
|
|
|
// todo
|
2024-06-15 08:36:20 +08:00
|
|
|
|
#else
|
Added modifier key combination to allow keyboard shortcuts on t-deck (#3668)
* Updated kbI2cBase.cpp
Updated keyboard settings for t-deck to allow a modifier key to trigger 'tab', mute notifications, or quit. To trigger the modifier press the shift key and mic (0) button at the same time. Then press q (quit), m (mute), or t (tab).
* Update kbI2cBase.cpp
* fixed formatting issues in kbI2cBase.cpp
* Removed keyboard shortcut code that doesnt work
alt+t does not work on a t-deck so I removed it to avoid confusion.
* Updated kbI2cBase.cpp
Updated keyboard settings for t-deck to allow a modifier key to trigger 'tab', mute notifications, or quit. To trigger the modifier press the shift key and mic (0) button at the same time. Then press q (quit), m (mute), or t (tab).
* Update kbI2cBase.cpp
* fixed formatting issues in kbI2cBase.cpp
* Removed keyboard shortcut code that doesnt work
alt+t does not work on a t-deck so I removed it to avoid confusion.
* Changed modifier key to alt+c
* Added screen brightness functionality
Use modifier key with o(+) to increase brightness or i(-) to decrease.
Currently there are 4 levels of brightness, (L, ML, MH, H). I would like to add a popup message to tell you the brightness.
* Added checks to disable screen brightness changes on unsupported hardware
* Setting the brightness code to work on only applicable devices
* Added "function symbol" display to bottom right corner of screen. Now shows when mute is active or modifier key is pressed. Also fixed some other minor issues.
* commented out a log
* Reworked how modifier functions worked, added
I wasn’t happy with my previous implementation, and I think it would have caused issues with other devices. This should work on all devices.
* Added back the function I moved causing issue with versions
* Fixed the version conflicts, everything seems to work fine now
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
2024-05-08 08:37:50 -04:00
|
|
|
|
tft->setBrightness(_brightness);
|
2024-10-14 06:11:43 +02:00
|
|
|
|
LOG_DEBUG("Brightness is set to value: %i ", _brightness);
|
2024-06-15 08:36:20 +08:00
|
|
|
|
#endif
|
Added modifier key combination to allow keyboard shortcuts on t-deck (#3668)
* Updated kbI2cBase.cpp
Updated keyboard settings for t-deck to allow a modifier key to trigger 'tab', mute notifications, or quit. To trigger the modifier press the shift key and mic (0) button at the same time. Then press q (quit), m (mute), or t (tab).
* Update kbI2cBase.cpp
* fixed formatting issues in kbI2cBase.cpp
* Removed keyboard shortcut code that doesnt work
alt+t does not work on a t-deck so I removed it to avoid confusion.
* Updated kbI2cBase.cpp
Updated keyboard settings for t-deck to allow a modifier key to trigger 'tab', mute notifications, or quit. To trigger the modifier press the shift key and mic (0) button at the same time. Then press q (quit), m (mute), or t (tab).
* Update kbI2cBase.cpp
* fixed formatting issues in kbI2cBase.cpp
* Removed keyboard shortcut code that doesnt work
alt+t does not work on a t-deck so I removed it to avoid confusion.
* Changed modifier key to alt+c
* Added screen brightness functionality
Use modifier key with o(+) to increase brightness or i(-) to decrease.
Currently there are 4 levels of brightness, (L, ML, MH, H). I would like to add a popup message to tell you the brightness.
* Added checks to disable screen brightness changes on unsupported hardware
* Setting the brightness code to work on only applicable devices
* Added "function symbol" display to bottom right corner of screen. Now shows when mute is active or modifier key is pressed. Also fixed some other minor issues.
* commented out a log
* Reworked how modifier functions worked, added
I wasn’t happy with my previous implementation, and I think it would have caused issues with other devices. This should work on all devices.
* Added back the function I moved causing issue with versions
* Fixed the version conflicts, everything seems to work fine now
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
2024-05-08 08:37:50 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-08 18:06:39 +02:00
|
|
|
|
void TFTDisplay::flipScreenVertically()
|
|
|
|
|
|
{
|
|
|
|
|
|
#if defined(T_WATCH_S3)
|
2024-10-14 06:11:43 +02:00
|
|
|
|
LOG_DEBUG("Flip TFT vertically"); // T-Watch S3 right-handed orientation
|
2023-12-12 20:27:31 -06:00
|
|
|
|
tft->setRotation(0);
|
2023-08-08 18:06:39 +02:00
|
|
|
|
#endif
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-07-30 14:51:26 +02:00
|
|
|
|
bool TFTDisplay::hasTouch(void)
|
|
|
|
|
|
{
|
2023-11-13 05:20:49 -07:00
|
|
|
|
#ifdef RAK14014
|
2024-06-15 08:36:20 +08:00
|
|
|
|
return true;
|
2023-11-13 05:20:49 -07:00
|
|
|
|
#elif !defined(M5STACK)
|
2023-12-12 20:27:31 -06:00
|
|
|
|
return tft->touch() != nullptr;
|
2023-07-30 14:51:26 +02:00
|
|
|
|
#else
|
|
|
|
|
|
return false;
|
|
|
|
|
|
#endif
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool TFTDisplay::getTouch(int16_t *x, int16_t *y)
|
|
|
|
|
|
{
|
2023-11-13 05:20:49 -07:00
|
|
|
|
#ifdef RAK14014
|
2024-06-14 19:53:47 -05:00
|
|
|
|
if (_rak14014_touch_int) {
|
2024-06-15 08:36:20 +08:00
|
|
|
|
_rak14014_touch_int = false;
|
|
|
|
|
|
/* The X and Y axes have to be switched */
|
|
|
|
|
|
*y = ft6336u.read_touch1_x();
|
|
|
|
|
|
*x = TFT_HEIGHT - ft6336u.read_touch1_y();
|
|
|
|
|
|
return true;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
2023-11-13 05:20:49 -07:00
|
|
|
|
#elif !defined(M5STACK)
|
2023-12-12 20:27:31 -06:00
|
|
|
|
return tft->getTouch(x, y);
|
2023-07-30 14:51:26 +02:00
|
|
|
|
#else
|
|
|
|
|
|
return false;
|
|
|
|
|
|
#endif
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-05-09 19:50:39 +02:00
|
|
|
|
void TFTDisplay::setDetected(uint8_t detected)
|
|
|
|
|
|
{
|
|
|
|
|
|
(void)detected;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-08-28 15:06:52 -07:00
|
|
|
|
// Connect to the display
|
|
|
|
|
|
bool TFTDisplay::connect()
|
2020-08-17 13:47:05 -07:00
|
|
|
|
{
|
2022-05-09 19:50:39 +02:00
|
|
|
|
concurrency::LockGuard g(spiLock);
|
2024-11-04 19:15:59 -06:00
|
|
|
|
LOG_INFO("Do TFT init");
|
2023-12-12 20:27:31 -06:00
|
|
|
|
#ifdef RAK14014
|
|
|
|
|
|
tft = new TFT_eSPI;
|
|
|
|
|
|
#else
|
|
|
|
|
|
tft = new LGFX;
|
|
|
|
|
|
#endif
|
2020-08-28 14:24:22 -07:00
|
|
|
|
|
2024-08-22 10:38:19 -07:00
|
|
|
|
backlightEnable->set(true);
|
2024-10-14 06:11:43 +02:00
|
|
|
|
LOG_INFO("Power to TFT Backlight");
|
2022-05-09 19:50:39 +02:00
|
|
|
|
|
2024-04-03 20:17:13 +01:00
|
|
|
|
#ifdef UNPHONE
|
2024-04-16 13:29:08 +01:00
|
|
|
|
unphone.backlight(true); // using unPhone library
|
2024-04-03 20:17:13 +01:00
|
|
|
|
#endif
|
2023-10-05 05:24:25 +02:00
|
|
|
|
|
2023-12-12 20:27:31 -06:00
|
|
|
|
tft->init();
|
2023-11-13 05:20:49 -07:00
|
|
|
|
|
2023-08-08 18:06:39 +02:00
|
|
|
|
#if defined(M5STACK)
|
2023-12-12 20:27:31 -06:00
|
|
|
|
tft->setRotation(0);
|
2023-11-13 05:20:49 -07:00
|
|
|
|
#elif defined(RAK14014)
|
2023-12-12 20:27:31 -06:00
|
|
|
|
tft->setRotation(1);
|
|
|
|
|
|
tft->setSwapBytes(true);
|
2024-06-14 19:53:47 -05:00
|
|
|
|
// tft->fillScreen(TFT_BLACK);
|
2024-06-15 08:36:20 +08:00
|
|
|
|
ft6336u.begin();
|
|
|
|
|
|
pinMode(SCREEN_TOUCH_INT, INPUT_PULLUP);
|
|
|
|
|
|
attachInterrupt(digitalPinToInterrupt(SCREEN_TOUCH_INT), rak14014_tpIntHandle, FALLING);
|
2024-01-26 07:40:16 -07:00
|
|
|
|
#elif defined(T_DECK) || defined(PICOMPUTER_S3) || defined(CHATTER_2)
|
2023-12-12 20:27:31 -06:00
|
|
|
|
tft->setRotation(1); // T-Deck has the TFT in landscape
|
2024-09-12 13:44:30 +02:00
|
|
|
|
#elif defined(T_WATCH_S3) || defined(SENSECAP_INDICATOR)
|
2023-12-12 20:27:31 -06:00
|
|
|
|
tft->setRotation(2); // T-Watch S3 left-handed orientation
|
Unify the native display config between legacy display and MUI (#6838)
* Add missed include
* Another Warning fix
* Add another HAS_SCREEN
* Namespace fixes
* Removed depricated destination types and re-factored destination screen
* Get rid of Arduino Strings
* Clean up after Copilot
* SixthLine Def, Screen Rename
Added Sixth Line Definition Screen Rename, and Automatic Line Adjustment
* Consistency is hard - fixed "Sixth"
* System Frame Updates
Adjusted line construction to ensure we fit maximum content per screen.
* Fix up notifications
* Add a couple more ifdef HAS_SCREEN lines
* Add screen->isOverlayBannerShowing()
* Don't forget the invert!
* Adjust Nodelist Center Divider
Adjust Nodelist Center Divider
* Fix variable casting
* Fix entryText variable as empty before update to fix validation
* Altitude is int32_t
* Update PowerTelemetry to have correct data type
* Fix cppcheck warnings (#6945)
* Fix cppcheck warnings
* Adjust logic in Power.cpp for power sensor
---------
Co-authored-by: Jason P <applewiz@mac.com>
* More pixel wrangling so things line up NodeList edition
* Adjust NodeList alignments and plumb some background padding for a possible title fix
* Better alignment for banner notifications
* Move title into drawCommonHeader; initial screen tested
* Fonts make spacing items difficult
* Improved beeping booping and other buzzer based feedback (#6947)
* Improved beeping booping and other buzzer based feedback
* audible button feedback (#6949)
* Refactor
---------
Co-authored-by: todd-herbert <herbert.todd@gmail.com>
* Sandpapered the corners of the notification popup
* Finalize drawCommonHeader migration
* Update Title of Favorite Node Screens
* Update node metric alignment on LoRa screen
* Update the border for popups to separate it from background
* Update PaxcounterModule.cpp with CommonHeader
* Update WiFi screen with CommonHeader and related data reflow
* It was not, in fact, pointing up
* Fix build on wismeshtap
* T-deck trackball debounce
* Fix uptime on Device Focused page to actually detail
* Update Sys screen for new uptime, add label to Freq/Chan on LoRa
* Don't display DOP any longer, make Uptime consistent
* Revert Uptime change on Favorites, Apply to Device Focused
* Label the satelite number to avoid confusion
* Boop boop boop boop
* Correct GPS positioning and string consistency across strings for GPS
* Fix GPS text alignment
* Enable canned messages by default
* Don't wake screen on new nodes
* Cannedmessage list emote support added
* Fn+e emote picker for freetext screen
* Actually block CannedInput actions while display is shown
* Add selection menu to bannerOverlay
* Off by one
* Move to unified text layouts and spacing
* Still my Fav without an "e"
* Fully remove EVENT_NODEDB_UPDATED
* Simply LoRa screen
* Make some char pointers const to fix compilation on native targets
* Update drawCompassNorth to include radius
* Fix warning
* button thread cleanup
* Pull OneButton handling from PowerFSM and add MUI switch (#6973)
* Trunk
* Onebutton Menu Support
* Add temporary clock icon
* Add gps location to fsi
* Banner message state reset
* Cast to char to satisfy compiler
* Better fast handling of input during banner
* Fix warning
* Derp
* oops
* Update ref
* Wire buzzer_mode
* remove legacy string->print()
* Only init screen if one found
* Unsigned Char
* More buttonThread cleaning
* screen.cpp button handling cleanup
* The Great Event Rename of 2025
* Fix the Radiomaster
* Missed trackball type change
* Remove unused function
* Make ButtonThread an InputBroker
* Coffee hadn't kicked in yet
* Add clock icon for Navigation Bar
* Restore clock screen definition code - whoops
* ExternalNotifications now observe inputBroker
* Clock rework (#6992)
* Move Clock bits into ClockRenderer space
* Rework clock into all device navigation
* T-Watch Actually Builds Different
* Compile fix
---------
Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
* Add AM/PM to Digital Clock
* Flip Seconds and AM/PM on Clock Display
* Tik-tok pixels are hard
* Fix builds on Thinknode M1
* Check for GPS and don't crash
* Don't endif til the end
* Rework the OneButton thread to be much less of a mess. (#6997)
* Rework the OneButton thread to be much less of a mess. And break lots of targets temporarily
* Update src/input/ButtonThread.h
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix GPS toggle
* Send the shutdown event, not just the kbchar
* Honor the back button in a notificaiton popup
* Draw the right size box for popup with options
* Try to un-break all the things
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* 24-hour Clock Should have leading zero, but not 12-hour
* Fixup some compile errors
* Add intRoutine to ButtonThread init, to get more responsive user button back
* Add Timezone picker
* Fix Warning
* Optionally set the initial selection for the chooser popup
* Make back buttons work in canned messages
* Drop the wrapper classes
* LonPressTime now configurable
* Clock Frame can not longer be blank; just add valid time
* Back buttons everywhere!
* Key Verification confirm banner
* Make Elecrow M* top button a back button
* Add settings saves
* EInk responsiveness fixes
* Linux Input Fixes
* Add Native Trackball/Joystick support, and move UserButton to Input
* No Flight Stick Mode
* Send input event
* Add Channel Utilization to Device Focused frame
* Don't shift screens when we draw new ones
* Add showOverlayBanner arguments to no-op
* trunk
* Default Native trackball to NC
* Fix crash in simulator mode
* Add longLong button press
* Get the args right
* Adjust Bluetooth Pairing Screen to account for bottom navigation.
* Trackball everywhere, and unPhone buttons
* Remap visionmaster secondary button to TB_UP
* Kill ScanAndSelect
* trunk
* No longer need the canned messages input filter
* All Canned All the time
* Fix stm32 compile error regarding inputBroker
* Unify tft lineheights (#7033)
* Create variable line heights based upon SCREEN_HEIGHT
* Refactor textPositions into method -> getTextPositions
* Update SharedUIDisplay.h
---------
Co-authored-by: Jason P <applewiz@mac.com>
* Adjust top distance for larger displays
* Adjust icon sizes for larger displays
* Fix Paxcounter compile errors after code updates
* Pixel wrangling to make larger screens fit better
* Alert frame has precedence over banner -- for now
* Unify on ALT_BUTTON
* Align AM/PM to the digit, not the segment on larger displays
* Move some global pin defines into configuration.h
* Scaffolding for BMM150 9-axis gyro
* Alt button behavior
* Don't add the blank GPS frames without HAS_GPS
* EVENT_NODEDB_UPDATED has been retired
* Clean out LOG_WARN messages from debugging
* Add dismiss message function
* Minor buttonThread cleanup
* Add BMM150 support
* Clean up last warning from dev
* Simplify bmm150 init return logic
* Add option to reply to messages
* Add minimal menu upon selecting home screen
* Move Messages to slot 2, rename GPS to Position, move variables nearer functional usage in Screen.cpp
* Properly dismiss message
* T-Deck Trackball press is not user button
* Add select on favorite frame to launch cannedMessage DM
* Minor wording change
* Less capital letters
* Fix empty message check, time isn't reliable
* drop dead code
* Make UIRenderer a static class instead of namespace
* Fix the select on favorite
* Check if message is empty early and then 'return'
* Add kb_found, and show the option to launch freetype if appropriate
* Ignore impossible touchscreen touches
* Auto scroll fix
* Move linebreak after "from" for banners to maximize screen usage.
* Center "No messages to show" on Message frame
* Start consolidating buzzer behavior
* Fixed signed / unsigned warning
* Cast second parameter of max() to make some targets happy
* Cast kbchar to (char) to make arduino string happy
* Shorten the notice of "No messages"
* Add buzzer mode chooser
* Add regionPicker to Lora icon
* Reduce line spacing and reorder Position screen to resolve overlapping issues
* Update message titles, fix GPS icons, add Back options
* Leftover boops
* Remove chirp
* Make the region selection dismissable when a region is already set
* Add read-aloud functionality on messages w/ esp8266sam
* "Last Heard" is a better label
* tweak the beep
* 5 options
* properly tear down freetext upon cancel
* de-convelute canned messages just a bit
* Correct height of Mail icon in navigation bar
* Remove unused warning
* Consolidate time methods into TimeFormatters
* Oops
* Change LoRa Picker Cancel to Back
* Tweak selection characters on Banner
* Message render not scrolling on 5th line
* More fixes for message scrolling
* Remove the safety next on text overflow - we found that root cause
* Add pin definitions to fix compilation for obscure target
* Don't let the touchscreen send unitialized kbchar values
* Make virtual KB just a bit quicker
* No more double tap, swipe!
* Left is left, and Right is right
* Update horizontal lightning bolt design
* Move from solid to dashed separator for Message Frame
* Single emote feature fix
* Manually sort overlapping elements for now
* Freetext and clearer choices
* Fix ESP32 InkHUD builds on the unify-tft branch (#7087)
* Remove BaseUI branding
* Capitalization is fun
* Revert Meshtastic Boot Frame Changes
* Add ANZ_433 LoRa region to picker
* Update settings.json
---------
Co-authored-by: HarukiToreda <116696711+HarukiToreda@users.noreply.github.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Jason P <applewiz@mac.com>
Co-authored-by: todd-herbert <herbert.todd@gmail.com>
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-21 06:36:04 -05:00
|
|
|
|
#elif ARCH_PORTDUINO
|
|
|
|
|
|
tft->setRotation(0); // use config.yaml to set rotation
|
2022-05-09 19:50:39 +02:00
|
|
|
|
#else
|
2023-12-12 20:27:31 -06:00
|
|
|
|
tft->setRotation(3); // Orient horizontal and wide underneath the silkscreen name label
|
2022-05-09 19:50:39 +02:00
|
|
|
|
#endif
|
2023-12-12 20:27:31 -06:00
|
|
|
|
tft->fillScreen(TFT_BLACK);
|
2023-11-13 05:20:49 -07:00
|
|
|
|
|
2020-08-28 15:06:52 -07:00
|
|
|
|
return true;
|
2020-08-17 13:47:05 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-04 14:47:14 +02:00
|
|
|
|
#endif
|