Skip to content

Commit

Permalink
Merge pull request #226 from lovyan03/develop
Browse files Browse the repository at this point in the history
0.4.16
  • Loading branch information
lovyan03 authored Apr 21, 2022
2 parents 1d98071 + 3a42dea commit 79fe6eb
Show file tree
Hide file tree
Showing 46 changed files with 2,384 additions and 443 deletions.
94 changes: 46 additions & 48 deletions .github/workflows/ArduinoBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,60 +16,58 @@ on:

jobs:
build:
name: ${{ matrix.fancy-name }}
name: ${{matrix.board}}@${{matrix.platform-version}}

runs-on: ubuntu-latest

strategy:
matrix:

arduino-boards-fqbn:
- Seeeduino:samd:seeed_wio_terminal
- esp8266:esp8266:d1_mini:eesz=4M3M,xtal=80
- esp32:esp32:esp32
- esp32:esp32:esp32s2
- esp32:esp32:m5stick-c
- esp32:esp32:m5stack-core-esp32
- esp32:esp32:m5stack-core2
#- esp32:esp32:m5stack-fire
#- esp32:esp32:odroid_esp32
platform-url:
- https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json

board:
- esp32
- esp32s2
- m5stick-c
- m5stack-core-esp32
- m5stack-core2
- esp32s3box

platform-version:
# ESP32 Core versions
- 1.0.6
- 2.0.0
- 2.0.1
- 2.0.2
- 2.0.3-RC1

include:
- arduino-boards-fqbn: Seeeduino:samd:seeed_wio_terminal
fancy-name: Wio Terminal
platform-url: https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json

- arduino-boards-fqbn: esp8266:esp8266:d1_mini:eesz=4M3M,xtal=80
fancy-name: ESP8266 D1Mini
platform-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json

- arduino-boards-fqbn: esp32:esp32:esp32
fancy-name: ESP32 Generic
platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json

- arduino-boards-fqbn: esp32:esp32:esp32s2
fancy-name: ESP32 S2
platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json

- arduino-boards-fqbn: esp32:esp32:m5stick-c
fancy-name: M5StickC
platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json

- arduino-boards-fqbn: esp32:esp32:m5stack-core-esp32
fancy-name: M5Stack
platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json

- arduino-boards-fqbn: esp32:esp32:m5stack-core2
fancy-name: M5Core2
platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json

#- arduino-boards-fqbn: esp32:esp32:m5stack-fire
# fancy-name: M5Fire
# platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json

#- arduino-boards-fqbn: esp32:esp32:odroid_esp32
# fancy-name: OdroidGo
# platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json
# 3D matrix doesn't apply to these:
- { board: seeed_wio_terminal, platform: Seeeduino, archi: samd, platform-url: 'https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json', platform-version: 1.8.2, ... }
- { board: 'd1_mini:eesz=4M3M,xtal=80', platform: esp8266, archi: esp8266, platform-url: 'https://arduino.esp8266.com/stable/package_esp8266com_index.json', platform-version: 3.0.1, ... }
- { board: 'd1_mini:eesz=4M3M,xtal=80', platform: esp8266, archi: esp8266, platform-url: 'https://arduino.esp8266.com/stable/package_esp8266com_index.json', platform-version: 3.0.2, ... }
# 3D matrix applies to these:
- { board: esp32, platform: esp32, archi: esp32, ... }
- { board: esp32s2, platform: esp32, archi: esp32, ... }
- { board: m5stick-c, platform: esp32, archi: esp32, ... }
- { board: m5stack-core-esp32, platform: esp32, archi: esp32, ... }
- { board: m5stack-core2, platform: esp32, archi: esp32, ... }
- { board: esp32s3box, platform: esp32, archi: esp32, ... }

