Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
7c8fd62
Quad SPI support for Bus_SPI(esp32) (#702)
tobozo May 1, 2025
bffea21
add support SD_MMC for ESP32 ( #513 )
lovyan03 May 11, 2025
538d8a4
Fixed unlocking of insecure buses.
lovyan03 May 14, 2025
770ac32
bug fix for ESP-IDF v5.5
lovyan03 May 15, 2025
a24a930
bug fix for ESP32
lovyan03 May 15, 2025
31071a1
Added Panel_SharpLCD - closes #694
tobozo May 29, 2025
21ce611
Added optional DISPON and EXTMOD pins to config
tobozo Jun 2, 2025
aab61c2
Backported misc tweaks from M5GFX
tobozo Jun 2, 2025
e7af60c
EOL for arduino-core 1.0.6
tobozo Jun 2, 2025
310a26f
Fix misc compile errors
tobozo Jun 2, 2025
b400c46
Fix workflow
tobozo Jun 2, 2025
4f13dec
migrate pio envs to pioarduino
tobozo Jun 2, 2025
6968c22
migrate pio envs to pioarduino
tobozo Jun 2, 2025
3798b0e
migrate pio envs to pioarduino
tobozo Jun 2, 2025
b59dc33
migrate pio envs to pioarduino
tobozo Jun 2, 2025
7823012
migrate pio envs to pioarduino
tobozo Jun 2, 2025
17b5576
+M5Tab5 display and touch
tobozo Jun 3, 2025
3333f01
init tweak
tobozo Jun 3, 2025
f9b92c9
Added Bus_MIPI
tobozo Jun 3, 2025
58d688f
fix ESP_LOG freaking out
tobozo Jun 3, 2025
53451a0
more backport from M5GFX
tobozo Jun 11, 2025
025accc
Adding touch support for CHSC6x
tobozo Jun 19, 2025
093546a
sync with M5GFX
lovyan03 Jun 25, 2025
682f4f8
fix compile error
lovyan03 Jun 25, 2025
3e2c03d
Added missing spi::readBytes() - fixes #216
tobozo Jul 7, 2025
55e708d
Added touch config to pico sdk example
tobozo Jul 7, 2025
ca258af
Fix ESP32C3 compilation fail with arduino-esp32 3.2.1 / esp-idf 5.4.2
tobozo Jul 7, 2025
b9dcc90
Adding ESP32C3 🤞
tobozo Jul 7, 2025
90d0d79
Merge branch 'M5GFX_Backport' into develop
tobozo Jul 7, 2025
fa5ec29
Update common.cpp (remove duplicate const)
tobozo Jul 7, 2025
08bfbc1
Upgraded python version
tobozo Jul 7, 2025
744dd45
re-applied #728
tobozo Jul 7, 2025
31019cc
raising version
tobozo Jul 7, 2025
d0499d0
Added GC9A01/071 160x160 Round panel, courtesy of @multiOP
tobozo Jul 16, 2025
6e22bd5
bugfix for Panel_fb
lovyan03 Aug 7, 2025
3113b66
tweak for AMOLED
lovyan03 Aug 7, 2025
4ee3bc0
tweak for ESP32 I2C
lovyan03 Aug 7, 2025
751464e
tweak
lovyan03 Aug 7, 2025
795e20a
fix BGR init value for MADCTL courtesy of @mverch67 - followup #609
tobozo Aug 23, 2025
ac9198d
fix compilation error for esp32s3+Bus_RGB with esp-idf 5.5
tobozo Aug 23, 2025
01d3696
macro tweak for esp32c3
tobozo Aug 23, 2025
80788f0
fix compilation error for esp32s3+Bus_RGB with esp-idf 5.5
tobozo Aug 23, 2025
bab798a
Backported M5GFX I2C NACK detection and bugfix (5581745 ... a64b35d)
tobozo Sep 1, 2025
96c419b
Backported M5GFX: support for Tab5 invert/sleep/powersave (f92cf9e)
tobozo Sep 1, 2025
b18ac5b
Added Panel_ILI9488IPS by @supremeneuron fixes #755
tobozo Sep 13, 2025
c4cb69c
Tweak inheritence for Panel_ILI9488IPS
tobozo Sep 14, 2025
2e0dc97
remove conflicting file
tobozo Sep 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/esp-idf-versions.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
$hardcoded_fqbns = ['[email protected]', '[email protected]'];

// restrict output to these idf targets, other targets will be ignored
$idf_boards = ['esp32', 'esp32s2', 'esp32s3', 'esp32c6', 'esp32p4'/*, 'esp32h2', 'esp32c5'*/];
$idf_boards = ['esp32', 'esp32s2', 'esp32s3', 'esp32c6', 'esp32c3', 'esp32p4'/*, 'esp32h2', 'esp32c5'*/];

// get the official support matrix from the espressif website
// it contains a JavaScript object declaration with all necessary chip/version informations
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/PlatformioBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ jobs:
- m5stack-cores3

platform-version:
- 1.0.6
#- 1.0.6
- 2.0.11
- 2.0.12
- 2.0.13
- default

exclude:
- { board: esp32-c3, platform-version: 1.0.6 }
- { board: esp32-s3, platform-version: 1.0.6 }
- { board: esp32-s3, platform-version: default }
- { board: esp32-s2, platform-version: 1.0.6 }
- { board: m5stack-cores3, platform-version: 1.0.6 }
#exclude:
#- { board: esp32-c3, platform-version: 1.0.6 }
#- { board: esp32-s3, platform-version: 1.0.6 }
#- { board: esp32-s3, platform-version: default }
#- { board: esp32-s2, platform-version: 1.0.6 }
#- { board: m5stack-cores3, platform-version: 1.0.6 }

include:
- board: esp32
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: '3.13'

- name: Install PlatformIO
run: |
Expand Down
7 changes: 6 additions & 1 deletion boards.cmake/esp-idf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,18 @@ file(GLOB SRCS
${LGFX_ROOT}/src/lgfx/v1/platforms/esp32c3/*.cpp
${LGFX_ROOT}/src/lgfx/v1/platforms/esp32s2/*.cpp
${LGFX_ROOT}/src/lgfx/v1/platforms/esp32s3/*.cpp
${LGFX_ROOT}/src/lgfx/v1/platforms/esp32p4/*.cpp
${LGFX_ROOT}/src/lgfx/v1/touch/*.cpp
)

set(COMPONENT_SRCS ${SRCS})

if (IDF_VERSION_MAJOR GREATER_EQUAL 5)
set(COMPONENT_REQUIRES nvs_flash efuse esp_lcd driver esp_timer)
if(IDF_VERSION_MINOR GREATER_EQUAL 1)
set(COMPONENT_REQUIRES nvs_flash efuse esp_lcd driver esp_timer esp_mm)
else()
set(COMPONENT_REQUIRES nvs_flash efuse esp_lcd driver esp_timer)
endif()
elseif ((IDF_VERSION_MAJOR EQUAL 4) AND (IDF_VERSION_MINOR GREATER 3) OR IDF_VERSION_MAJOR GREATER 4)
set(COMPONENT_REQUIRES nvs_flash efuse esp_lcd)
else()
Expand Down
22 changes: 15 additions & 7 deletions examples/Test/build_test/platformio_esp32.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ build_flags =

[platform_default]
tasmota_2xx = https://github.com/tasmota/platform-espressif32/releases/download/2023.11.01/platform-espressif32.zip
pioarduino = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip


[esp32_1_0_6]
Expand All @@ -36,7 +37,7 @@ build_flags = ${coding_standards.build_flags}


[esp32_default]
platform = ${platform_default.tasmota_2xx}
platform = ${platform_default.pioarduino}
;platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32/releases/download/2.0.3/esp32-2.0.3.zip
build_flags = ${coding_standards.build_flags}

Expand All @@ -45,16 +46,19 @@ build_flags = ${coding_standards.build_flags}
board = esp32dev
[M5StickC]
board = m5stick-c
platform = ${platform_default.tasmota_2xx}
[M5Stack]
board = m5stack-core-esp32
; pioarduino JSON reports a wrong variant folder
board_build.variant = m5stack_core
[M5Core2]
board = m5stack-core2
[M5CoreS3]
board = esp32-s3-devkitc-1
board_upload.flash_size = 16MB
board_upload.maximum_size = 16777216
board_build.partitions = default_16MB.csv
board_build.arduino.memory_type = qio_qspi
board = esp32dev
board_build.mcu = esp32s3
board_build.variant = esp32s3
; no rom binary available for dio/qio "default" 40MHz, why ??
board_build.f_flash = 80000000L
build_flags =
${env.build_flags}
-DARDUINO_M5STACK_CORES3
Expand All @@ -71,8 +75,12 @@ build_flags =
board = esp32dev
board_build.mcu = esp32s2
[esp32s3]
; generic esp32s3 board has no "esp32-s3.json" default in pioarduino, why ??
board = esp32dev
board_build.mcu = esp32s3
board_build.variant = esp32s3
; no rom binary available for dio/qio "default" 40MHz, why ??
board_build.f_flash = 80000000L


; for some reason platformio 5.0 wants this
Expand Down Expand Up @@ -118,7 +126,7 @@ extends = esp32, esp32_2_0_12
[env:m5stick-c-2_0_13]
extends = esp32, esp32_2_0_13
[env:m5stick-c-default]
extends = M5StickC, esp32_default
extends = esp32_default, M5StickC


[env:m5stack-core-esp32-1_0_6]
Expand Down
23 changes: 23 additions & 0 deletions examples_for_picosdk/spi/LGFX_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,20 @@
#endif
#define SPI_PORT 0

#ifdef USE_TOUCH
#define TOUCH_CS 29
#endif

class LGFX : public lgfx::LGFX_Device
{
lgfx::Panel_ST7735S _panel_instance;
lgfx::Bus_SPI _bus_instance; // SPIバスのインスタンス
#ifdef USE_BACKLIGHT
lgfx::Light_PWM _light_instance;
#endif
#ifdef USE_TOUCH
lgfx::Touch_XPT2046 _touch_instance;
#endif

public:
LGFX(void)
Expand Down Expand Up @@ -76,6 +83,22 @@ class LGFX : public lgfx::LGFX_Device
}
#endif

#ifdef USE_TOUCH
{
auto cfg = _touch_instance.config();
cfg.bus_shared = true;
cfg.spi_host = SPI_PORT;
cfg.pin_sclk = TFT_SCLK;
cfg.pin_mosi = TFT_MOSI;
cfg.pin_miso = TFT_MISO;
cfg.pin_cs = TOUCH_CS;

_touch_instance.config(cfg);
_panel_instance.setTouch(&_touch_instance);
}
#endif


setPanel(&_panel_instance); // 使用するパネルをセットします。
}
};
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"type": "git",
"url": "https://github.com/lovyan03/LovyanGFX.git"
},
"version": "1.2.7",
"version": "1.2.9",
"frameworks": ["arduino", "espidf", "*"],
"platforms": ["espressif32", "espressif8266", "atmelsam", "native", "raspberrypi"],
"headers": "LovyanGFX.hpp",
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=LovyanGFX
version=1.2.7
version=1.2.9
author=lovyan03
maintainer=lovyan03,tobozo
sentence=TFT LCD Graphics driver with touch for ESP32/ESP8266, SAMD21/SAMD51, RP2040/RP2350
Expand Down
7 changes: 5 additions & 2 deletions src/lgfx/v1/LGFXBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ namespace lgfx
float fmidy = midy*hratio;
float hyp0 = pixelDistance( midx, midy, 0, 0 );

rgb888_t scanline[w];
auto scanline = (rgb888_t*)alloca(w * sizeof(rgb888_t));

startWrite();
for( int _y=0;_y<h;_y++ ) {
Expand All @@ -1117,7 +1117,7 @@ namespace lgfx
if( !gradient.colors || gradient.count==0 ) return;
bool is_vertical = style==VLINEAR;
const uint32_t gradient_len = is_vertical ? h : w;
rgb888_t scanline[gradient_len];
auto scanline = (rgb888_t*)alloca(gradient_len * sizeof(rgb888_t));
for(int i=0;i<gradient_len;i++) { // memoize one gradient scanline
scanline[i] = map_gradient( i, 0, gradient_len, gradient );
}
Expand Down Expand Up @@ -1395,6 +1395,7 @@ namespace lgfx
: (dst_depth == rgb332_1Byte) ? pixelcopy_t::copy_grayscale_affine<rgb332_t>
: (dst_depth == rgb888_3Byte) ? pixelcopy_t::copy_grayscale_affine<bgr888_t>
: (dst_depth == rgb666_3Byte) ? pixelcopy_t::copy_grayscale_affine<bgr666_t>
: (dst_depth == rgb565_nonswapped) ? pixelcopy_t::copy_grayscale_affine<rgb565_t>
: (dst_depth == grayscale_8bit) ? pixelcopy_t::copy_grayscale_affine<grayscale_t>
: nullptr;

Expand Down Expand Up @@ -1827,7 +1828,9 @@ namespace lgfx
else { if (dst_y < 0) { h += dst_y; src_y -= dst_y; dst_y = 0; } if (h > hei - src_y) h = hei - src_y; }
if (h < 1) return;

startWrite();
_panel->copyRect(dst_x, dst_y, w, h, src_x, src_y);
endWrite();
}

void LGFXBase::read_rect(int32_t x, int32_t y, int32_t w, int32_t h, void* dst, pixelcopy_t* param)
Expand Down
1 change: 1 addition & 0 deletions src/lgfx/v1/LGFXBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,7 @@ namespace lgfx
else
{
if ( dst_depth == rgb565_2Byte) { pc.fp_copy = pixelcopy_t::copy_rgb_fast<swap565_t, T>; }
else if (dst_depth == rgb565_nonswapped) { pc.fp_copy = pixelcopy_t::copy_rgb_fast<rgb565_t, T>; }
else if (dst_depth == rgb332_1Byte) { pc.fp_copy = pixelcopy_t::copy_rgb_fast<rgb332_t, T>; }
else { pc.fp_copy = pixelcopy_t::copy_rgb_fast<grayscale_t, T>; }
}
Expand Down
6 changes: 5 additions & 1 deletion src/lgfx/v1/LGFX_Sprite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,14 @@ namespace lgfx
{
_img.img16()[index] = rawcolor;
}
else
else if (bits == 24)
{
_img.img24()[index] = rawcolor;
}
else if (bits == 32)
{
_img.img32()[index] = rawcolor;
}
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/lgfx/v1/gitTagVersion.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define LGFX_VERSION_MAJOR 1
#define LGFX_VERSION_MINOR 2
#define LGFX_VERSION_PATCH 7
#define LGFX_VERSION_PATCH 9
#define LOVYANGFX_VERSION F( LGFX_VERSION_MAJOR "." LGFX_VERSION_MINOR "." LGFX_VERSION_PATCH )
2 changes: 1 addition & 1 deletion src/lgfx/v1/lgfx_filesystem_support.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ namespace lgfx

#endif
//*/
#if defined (Stream_h) || defined (ARDUINO_ARCH_RP2040) // RP2040 has no defines for builtin Stream API
#if defined (Stream_h) || defined (HTTPClient_H_) || defined (ARDUINO_ARCH_RP2040) // RP2040 has no defines for builtin Stream API

#define LGFX_FUNCTION_GENERATOR(drawImg, draw_img) \
inline bool drawImg(Stream *dataSource, int32_t x = 0, int32_t y = 0, int32_t maxWidth = 0, int32_t maxHeight = 0, int32_t offX = 0, int32_t offY = 0, float scale_x = 1.0f, float scale_y = 0.0f, datum_t datum = datum_t::top_left) \
Expand Down
16 changes: 8 additions & 8 deletions src/lgfx/v1/lgfx_fonts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -798,8 +798,8 @@ namespace lgfx
//getSwap32(buf[1]); // vlw encoder version - discard
yAdvance = getSwap32(buf[2]); // Font size in points, not pixels
//getSwap32(buf[3]); // discard
ascent = getSwap32(buf[4]); // top of "d"
descent = getSwap32(buf[5]); // bottom of "p"
ascent = abs((int32_t)getSwap32(buf[4])); // top of "d"
descent = abs((int32_t)getSwap32(buf[5])); // bottom of "p"
}

// These next gFont values might be updated when the Metrics are fetched
Expand All @@ -808,11 +808,11 @@ namespace lgfx
yAdvance = std::max((int)yAdvance, ascent + descent);
spaceWidth = yAdvance * 2 / 7; // Guess at space width

//ESP_LOGI("LGFX", "ascent:%d descent:%d", gFont.ascent, gFont.descent);
//printf("LGFX:ascent:%d descent:%d\r\n", ascent, descent);

if (!gCount) return false;

//ESP_LOGI("LGFX", "font count:%d", gCount);
//printf("LGFX:font count:%d\r\n", gCount);

uint32_t bitmapPtr = 24 + (uint32_t)gCount * 28;

Expand All @@ -833,7 +833,7 @@ namespace lgfx
|| !gWidth
|| !gxAdvance
|| !gdX) {
//ESP_LOGE("LGFX", "can not alloc font table");
//printf("LGFX:can not alloc font table\r\n");
return false;
}

Expand All @@ -854,12 +854,12 @@ namespace lgfx
uint16_t height = getSwap32(buffer[1]); // Height of glyph
if ((unicode > 0xFF) || ((unicode > 0x20) && (unicode < 0xA0) && (unicode != 0x7F))) {
int16_t dY = (int16_t)getSwap32(buffer[4]); // y delta from baseline
//Serial.printf("LGFX:unicode:%x dY:%d\r\n", unicode, dY);
//printf("LGFX:unicode:%x dY:%d\r\n", unicode, dY);
if (maxAscent < dY && unicode != 0x3000) {
maxAscent = dY;
}
if (maxDescent < (height - dY) && unicode != 0x3000) {
//Serial.printf("LGFX:maxDescent:%d\r\n", maxDescent);
//printf("LGFX:maxDescent:%d\r\n", maxDescent);
maxDescent = height - dY;
}
}
Expand All @@ -870,7 +870,7 @@ namespace lgfx

yAdvance = maxAscent + maxDescent;

//Serial.printf("LGFX:maxDescent:%d\r\n", maxDescent);
//printf("LGFX:maxDescent:%d\r\n", maxDescent);
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/lgfx/v1/misc/DataWrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ namespace lgfx

//----------------------------------------------------------------------------

#if ( defined (ARDUINO) && defined (Stream_h) ) || defined (ARDUINO_ARCH_RP2040) // RP2040 has no defines for builtin Stream API
#if ( defined (ARDUINO) && ( defined (Stream_h) || defined (HTTPClient_H_)) ) || defined (ARDUINO_ARCH_RP2040) // RP2040 has no defines for builtin Stream API

struct StreamWrapper : public DataWrapper
{
Expand Down
12 changes: 6 additions & 6 deletions src/lgfx/v1/misc/colortype.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -777,12 +777,12 @@ namespace lgfx

struct color_conv_t
{
uint32_t (*convert_argb8888)(uint32_t);
uint32_t (*convert_bgr888)(uint32_t);
uint32_t (*convert_rgb888)(uint32_t);
uint32_t (*convert_rgb565)(uint32_t);
uint32_t (*convert_rgb332)(uint32_t);
uint32_t (*revert_rgb888)(uint32_t);
uint32_t (*convert_argb8888)(uint32_t) = nullptr;
uint32_t (*convert_bgr888)(uint32_t) = nullptr;
uint32_t (*convert_rgb888)(uint32_t) = nullptr;
uint32_t (*convert_rgb565)(uint32_t) = nullptr;
uint32_t (*convert_rgb332)(uint32_t) = nullptr;
uint32_t (*revert_rgb888)(uint32_t) = nullptr;
uint32_t colormask;
union
{
Expand Down
15 changes: 10 additions & 5 deletions src/lgfx/v1/misc/pixelcopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,16 @@ namespace lgfx
fp_skip = pixelcopy_t::skip_bit_affine;
} else {
if (src_bits > 16) {
fp_skip = pixelcopy_t::skip_rgb_affine<bgr888_t>;
if (src_depth == rgb888_3Byte) {
fp_copy = pixelcopy_t::get_fp_copy_rgb_affine<bgr888_t>(dst_depth);
} else if (src_depth == rgb666_3Byte) {
fp_copy = pixelcopy_t::get_fp_copy_rgb_affine<bgr666_t>(dst_depth);
if (src_bits > 24) {
fp_skip = pixelcopy_t::skip_rgb_affine<bgra8888_t>;
fp_copy = pixelcopy_t::get_fp_copy_rgb_affine<bgra8888_t>(dst_depth);
} else {
fp_skip = pixelcopy_t::skip_rgb_affine<bgr888_t>;
if (src_depth == rgb888_3Byte) {
fp_copy = pixelcopy_t::get_fp_copy_rgb_affine<bgr888_t>(dst_depth);
} else if (src_depth == rgb666_3Byte) {
fp_copy = pixelcopy_t::get_fp_copy_rgb_affine<bgr666_t>(dst_depth);
}
}
} else {
if (src_depth == rgb565_2Byte) {
Expand Down
1 change: 1 addition & 0 deletions src/lgfx/v1/misc/pixelcopy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ namespace lgfx
return (src_depth == rgb565_2Byte) ? copy_rgb_affine<TDst, swap565_t>
: (src_depth == rgb332_1Byte) ? copy_rgb_affine<TDst, rgb332_t >
: (src_depth == grayscale_8bit) ? copy_rgb_affine<TDst, grayscale_t>
: (src_depth == rgb565_nonswapped) ? copy_rgb_affine<TDst, rgb565_t >
: (src_depth == rgb888_3Byte) ? copy_rgb_affine<TDst, bgr888_t >
: (std::is_same<bgr666_t, TDst>::value)
? copy_rgb_affine<bgr888_t, bgr888_t>
Expand Down
Loading
Loading