exclude:
- board: esp32s3box
platform-version: 1.0.6
- board: esp32s3box
platform-version: 2.0.0
- board: esp32s3box
platform-version: 2.0.1
- board: esp32s3box
platform-version: 2.0.2
- board: esp32s2
platform-version: 1.0.6
- board: esp32s2
platform-version: 2.0.0

fail-fast: false

Expand All @@ -82,11 +80,11 @@ jobs:
- name: Compile example
uses: ArminJo/arduino-test-compile@v3
with:
arduino-board-fqbn: ${{ matrix.arduino-boards-fqbn }}
arduino-board-fqbn: ${{matrix.platform}}:${{matrix.archi}}:${{matrix.board}}
arduino-platform: ${{matrix.platform}}:${{matrix.archi}}@${{matrix.platform-version}}
platform-url: ${{ matrix.platform-url }}
required-libraries: ${{ matrix.required-libraries }}
build-properties: ${{ toJson(matrix.build-properties) }}
sketch-names: ${{ env.SKETCH_NAME }}
#platform-default-url: ${{ env.PLATFORM_DEFAULT_URL }}
#sketches-exclude: ${{ matrix.sketches-exclude }}

4 changes: 4 additions & 0 deletions .github/workflows/IDFBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
- esp32@v4.2
- esp32@v4.3.1
- esp32s2@v4.3.1
- esp32s3@v4.4-rc1

include:
- esp-idf-fqbn: esp32@v4.1
Expand All @@ -43,6 +44,9 @@ jobs:
- esp-idf-fqbn: esp32s2@v4.3.1
idf-board: esp32s2
idf-version: v4.3.1
- esp-idf-fqbn: esp32s3@v4.4-rc1
idf-board: esp32s3
idf-version: v4.4-rc1

fail-fast: false

Expand Down
58 changes: 40 additions & 18 deletions .github/workflows/PlatformioBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,54 @@ on:

jobs:
build:
name: ${{ matrix.pio-env }}
name: ${{ matrix.board }}@${{ matrix.platform-version }}

runs-on: ubuntu-latest

strategy:
matrix:

pio-env:
- esp8266
board:
- esp32
- esp32-s2
- esp32-s3
- m5stick-c
- m5stack-core-esp32
- m5stack-core2
- seeed_wio_terminal
- adafruit_pybadge_m4
#- m5stack-fire
#- odroid_esp32

platform-version:
- 1.0.6
- 2.0.0
- 2.0.1
- 2.0.2
- 2.0.3-RC1

exclude:
- board: esp32-s3
platform-version: 1.0.6
- board: esp32-s3
platform-version: 2.0.0
- board: esp32-s3
platform-version: 2.0.1
- board: esp32-s3
platform-version: 2.0.2
- board: esp32-s2
platform-version: 1.0.6
- board: esp32-s2
platform-version: 2.0.0

include:
- pio-env: esp8266
- pio-env: esp32
- pio-env: esp32-s2
- pio-env: m5stick-c
- pio-env: m5stack-core2
- pio-env: m5stack-core-esp32
- pio-env: seeed_wio_terminal
- pio-env: adafruit_pybadge_m4
#- pio-env: m5stack-fire
#- pio-env: odroid_esp32
- board: esp32
- board: esp32-s2
- board: esp32-s3
- board: m5stick-c
- board: m5stack-core-esp32
- board: m5stack-core2
- { board: esp8266, platform-version: 3.0.0, ... }
- { board: esp8266, platform-version: 3.1.0, ... }
- { board: esp8266, platform-version: 3.2.0, ... }
- { board: seeed_wio_terminal, platform-version: default, ... }
- { board: adafruit_pybadge_m4, platform-version: default, ... }

fail-fast: false

Expand Down Expand Up @@ -77,4 +95,8 @@ jobs:
pip install --upgrade platformio
- name: Run PlatformIO
run: cd ${{ env.PROJECT_DIR }} && pio run -e ${{ matrix.pio-env }}

run: |
cd ${{ env.PROJECT_DIR }}
pio lib -e ${{ matrix.board }}@${{ matrix.platform-version }} install --no-save file://$(realpath ../../../)
pio run -e ${{ matrix.board }}@${{ matrix.platform-version }}
1 change: 1 addition & 0 deletions .github/workflows/pioPkgPublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: pioPkgPublish

on:
release:
types: [published]
workflow_dispatch:

jobs:
Expand Down
14 changes: 9 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# CMakeLists for ESP-IDF

set(COMPONENT_ADD_INCLUDEDIRS
src
)
Expand All @@ -16,13 +18,15 @@ file(GLOB SRCS
src/lgfx/v1/platforms/esp32/*.cpp
src/lgfx/v1/platforms/esp32c3/*.cpp
src/lgfx/v1/platforms/esp32s2/*.cpp
src/lgfx/v1/platforms/esp8266/*.cpp
src/lgfx/v1/platforms/samd21/*.cpp
src/lgfx/v1/platforms/samd51/*.cpp
src/lgfx/v1/platforms/stm32/*.cpp
src/lgfx/v1/platforms/esp32s3/*.cpp
src/lgfx/v1/touch/*.cpp
)
set(COMPONENT_SRCS ${SRCS})
set(COMPONENT_REQUIRES nvs_flash efuse)
find_package(LCD COMPONENTS esp_lcd QUIET)
if (NOT LCD_FOUND)
set(COMPONENT_REQUIRES nvs_flash efuse)
else()
set(COMPONENT_REQUIRES nvs_flash efuse esp_lcd)
endif()

register_component()
28 changes: 15 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
[![arduino-library-badge](https://www.ardu-badge.com/badge/LovyanGFX.svg?)](https://www.ardu-badge.com/LovyanGFX)
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/lovyan03/library/LovyanGFX.svg)](https://registry.platformio.org/packages/libraries/lovyan03/LovyanGFX)

[![Arduino](https://github.com/lovyan03/LovyanGFX/actions/workflows/ArduinoBuild.yml/badge.svg?branch=master)](https://github.com/lovyan03/LovyanGFX/actions/workflows/ArduinoBuild.yml)
[![Platformio](https://github.com/lovyan03/LovyanGFX/actions/workflows/PlatformioBuild.yml/badge.svg?branch=master)](https://github.com/lovyan03/LovyanGFX/actions/workflows/PlatformioBuild.yml)
[![esp-idf](https://github.com/lovyan03/LovyanGFX/actions/workflows/IDFBuild.yml/badge.svg?branch=master)](https://github.com/lovyan03/LovyanGFX/actions/workflows/IDFBuild.yml)



Display (LCD / OLED / EPD) graphics library (for ESP32 SPI, I2C, 8bitParallel / ESP8266 SPI, I2C / ATSAMD51 SPI).
Expand Down Expand Up @@ -38,16 +42,16 @@ This library has the following advantages.
- OpenCV can be used as a drawing destination and can run on a PC.


| | SPI | I2C | 8bit Para|16bit Para|
|:------:|:---:|:---:|:--------:|:--------:|
|ESP32 | HW | HW | HW (I2S) | --- |
|ESP32-S2| HW | HW | HW (I2S) | HW (I2S) |
|ESP32-S3| HW | HW | --- | --- |
|ESP32-C3| HW | HW | SW | --- |
|ESP8266 | HW | SW | --- | --- |
|SAMD51 | HW | HW | --- | --- |
|SAMD21 | HW | HW | --- | --- |
|RP2040 | HW | --- | --- | --- |
| | SPI | I2C | 8bit Para |16bit Para |
|:------:|:---:|:---:|:---------:|:---------:|
|ESP32 | HW | HW | HW (I2S) | --- |
|ESP32-S2| HW | HW | HW (I2S) | HW (I2S) |
|ESP32-S3| HW | HW |HW(LCD/CAM)|HW(LCD/CAM)|
|ESP32-C3| HW | HW | SW | --- |
|ESP8266 | HW | SW | --- | --- |
|SAMD51 | HW | HW | --- | --- |
|SAMD21 | HW | HW | --- | --- |
|RP2040 | HW | --- | --- | --- |

※ HW = HardWare Peripheral / SW = SoftWare implementation

Expand Down Expand Up @@ -90,6 +94,7 @@ This library has the following advantages.
- I2C FT5x06 (FT5206, FT5306, FT5406, FT6206, FT6236, FT6336, FT6436)
- I2C GSLx680 (GSL1680)
- I2C GT911
- I2C NS2009
- I2C TT21xxx (TT21100)
- SPI XPT2046
- SPI STMPE610
Expand Down Expand Up @@ -535,7 +540,4 @@ TomThumb font : [3-clause BSD](src/lgfx/Fonts/GFXFF/TomThumb.h) Brian J. Swetlan
- RM68120
- R61529
- タッチスクリーン TouchScreens
- NS2009
62 changes: 45 additions & 17 deletions examples/Test/build_test/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,39 @@
};
#endif

static LGFX lcd;
static LGFX_Sprite sprite(&lcd);
class LGFX_I2C : public lgfx::LGFX_Device
{
lgfx::Bus_I2C _bus_instance;
lgfx::Panel_SSD1306 _panel_instance;
lgfx::Touch_FT5x06 _touch_instance;

public:
LGFX_I2C(void)
{
{
auto cfg = _bus_instance.config();
_bus_instance.config(cfg);
_panel_instance.setBus(&_bus_instance);
}
{
auto cfg = _panel_instance.config();
_panel_instance.config(cfg);
}
{
auto cfg = _touch_instance.config();
_touch_instance.config(cfg);
_panel_instance.setTouch(&_touch_instance);
}
setPanel(&_panel_instance);
}
};

void setup(void)

static LGFX display1;
static LGFX_I2C display2;
static LGFX_Sprite sprite(&display1);

void test(LGFX_Device &lcd)
{
lcd.init();
lcd.setRotation(1);
Expand Down Expand Up @@ -148,31 +177,30 @@ void setup(void)
sprite.fillCircle(32, 32, 22, 2);
sprite.fillTriangle(32, 12, 15, 43, 49, 43, 3);

sprite.pushSprite( 0, 0, 0);
sprite.pushSprite(&lcd, 0, 0, 0);

lcd.startWrite();
lcd.drawBmp((uint8_t*)nullptr, 0, 0, 0);
lcd.drawPng((uint8_t*)nullptr, 0, 0, 0);
lcd.drawJpg((uint8_t*)nullptr, 0, 0, 0);
lcd.drawQoi((uint8_t*)nullptr, 0, 0, 0);

#if defined ( ARDUINO ) && defined ( ESP32 )
lcd.drawBmpFile(SPIFFS, "/test.bmp");
lcd.drawPngFile(SPIFFS, "/test.png");
lcd.drawJpgFile(SPIFFS, "/test.jpg");
lcd.drawQoiFile(SPIFFS, "/test.qoi");
#endif
}

void setup()
{
test(display1);
test(display2);
}

void loop(void)
{
static int count = 0;
static int a = 0;
static int x = 0;
static int y = 0;
static float zoom = 3;
++count;
if ((a += 1) >= 360) a -= 360;
if ((x += 2) >= lcd.width()) x -= lcd.width();
if ((y += 1) >= lcd.height()) y -= lcd.height();
sprite.setPaletteColor(3, lcd.color888( count & 0xFF, 0, 0));
sprite.pushRotateZoom(x, y, a, zoom, zoom, 0);
if ((count % 100) == 0) lcd.display(); // 電子ペーパーの場合の表示更新を 100回に一度行う
lgfx::delay(1000);
}


Expand Down
Loading

0 comments on commit 79fe6eb

Please sign in to comment.